API ndị otu gị ga-enwe mmasị na ya n'ezie
REST a na-atụ anya ya, igodo idempotency, webhook e bịanyere aka na sandbox nwere ụzọ ego ngosi ka i wee jikọta ihe niile tupu i bufee otu franc.
Nnakọta ego mbụ gị n'otu arịrịọ
REST dị ọcha, nhazi JSON a na-atụ anya ya, na request id na azịza ọ bụla. Sandbox na-egosipụta production: otu API, otu ọnọdụ, otu webhook.
- Igodo sandbox na production, e kewara maka ngwa ọ bụla
- Webhook e ji HMAC bịanyere aka, nwere nchekwa megide replay
- Igodo idempotency n'ọkpụkpọ ọ bụla na-emegharị ego
- Njehie e dere ụdị ha nke na-agwa gị kpọmkwem ihe ị ga-edozi
- Nkowa OpenAPI, nchikota Postman na llms.txt, e bipụtara ha nile
- Oge ịkwụ ụgwọ e debere na callback dị larịị maka njikọ CRM, ERP na ụlọ ahịa
curl https://api.capayglobal.com/v1/collections \
-H "Authorization: Bearer sk_test_..." \
-H "Idempotency-Key: 9f1c-collect-01" \
-H "Content-Type: application/json" \
-d '{
"amount": "2500",
"currency": "XAF",
"country": "CM",
"method": "mobile_money",
"msisdn": "2376XXXXXXXX",
"merchant_reference": "order-1042"
}'{
"status": "success",
"data": {
"id": "col_9xKQ2mD41Vb8",
"object": "collection",
"status": "pending",
"amount": "2500",
"currency": "XAF",
"country": "CM",
"method": "mobile_money",
"merchant_reference": "order-1042",
"fees": {
"platform_fee": "50",
"provider_fee": "0",
"total_fee": "50",
"bearer": "merchant"
},
"net_amount": null,
"livemode": false,
"created_at": "2026-08-30T12:04:11Z"
},
"request_id": "req_b0f3d2c1"
}Nnakota mbu gi
Otu arirıo na-emepụta ebumnuche ugwo, na-eweghachi njirimara arirıo ma, maka ego ekwentị, na-ezipu ncheta na ekwentị onye na-akwu ugwo. Sandbox na-eme kpom kwem ka mmeputa.
curl -X POST https://api.capayglobal.com/v1/collections \
-H "Authorization: Bearer sk_test_XXXXXXXXXXXX" \
-H "Idempotency-Key: col-order-10482-a1b2c3" \
-H "Content-Type: application/json" \
-d '{
"amount": "5000",
"currency": "XAF",
"country": "CM",
"method": "mobile_money",
"msisdn": "+237650000001",
"merchant_reference": "order-10482"
}'{
"status": "success",
"data": {
"id": "col_7Qm3k1Xa9Zr4",
"object": "collection",
"status": "pending",
"amount": "5000",
"currency": "XAF",
"auth_model": "STK_PROMPT",
"livemode": false
},
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}SDK nkesa
Mkpuchi di mkpa nwere udi n'elu otu API REST ahu, nwere idempotency na nyocha mbinye aka n'ime ya.
import { Capay } from '@capay/sdk';Ọ nọbeghị na npm. Ahịrị import dị n’elu bụ nke ikpeazụ, ya mere njikọ gị agaghị agbanwe mgbe e bipụtara ya.
Guo ntuziakafrom capay import CapayỌ nọbeghị na PyPI. Ahịrị import dị n’elu bụ nke ikpeazụ, ya mere njikọ gị agaghị agbanwe mgbe e bipụtara ya.
Guo ntuziakause Capay\CapayClient;Ọ nọbeghị na Packagist. Ahịrị import dị n’elu bụ nke ikpeazụ, ya mere njikọ gị agaghị agbanwe mgbe e bipụtara ya.
Guo ntuziakaNyochaa webhook obula
A na-agbako mbinye aka n'ahu na-adighi ocha ma tulee ya n'oge kwụsiri ike, a na-ajukwa akara oge karịrị sekọnd 300. Atukwala uche na webhook i nyochabeghi.
# T is the t= value from X-Capay-Signature; delivery.json is the raw body as received.
T=1767225600
SECRET=whsec_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
{ printf '%s.' "$T"; cat delivery.json; } \
| openssl dgst -sha256 -hmac "$SECRET" -r | cut -d' ' -f1
# Compare the printed hex with each v1= value in the header (either may match
# during a secret rotation), and reject the delivery if |now - T| > 300 s.X-Capay-Signature: t=1767225600,v1=6f8b4c2d9e0a1b3c5d7e9f0a2b4c6d8e0f1a3b5c7d9e1f0a2b4c6d8e0f1a3b5c
X-Capay-Event-Id: evt_2n4Kq8Zr41Xa
X-Capay-Event-Type: collection.completedA na-anwale nnyefe dara ozo na usoro kwụsiri ike: 1m, 5m, 30m, 2h, 6h, 12h, 24h, 24h. Ebe njedebe dara ugboro 8 n'usoro ka a na-agbanyụ ma gwa gi, ya mere ebe nwuru anwu anaghi elo ihe omume na nzuzo.
Nzuzo mbinye aka abuo nwere ike ino na-aru oru n'otu oge, ya mere i nwere ike ịgbanwe ha na-atufughi ihe omume. Jụ ihe obula no n'ezi windo sekọnd 300 ma chekwaa njirimara ihe omume ka nkwughachi ghara imerụ ahu.
Ihe ndi ozo di na ngwaonwe
Nkowa igwe nwere ike ịgụ, nchikota i nwere ike ibubata, na ngwaọrụ na-agu ha.
Leba anya na platfọọmụ
Malite ịnakọta ụgwọ gafee Afrịka taa
Mepee akaụntụ efu, wuo na sandbox ma malite ọrụ mgbe nyocha gasịrị.
Gwa anyị gbasara ụzọ ego gị na ọnụ ọgụgụ ego gị mgbe ọ bụla.