v1

latestOpenAPI 3.0.02026-07-1412068.2 KB
Transactions

Initiate Payment

API to initiate transactions by merchant. <br> <h3>About MIT (Merchant Initiated Transaction)</h3> Merchant Initiated Transactions (MIT) allows a business to use card details, that were stored during previous transactions, to charge their customers.<br> <br> <h3>How do MITs work?</h3> 1- You request a payment link with the option to save the card details.<br> 2- You save the charge ID.<br> 3- You get the charge details (redirect, GET /charge, or webhook) which will include the ID of the card used to make the payment, you can save either one of the IDs so you always have access to the card ID.<br> 4- You call the below API to initiate a transaction using the same card.<br>

post/charges

Headers

Content-Typestring
Authorizationstring

Request body

card_idstring required

Saved card ID retrieved from the initial transaction made with MIT-enabled link.

amountnumber required

Amount to be charged.

currencystring

The three-letter ISO currency code, default is AED

send_customer_receiptboolean

Enables the sending of customer receipts.

custom_dataobject

Key-value object that can be used to pass custom data.

external_idstring

The external ID allows non Mamo IDs to be associated with a given charge.

hold_and_charge_laterboolean

Indicates whether to place the payment on hold and charge it later using the "captures" API.

Example request

{
  "card_id": "CARD-5DF50209F8",
  "amount": 10,
  "custom_data": {
    "internal_customer_id": "0114120d-c394-4cce-9cdb-4ccbae605748",
    "val1": true,
    "val2": "custom value"
  },
  "external_id": "ORDER-12345",
  "hold_and_charge_later": false
}

Response

Successful response

status'captured' | 'failed'
idstring
amountnumber
amount_currencystring
refund_amountnumber
refund_statusstring
billing_descriptorstring
custom_dataobject
created_datestring
subscription_idstring

Value is set for subscriptions only. For one-time payments, this will be null.

next_payment_datestring

Value is set for subscriptions only. For one-time payments, this will be null.

settlement_amountnumber
settlement_currencystring
settlement_datestring
error_codestring
error_messagestring

Example response

{
  "status": "captured",
  "id": "MPB-CHRG-E0CE93E071",
  "amount": 100,
  "amount_currency": "AED",
  "refund_amount": 0,
  "refund_status": "No refund",
  "billing_descriptor": "Mamo*Merchant",
  "custom_data": {
    "internal_customer_id": "0114120d-c394-4cce-9cdb-4ccbae605748",
    "val1": true,
    "val2": "custom value"
  },
  "created_date": "2023-05-31-11-18-57",
  "subscription_id": "MPB-SUB-B764EDCBA2",
  "next_payment_date": "05/06/2023",
  "settlement_amount": 356.42,
  "settlement_currency": "AED",
  "settlement_date": "05/06/2023",
  "customer_details": {
    "name": "Mamo User",
    "email": "email@mamopay.com",
    "phone_number": "+971551234567",
    "comment": "Dolore voluptate possimus et."
  },
  "payment_method": {
    "type": "CREDIT VISA",
    "card_holder_name": "Mamo User",
    "card_last4": "•••• 4242",
    "origin": "UAE card"
  },
  "error_code": "generic",
  "error_message": "Unknown reason - user should contact their bank to find out"
}