API
Skip to main content

Payment methods

The resource Checkouts supports the following payment methods, which can be specified individually or in combination when creating a checkout.

CodePayment methodDescription
CCCredit/Debit CardPayment by credit or debit card.
MBATM - MultibancoMultibanco reference number payable at ATMs or via online banking.
MWMB WAYPayment via mobile number using the MB WAY app.
APApple PayPayment via Apple Pay on compatible Apple devices.
GPGoogle PayPayment 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
WhenavailableMethodsthis field is usedpaymentMethodit must not be specified. If neither field is provided, the checkout is created using the payment methods available in the integration.
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" }
]
}
The response returns the 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, embed and inApp.
  • Supports redirects success, cancel and back. The redirect action is the only one accepted in the layout embed.

MB — ATM - Multibanco

  • Available in the layouts: web and inApp.
  • 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: web and inApp.
  • Supports redirects success, cancel and back.

AP — Apple Pay

  • Available in the layouts: web and inApp.
  • Supports redirects success, cancel and back.
  • 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: web and inApp.
  • Supports redirects success, cancel and back.
  • Requires the user to have Google Pay set up on an Android device or a compatible browser.