PinnPayHow it worksFeaturesUse casesPricingFAQContactDocsSign in
/docs.md

For AI agents: share /docs.md or paste the copied docs.

PinnPay API v1

The only API version. The old /api/pay endpoint is not supported.

Instructions for AI agents

  1. Call from a server only. Never ship the API key to a browser or client app.
  2. Keep the API key and webhook secret in environment variables.
  3. Show total_bayar to the buyer, not nominal.
  4. Treat as paid only on a validly signed webhook or a PAID status from GET.
  5. Process webhooks idempotently by tx_id.
  6. Do not invent endpoints or fields beyond this document.

Base URL: https://artomoro.group/api/v1

Format: JSON, UTF-8. Money: integer Rupiah. Time: ISO 8601 +07:00 (WIB).

Flow

  1. POST /payments → receive qris_payload and total_bayar
  2. Render qris_payload as a QR image with total_bayar and a countdown
  3. Buyer pays exactly total_bayar
  4. PinnPay sends a payment.paid webhook
  5. Your server verifies the signature, then fulfils
FieldMeaning
nominalinvoice price; credited to your balance
kode_unik200-300, gateway fee paid by the buyer
total_bayarnominal + kode_unik
statusMeaning
PENDINGawaiting payment, valid 5 minutes
PAIDpaid (final)
EXPIREDexpired; a payment up to 30 minutes later can still turn it PAID

Authentication

Authorization: Bearer <API_KEY>
Content-Type: application/json

Find the key under API & Webhook after approval. Limit: 60 requests per minute per key.

POST /payments

BodyTypeRequiredNotes
nominalintegeryes100 - 10000000
refstring(64)yesunique order ID. Letters, digits, . _ - : /. Repeating it returns the same transaction
notestring(140)nofree text
client_idstringnoif sent it must match the API key
curl -X POST https://artomoro.group/api/v1/payments \
  -H "Authorization: Bearer $PINNPAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"nominal":7000,"ref":"ORDER-1"}'

201 (200 if the ref already exists):

{
  "tx_id": 1042,
  "ref": "ORDER-1",
  "note": "",
  "nominal": 7000,
  "kode_unik": 239,
  "total_bayar": 7239,
  "status": "PENDING",
  "qris_payload": "000201...6304ABCD",
  "created_at": "2026-12-03T14:22:00+07:00",
  "expired_at": "2026-12-03T14:27:00+07:00",
  "paid_at": null,
  "rrn": null,
  "payer": null
}

GET /payments/{tx_id}

Same shape as above. paid_at, rrn and payer are filled once PAID. Poll no faster than every 5 seconds.

GET /payments?status=PAID&from=2026-12-01&to=2026-12-03&page=1

{"data": [ { "tx_id": 1042, "ref": "ORDER-1", "status": "PAID", "total_bayar": 7239 } ], "page": 1, "has_more": false}

50 items per page.

GET /balance

{"available": 486500, "held": 200000}

Withdrawals are dashboard-only (OTP required); there is no API endpoint.

Webhook

Events: payment.paid and payment.expired. Sent by POST to your URL (public HTTPS only, redirects are not followed).

X-PinnPay-Timestamp: 1796283720
X-PinnPay-Signature: <hex HMAC-SHA256(secret, timestamp + "." + raw_body)>
{"event":"payment.paid","tx_id":1042,"ref":"ORDER-1","status":"PAID","nominal":7000,"kode_unik":239,"total_bayar":7239,"rrn":"1u6nxxxx","paid_at":"2026-12-03T14:23:10+07:00"}

Reply 2xx within 10 s. On failure we retry after 10 s, 1 min, 5 min, then less often, 12 attempts in total. Reject timestamps older than 5 minutes.

Node.js (Express)

const crypto = require("crypto");
app.post("/webhook", express.raw({ type: "application/json" }), async (req, res) => {
  const ts = req.get("X-PinnPay-Timestamp") || "";
  const sig = Buffer.from(req.get("X-PinnPay-Signature") || "", "hex");
  const good = crypto.createHmac("sha256", process.env.PINNPAY_WEBHOOK_SECRET)
    .update(ts + "." + req.body.toString()).digest();
  const fresh = Math.abs(Date.now() / 1000 - Number(ts)) <= 300;
  if (!fresh || sig.length !== good.length || !crypto.timingSafeEqual(sig, good)) return res.sendStatus(401);
  const event = JSON.parse(req.body.toString());
  if (event.event === "payment.paid") await fulfilOnce(event.tx_id, event.ref); // idempotent
  res.sendStatus(200);
});

Python (Flask)

import hmac, hashlib, os, time

@app.post("/webhook")
def webhook():
    ts = request.headers.get("X-PinnPay-Timestamp", "")
    sig = request.headers.get("X-PinnPay-Signature", "")
    good = hmac.new(os.environ["PINNPAY_WEBHOOK_SECRET"].encode(),
                    ts.encode() + b"." + request.get_data(), hashlib.sha256).hexdigest()
    if not ts.isdigit() or abs(time.time() - int(ts)) > 300 or not hmac.compare_digest(good, sig):
        return "", 401
    event = request.get_json()
    if event["event"] == "payment.paid":
        fulfil_once(event["tx_id"], event["ref"])  # idempotent
    return "", 200

PHP

<?php
$raw = file_get_contents("php://input");
$ts  = $_SERVER["HTTP_X_PINNPAY_TIMESTAMP"] ?? "";
$sig = $_SERVER["HTTP_X_PINNPAY_SIGNATURE"] ?? "";
$good = hash_hmac("sha256", $ts . "." . $raw, getenv("PINNPAY_WEBHOOK_SECRET"));
if (!ctype_digit($ts) || abs(time() - (int)$ts) > 300 || !hash_equals($good, $sig)) { http_response_code(401); exit; }
$event = json_decode($raw, true);
if ($event["event"] === "payment.paid") fulfilOnce($event["tx_id"], $event["ref"]); // idempotent
http_response_code(200);

Error

{"error": {"code": "INVALID_REQUEST", "message": "nominal harus bilangan bulat"}}
HTTPcodeAction
400INVALID_REQUESTfix the input
401INVALID_KEYcheck the API key; suspended accounts get this too
404NOT_FOUNDcheck tx_id
409CONFLICTunique codes exhausted, or same ref with a different nominal
429RATE_LIMITEDwait 60 seconds
5xxSERVER_ERRORretry with the same ref

Go-live checklist

  • API key is server-side only
  • Buyer sees total_bayar
  • Webhook signature and timestamp verified
  • Orders are never fulfilled twice
  • EXPIRED handled, including a later PAID