> For the complete documentation index, see [llms.txt](https://startbutton.gitbook.io/startbutton-product-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://startbutton.gitbook.io/startbutton-product-api/startbutton-api-doc/server-to-server-integration/s2s-integration-for-mobile-money/s2s-momo-xof-and-xaf.md).

# S2S MoMo XOF and XAF

#### TO GET STARTED:

<table><thead><tr><th width="224">Authorization</th><th>Set to Bearer PUBLIC_KEY</th></tr></thead><tbody><tr><td>Content-Type</td><td>Set value to <code>application/json</code></td></tr></tbody></table>

{% hint style="info" %}
The public key can be gotten from the 'Settings' page on your Startbutton dashboard.
{% endhint %}

Post a request to the URL below, where the base URL is determined by the environment you are on.

<details>

<summary>BaseUrl</summary>

Sandbox/PROD: <https://api.startbutton.tech&#x20>;

</details>

{% tabs %}
{% tab title="Endpoint" %}
POST  `{{baseurl}}/transaction/initialize/s2s/mobile_money`
{% endtab %}
{% endtabs %}

#### Here's a sample request below:

{% hint style="info" %}
The next step after initiating the transaction is to verify the OTP using this [endpoint](/startbutton-product-api/startbutton-api-doc/server-to-server-integration/s2s-integration-for-mobile-money/s2s-momo-kes-and-ghs.md#otp-verify). Enter any 6-digit number as the OTP to complete the transaction.
{% endhint %}

{% hint style="info" %}
To test a success or failure scenario, find a test number [here](/startbutton-product-api/startbutton-api-doc/test-numbers/test-numbers-for-collections.md#use-the-numbers-below).
{% endhint %}

{% tabs %}
{% tab title="Required Parameters (XOF)" %}

```
{
  "provider": "WAVE",
  "phone": "+2250111111111",
  "amount": 25000,
  "currency": "XOF",
  "email": "xof-pms@customer.com"
}

```

{% endtab %}

{% tab title="Required Parameters (XAF)" %}

<pre><code>{
    "phone": "+2370707000200",
    "amount": 50000,
    "email": "xaf-momo-test@customer.com",
    "currency": "<a data-footnote-ref href="#user-content-fn-1">XAF</a>"
}
</code></pre>

{% endtab %}

{% tab title="To simulate a Failed response" %}

```
{
    "phone": "+2250707000205",
    "amount": 50000,
    "email": "xof-momo-test@customer.com",
    "currency": "XOF"
}
```

{% endtab %}
{% endtabs %}

Here's a sample response:

{% tabs %}
{% tab title="Sample Response  (XOF and XAF)" %}

```
{
    "success": true,
    "message": "Payment Request Successful",
    "data": {
        "reference": "cc7f3971826e",
        "nextStep": "PIN"
    }
}
```

{% endtab %}

{% tab title="UOTP" %}

```json
{
    "success": true,
    "message": "Payment Request Successful",
    "data": {
        "reference": "a0bxxxxxxxxe",
        "nextStep": "UNKNOWN",
        "meta": {
            "beforePaymentInstruction": "<p>How to Pay</p>\n<ol><li><b>Generate Voucher/OTP:</b> Dial <b>*144*82#</b> using your mobile number 2250717735258 to receive an OTP/Voucher.</li><li><b>Submit Voucher/OTP:</b> Enter the code in the input field below to proceed with your payment.</li></ol>"
        }
    }
}
```

{% endtab %}

{% tab title="URL" %}

```json
{
    "success": true,
    "message": "Payment Request Successful",
    "data": {
        "reference": "82XXXXXXXX07",
        "nextStep": "URL",
        "paymentUrl": "https://pay.wave.com/c/cos-24tfdam1g1pb6?a=250&c=XOF&m=point%20touch%20%2A%20Into",
        "meta": {}
    }
}
```

{% endtab %}

{% tab title="Failed response" %}

```
{
    "success": false,
    "message": "Failed to process payment request"
}
```

{% endtab %}
{% endtabs %}

Depending on the customer's mobile network, the authentication flow varies based on whether it is their first payment or a subsequent transaction:

* First-Time Payments: The customer will receive an OTP to authorize the transaction.
* Subsequent Payments: The customer will be prompted to enter a PIN instead.

#### Handling Specific API Responses

When processing the transaction, your system needs to handle two specific response types:

**1. If a `UOTP` (User OTP) status is returned:**

* The API response will include specific instructions.
* Your Action: Display these instructions clearly on your checkout interface.
* Customer Action: The customer follows the prompts to manually generate an OTP.
* Collect this generated OTP and send it to the Verify OTP endpoint.

**2. If a `URL` is returned:**

* On Desktop: Open the provided URL in a new browser tab.
* On Mobile: Redirect the customer using the URL. It will automatically open their mobile operator's app so they can authorize the transaction.

When it is an OTP; you need to present the User with a screen to enter OTP and then call the endpoint below.

To verify OTP: use this [guide](/startbutton-product-api/startbutton-api-doc/server-to-server-integration/s2s-integration-for-mobile-money/s2s-momo-kes-and-ghs.md#otp-verify).

{% hint style="info" %}
The amount should be in fractional units.
{% endhint %}

| Currency | Minimum amount | Maximum amount |
| -------- | -------------- | -------------- |
| XOF      | `200`          | `1500000`      |
| XAF      | `200`          | `1500000`      |

[^1]: For Camerounm
