> For the complete documentation index, see [llms.txt](https://docs.xtrakit.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xtrakit.com/overview/payments/pay-with-momo.md).

# Pay with MoMo

The request process is asynchronous, meaning you receive an initial response indicating that the request is being processed. Once the payer completes the transaction, a callback response is sent to your configured callback URL.

## Endpoint

<mark style="color:$warning;">**`POST`**</mark> `https://api.xtrakit.com/api/v1/momo/pay`

## Headers

`Authorization: Bearer API_KEY`

## **Request Body**

<table><thead><tr><th width="289">Parameters</th><th width="100">Type</th><th>Description</th></tr></thead><tbody><tr><td><p>transaction_id</p><p><code>string</code></p></td><td>Required</td><td>Merchants' transaction ID to uniquely identify the transaction</td></tr><tr><td><p>business_code</p><p><code>string</code></p></td><td>Required</td><td>Business code retrieved from the merchant dashboard</td></tr><tr><td><p>currency</p><p><code>status</code></p></td><td>Required</td><td>Currency you are receiving payment</td></tr><tr><td><p>payment_details </p><p><em><code>status</code></em></p></td><td>Required</td><td>Payment details unique to this collection channel</td></tr><tr><td><p>payment_details.momo_number</p><p><code>status</code></p></td><td>Required</td><td>Momo number to receive payment from. This is a field within payment_details.</td></tr><tr><td><p>payment_details.otp</p><p><code>status</code></p></td><td>Required</td><td>One Time Password sent to payer's phone number to authorize the transaction. This is a field within payment_details.</td></tr><tr><td><p>payment_details.customer_email</p><p><code>status</code></p></td><td>Required</td><td>Refers to the payer's email address e.g kofi@gmail.com</td></tr><tr><td><p>payment_details.customer_firstname</p><p><code>status</code></p></td><td>Required</td><td>Payer's First Name</td></tr><tr><td><p>payment_details.customer_lastname</p><p><code>status</code></p></td><td>Required</td><td>Payer's Last Name</td></tr><tr><td><p>payment_method_id</p><p><code>status</code></p></td><td>Required</td><td>The ID of the payment channel retrieved from get payment methods endpoint. eg. 8rf8788997</td></tr><tr><td><p>amount</p><p><code>float|numeric-string</code></p><p><br></p></td><td>Required</td><td>Amount to be received from the payer</td></tr></tbody></table>

## Sample Requests <a href="#sample-requests" id="sample-requests"></a>

{% tabs %}
{% tab title="PHP" %}
{% code fullWidth="true" %}

```php
<?php
$curl = curl_init();

$data = [
    'transaction_id' => 'TXN-202607020001',
    'business_code' => '25754643',
    'currency' => 'GHS',
    'payment_method_id' => 'mtnghana', //airteltigoghana, vodafoneghana
    'amount' => 100.00,
    'payment_details' => [
        'momo_number' => '+233240000000',
        'otp' => '123456',
        'customer_email' => 'kofi@example.com',
        'customer_firstname' => 'Kofi',
        'customer_lastname' => 'Narh',
    ],
];

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.xtrakit.com/api/v1/momo/pay',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => $data,
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer API_KEY', // Replace 'API_KEY' with your actual API key
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>
```

{% endcode %}
{% endtab %}

{% tab title="NodeJS" %}

```javascript
const axios = require("axios");

const data = {
  transaction_id: "TXN-202607020001",
  business_code: "264356434",
  currency: "GHS",
  payment_method_id: 'mtnghana', //airteltigoghana, vodafoneghana
  amount: 100.00,
  payment_details: {
    momo_number: "+233240000000",
    otp: "123456",
    customer_email: "kofi@example.com",
    customer_firstname: "Kofi",
    customer_lastname: "Narh"
  }
};

axios.post("https://api.xtrakit.com/api/v1/momo/pay", data, {
  headers: {
    Authorization: `Bearer ${process.env.XTRAPAY_API_KEY}`,
    "Content-Type": "application/json"
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.error(error.response?.data || error.message);
});
```

{% endtab %}
{% endtabs %}

## Sample Response

{% tabs %}
{% tab title="Success" %}

```json
{
    "status": "000",
    "data": {
        "transaction_id": "TXN-202607020001",
        "merchant_transaction_id": "44b8daae-5e66-6280-8aa2-e41c73d5e43b",
        "momo_number": "+233539421088",
        "amount": "1.00",
        "currency": "GHS",
        "payment_method_name": "mtnghana", //airteltigoghana, vodafoneghana
        "status": "pending",
        "fee": "0.00",
        "created_at": "2026-07-02T22:12:37.000000Z"
    },
    "message": "Payment is being processed"
}
```

{% endtab %}

{% tab title="Error" %}

```json
{
    "status": 401,
    "error": "Unauthorized: Missing Bearer Token"
},

{
    "status": 401,
    "error": "Unauthorized: Invalid API Key"
}
```

{% endtab %}
{% endtabs %}
