CEDILINK

Authentication

Every request carries a bearer key. Which key you use decides what you can do and where it is safe to put it.

CredentialLooks likeWhere it belongs
Merchant IDmch_7QWv2Kx9LpAnywhere. It identifies you, it does not authenticate you.
Publishable keypk_live_...Browser, mobile app. Can read an intent, cannot create a charge.
Secret keysk_live_...Your server only.

The secret key is the whole account

Anyone holding it can charge your customers and read every transaction you have ever taken. It belongs in a secrets manager. Not in a repository, not in a .env you commit, not in a screenshot in a support thread, and never in a mobile app, where it can be pulled out of the binary.

Test and live

You can create test keys the moment you sign up, before your business verification clears — Dashboard → Developers → New test key. Everything behaves identically except that no money moves and no prompts reach real handsets. Live keys are only issued once your verification is approved; asking for one before that returns403 live_not_available. One honest caveat: the mock rail only loads when the API server boots in test mode — the production server boots live, so test behaviour on the production URL is not the mock. Run a local server in test mode for mock testing and verify production with a real GH₵1 payment.

sk_test_...   test mode — the mock rail, fake money
sk_live_...   real customers, real cedis

A test key cannot read or write live data. That is enforced in the database rather than by convention, so no configuration mistake can cross the boundary.

Idempotency

POST/v1/payment_intents

Every mutating request needs an Idempotency-Key header. Send the same key with the same body and you get the stored response back rather than a second charge.

-H "Idempotency-Key: 8f14e45f-ea5b-4c0f-9b3a-2c1d4e5f6a7b"

Why this is required rather than optional

Your HTTP client retries on timeout by default, and the request most likely to time out is the one that already reached the gateway. Without an idempotency key, that retry is a second charge on a customer who has already paid.
SituationWhat happens
Same key, same bodyYou get the stored response back, with an idempotent-replay header. No second charge.
Same key, different bodyA 409 idempotency_key_reuse. We refuse rather than guess which body you meant, because guessing could charge an amount the customer never agreed to.
Key still in flightA 409 request_in_flight. Retry shortly.
No key at allA 400 idempotency_key_required.

Rotating a key

Create a new key from Dashboard → Developers, deploy it, then switch traffic over. There is no revoke button yet — an old key keeps working until it is revoked, so treat a leaked key as compromised: create a new key, switch traffic, and ask support to revoke the old one.