KatanaPay Console ↗
Documentation

Integrate in
an afternoon.

Any language that can sign a request and read a callback can take payments with Katana Pay. Here's the whole flow.

1 · Credentials (Key + Salt)

Generate a per-branch Key and Salt from your provider console under Developers. The Key goes in every request; the Salt signs the hash and is shown only once — store it server-side.

2 · Endpoints

  • Create order (POST)
    https://katanapay.co/api/v1/katana-pay/order
  • Hosted payment page
    https://katanapay.co/pay/{order_id}
  • Status enquiry (GET)
    https://katanapay.co/api/pay-status/{order_id}

3 · Create the order

Server-side. Returns a pay_url you redirect the customer to.

create-order.sh
curl -X POST https://katanapay.co/api/v1/katana-pay/order \
  -H "Content-Type: application/json" \
  -d '{
    "key": "mk_your_key",
    "txnid": "ORDER-1001",
    "amount": "100.00",
    "productinfo": "Order 1001",
    "email": "buyer@example.com",
    "hash": "<computed: see signing>",
    "return_url": "https://your-site.com/payment/return",
    "notify_url": "https://your-site.com/api/katana/callback"
  }'

# → { "pay_url": "https://katanapay.co/pay/<id>", ... }

Sign the request with your Key + Salt:

signing
// HMAC_SHA256
data = txnid + "|" + amount + "|" + productinfo + "|" + email
hash = HMAC_SHA256( key = (KEY + SALT), message = data )   // lowercase hex

4 · Receive the status callback

We POST the terminal status to your notify_url. Verify the HASH with your Salt, then mark the order paid and reply HTTP 200.

callback
{ "ORDER_ID":"ORDER-1001", "STATUS":"Captured", "RESPONSE_CODE":"000",
  "RRN":"...", "HASH":"<uppercase sha256>" }

// verify: sort fields (except HASH) ascending, join KEY=value with "~",
// append your SALT, SHA256 -> hex -> UPPERCASE  ==  HASH
// STATUS="Captured" & RESPONSE_CODE="000"  =>  paid