Process a payment

Learn how to provide a variety of payment methods and initiate payments.

Overview

When the payment process is initiated, Monite allows the partner's platform to control the available payment methods to display, so that payers can choose their preferred one and proceed with the payment.

26462646

Example of partner payment screen displaying the available payment methods.

The payment process is composed of three steps:

  1. Get all available payment methods (Optional).

  2. Initiate the payment request.

  3. Get notified about the payment status changes.

Step 1. Get all available payment methods

The list of all the payment methods available to the payer is determined by the following criteria:

  • payer's location
  • vendor's accepted payment methods
  • payment amount
  • payment currency

To get the list of all the payment methods available for a particular payment, call GET /payment_methods:

curl -X GET 'https://api.sandbox.monite.com/v1/payment_methods' \
  -H 'X-Monite-Entity-Id: ENTITY_ID' \
  -H 'Authorization: Bearer YOUR_PARTNER_TOKEN' 

The successful response returns the list of payment methods available for the particular payment:

{
  "data": [
    {
      "name": "ACSS debit",
      "type": "acss_debit"
    },
    {
      "name": "Alipay",
      "type": "alipay"
    },
    {
      "name": "BECS Direct Debit",
      "type": "au_becs_debit"
    },
    {
      "name": "Bancontact",
      "type": "bancontact"
    },
    {
      "name": "Boleto",
      "type": "boleto"
    },
    {
      "name": "Card",
      "type": "card"
    },
    {
      "name": "EPS",
      "type": "eps"
    },
    {
      "name": "FPX",
      "type": "fpx"
    },
    {
      "name": "Giropay",
      "type": "giropay"
    },
    {
      "name": "GrabPay",
      "type": "grabpay"
    },
    {
      "name": "iDEAL",
      "type": "ideal"
    },
    {
      "name": "Konbini",
      "type": "konbini"
    },
    {
      "name": "Link",
      "type": "link"
    },
    {
      "name": "P24",
      "type": "p24"
    },
    {
      "name": "Paynow",
      "type": "paynow"
    },
    {
      "name": "PromptPay",
      "type": "promptpay"
    },
    {
      "name": "SEPA Debit",
      "type": "sepa_debit"
    },
    {
      "name": "SOFORT",
      "type": "sofort"
    },
    {
      "name": "US Bank Account",
      "type": "us_bank_account"
    },
    {
      "name": "WeChat Pay",
      "type": "wechat_pay"
    },
    {
      "name": "SEPA Payments",
      "type": "sepa"
    }
  ]
}

With all the available payment methods in hand, you can select which ones must be presented to the payer.

πŸ“˜

Alternatively, if you know in advance which payment methods to display to the payer, it is possible to directly initiate the payment request through the provided method without having to retrieve the whole list of available payment methods first.

Step 2. Initiate the payment request

You can initiate a payment request by calling POST /payment_links, which will return you a payment page β€˜url’ used to make a payment.

The body examples may vary whether the partner uses Monite's accounts payable and receivable solutions or only Monite's payment rails :

curl -X POST 'https://api.sandbox.monite.com/v1/payment_links' \
  -H 'X-Monite-Entity-Id: ENTITY_ID' \
  -H 'Authorization: Bearer YOUR_PARTNER_TOKEN' \
  -d '{
    "object": {
      "id": "<Object ID>",
      "type": "payable/receivable"
    },
    "payment_methods": [
      "card",
      "eps",
      "ideal",
      "sepa_debit"
    ],
    "recipient": {
      "id": "<Recipient ID>",
      "type": "entity/counterpart"
    },
    "return_url": "https://return.url.com"
  }'
curl -X POST 'https://api.sandbox.monite.com/v1/payment_links' \
  -H 'X-Monite-Entity-Id: ENTITY_ID' \
  -H 'Authorization: Bearer YOUR_PARTNER_TOKEN' \
  -d '{
    "amount": 1000,
    "currency": "EUR",
    "payment_reference": "string",
    "payment_methods": [
      "card",
      "eps",
      "ideal",
      "sepa_debit"
    ],
    "recipient": {
      "id": "<Recipient ID>",
      "type": "entity/counterpart"
    },
    "return_url": "https://return.url.com"
  }'

πŸ“˜

  • With AP/AR: The field 'return_url' is mandatory only if object.type equals to payable.
  • For Monite’s Payment rails only: The field 'return_url' is optional.

The successful response contains the URL to the checkout session:

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "amount": 1000,
  "currency": "EUR",
  "payment_reference": "string",
  "payment_methods": [
    "card",
    "eps",
    "ideal",
    "sepa_debit"
  ],
  "recipient": {
    "id": "<Recipient ID>",
    "type": "entity/counterpart"
  },
  "return_url": "https://return.url.com",
  "payment_page_url": "https://payment.page.com"
}

Step 3. Get notified about the payment status changes

Once the payment intent is created, you can track the status of this payment by subscribing to a webhook, so you are notified when the payment status changes to pending or done.

To enable this webhook, call POST /webhook_settings, passing in the body the object_type as payment_intent and the URL of your endpoint:

curl -X 'POST https://api.sandbox.monite.com/v1/webhook_settings' \
  -H 'Authorization: Bearer YOUR_PARTNER_TOKEN' \
  -d '{
    "object_type": "payment_intent",
    "url": "https://yourendpointurl.com"
  }'

πŸ“˜

It is possible to run this call more than once and associate one object_type with multiple URLs.

The successful response contains the ID of the webhook:

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "object_type": "payment_intent",
  "url": "https://yourendpointurl.com"
}

πŸ“˜

Check our Webhooks page for further information.


Did this page help you?