Search docs

Search the API documentation

POST

Create Payment

/v1/payments/create

Creates a new payment transaction. Returns a payment URL and QR string for QRIS payment.

Request Body

merchantOrderIdstringrequired

Your unique order ID. Max 50 characters.

amountnumberrequired

Payment amount in IDR (Indonesian Rupiah). Must be a positive integer.

productDetailsstringrequired

Product description. Max 255 characters.

customerEmailstring

Customer email address.

customerNamestring

Customer name. Max 255 characters.

customerVaNamestring

Virtual Account display name. Max 20 characters.

returnUrlstring

URL to redirect customer after payment.

expiryPeriodnumber

Payment expiry in minutes.

Examples

curl
curl -X POST https://api-artos.kasir.ai/v1/payments/create \
  -H "X-API-Key: art_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "merchantOrderId": "ORDER-001",
    "amount": 50000,
    "productDetails": "Premium Plan",
    "customerEmail": "[email protected]",
    "returnUrl": "https://yoursite.com/success"
  }'
JavaScript
const response = await fetch('https://api-artos.kasir.ai/v1/payments/create', {
  method: 'POST',
  headers: {
    'X-API-Key': 'art_live_your_api_key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    merchantOrderId: 'ORDER-001',
    amount: 50000,
    productDetails: 'Premium Plan',
  }),
})
const data = await response.json()
200 — Success
{
  "success": true,
  "data": {
    "id": "tx_abc123",
    "merchantOrderId": "ORDER-001",
    "amount": 50000,
    "status": "pending",
    "qrString": "00020101021226...",
    "paymentUrl": "https://pay.artos.dev/...",
    "reference": "REF-12345",
    "createdAt": "2025-01-01T00:00:00.000Z"
  }
}
400 — Validation error
{
  "success": false,
  "error": "Invalid input",
  "details": {
    "fieldErrors": {
      "amount": ["Expected number, received string"]
    }
  }
}