MB Way

/api/v2/payment

Create payment/authorization

Creates a new MB WAY payment or authorization without a checkout URL. A notification will be sent to your customer mobile phone.

Check valid mobile phones using this regular expression: ^9[1236]{1}[0-9]{7}$. If you try to send a valid number, but not registered at MB WAY service, you will get a 10002 error code. Check full list of errors here.

The only difference between a payment and an authorization request is the type passed in the payload. Check examples below.

Request POST /api/v2/payment
Query params none
Data params Payment
Returns Payment
Click here for an example of a payment
curl -X POST https://services.wallet.pt/api/v2/payment \
  -H "Content-Type: application/json" \
  -H "Authorization: WalletPT 7a0eb41208209639eda9bf765b6cb04d59fb9e34" \
  -d ' {
        "method": "MBWAY",
        "amount": 10,
        "type": "PAYMENT",
        "mbway": {
            "phone":"960000000"
        },
        "client": {
            "name": "some name",
            "email": "foo@bar.com",
            "address": {
                "address": "some street",
                "city": "lisboa",
                "postalcode": "1100-000",
                "country": "pt"
            }
        },
        "currency": "EUR",
        "items": [
            {
                "ref": 123,
                "name": "Somny DX-200",
                "descr": "Photo Camera",
                "qt": 1
            }
        ]
  }
'
Returns
{
    "mbway": {
        "phone": "351#960000000"
    },
    "currency": "EUR",
    "id": "46cb7542-8f8d-11ea-8dd6-ae36e476a08e",
    "ipaddress": "127.0.0.1",
    "type": "PAYMENT",
    "channel": "WEBSITE",
    "modified_date": "2020-05-06T11:32:32+0000",
    "notes": "",
    "items": [
        {
            "descr": "Photo Camera",
            "ref": 123,
            "name": "Somny DX-200",
            "qt": 1
        }
    ],
    "refundable": false,
    "fee": -0.15,
    "amount": 10,
    "amount_net": 9.85,
    "client": {
        "name": "some name",
        "email": "foo@bar.com",
        "address": {
            "address": "some street",
            "city": "lisboa",
            "postalcode": "1100-000",
            "country": "pt"
        }
    },
    "merchant": {
        "id": 73,
        "name": "Produção de Electrónica e Software",
        "email": ""
    },
    "date": "2020-05-06T11:32:32+0000",
    "method": "MBWAY",
    "status": "PENDING"
}
Click here for an example of an authorization
curl -X POST https://services.wallet.pt/api/v2/payment \
  -H "Content-Type: application/json" \
  -H "Authorization: WalletPT 7a0eb41208209639eda9bf765b6cb04d59fb9e34" \
  -d ' {
        "method": "MBWAY",
        "amount": 10,
        "type": "AUTH",
        "mbway": {
            "phone":"960000000"
        },
        "client": {
            "name": "some name",
            "email": "foo@bar.com",
            "address": {
                "address": "some street",
                "city": "lisboa",
                "postalcode": "1100-000",
                "country": "pt"
            }
        },
        "currency": "EUR",
        "items": [
            {
                "ref": 123,
                "name": "Somny DX-200",
                "descr": "Photo Camera",
                "qt": 1
            }
        ]
  }
'
Returns
{
    "mbway": {
        "phone": "351#960000000"
    },
    "currency": "EUR",
    "id": "de4ebaf1-05a2-4fdf-affb-4c49ee5bf75f",
    "ipaddress": "127.0.0.1",
    "type": "PAYMENT",
    "channel": "WEBSITE",
    "modified_date": "2024-11-12T11:33:32+0000",
    "notes": "",
    "items": [
        {
            "descr": "Photo Camera",
            "ref": 123,
            "name": "Somny DX-200",
            "qt": 1
        }
    ],
    "refundable": false,
    "fee": -0.15,
    "amount": 10,
    "amount_net": 9.85,
    "client": {
        "name": "some name",
        "email": "foo@bar.com",
        "address": {
            "address": "some street",
            "city": "lisboa",
            "postalcode": "1100-000",
            "country": "pt"
        }
    },
    "merchant": {
        "id": 73,
        "name": "Produção de Electrónica e Software",
        "email": ""
    },
    "date": "2024-11-12T11:33:32+0000",
    "method": "MBWAY",
    "status": "PENDING"
}


You can pass a request_id to track this request. Check the Idempotency page.

A callback will be sent in case of failure or success with a reference to the created operation.