Payment Intents
A PaymentIntent represents a payment flow. Create one, then let the customer pay via checkout or direct rail interaction.
Create a Payment Intent
POST /v1/payment_intents
Parameters
| Param | Type | Required | Description |
|---|
amount | integer | Yes | Amount in minor units (e.g. FCFA) |
currency | string | Yes | XOF, XAF, GNF, BTC, USDT |
rail | string | Yes | orange_money, moov, wave, mtn_momo, btc_lightning, btc_onchain, usdt_trc20 |
reference | string | No | Merchant reference for reconciliation |
metadata | object | No | Key-value metadata |
Example
curl -X POST https://api.ynopay.com/v1/payment_intents \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"amount": 10000,
"currency": "XOF",
"rail": "orange_money",
"metadata": { "order_id": "ORD-42" }
}'
Response
{
"id": "pi_abc123",
"object": "payment_intent",
"amount": 10000,
"currency": "XOF",
"status": "requires_payment_method",
"rail": "orange_money",
"metadata": { "order_id": "ORD-42" },
"createdAt": 1716000000
}
Retrieve a Payment Intent
GET /v1/payment_intents/:id
List Payment Intents
GET /v1/payment_intents
Statuses
| Status | Description |
|---|
requires_payment_method | Awaiting customer payment |
pending | Payment initiated, awaiting confirmation |
succeeded | Payment confirmed and reconciled |
failed | Payment failed or expired |
canceled | Canceled by merchant |