POST
Create Payment
/v1/payments/create
Creates a new payment transaction. Returns a payment URL and QR string for QRIS payment.
Request Body
merchantOrderIdstringrequiredYour unique order ID. Max 50 characters.
amountnumberrequiredPayment amount in IDR (Indonesian Rupiah). Must be a positive integer.
productDetailsstringrequiredProduct description. Max 255 characters.
customerEmailstringCustomer email address.
customerNamestringCustomer name. Max 255 characters.
customerVaNamestringVirtual Account display name. Max 20 characters.
returnUrlstringURL to redirect customer after payment.
expiryPeriodnumberPayment 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"]
}
}
}