API eo sehlopha sa hao se tla e rata
REST e lebelletsweng, di-idempotency key, di-webhook tse saenneng le sandbox e nang le ditsela tse etsisitsweng e le hore o kopanye ho tloha qalong ho isa qetellong pele franc e le nngwe e tsamaya.
Kamohelo ya hao ya pele ka kopo e le nngwe
REST e hlwekileng, sebopeho sa JSON se lebelletsweng le request id karabong e nngwe le e nngwe. Sandbox e tshwana le production: API e le nngwe, maemo a mang, di-webhook tse tshwanang.
- Dinotlolo tsa sandbox le tsa production, tse arotsweng ka app
- Di-webhook tse saenneng ka HMAC, tse sireletsehileng kgahlanong le ho phetwa
- Di-idempotency key kopong e nngwe le e nngwe e tsamaisang tjhelete
- Diphoso tse hlalositsweng tse o bolellang hantle hore o lokise eng
- Tlhaloso ea OpenAPI, pokello ea Postman le llms.txt, tsohle li phatlalalitsoe
- Linako tsa ho lefa tse amohetsoeng le li-callback tse bataletseng bakeng sa lihokelo tsa CRM, ERP le mabenkele
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"
}Ho bokella ha hau ha pele
Kopo e le 'ngoe e theha morero oa tefo, e khutlisa id ea kopo 'me, bakeng sa chelete ea mohala, e romella kopo mohaleng oa molefi. Sandbox e sebetsa hantle joalo ka tlhahiso.
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"
}Li SDK tsa seva
Likoahelo tse tshesaane tse nang le mefuta holim'a API e le 'ngoe ea REST, li e na le idempotency le netefatso ea tekeno ka hare.
import { Capay } from '@capay/sdk';Ha e so be teng ho npm. Mola wa import o ka hodimo ke wa ho qetela, kahoo kopano ya hao e ke ke ya fetoha ha e phatlalatswa.
Bala tataisofrom capay import CapayHa e so be teng ho PyPI. Mola wa import o ka hodimo ke wa ho qetela, kahoo kopano ya hao e ke ke ya fetoha ha e phatlalatswa.
Bala tataisouse Capay\CapayClient;Ha e so be teng ho Packagist. Mola wa import o ka hodimo ke wa ho qetela, kahoo kopano ya hao e ke ke ya fetoha ha e phatlalatswa.
Bala tataisoNetefatsa webhook e 'ngoe le e 'ngoe
Litekeno li baloa 'meleng o sa lokisoang 'me li bapisoa ka nako e sa fetoheng, 'me letshoao la nako le fetang metsotsoana e 300 le hanoa. Le ka mohla u se ke oa tshepa webhook eo u sa e netefatsang.
# 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.completedHo fana ho hlolehileng ho lekoa hape ka kemiso e sa fetoheng: 1m, 5m, 30m, 2h, 6h, 12h, 24h, 24h. Endpoint e hlolehang makhetlo a 8 a latellanang ea koaloa 'me ua bolelloa, e le hore endpoint e shoeleng e se ke ea koenya liketsahalo ka khutso.
Liphiri tse peli tsa ho saena li ka sebetsa ka nako e le 'ngoe, kahoo u ka li fetola u sa lahleheloe ke ketsahalo. Hana ntho e 'ngoe le e 'ngoe e ka ntle ho nako ea metsotsoana e 300 'me u boloke id ea ketsahalo hore ho pheta ho se be kotsi.
Lisebelisoa tse ling
Litlhaloso tse baloang ke mochine, pokello eo u ka e kenyang, le lisebelisoa tse li balang.
Sheba platform
Qala ho amohela ditefo ho pholletsa le Afrika kajeno
Bula akhaonto ya mahala, o hahe ka sandbox, mme o ye live kamora netefatso.
O ka re bolella ka dibaka tsa hao le bongata ba tjhelete neng kapa neng.