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.

You create a transaction→Buyer pays on Konkon checkout→You dispatch→Buyer confirms with delivery code→Protection window→Funds settle to you

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"
  }
}
  1. Redirect the buyer to checkout_url.
  2. Wait for the payment.successful webhook, then fulfil the order.
  3. Call POST /v1/transactions/{id}/dispatch when you ship it.
  4. 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
KeyUse
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

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" } }
HTTPcodeMeaning
400invalid_requestBody is not valid JSON or is too large.
401unauthorizedMissing, malformed, wrong or revoked key.
403forbiddenKey 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).
404not_foundNo such object for your account and mode.
409invalid_transitionThe transaction is not in a state that allows this action.
409duplicate_order_referenceorder_reference already exists with a different amount.
409idempotency_conflict, request_in_progressSee Idempotency.
422validation_failedA field is missing or wrong. details.field names it.
422invalid_code, protection_window_closed, dispute_not_allowedDelivery code wrong, dispute window over, or dispute type not allowed yet.
429rate_limited, code_lockedToo many requests, or too many wrong delivery codes (locked for 15 minutes).
503partner_not_configuredLive 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.

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

StatusMeaning
awaiting_paymentCreated. The buyer has a checkout link and has not paid.
expiredNot paid in time, or cancelled before payment.
fundedPaid. Funds are held. You should now prepare the order.
processingYou are preparing the order.
in_transitDispatched. Waiting for delivery.
deliveredBuyer confirmed with the delivery code. The protection window is running.
disputedA dispute is open. Release is paused.
awaiting_releaseWindow closed or buyer accepted. Settlement is being paid out.
refunding / refundedMoney is going back to the buyer, or has.
settledDone. Your net amount has been paid out.
Deadlines. The protection policy sets how long the buyer has to pay, how long you have to dispatch, how long delivery may take, and how long the protection window lasts. If you miss the dispatch deadline the buyer is refunded automatically. Current values are returned on every transaction under 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

GET/v1/merchants/memerchant:read

Returns your account name, status, whether live mode is enabled, and your limits.

POST/v1/integrationsintegrations:write

Registers 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.

FieldType
platformstringwoocommerce, shopify, custom_web or mobile_app
namestringStore name
domainsstring[]At least one, for example ["shop.example.com"]
GET/v1/integrationsintegrations:write

Lists your integrations with each domain's verified flag.

POST/v1/webhook-endpointswebhooks:write

Body: { "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.

GET/v1/webhook-endpointswebhooks:write

Lists endpoints for the current mode. Secrets are never returned.

POST/v1/webhook-endpoints/{id}/testwebhooks:write

Queues a webhook.test event to that endpoint. Returns 202.

POST/v1/webhook-endpoints/{id}/rotate-secretwebhooks:write

Issues 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

POST/v1/transactionstransactions:write

Creates a transaction and its payment session. Returns 201, or 200 if the same order_reference and amount already exist.

FieldType
order_referencestringYour order id. Required, max 100 characters, unique per mode.
currencystringNGN (default)
amountintegerTotal in kobo. Must equal the sum of quantity × unit_price plus delivery.fee.
items[]array1 to 100 items: name, quantity, unit_price (kobo), optional category
delivery.feeintegerKobo, default 0
delivery.methodstringseller_managed, courier, third_party, pickup or customer_collection
customerobjectname, email (required), phone (optional). The email receives the delivery code.
return_url, cancel_urlstringWhere the buyer goes after paying or cancelling

May also return 422 if the amount is over your per-transaction limit.

GET/v1/transactions/{id}transactions:read

Returns 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.

GET/v1/transactionstransactions:read

Newest first. Query: limit (1 to 100, default 20), status, and starting_after (a transaction id) for the next page. Returns { "items": […], "has_more": true }.

GET/v1/transactions/{id}/timelinetransactions:read

Ordered history of everything that happened: sequence, event_type, from_status, to_status, actor, reason, created_at.

POST/v1/transactions/{id}/payment-sessiontransactions:write

Returns 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.

POST/v1/transactions/{id}/canceltransactions:write

Optional 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

POST/v1/transactions/{id}/processingfulfilment:write

Optional. Tells the buyer you have started preparing the order (funded → processing).

POST/v1/transactions/{id}/dispatchfulfilment:write

Marks the order as shipped. Works from funded or processing. Moves the transaction to in_transit and fires order.dispatched.

Field
courierRequired
tracking_referenceRequired
expected_delivery_dateOptional, YYYY-MM-DD
notesOptional
POST/v1/transactions/{id}/delivery-prooffulfilment:write

Adds 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.

POST/v1/transactions/{id}/confirm-deliveryfulfilment:write

Submit 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.

POST/v1/transactions/{id}/disputesdisputes:write

Allowed 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
reasonnot_delivered, not_as_described, damaged, defective or other
descriptionOptional text
requested_resolutionOptional: full_refund or partial_refund
GET/v1/disputes/{id}disputes:write

Returns the dispute, its status, the merchant response deadline, any decision and the evidence submitted.

POST/v1/disputes/{id}/responsesdisputes:write

Your 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

GET/v1/settlementssettlements:read

The 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-SignatureSignature, see below
Konkon-Event-IdSame as id. Stays the same across retries.
Konkon-Delivery-Attempt1 for the first try, then 2, 3…

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

TypeWhenExtra fields in data
transaction.createdA transaction is created
payment.successfulPayment confirmed and funds are held. Start fulfilment.
payment.failedThe payment did not go through
transaction.expiredUnpaid session expired, or cancelled before paymentreason
order.dispatchedYou marked the order shippedcourier, tracking_reference
delivery.confirmedBuyer's code accepted; protection window starts
dispute.openedA dispute was raised. Respond with evidence.dispute_id, reason
dispute.resolvedReviewer decideddispute_id, decision, refund_amount
refund.completedA refund reached the buyerrefund_id, amount
settlement.completedYour payout was sentsettlement_id, gross, fee, refund_adjustment, net
webhook.testYou asked for a test eventmessage

Testing in sandbox

  1. Create an integration and a webhook endpoint with your test key.
  2. Create a transaction and open its checkout_url. Press Pay (sandbox). You receive payment.successful.
  3. Call dispatch. Fetch the transaction and read sandbox.delivery_code.
  4. Call confirm-delivery with that code (or enter it on the checkout page). You receive delivery.confirmed.
  5. 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.
  6. Try the unhappy paths: cancel before dispatch, open a dispute, let a session expire, enter wrong codes.

Going live

Need help? Quote the X-Request-Id from the response when you contact Konkon support.