Reserved AccountsCreate Reserved Account

Create Reserved Account

Create a dedicated virtual account for a customer.

Endpoint

POST https://mainapi.cashonrails.com/api/v1/reserved_virtual_account

Request Headers

HeaderTypeDescription
Content-Typestringapplication/json
AuthorizationstringBearer token with your secret key

Request Parameters

ParameterTypeRequiredDescription
customer_codestringYesCustomer’s unique identifier (Get Customer Details)
providerstringYesVirtual account provider e.g, netbank (Get Providers)
idstringYesUnique identifier for the reserved account
How to get the customer_code
  1. Create a New Customer: Make a POST request to Create Customer endpoint. The response will contain the customer_code.

  2. Find Existing Customer:

Sample Request

curl --location 'https://mainapi.cashonrails.com/api/v1/reserved_virtual_account' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_KEY' \
--data '{
    "customer_code": "CUS_2qag1olxkkom7kl",
    "provider": "netbank",
    "id": "unique_identifier"
}'