Payment methods
The resource Checkouts supports the following payment methods, which can be specified individually or in combination when creating a checkout.
| Code | Payment method | Description |
|---|---|---|
CC | Credit/Debit Card | Payment by credit or debit card. |
MB | ATM - Multibanco | Multibanco reference number payable at ATMs or via online banking. |
MW | MB WAY | Payment via mobile number using the MB WAY app. |
AP | Apple Pay | Payment via Apple Pay on compatible Apple devices. |
GP | Google Pay | Payment via Google Pay on Android devices and compatible browsers. |
Specify a single payment method
To direct the customer to a specific payment method, use the field paymentMethod.code in the body of the request.
POST /checkouts
{
"payment": {
"amount": 500,
"code": "REFPRODUTO_1",
"summary": "Computador",
"customer": {
"customerId": "1",
"firstName": "José",
"lastName": "Silva",
"phoneNumber": "351#961234567",
"email": "jose.silva@email.com"
},
"billingAddress": {
"country": "PT",
"city": "Lisboa",
"street1": "Rua Domingos Monteiro nº 7 A",
"postCode": "1050-074"
},
"shippingAddress": {
"country": "PT",
"city": "Lisboa",
"street1": "Rua Domingos Monteiro nº 7 A",
"postCode": "1050-074"
},
"paymentMethod": {
"code": "CC"
}
},
"page": {
"language": "PT",
"layout": "web"
},
"redirects": [
{ "type": "success", "url": "https://www.url-after-success.dominio" },
{ "type": "cancel", "url": "https://www.url-after-cancel.dominio" },
{ "type": "back", "url": "https://www.url-back.dominio" }
]
}
Specify multiple payment methods
To allow the customer to choose a payment method, use the field availableMethods with the list of desired codes. This way, the customer can select the method directly on the payment page.
information
When
availableMethodsthis field is usedpaymentMethodit must not be specified. If neither field is provided, the checkout is created using the payment methods available in the integration.- Request
- Response
POST /checkouts
{
"payment": {
"amount": 500,
"code": "REFPRODUTO_1",
"summary": "Computador",
"availableMethods": [
{ "code": "CC" },
{ "code": "MB" },
{ "code": "MW" },
{ "code": "AP" },
{ "code": "GP" }
]
},
"page": {
"language": "PT",
"layout": "web"
},
"redirects": [
{ "type": "success", "url": "https://www.url-after-success.dominio" },
{ "type": "cancel", "url": "https://www.url-after-cancel.dominio" },
{ "type": "back", "url": "https://www.url-back.dominio" }
]
}
{
"date": "2022-01-03T14:16:17+00:00",
"success": true,
"data": {
"id": "pyKP1B9IaK9J47wTSNB4mUnv2h4DJW8HzomddMp1",
"createdAt": "2022-01-03 14:16:17",
"checkoutUrl": "https://paypay.pt/paypay/referencia/referencia_c/pay/4d0757e6d4db52fae248e1a2e9f10a1e8cdb0a25/paypay/pyKP1B9IaK9J47wTSNB4mUnv2h4DJW8HzomddMp1",
"paymentId": "42690",
"stateDetails": {
"state": "PaymentReady",
"timestamp": "2022-01-03T14:16:17+00:00"
}
}
}
id
which identifies the checkout to the API.
The
checkoutUrl
is the link to access the page and make the payment.
The
paymentId
is the ID that identifies the payment.
Notes by method
CC — Credit/Debit Card
- Available in all layouts:
web,embedandinApp. - Supports redirects
success,cancelandback. The redirectactionis the only one accepted in the layoutembed.
MB — ATM - Multibanco
- Available in the layouts:
webandinApp. - Does not support redirects -” once the checkout has been created, a Multibanco reference is generated which is immediately accessible via
checkoutUrl.
MW — MB WAY
- Available in all layouts:
webandinApp. - Supports redirects
success,cancelandback.
AP — Apple Pay
- Available in the layouts:
webandinApp. - Supports redirects
success,cancelandback. - Requires the user to be on a compatible Apple device (iPhone, iPad, Mac) with Apple Pay set up.
GP — Google Pay
- Available in the layouts:
webandinApp. - Supports redirects
success,cancelandback. - Requires the user to have Google Pay set up on an Android device or a compatible browser.