> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zerocash.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Collect Orange Money in Burkina Faso

> Charge an XOF Orange Money customer in Burkina Faso, where a one-time payment code is generated before the charge.

Use this recipe to collect an `XOF` mobile money payment from an Orange Money customer in Burkina
Faso.

This differs from a normal mobile money charge: the customer must generate a **one-time payment
code before** you create the charge. You send that code as `otpCode`.

<Warning>
  Do not ask the customer for their Orange Money PIN. Zerocash only needs the OTP that Orange Money
  generates for this specific payment attempt.
</Warning>

## Step 1. Show the customer OTP instructions

```text Customer copy theme={null}
1. On your Orange Money phone, dial *144*4*6*1000#
2. Replace 1000 with the exact amount you are paying.
3. You will receive a one-time payment code.
4. Enter that code here to continue.

Do not enter your Orange Money PIN.
```

<Warning>
  The amount in the shortcode must match the `amount` you send to Zerocash. A mismatch is the most
  common cause of failure in this corridor.
</Warning>

## Step 2. Choose the operator code

Orange Money in Burkina Faso is `orange`. Confirm against
[mobile money operators](/guides/mobile-money-operators) and send it as `momoOperatorId`.

## Step 3. Create the charge with `otpCode`

After the customer enters the OTP, create the charge.

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url "https://api.zerocash.tech/api/b2b/fiat/deposit/momo" \
    --header "Authorization: Bearer $ZEROCASH_TOKEN" \
    --header "content-type: application/json" \
    --data '{
      "amount": 1000,
      "currency": "XOF",
      "phoneNumber": "22670000000",
      "momoOperatorId": "orange",
      "externalReference": "order_orange_bf_12345",
      "otpCode": "123456"
    }'
  ```

  ```javascript Node.js theme={null}
  const axios = require("axios");

  const ZEROCASH_TOKEN = process.env.ZEROCASH_TOKEN;
  const BASE_URL = "https://api.zerocash.tech/api/b2b";

  async function collectOrangeMoneyBurkinaFaso({ amount, phoneNumber, otpCode, externalReference }) {
    const headers = {
      accept: "application/json",
      "content-type": "application/json",
      Authorization: `Bearer ${ZEROCASH_TOKEN}`,
    };

    const chargeResponse = await axios.post(
      `${BASE_URL}/fiat/deposit/momo`,
      {
        amount,
        currency: "XOF",
        phoneNumber,
        momoOperatorId: "orange",
        externalReference,
        otpCode,
      },
      { headers },
    );

    const transactionId = chargeResponse.data.transactionId;
    const transactionResponse = await axios.get(
      `${BASE_URL}/transactions/${transactionId}`,
      { headers },
    );

    return {
      charge: chargeResponse.data,
      transaction: transactionResponse.data,
    };
  }

  collectOrangeMoneyBurkinaFaso({
    amount: 1000,
    phoneNumber: "22670000000",
    otpCode: "123456",
    externalReference: "order_orange_bf_12345",
  })
    .then(console.log)
    .catch((error) => {
      console.error(error.response?.data || error.message);
    });
  ```
</CodeGroup>

```json Response theme={null}
{
  "success": true,
  "message": "Initiated request.",
  "transactionId": "123456789"
}
```

A successful response means accepted for processing, not that the customer has paid. Store the
`transactionId` and your `externalReference` for reconciliation.

## Step 4. Confirm the final status

```bash theme={null}
curl --request GET \
  --url "https://api.zerocash.tech/api/b2b/transactions/123456789" \
  --header "Authorization: Bearer $ZEROCASH_TOKEN" \
  --header "accept: application/json"
```

```json Successful transaction theme={null}
{
  "success": true,
  "data": {
    "transactionId": "123456789",
    "type": "deposit",
    "method": "momo",
    "currency": "XOF",
    "chargeStatus": "successful",
    "status": "SUCCESSFUL",
    "externalReference": "order_orange_bf_12345"
  }
}
```

## Step 5. Handle common issues

| Issue                                  | What to check                                                                              |
| :------------------------------------- | :----------------------------------------------------------------------------------------- |
| `Otp code is required`                 | The provider requires `otpCode` — collect it before creating the charge.                   |
| Invalid or failed charge               | Confirm the customer generated the OTP for the **exact** amount in the charge request.     |
| Customer asks where to enter their PIN | Never in your checkout. Ask only for the OTP generated for this payment.                   |
| Operator not found                     | Confirm the Orange Money code in [mobile money operators](/guides/mobile-money-operators). |
| Transaction remains pending            | Wait for webhook updates or poll the transaction. Do not fulfil until final success.       |
