The three kinds of key
A key is minted in the dashboard and returned exactly once. Only a selector and a hash of the verifier are stored, so there is no reveal endpoint and there never will be.
nyk_sk_live_…Secret key
Server-side only. Full authority over your app, and optionally bound to one wallet so a key separates one project’s money from another’s.
nyk_pk_live_…Publishable key
Safe in a browser or an app, but it cannot create a payment or read your data. It lists the methods available for a corridor and, with a payment’s client secret, confirms and follows that one payment.
nyk_rk_live_…Restricted key
Server-side, limited to an explicit list of permission scopes. One per integration, so a compromise has a blast radius rather than a total.
Which key for which call
Every endpoint, and what each kind of key needs to call it. A restricted key needs the scope shown; a secret key needs nothing extra.
| Endpoint | Secret | Restricted — scope | Publishable |
|---|---|---|---|
| POST /v1/payment_intents | Yes | payments.intents.create | No |
| POST /v1/payment_intents/:id/confirm | Yes | payments.intents.create | With the client secret |
| GET /v1/payment_intents/:id | Yes | payments.intents.read | With the client secret |
| GET /v1/payment_intents | Yes | payments.intents.read | No |
| POST /v1/customers | Yes | customers.write | No |
| GET /v1/providers | Yes | Any key | Yes |
| POST /v1/payment_links | Yes | billing.links.manage | No |
| GET /v1/payment_links/:id | Yes | billing.links.read | No |
| POST /v1/payment_links/:id/deactivate | Yes | billing.links.manage | No |
| POST /v1/sellers | Yes | sellers.manage | No |
| GET /v1/sellers | Yes | sellers.read | No |
| GET /v1/sellers/:id | Yes | sellers.read | No |
| PATCH /v1/sellers/:id | Yes | sellers.manage | No |
| POST /v1/sellers/:id/payout_destinations | Yes | sellers.manage | No |
| POST /v1/sellers/:id/payouts | Yes | sellers.payouts.create | No |
| GET /v1/sellers/:id/payouts | Yes | sellers.read | No |
| GET /v1/sellers/:id/payouts/:payoutId | Yes | sellers.read | No |
| POST /v1/disputes | Yes | payments.disputes.manage | No |
| GET /v1/disputes | Yes | payments.disputes.read | No |
| GET /v1/disputes/:id | Yes | payments.disputes.read | No |
| POST /v1/disputes/:id/accept | Yes | payments.disputes.manage | No |
| POST /v1/disputes/:id/reject | Yes | payments.disputes.manage | No |
| POST /v1/refunds | Yes | payments.refunds.create | No |
| GET /v1/refunds/:id | Yes | payments.refunds.read | No |
Using a publishable key
For a checkout you build yourself. Your server creates the payment with the secret key and gives the browser two things: the payment id and its clientSecret. The browser then confirms it and follows its progress with the publishable key, sending the client secret each time. The key is public by design; the client secret is what limits it to the one payment it was handed.
// 1. Your server creates the payment with the SECRET key, and hands the
// browser only the id and the client secret.
app.post('/pay', async (req, res) => {
const response = await fetch('https://secure.nyukiai.com/v1/payment_intents', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.NYUKIAI_SECRET_KEY}`,
'Idempotency-Key': `order-${req.body.orderId}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: '500000',
currency: 'XAF',
country: 'CM',
methodType: 'MOBILE_MONEY',
reference: req.body.orderId,
providerParams: { msisdn: req.body.phone },
}),
});
const intent = await response.json();
res.json({ id: intent.id, clientSecret: intent.clientSecret });
});Scopes
A restricted key carries permission codes and may exercise only the intersection of its own scopes and what its app is allowed to do. Widening an app’s permissions never silently widens a key.
Create one under Developers → API keys: choose Restricted, then tick the scopes. You can only grant scopes you hold yourself. The key works exactly like a secret key for everything in its scopes, and answers 403 for everything else.
IP allowlist
Each key can name the source addresses permitted to use it. It defaults to empty, meaning any address, because an app on dynamic egress would otherwise lock itself out — but on a fixed egress it is the strongest single control you have.
