API Reference

Example: Create Checkout Page

Quick Start

1) Create Checkout (curl)

curl -X POST https://api.paystrator.com/v1/checkout \
  -H "Authorization: Bearer sk_test_xxx" \
  -H "Idempotency-Key: 7f4a7a2c-4c2d-4a62-9a1d-c2a1f10a16a1" \
  -H "Content-Type: application/json" \
  -d '{
    "externalId": "ORD-2025-0001",
    "currency": "IDR",
    "amount": 500000,
    "description": "Invoice #1001",
    "successUrl": "https://merchant.com/thank-you",
    "cancelUrl": "https://merchant.com/cancel",
    "type": "qrcode"
  }'

Redirect your customer to the returned checkoutUrl.

2) Receive Webhook (server)

Use your existing Receive Money webhook endpoint. You’ll get events like:

  • payment.pending
  • payment.succeeded
  • payment.failed
  • payment.expired

Verify HMAC signature and match to your externalId / transaction IDs.

3) Check Status (optional)

Can be use as a fallback or for reconciliation, please check the documentation here


Advanced Examples

A) Direct End-User to QR Code final page

{
  "externalId": "INV-1002",
  "currency": "IDR",
  "amount": 275000,
  "successUrl": "https://merchant.com/success",
  "cancelUrl": "https://merchant.com/cancel",
  "type": "qrcode"
}

→ Customer lands on final QR Code page for Rp 275.000.

B) Direct End-User to Virtual Account final page

{
  "externalId": "INV-1003",
  "currency": "IDR",
  "amount": 500000,
  "successUrl": "https://merchant.com/success",
  "cancelUrl": "https://merchant.com/cancel",
  "type": "virtual_account",
  "code": "BCA",
  "name": "John Doe"
}

→ Customer lands on VA page with bank=BCA, name=John Doe, amount fixed.

C) Direct End-User to eWallet final page

{
  "externalId": "INV-1004",
  "currency": "IDR",
  "amount": 100000,
  "successUrl": "https://merchant.com/success",
  "cancelUrl": "https://merchant.com/cancel",
  "type": "ewallet",
  "code": "dana"
}

→ Customer lands on DANA deeplink/QR for Rp 100.000.

D) Credit card (coming soon)

{
  "externalId": "INV-1005",
  "currency": "IDR",
  "amount": 250000,
  "successUrl": "https://merchant.com/success",
  "cancelUrl": "https://merchant.com/cancel",
  "type": "credit_card"
}

→ Customer lands on CC form (PAN, expiry, CVV). No direct final.