API reference

Every endpoint, field and error.

Basics

Base URLhttps://cshpay.cksolutionshub.com/api/v1
AuthenticationAuthorization: Bearer cpk_test_… or cpk_live_…
FormatJSON in, JSON out. HTTPS only.
ModesA key belongs to one workspace and one mode, and sees only that mode's data.
Rate limitPer key, by plan (60 a minute to start). Over the limit: 429 with Retry-After.
BrowsersNo CORS headers are sent. Call the API from your server only.

Key permissions

ScopeAllows
payments:writeCreate payments; get signed Kina fields
payments:readRead and list payments
refunds:writeRefund payments
webhooks:writeCreate, list and remove webhook endpoints

Create a payment

POST /payments · scope payments:write

FieldRequiredNotes
amountYesA number above 0 with at most 2 decimals, up to 50,000.00
referenceYesYour own id for the order. 1–64 characters: letters, digits, spaces and - _ / . # :
returnUrlYesWhere the customer is sent afterwards. Must be https in live mode
currencyNoPGK only (the default)
descriptionNoShown at checkout. Up to 200 characters
customerNo{ "email", "name" }
expiresInNoSeconds the payment can be paid: 300 to 604800. Default 86400 (one day)
metadataNoUp to 20 string keys, returned unchanged. The key billing is reserved

Send an Idempotency-Key header (up to 255 characters). The first request with a key creates the payment and returns 201; a repeat returns the same payment with 200. Reusing a key for a different amount, currency or reference returns 409 IDEMPOTENCY_MISMATCH.

The payment object

Payment
{
  "id": "7b0e3c0a-6f0b-4b63-9d0c-2f8f7a3a1e11",
  "object": "payment",
  "mode": "test",
  "reference": "ORDER-14",
  "amount": "968.62",
  "currency": "PGK",
  "description": "Order #14",
  "customer": { "email": "mary@example.com", "name": "Mary Kila" },
  "status": "succeeded",
  "checkoutUrl": null,
  "returnUrl": "https://your-site.com/thanks",
  "metadata": {},
  "gateway": {
    "order": "261118100042",
    "approvalCode": "123456",
    "authorizedAmount": "968.62",
    "rrn": "…",
    "reference": "…",
    "responseCode": "00",
    "message": "Approved"
  },
  "paidAt": "2026-11-18T00:14:09.101Z",
  "refundedAt": null,
  "expiresAt": "2026-11-19T00:00:00.000Z",
  "createdAt": "2026-11-18T00:00:00.000Z"
}
StatusMeaning
pendingNot paid yet. checkoutUrl is set
succeededPaid. Kina Bank's signed result has been verified
failedDeclined or failed. Final; create a new payment to try again
expiredNot paid before it expired
refund_pendingA refund was sent to Kina Bank and its outcome is not confirmed yet
refundedReversed in full
refund_failedKina Bank declined the reversal. The payment remains paid
amount is what you asked for. gateway.authorizedAmount is what Kina Bank authorized, which can be higher if the acquirer adds a fee.

Read payments

GET /payments/{id} · scope payments:read. The authoritative state of one payment.

GET /payments?reference=ORDER-14&limit=20 · scope payments:read. Newest first; limit up to 100.

List response
{ "object": "list", "data": [ { "id": "…", "object": "payment", "…": "…" } ] }

Signed Kina fields (drop-in checkout)

POST /payments/{id}/kina-fields · scope payments:write. Optional body { "style": "iframe" | "redirect" }. Returns the form fields to post to Kina Bank. See Checkout.

Refund a payment

POST /payments/{id}/refund · scope refunds:write. Reverses a succeeded payment in full. No body.

HTTPStatus in the responseMeaning
200refundedKina Bank reversed it
200refund_failedKina Bank declined the reversal
202refund_pendingSent, outcome not confirmed. A webhook follows when it is known

Partial refunds are not supported. A key may make at most 30 refunds an hour.

Webhook endpoints

POST /webhook-endpoints · scope webhooks:write

Request
{ "url": "https://your-site.com/webhooks/cshpay", "events": ["*"], "description": "Production" }

The response includes secret (whsec_…), shown this once. events is ["*"] or a list of event types. GET /webhook-endpoints lists active endpoints; DELETE /webhook-endpoints/{id} stops deliveries to one.

Errors

Error body
{ "error": { "code": "VALIDATION", "message": "The request is not valid", "fields": { "amount": ["amount must be greater than 0"] } } }
CodeHTTPMeaning
UNAUTHORIZED401Missing, malformed or revoked key
BILLING_OVERDUE402An invoice is overdue; live requests are refused until it is paid
FORBIDDEN403The key lacks the permission, or the request was not HTTPS
ACCOUNT_SUSPENDED403The workspace is suspended
NOT_FOUND404No such object in this workspace and mode
IDEMPOTENCY_MISMATCH409That Idempotency-Key was used for a different payment
NOT_CONFIGURED409Live mode is not enabled for the workspace
NOT_PAYABLE409The payment is already paid, failed or expired
NOT_REFUNDABLE409The payment is not in a refundable state
VALIDATION422Invalid request; fields says which
RATE_LIMITED429Too many requests; see Retry-After
INTERNAL500Unexpected error. Safe to retry with the same Idempotency-Key