Collect with a Local Payment Method

Your customer pays with a bank transfer, mobile money, card or local wallet.

✅

What this does

Your customer pays with a method they already use — M-Pesa, GCash, PIX, SEPA, cards, and more. You get the money on your TransFi balance in the currency you choose.

Steps

1. Create the customer

curl -X POST 'https://sandbox-api.transfi.com/v3/users/individual' \
  -H 'Authorization: Basic YOUR_BASE64_CREDENTIALS' \
  -H 'mid: YOUR_MID' \
  -H 'Content-Type: application/json' \
  -d '{
    "firstName": "Asha",
    "lastName": "Kamau",
    "email": "[email protected]",
    "phone": "0712345678",
    "phoneCode": "+254",
    "country": "KE",
    "date": "15-06-1990"
  }'

Save the userId from the response. → Create Individual User

2. Find the payment methods for their country

curl -X GET 'https://sandbox-api.transfi.com/v3/config/payment-methods?direction=deposit&country=KE' \
  -H 'Authorization: Basic YOUR_BASE64_CREDENTIALS' \
  -H 'mid: YOUR_MID'

Use the paymentType and paymentCode from the response in the next step. → List Payment Methods

3. Create the order

curl -X POST 'https://sandbox-api.transfi.com/v3/orders' \
  -H 'Authorization: Basic YOUR_BASE64_CREDENTIALS' \
  -H 'mid: YOUR_MID' \
  -H 'Content-Type: application/json' \
  -d '{
    "userId": "UX-250930062608488",
    "orderType": "payin",
    "purposeCode": "company_expenses",
    "partnerId": "order-1001",
    "source": {
      "currency": "KES",
      "amount": "2500",
      "paymentType": "local_wallet",
      "paymentCode": "MPESA"
    },
    "destination": {
      "currency": "USDT"
    }
  }'
{
  "status": "success",
  "data": {
    "orderId": "OR-2509291454262384294",
    "payUrl": "https://sandbox-pay-widget.transfi.com/pay?paytoken=..."
  }
}

→ Create Order

4. Send the customer to payUrl

They pay there. When they come back, the payment is not yet confirmed — wait for the status.

5. Wait for the final status

StatusMeaningWhat to do
initiatedWaiting for the customer to payShow "pending"
fund_processingPayment made, being confirmedShow "processing"
fund_settledDone. Money is on your balanceDeliver what they paid for
fund_failedPayment didn't arriveCreate a new order with a new partnerId

Use webhooks to be told when the status changes, or check with Get Order.

🛑

Don't retry a failed order. Create a new one with a new partnerId.

Test it

Create the order in sandbox, then set its status with Simulate Order Status.

Related

Collect Crypto · Collect via a Virtual Account · Payouts


Did this page help you?