Skip to content
Skills Library
Finance & accounting · Tool integration

koko

/koko

Expert knowledge of Koko (paykoko.com, Koko Pay, "Buy Now Pay Later"), a Sri Lankan BNPL payment gateway by Koko Pay, covering code integration AND account/support questions. Use whenever the user mentions Koko, paykoko.com, qaapi.paykoko.com, prodapi.paykoko.com, api/merchants/orderCreate, orderView, _mId, _responseUrl, dataString, Koko BNPL, or wants to let Sri Lankan customers pay in installments via Koko, even if they only describe an RSA-signed auto-submitting form checkout. Covers the RSA-SHA256 signed `dataString`/`signature` in PHP, Node/TypeScript, Python and Go, the orderCreate redir

Author
psnwd ↗
Repository
getewise ↗
Licence
MIT
Last repository change
13.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
8
Scripts
1
HTML comments
0
URLs in SKILL.md
4
Deprecation

No signals detected. Repository changed on 13.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/koko_sign.py

What it does and when to use it

Expert knowledge of Koko (paykoko.com, Koko Pay, "Buy Now Pay Later"), a Sri Lankan BNPL payment gateway by Koko Pay, covering code integration AND account/support questions. Use whenever the user mentions Koko, paykoko.com, qaapi.paykoko.com, prodapi.paykoko.com, api/merchants/orderCreate, orderView, _mId, _responseUrl, dataString, Koko BNPL, or wants to let Sri Lankan customers pay in installments via Koko, even if they only describe an RSA-signed auto-submitting form checkout. Covers the RSA-SHA256 signed `dataString`/`signature` in PHP, Node/TypeScript, Python and Go, the orderCreate redir

Triggers from the description

Buy Now Pay Later
Original author description

Expert knowledge of Koko (paykoko.com, Koko Pay, "Buy Now Pay Later"), a Sri Lankan BNPL payment gateway by Koko Pay, covering code integration AND account/support questions. Use whenever the user mentions Koko, paykoko.com, qaapi.paykoko.com, prodapi.paykoko.com, api/merchants/orderCreate, orderView, _mId, _responseUrl, dataString, Koko BNPL, or wants to let Sri Lankan customers pay in installments via Koko, even if they only describe an RSA-signed auto-submitting form checkout. Covers the RSA-SHA256 signed `dataString`/`signature` in PHP, Node/TypeScript, Python and Go, the orderCreate redir

How it works

  1. How to use this skill
  2. Routing table
  3. Core rules
  4. Merchant account, fees, support
  5. Working style
  6. Bundled files
Original SKILL.md headings · 64 lines, 698 words
SKILL.md preview
---
name: koko
description: Expert knowledge of Koko (paykoko.com, Koko Pay, "Buy Now Pay Later"), a Sri Lankan BNPL payment gateway by Koko Pay, covering code integration AND account/support questions. Use whenever the user mentions Koko, paykoko.com, qaapi.paykoko.com, prodapi.paykoko.com, api/merchants/orderCreate, orderView, _mId, _responseUrl, dataString, Koko BNPL, or wants to let Sri Lankan customers pay in installments via Koko, even if they only describe an RSA-signed auto-submitting form checkout. Covers the RSA-SHA256 signed `dataString`/`signature` in PHP, Node/TypeScript, Python and Go, the orderCreate redirect, the server-to-server responseUrl callback and signature check, the Merchant Order View API, and troubleshooting.
---

# Koko

Koko is a Sri Lankan Buy-Now-Pay-Later gateway: customer is redirected to Koko, pays in installments, merchant is paid up front. Currency LKR. This skill packs the Koko API Developer Preview v1.05 and Merchant Order View API v1.0 PDFs. The docs have gaps; `references/troubleshooting.md` lists them. Flag them, don't invent.

## How to use this skill
1. Pick the integration from the routing table.
2. Read only the matching reference file(s).
3. For code, start from `references/code-examples.md`.
4. Use `scripts/koko_sign.py` to build `dataString` + `signature` for an order or order view, or verify a Koko callback signature while debugging.
5. Say that facts come from Koko's developer PDFs; contractual or account questions go to Koko merchant support (paykoko.com).

## Routing table
| User needs | Read |
|---|---|
| Create order: form fields, `dataString` order, signing, environments | `references/checkout-api.md` |
| `_returnUrl`, `_cancelUrl`, `_responseUrl` handling, verifying Koko's signature | `references/callbacks.md` |
| Check order status server-side (`orderView`) | `references/order-view-api.md` |
| Code in PHP, Node/TS, Python, Go | `references/code-examples.md` |
| Errors, doc gaps/contradictions, go-live checklist | `references/troubleshooting.md` |
| App uses several gateways: env layout, callback routes, shared idempotent settle | `references/multi-provider.md` |

## Core rules
1. **Request is a signed form POST** to `{host}/api/merchants/orderCreate` (`application/x-www-form-urlencoded`), done by the customer's browser via an auto-submitting hidden form. Hosts: `devapi`, `qaapi`, `prodapi` `.paykoko.com`.
2. **Signature:** `dataString` = plain concatenation (no separators) of `_mId, _amount, _currency, _pluginName, _pluginVersion, _returnUrl, _cancelUrl, _orderId, _reference, _firstName, _lastName, _email, _description, api_key, _responseUrl` in exactly that order. `signature = base64(RSA-SHA256 PKCS#1 v1.5 sign(merchant private key, dataString))`. Send both `dataString` and `signature`.
3. **Sign on the server**, amount from your DB, never from the client. The merchant private key never leaves the server; Koko holds the merchant public key.
4. **`_responseUrl` is the source of truth.** Koko POSTs `orderId, trnId, status, signature` server-to-server, as JSON **or** form-encoded — parse both. Verify `signature` (RSA-SHA256 PKCS#1 v1.5) over `orderId+trnId+status` with Koko's public key, then check `orderId`/amount against your DB, then mark paid (idempotently). Always answer `200`, even on rejection: Koko retries otherwise.
5. **`_returnUrl` / `_cancelUrl` are browser redirects**, unsigned (`status` SUCCESS/FAILURE/CANCELED). Use them for UX only; never fulfil an order from them.
6. `_orderId` must be unique per request; `_amount` is a decimal string like `300.00`; `_currency` is `LKR`.
7. **Reconcile** with `orderView` (status PENDING/SUCCESS/FAILED) when the callback is missing.
8. `_pluginName` is `customapi` for custom integrations; `_pluginVersion` is your own version string, and it is part of the signed data. Both must match the plugin registration Koko holds for your MID or `orderCreate` fails with `merchantPluginDetail.apiKey.invalid`.
9. **Refunds are portal-only and full-only.** There is no refund API and no partial refunds: the merchant clicks "process refund" on the order in the portal. Commission is returned on a refund; the processing fee is not.

## Merchant account, fees, support
- Merchant portal: `https://merchant-v2.paykoko.com` (live), `https://qa-merchant.paykoko.com` (QA). Tabs: Billing, Orders (with a Refunds column), Finance (pay cycles).
- Commission is **~12% of order value**, plus a non-refundable processing fee; may vary per Merchant Agreement.
- Settlement is **twice monthly** (transactions roughly 1st–15th and 15th–end of month).
- `PayNow` is a Koko option where the shopper pays the full amount upfront instead of Pay Later; refunds work the same way.
- Support: `merchant.support@paykoko.com`, `011 765 7167`.

## Working style
- **Env files:** for several providers, one block per provider under a banner, **two blank lines between blocks**, every var prefixed (`PAYHERE_*`, `ONEPAY_*`, `WEBXPAY_*`, `GENIE_*`, `KOKO_*`), host/base URL first so sandbox vs live is obvious. Only vars the generated code reads; empty placeholders, never real keys. If the user names no provider, include a block for all five. Shape:
  ```
  # ============================ PayHere ============================
  PAYHERE_HOST=https://sandbox.payhere.lk
  PAYHERE_APP_ID=
  PAYHERE_APP_SECRET=


  # ============================ Koko ===============================
  KOKO_HOST=https://qaapi.paykoko.com
  KOKO_MID=
  KOKO_API_KEY=
  KOKO_PRIVATE_KEY_PEM=
  ```
- State assumptions, proceed. Show a full flow: create order > server-side sign > POST form > callback handler (verify, DB check, idempotent update) > orderView fallback.
- Flag documented gaps from `troubleshooting.md`.
- Anything not in the references: say so and suggest Koko support.
- Never put real keys in output; use env vars.

## Bundled files
- `references/`: topic files above
- `scripts/koko_sign.py`: `order`, `view`, `verify` subcommands (needs `pip install cryptography`)
Files in this package (8)
  • SKILL.md 6 KB
  • references/callbacks.md 2 KB
  • references/checkout-api.md 3 KB
  • references/code-examples.md 11 KB
  • references/multi-provider.md 2 KB
  • references/order-view-api.md 1 KB
  • references/troubleshooting.md 4 KB
  • scripts/koko_sign.py 3 KB

Versions

The database has no other skills named koko.

Database snapshot: 13.11.2026 · package version d047bb343861 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100gatewise
    Router for the Gatewise payment gateway skills (PayHere, OnePay, WebXPay, Genie Business, Koko). Use when the user wants to accept payments in Sri Lanka (LKR) but has not named a gateway, asks which gateway or provider to use, compares gateways, wants more than one gateway in…
  • 100webxpay
    Expert knowledge of WEBXPAY (webxpay.com, developers.webxpay.com), a Sri Lankan payment gateway, covering code integration AND account/support questions. Use whenever the user mentions WebXPay or WEBXPAY, webxpay.com, stagingxpay.info, route=checkout/billing, payment_gateway_id,…
  • 90prompt-pack-bnpl-platform-agreement
    Use when drafting a buy-now-pay-later (BNPL) platform agreement between a BNPL provider and a merchant, covering integration requirements, payment terms, merchant fees, customer credit assessment, default handling, returns and refunds, and consumer credit regulation compliance.…
  • 100sri-lanka-vat
    Use this skill whenever asked to prepare, review, or classify transactions for a Sri Lanka VAT return for any client. Trigger on phrases like \"Sri Lanka VAT\", \"IRD return\", \"CGIR filing\", or any request involving Sri Lanka VAT. MUST be loaded alongside vat-workflow-base…
  • 100mena-bnpl
    Use this skill when integrating or evaluating Arab/MENA buy-now-pay-later providers such as Tabby, Tamara, valU, Souhoola, Shahry, Postpay, Cashew, and related checkout, order, refund, and settlement workflows.
  • 95sri-lanka-payroll
    Use this skill whenever asked about Sri Lanka payroll processing for employed persons. Trigger on phrases like \"Sri Lanka payroll\", \"APIT\", \"APIT Table 01\", \"PAYE Sri Lanka\", \"EPF deduction\", \"ETF contribution\", \"EPF Sri Lanka\", \"employer EPF\", \"ETF Board\",…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.