Overview
Konkon Protect lets you keep your own storefront and payment setup and add protected checkout for orders that need buyer confidence. Your system creates a transaction through this API and sends the buyer to a Konkon-hosted checkout page. The buyer pays, and Konkon holds the money. It is released to you after the buyer has received the order and the protection window has passed without a dispute.
Konkon Protect is protection only. It does not run your catalogue, cart or fulfilment.
- All money amounts are integers in kobo (₦88,000 is
8800000). OnlyNGNis supported. - The protection fee is deducted from your settlement, not added to the buyer's price.
- Webhooks tell you about every change, so you do not need to poll.
Quickstart
You need a test secret key (kk_test_sk_…) from Konkon. Create a transaction:
curl -X POST __BASE__/v1/transactions \
-H "Authorization: Bearer kk_test_sk_YOUR_KEY" \
-H "Idempotency-Key: order-10045-v1" \
-H "Content-Type: application/json" \
-d '{
"order_reference": "ET-10045",
"currency": "NGN",
"amount": 8800000,
"items": [{ "name": "Luxury Oud Perfume", "quantity": 1, "unit_price": 8500000, "category": "fragrance" }],
"delivery": { "fee": 300000, "method": "courier" },
"customer": { "name": "Jane Doe", "email": "jane@example.com", "phone": "08000000000" },
"return_url": "https://yourshop.com/order/success",
"cancel_url": "https://yourshop.com/checkout"
}'
Response (201):
{
"success": true,
"data": {
"transaction_id": "KKN-TXN-100001",
"order_reference": "ET-10045",
"status": "awaiting_payment",
"amount": 8800000,
"currency": "NGN",
"checkout_url": "__BASE__/txn/9f3c…",
"expires_at": "2026-11-24T10:30:00.000Z"
}
}
- Redirect the buyer to
checkout_url. - Wait for the
payment.successfulwebhook, then fulfil the order. - Call
POST /v1/transactions/{id}/dispatchwhen you ship it. - The buyer confirms delivery. After the protection window you receive
settlement.completed.
Authentication
Send your secret key as a bearer token on every request. Never put it in browser or mobile code.
Authorization: Bearer kk_test_sk_xxxxxxxxxxxxxxxx
| Key | Use |
|---|---|
kk_test_sk_… | Secret test key. Works against the sandbox. No real money moves. |
kk_live_sk_… | Secret live key. Only works once Konkon has approved your account for live mode. |
Keys carry scopes: merchant:read, transactions:read, transactions:write, fulfilment:write, disputes:write, settlements:read, webhooks:write, integrations:write. A missing scope returns 403 forbidden. Lost or leaked keys are revoked by Konkon and replaced.
Test and live modes
The key you use decides the mode. Test and live data are completely separate: transactions, webhook endpoints and settlements in one mode are invisible in the other. Every webhook includes livemode.
In test mode the checkout page shows a Pay (sandbox) button, and the transaction response includes the buyer's delivery code under sandbox.delivery_code. Neither exists in live mode.
Requests and errors
- Requests and responses are JSON. Send
Content-Type: application/json. - Every response has a
request_idin theX-Request-Idheader. Quote it when contacting support. - Rate limit: 120 requests per minute per key. When exceeded you get
429with aRetry-Afterheader. - Transaction ids look like
KKN-TXN-100001. Timestamps are ISO 8601 in UTC.
Success:
{ "success": true, "data": { … } }
Failure:
{ "success": false, "error": { "code": "validation_failed", "message": "amount must equal the sum of items plus delivery.fee",
"details": { "expected": 8800000, "received": 8500000 }, "request_id": "req_0243b4a3" } }
| HTTP | code | Meaning |
|---|---|---|
| 400 | invalid_request | Body is not valid JSON or is too large. |
| 401 | unauthorized | Missing, malformed, wrong or revoked key. |
| 403 | forbidden | Key lacks a scope, live mode is not enabled, the merchant account is not active, or return_url/cancel_url is not on one of your registered domains (verified domains in live mode). |
| 404 | not_found | No such object for your account and mode. |
| 409 | invalid_transition | The transaction is not in a state that allows this action. |
| 409 | duplicate_order_reference | order_reference already exists with a different amount. |
| 409 | idempotency_conflict, request_in_progress | See Idempotency. |
| 422 | validation_failed | A field is missing or wrong. details.field names it. |
| 422 | invalid_code, protection_window_closed, dispute_not_allowed | Delivery code wrong, dispute window over, or dispute type not allowed yet. |
| 429 | rate_limited, code_locked | Too many requests, or too many wrong delivery codes (locked for 15 minutes). |
| 503 | partner_not_configured | Live payments are not available for this account yet. |
Idempotency
Send an Idempotency-Key header (up to 200 characters) on any POST you might retry. Keys are remembered for 24 hours per merchant.
- Same key and same request: you get the original response back, with
Idempotent-Replayed: true. - Same key, different request:
409 idempotency_conflict. - Same key while the first request is still running:
409 request_in_progress. - Server errors (5xx) are not stored, so retrying is safe.
Separately, order_reference is unique per merchant and mode. Creating a transaction again with the same reference and amount returns the existing transaction with 200 instead of 201.
Transaction lifecycle
| Status | Meaning |
|---|---|
awaiting_payment | Created. The buyer has a checkout link and has not paid. |
expired | Not paid in time, or cancelled before payment. |
funded | Paid. Funds are held. You should now prepare the order. |
processing | You are preparing the order. |
in_transit | Dispatched. Waiting for delivery. |
delivered | Buyer confirmed with the delivery code. The protection window is running. |
disputed | A dispute is open. Release is paused. |
awaiting_release | Window closed or buyer accepted. Settlement is being paid out. |
refunding / refunded | Money is going back to the buyer, or has. |
settled | Done. Your net amount has been paid out. |
protection.Settlement maths. On a ₦88,000 order with a 1.5% protection fee: gross ₦88,000, fee ₦1,320, net paid to you ₦86,680. If part of the order is refunded after a dispute, the fee is charged on what you keep.
Hosted checkout
Redirect the buyer to the checkout_url. The page shows the order, takes payment, and afterwards becomes the buyer's order page where they can confirm delivery, accept the order early, or report a problem. The buyer is emailed a 6 digit delivery code when payment succeeds; they give it to the courier or enter it on the page only when they have the goods.
After payment the buyer can return to your return_url. A konkon_txn query parameter is appended. Do not treat reaching return_url as proof of payment. Confirm with the payment.successful webhook or by fetching the transaction.
Use POST /v1/transactions/{id}/payment-session to fetch the current link again while the transaction is still unpaid. Once an unpaid transaction has expired it cannot be revived; create a new one with a new order_reference.
Reference: merchant and setup
/v1/merchants/memerchant:readReturns your account name, status, whether live mode is enabled, and your limits.
/v1/integrationsintegrations:writeRegisters a store and the domains it uses. Checkout return_url and cancel_url must be on a registered domain (subdomains are accepted). In live mode the domain must also be verified, which Konkon does during live onboarding.
| Field | Type | |
|---|---|---|
platform | string | woocommerce, shopify, custom_web or mobile_app |
name | string | Store name |
domains | string[] | At least one, for example ["shop.example.com"] |
/v1/integrationsintegrations:writeLists your integrations with each domain's verified flag.
/v1/webhook-endpointswebhooks:writeBody: { "url": "https://yourshop.com/konkon/webhook" }. The URL must be public https. The response includes signing_secret (starts whsec_). It is shown once, so store it securely.
/v1/webhook-endpointswebhooks:writeLists endpoints for the current mode. Secrets are never returned.
/v1/webhook-endpoints/{id}/testwebhooks:writeQueues a webhook.test event to that endpoint. Returns 202.
/v1/webhook-endpoints/{id}/rotate-secretwebhooks:writeIssues a new signing secret. For 24 hours each delivery is signed with both the new and the old secret so you can switch over without dropping events.
Reference: transactions
/v1/transactionstransactions:writeCreates a transaction and its payment session. Returns 201, or 200 if the same order_reference and amount already exist.
| Field | Type | |
|---|---|---|
order_reference | string | Your order id. Required, max 100 characters, unique per mode. |
currency | string | NGN (default) |
amount | integer | Total in kobo. Must equal the sum of quantity × unit_price plus delivery.fee. |
items[] | array | 1 to 100 items: name, quantity, unit_price (kobo), optional category |
delivery.fee | integer | Kobo, default 0 |
delivery.method | string | seller_managed, courier, third_party, pickup or customer_collection |
customer | object | name, email (required), phone (optional). The email receives the delivery code. |
return_url, cancel_url | string | Where the buyer goes after paying or cancelling |
May also return 422 if the amount is over your per-transaction limit.
/v1/transactions/{id}transactions:readReturns the transaction. This is the same shape as list items and as most action responses.
{
"success": true,
"data": {
"transaction_id": "KKN-TXN-100001",
"order_reference": "ET-10045",
"status": "in_transit",
"amount": 8800000, "currency": "NGN",
"protection_fee": 132000, "refunded_amount": 0,
"livemode": false,
"created_at": "2026-11-24T09:58:00.000Z",
"payment": { "status": "confirmed", "paid_at": "2026-11-24T10:02:11.000Z" },
"fulfilment": { "status": "in_transit", "method": "third_party", "courier": "GIG Logistics",
"tracking_reference": "TOL-7781", "dispatched_at": "…", "delivered_at": null },
"protection": { "fulfilment_due_at": "…", "delivery_due_at": "…", "window_ends_at": null, "dispute_status": "none" },
"settlement": { "status": "not_started", "net_amount": null, "settled_at": null },
"sandbox": { "delivery_code": "482910" }
}
}
sandbox appears in test mode only.
/v1/transactionstransactions:readNewest first. Query: limit (1 to 100, default 20), status, and starting_after (a transaction id) for the next page. Returns { "items": […], "has_more": true }.
/v1/transactions/{id}/timelinetransactions:readOrdered history of everything that happened: sequence, event_type, from_status, to_status, actor, reason, created_at.
/v1/transactions/{id}/payment-sessiontransactions:writeReturns the current checkout_url and expires_at for a transaction that is still unpaid. If the transaction has expired or been paid you get 409 invalid_transition.
/v1/transactions/{id}/canceltransactions:writeOptional body { "reason": "out of stock" }. Before payment the transaction becomes expired. After payment but before dispatch the buyer is refunded in full (refunding, then refunded). After dispatch it cannot be cancelled; the buyer can dispute instead.
Reference: fulfilment
/v1/transactions/{id}/processingfulfilment:writeOptional. Tells the buyer you have started preparing the order (funded → processing).
/v1/transactions/{id}/dispatchfulfilment:writeMarks the order as shipped. Works from funded or processing. Moves the transaction to in_transit and fires order.dispatched.
| Field | |
|---|---|
courier | Required |
tracking_reference | Required |
expected_delivery_date | Optional, YYYY-MM-DD |
notes | Optional |
/v1/transactions/{id}/delivery-prooffulfilment:writeAdds supporting proof after dispatch. Body: type (tracking, photo, signature or courier_confirmation) and a reference (for example a tracking link). Returns 201. Proof helps in a dispute, but it does not by itself complete delivery.
/v1/transactions/{id}/confirm-deliveryfulfilment:writeSubmit the buyer's 6 digit delivery code, for example when your courier app collects it: { "code": "482910" }. On success the status becomes delivered and the protection window starts. Five wrong codes lock the transaction for 15 minutes (429 code_locked).
Reference: disputes
Buyers normally report problems from the hosted order page. The endpoints below let your own app do the same on the buyer's behalf, and let you answer.
/v1/transactions/{id}/disputesdisputes:writeAllowed while the order is in_transit (only not_delivered, and only once the delivery deadline has passed) or delivered (until the protection window ends). Returns 201 and moves the transaction to disputed.
| Field | |
|---|---|
reason | not_delivered, not_as_described, damaged, defective or other |
description | Optional text |
requested_resolution | Optional: full_refund or partial_refund |
/v1/disputes/{id}disputes:writeReturns the dispute, its status, the merchant response deadline, any decision and the evidence submitted.
/v1/disputes/{id}/responsesdisputes:writeYour side of the story. Body: { "note": "Shipped intact; courier confirms damage in transit." }. Returns 201 and the dispute moves to under_review. Respond before merchant_response_due_at.
A Konkon reviewer then decides: full_refund, partial_refund or rejected. You are told through the dispute.resolved webhook. A rejected dispute releases the funds to you; a refund is returned to the buyer's original payment method and settlement continues on the remainder.
Reference: settlements
/v1/settlementssettlements:readThe latest 100 settlements for the current mode. Each has transaction_id, gross, fee, refund_adjustment, net, status, authorised_at and completed_at. Funds are paid to your verified settlement account.
Receiving webhooks
Konkon sends a POST with a JSON body to every active endpoint in the matching mode whenever something happens.
{
"id": "evt_8a1c…",
"type": "payment.successful",
"api_version": "v1",
"livemode": false,
"created_at": "2026-11-24T10:02:11.482Z",
"sequence": 2,
"data": { "transaction_id": "KKN-TXN-100001", "order_reference": "ET-10045", "status": "funded", "amount": 8800000, "currency": "NGN" }
}
| Header | |
|---|---|
Konkon-Signature | Signature, see below |
Konkon-Event-Id | Same as id. Stays the same across retries. |
Konkon-Delivery-Attempt | 1 for the first try, then 2, 3… |
- Reply with any
2xxwithin 10 seconds. Anything else, or a timeout, is retried. Redirects are not followed. - Retries happen after 1 min, 5 min, 15 min, 1 h, 3 h, 6 h and 12 h, 8 attempts in total. After that the delivery is marked dead.
- Handle duplicates. Delivery is at least once. Deduplicate on
id. - Order is not guaranteed. Use
sequence(the position in the transaction's timeline) to ignore stale events, or fetch the transaction for the current state. - Return
200quickly and do heavy work afterwards.
Verifying signatures
Always verify the signature before trusting an event. The header looks like t=1732442531,v1=5257a8…. The signed text is the timestamp, a dot, then the raw request body exactly as received. The signature is the hex HMAC-SHA256 of that text, keyed with your whsec_ secret. During a secret rotation the header carries two v1 values; accept the event if either matches. Reject timestamps older than 5 minutes.
Node.js
import crypto from 'node:crypto';
export function verifyKonkon(secret, rawBody, header, toleranceSeconds = 300) {
const parts = header.split(',').map((p) => p.split('='));
const t = Number(parts.find(([k]) => k === 't')?.[1]);
if (!t || Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false;
const want = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
return parts.filter(([k]) => k === 'v1').some(([, sig]) =>
sig.length === want.length && crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(want)));
}
// Express: use express.raw({ type: 'application/json' }) on this route so req.body is the raw Buffer.
app.post('/konkon/webhook', express.raw({ type: 'application/json' }), (req, res) => {
const raw = req.body.toString('utf8');
if (!verifyKonkon(process.env.KONKON_WEBHOOK_SECRET, raw, req.get('Konkon-Signature') || '')) return res.sendStatus(400);
const event = JSON.parse(raw);
// dedupe on event.id, then act on event.type
res.sendStatus(200);
});
PHP
function verify_konkon(string $secret, string $raw, string $header, int $tolerance = 300): bool {
$t = null; $sigs = [];
foreach (explode(',', $header) as $part) {
[$k, $v] = array_pad(explode('=', $part, 2), 2, '');
if ($k === 't') $t = (int)$v;
if ($k === 'v1') $sigs[] = $v;
}
if (!$t || abs(time() - $t) > $tolerance) return false;
$want = hash_hmac('sha256', $t . '.' . $raw, $secret);
foreach ($sigs as $s) if (hash_equals($want, $s)) return true;
return false;
}
$raw = file_get_contents('php://input');
if (!verify_konkon(getenv('KONKON_WEBHOOK_SECRET'), $raw, $_SERVER['HTTP_KONKON_SIGNATURE'] ?? '')) { http_response_code(400); exit; }
Python
import hmac, hashlib, time
def verify_konkon(secret: str, raw: bytes, header: str, tolerance: int = 300) -> bool:
parts = [p.split('=', 1) for p in header.split(',')]
t = next((int(v) for k, v in parts if k == 't'), 0)
if not t or abs(time.time() - t) > tolerance:
return False
want = hmac.new(secret.encode(), f'{t}.'.encode() + raw, hashlib.sha256).hexdigest()
return any(hmac.compare_digest(want, v) for k, v in parts if k == 'v1')
Event types
| Type | When | Extra fields in data |
|---|---|---|
transaction.created | A transaction is created | |
payment.successful | Payment confirmed and funds are held. Start fulfilment. | |
payment.failed | The payment did not go through | |
transaction.expired | Unpaid session expired, or cancelled before payment | reason |
order.dispatched | You marked the order shipped | courier, tracking_reference |
delivery.confirmed | Buyer's code accepted; protection window starts | |
dispute.opened | A dispute was raised. Respond with evidence. | dispute_id, reason |
dispute.resolved | Reviewer decided | dispute_id, decision, refund_amount |
refund.completed | A refund reached the buyer | refund_id, amount |
settlement.completed | Your payout was sent | settlement_id, gross, fee, refund_adjustment, net |
webhook.test | You asked for a test event | message |
Testing in sandbox
- Create an integration and a webhook endpoint with your test key.
- Create a transaction and open its
checkout_url. Press Pay (sandbox). You receivepayment.successful. - Call
dispatch. Fetch the transaction and readsandbox.delivery_code. - Call
confirm-deliverywith that code (or enter it on the checkout page). You receivedelivery.confirmed. - The protection window closes on a timer, after which settlement runs. To test early release, use the Yes, release payment to the seller button on the buyer's order page once the order is delivered.
- Try the unhappy paths: cancel before dispatch, open a dispute, let a session expire, enter wrong codes.
Going live
- Konkon approves your business, verifies your store domains and your settlement bank account, then enables live mode and issues
kk_live_sk_…keys. - Create your webhook endpoint again with the live key. Test and live endpoints are separate.
- Switch the key, run one low-value order end to end, then open up.
- Make sure your server verifies webhook signatures, deduplicates events, and never exposes the secret key to browsers.
X-Request-Id from the response when you contact Konkon support.