Create Transaction

Endpoint

POST /api/v1/transaction/create

Authentication

Use X-API-KEY and Content-Type: application/json.

Header Value Required
X-API-KEY your API key M
Content-Type application/json M

Request

Field Type Required Description
method integer M Payment method. 1 = Virtual Account.
amount number M Amount to bill. For dynamic VA this is the fixed amount; for static VA it may be 0 (payer-defined). Max 12 digits (e.g. 100000000000).
additional_info object M Method-specific payload.

additional_info for method: 1

Field Type Required Description
type integer M 1 = DYNAMIC, 2 = STATIC.
customer_name string M Customer name.
account_email string O Customer email.
account_phone string O Customer phone number. Max 15 digits.
custom_number string C Last 8 digits of the VA, for static VA only.
currency string O Defaults to IDR.
bank_code string M Bank code such as BMRI. See Bank List.
expired_date string O RFC3339 expiry timestamp, e.g. 2026-06-20T23:59:59+07:00.
callback_url string O Public callback URL on your server.

DYNAMIC vs STATIC

  • DYNAMIC (type: 1) — single-use VA with a fixed amount. Once paid, the VA number is deactivated and will not accept another payment.
  • STATIC (type: 2) — reusable VA that can accept many payments; amount may be 0 so the payer chooses the amount. Often paired with custom_number.

Example — Dynamic VA

Request

{
	"method": 1,
	"amount": 10000,
	"additional_info": {
		"type": 1,
		"customer_name": "From API KEY",
		"account_email": "john@example.com",
		"account_phone": "08123456789",
		"custom_number": null,
		"currency": "IDR",
		"bank_code": "BMRI",
		"expired_date": "2026-06-20T23:59:59+07:00",
		"callback_url": "https://webhook.site/552a5d7b-6ca8-44f4-863c-8bf5b2d42992"
	}
}

Response 200 OK

{
	"success": true,
	"message": "Transaction created successfully",
	"data": {
		"amount": 10000,
		"bank_code": "BMRI",
		"bank_name": "Bank Mandiri",
		"callback_url": "https://webhook.site/552a5d7b-6ca8-44f4-863c-8bf5b2d42992",
		"currency": "IDR",
		"custom_no": null,
		"customer_name": "From API KEY",
		"email": "john@example.com",
		"expired_date": "2026-06-24T14:24:01+07:00",
		"method": "VirtualAccount",
		"phone": "08123456789",
		"status": "Pending",
		"trx_date": "2026-06-23T14:24:31+07:00",
		"trx_id": "cmqqbjt3p000001msefepr65l",
		"type": "DYNAMIC",
		"virtual_account_no": "7001400002025150"
	},
	"timestamp": "2026-06-23T14:24:31+07:00"
}

Example — Static VA

Request

{
	"method": 1,
	"amount": 0,
	"additional_info": {
		"type": 2,
		"customer_name": "From API KEY",
		"account_email": "john@example.com",
		"account_phone": "08123456789",
		"custom_number": "1234",
		"currency": "IDR",
		"bank_code": "BMRI",
		"expired_date": "2026-06-20T23:59:59+07:00",
		"callback_url": "https://webhook.site/552a5d7b-6ca8-44f4-863c-8bf5b2d42992"
	}
}

Response 200 OK

{
	"success": true,
	"message": "Transaction created successfully",
	"data": {
		"amount": 0,
		"bank_code": "BMRI",
		"bank_name": "Bank Mandiri",
		"callback_url": "https://webhook.site/552a5d7b-6ca8-44f4-863c-8bf5b2d42992",
		"currency": "IDR",
		"custom_no": "1234",
		"customer_name": "From API KEY",
		"email": "john@example.com",
		"expired_date": "2026-06-24T13:58:31+07:00",
		"method": "VirtualAccount",
		"phone": "08123456789",
		"status": "Pending",
		"trx_date": "2026-06-23T13:59:00+07:00",
		"trx_id": "cmqqamzx2000001o1pbb2z107",
		"type": "STATIC",
		"virtual_account_no": "8804985800001234"
	},
	"timestamp": "2026-06-23T13:59:00+07:00"
}

Example — Unauthorized

Response 401 Unauthorized

{
	"success": false,
	"message": "invalid api key",
	"error": {
		"code": "UNAUTHORIZED"
	},
	"timestamp": "2026-06-23T14:31:58+07:00"
}

Response data fields

Field Type Description
trx_id string Unique transaction ID. Reference it when matching callbacks.
method string Resolved method name, e.g. VirtualAccount.
status string Transaction status; newly created VAs are Pending.
amount number Billed amount (0 for payer-defined static VAs).
currency string Currency code.
type string DYNAMIC or STATIC.
bank_code / bank_name string Bank code and display name.
virtual_account_no string The generated VA number.
custom_no string Custom number for static VA, otherwise null.
customer_name string Customer / VA holder name.
email / phone string Customer email and phone.
callback_url string Registered callback URL.
trx_date string When the transaction was created (RFC3339).
expired_date string VA expiry (RFC3339).

Status codes

Code Meaning
200 Transaction created.
400 Invalid request body, unsupported method, or invalid VA type.
401 Missing or invalid API key.
403 Caller lacks module access / authorization for the organization.
500 Failed to create transaction.