Search

Are you looking for test card numbers?

Would you like to contact support?

Payment-method icon

Multibanco for API only

Add Multibanco to an existing API-only integration.

Accept Multibanco payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.

Before you begin

These instructions explain how to add Multibanco to your existing API-only integration. The API-only integration works the same way for all payment methods. If you haven't done this integration yet, refer to our API-only integration guide.

Before starting your Multibanco integration:

  1. Make sure that you have set up your back end implementation.
  2. Add Multibanco in your test Customer Area.

Build your payment form for Multibanco

Include Multibanco in the list of available payment methods. You don't need to collect any information from the shopper in your payment form.

We provide an Multibanco logo which you can use on your payment form. For more information, refer to Downloading logos.

You can also get the required fields from the /paymentMethods response as explained in our API-only integration guide. In your request, specify:

  • countryCode: PT
  • amount.currency: EUR

The required fields are included in the object with type multibanco.

Make a payment

  1. In your /payments request, specify the following parameters:
    • paymentMethod.type: multibanco
    • countryCode: PT

The following code sample is a /payments request for a Multibanco payment.

curl https://checkout-test.adyen.com/v52/payments \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
    "shopperLocale": "pt-PT",
    "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
    "reference": "YOUR_ORDER_NUMBER",
    "amount": {
        "currency": "EUR",
        "value": 1000
    },
    "countryCode": "PT",
    "paymentMethod": {
        "type": "multibanco"
    }
}'
# Set your X-API-KEY with the API key from the Customer Area.
adyen = Adyen::Client.new
adyen.api_key = "YOUR_X-API-KEY"
 
response = adyen.checkout.payments({
  :amount => {
    :currency => "EUR",
    :value => 1000
  },
  :reference => "YOUR_ORDER_NUMBER",
  :shopperLocale => "pt-PT",
  :paymentMethod => {
    :type => "multibanco"
  },
  :countryCode => "PT",
  :merchantAccount => "YOUR_MERCHANT_ACCOUNT"
})
// Set YOUR_X-API-KEY with the API key from the Customer Area.
// Change to Environment.LIVE and add the Live URL prefix when you're ready to accept live payments.
    Client client = new Client("YOUR_X-API-KEY", Environment.TEST);
    Checkout checkout = new Checkout(client);

    PaymentsRequest paymentsRequest = new PaymentsRequest();

    String merchantAccount = "YOUR_MERCHANT_ACCOUNT";
    paymentsRequest.setMerchantAccount(merchantAccount);

    Amount amount = new Amount();
    amount.setCurrency("EUR");
    amount.setValue(15000L);
    paymentsRequest.setAmount(amount);

    DefaultPaymentMethodDetails paymentMethodDetails = new DefaultPaymentMethodDetails();
    paymentMethodDetails.setType("multibanco");
    paymentsRequest.setPaymentMethod(paymentMethodDetails);

    paymentsRequest.setReference("YOUR_ORDER_NUMBER");
    paymentsRequest.setShopperLocale("pt-PT");
    paymentsRequest.setReturnUrl("https://your-company.com/checkout?shopperOrder=12xy..");

    PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);
// Set your X-API-KEY with the API key from the Customer Area.
$client = new \Adyen\Client();
$client->setXApiKey("YOUR_X-API-KEY");
$service = new \Adyen\Service\Checkout($client);

$params = array(
  "amount" => array(
    "currency" => "EUR",
    "value" => 1000
  ),
  "reference" => "YOUR_ORDER_NUMBER",
  "shopperLocale" => "pt-PT",
  "paymentMethod" => array(
    "type" => "multibanco"
  ),
  "countryCode" => "PT",
  "merchantAccount" => "YOUR_MERCHANT_ACCOUNT"
);
$result = $service->payments($params);
#Set your X-API-KEY with the API key from the Customer Area.
adyen = Adyen.Adyen()
adyen.client.xapikey = 'YOUR_X-API-KEY'

result = adyen.checkout.payments({
   'amount': {
      'value': 1000,
      'currency': 'EUR'
   },
   'reference': 'YOUR_ORDER_NUMBER',
   'shopperLocale': 'pt-PT',
   'paymentMethod': {
      'type': 'multibanco'
   },
   'countryCode': 'PT',
   'merchantAccount': 'YOUR_MERCHANT_ACCOUNT'
})
// Set your X-API-KEY with the API key from the Customer Area.
var client = new Client ("YOUR_X-API-KEY", Environment.Test);
var checkout = new Checkout(client);

var amount = new Model.Checkout.Amount("EUR", 1000);
var details = new Model.Checkout.DefaultPaymentMethodDetails{
  Type = "multibanco"
};
var paymentRequest = new Adyen.Model.Checkout.PaymentRequest
{
  Reference = "YOUR_ORDER_NUMBER",
  Amount = amount,
  CountryCode = "PT",
  MerchantAccount = "YOUR_MERCHANT_ACCOUNT",
  ShopperLocale = "pt-PT",
  PaymentMethod = details
};

var paymentResponse = checkout.Payments(paymentsRequest);
// Set your X-API-KEY with the API key from the Customer Area.
const {Client, Config, CheckoutAPI} = require('@adyen/api-library');
const config = new Config();
// Set your X-API-KEY with the API key from the Customer Area.
config.apiKey = '[API_KEY]';
config.merchantAccount = '[YOUR_MERCHANT_ACCOUNT]';
const client = new Client({ config });
client.setEnvironment("TEST");
const checkout = new CheckoutAPI(client);
checkout.payments({
    amount: { currency: "EUR", value: 1000 },
    paymentMethod: {
        type: 'multibanco'
    },
    reference: "YOUR_ORDER_NUMBER",
    merchantAccount: config.merchantAccount,
    countryCode: "PT",
    shopperLocale: "pt-PT"
}).then(res => res);

Response

You receive a response containing:

  • expiresAt: The expiry date of the voucher. The shopper needs to make their payment before this date and time.
  • entity: The corresponding entity number.
  • reference: The Multibanco reference that the shopper needs to make the payment.
/payments response
{
    "resultCode": "PresentToShopper",
    "action": {
        "paymentMethodType": "multibanco",
        "type": "voucher",
        "entity": "12101",
        "expiresAt": "2020-01-10T09:56:48",
        "initialAmount": {
            "currency": "EUR",
            "value": 1000
        },
        "merchantName": "YOUR_MERCHANT_NAME",
        "merchantReference": "YOUR_ORDER_NUMBER",
        "reference": "501 417 571",
        "totalAmount": {
            "currency": "EUR",
            "value": 1000
        },
        "action": "voucher"
    }
}

Present voucher

Use the information in the action object in the /payments response to present the voucher to the shopper.

Multibanco references are valid until the end of the expiry day. For example, if a reference is generated at 13:30 and the expiry date is D+1 (next day), the reference is payable until 23:59 on the next day.

The payment voucher should include the following information:

  • action.expiresAt: The expiry date of the payment voucher. The shopper needs to make the payment before this time. You can set the time period for the expiry of the voucher. To do so, contact the Support Team.
  • action.initialAmount.currency: EUR
  • action.initialAmount.value: The amount the shopper needs to pay.
  • reference: The payment reference that the shopper needs to make the payment.

Present the payment result

Use the resultCode that you received in response to your /payments call to present the payment voucher to your shopper.
The resultCode value you can receive for Multibanco is:

resultCode Description Action to take
PresentToShopper Present the voucher to the shopper. Inform the shopper that you've received their order, and are waiting for the payment to be completed.
When the shopper has completed the payment you will receive a successful AUTHORISATION notification.

We don't know when the shopper will make the payment. Thus, we will only send the AUTHORISATION notification once the payment has been received. Once the shopper transfers the funds, we receive the result from the bank, and the transaction status changes to Authorised. If the shopper fails to make the payment before the payment voucher expires, you will receive an OFFER_CLOSED notification.

Test and go live

To test Multibanco payments before going live, contact the Support Team.

Before you can accept live Multibanco payments, you need to submit a request for Multibanco in your live Customer Area.

See also