Skip to content
Esc
↑↓navigate↵open⌘Jpreview

Create a payment

Creates a payment for the given amount and method. Returns the payment with a pending status until the customer completes it.

POST/payments
Authorization
AuthorizationBearer token · headerrequired

Your Apipay secret API key.

Request body
requiredapplication/json
amountintegerrequired
currencystringrequired
default: "IDR"
methodPaymentMethodrequired
Allowed:qrisvirtual_accountcardewallet
customer_idstring
descriptionstring
Responses
201

The created payment.

idstringrequired
amountintegerrequired

Amount in the smallest unit of the currency (e.g. Rupiah has no sub-unit, so this is whole Rupiah).

currencystringrequired
methodPaymentMethodrequired
Allowed:qrisvirtual_accountcardewallet
statusPaymentStatusrequired
Allowed:pendingsucceededfailedcanceled
customer_idstring | null
descriptionstring | null
created_atstring<date-time>required
400

The request was malformed or missing a required field.

errorobjectrequired
Show properties
codestringrequired
messagestringrequired
401

The API key is missing, invalid, or revoked.

errorobjectrequired
Show properties
codestringrequired
messagestringrequired
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST 'https://api.apipay.id/v1/payments' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "amount": 150000,
  "currency": "IDR",
  "method": "qris",
  "customer_id": "cus_8f3a2b1c",
  "description": "Order"
}'
Response
{
  "id": "pay_6b2f9d4e",
  "amount": 150000,
  "currency": "IDR",
  "method": "qris",
  "status": "pending",
  "customer_id": "cus_8f3a2b1c",
  "description": "Order",
  "created_at": "2019-08-24T14:15:22Z"
}