Create CVS Transaction

Issues a payment code (pay_no) for the customer to pay at a minimarket cashier.

Endpoint

POST /api/v1/transaction/create

Headers

Header Type Required Description
Content-Type string Yes application/json
X-API-KEY string Yes API Key issued by Manjo

Request Body Parameters

Field Type Required Description
method int Yes Must be 8 (Convenience Store enum).
amount float Yes Transaction amount, a whole number within the mitra's range (see Mitra List).
expired_date string Optional Payment code deadline. May be set at the root or in additional_info; the root value takes precedence.
additional_info object Yes CVS-specific fields, see the table below.

additional_info Fields

Field Type Required Description
customer_name string Yes Customer name, maximum 100 characters.
account_email string Yes A valid customer email.
account_phone string Yes Customer phone number, 10–15 digits.
mitra_code string Yes Store code, e.g. ALMA or INDO. Case-insensitive.
currency string Optional IDR only. Defaults to IDR.
callback_url string Optional Merchant webhook URL that receives the payment notification.
expired_date string Optional RFC 3339 with offset (e.g. 2026-12-31T23:59:59+07:00) or YYYY-MM-DD HH:mm:ss local time. Must be in the future.

Example Request

{
	"method": 8,
	"amount": 150000,
	"additional_info": {
		"customer_name": "John Doe",
		"account_email": "johndoe@example.com",
		"account_phone": "081234567890",
		"mitra_code": "ALMA",
		"currency": "IDR",
		"callback_url": "https://webhook.site/your-webhook-url",
		"expired_date": "2026-12-31T23:59:59+07:00"
	}
}

Example Response

HTTP 200 - Success

{
	"success": true,
	"message": "Transaction created successfully",
	"data": {
		"trx_id": "cmr1h08xk000342qq3fmnl5u1",
		"method": "ConvenienceStore",
		"status": "PENDING",
		"pay_no": "ALMA1234567890123",
		"mitra_code": "ALMA",
		"mitra_name": "Alfa Group (Alfamart, Alfamidi, Dan+Dan, Lawson)",
		"customer_name": "John Doe",
		"merchant_name": "Ayoborong",
		"amount": 150000,
		"fee_amount": 0,
		"total_amount": 150000,
		"currency": "IDR",
		"trx_date": "2026-07-01T09:42:44+07:00",
		"expired_date": "2026-12-31T23:59:59+07:00"
	},
	"timestamp": "2026-07-01T09:42:44+07:00"
}

Next Steps: Show the pay_no, store name (mitra_name), total_amount, and expired_date to the customer. The customer pays in cash at the cashier; you receive the result via Payment Callback.

Note: fee_amount and total_amount follow the merchant account's fee and are frozen when the transaction is created. mitra_code in the response is the code confirmed by the payment network.


Error Responses

HTTP 400 - Bad Request

Validation failed. The message names the offending field, e.g. customer_name is required, currency must be IDR, account_email must be a valid email address, account_phone must be a numeric string between 10 and 15 digits, mitra_code is required, mitra_code XXXX is not supported, amount must be a whole number, amount for <mitra> must be between <min> and <max>, invalid expired_date format, or expired_date must be in the future:

{
	"success": false,
	"message": "amount for Indomaret must be between 10000 and 1000000",
	"error": {
		"code": "BAD_REQUEST"
	},
	"timestamp": "2026-07-01T09:42:44+07:00"
}

HTTP 401 - Unauthorized

{
	"success": false,
	"message": "invalid api key",
	"error": {
		"code": "UNAUTHORIZED"
	},
	"timestamp": "2026-07-01T09:42:44+07:00"
}

HTTP 403 - Forbidden

The account has no access to CVS transactions:

{
	"success": false,
	"message": "Access denied. The requested organization does not have sufficient privileges to create this transaction type.",
	"error": {
		"code": "FORBIDDEN"
	},
	"timestamp": "2026-07-01T09:42:44+07:00"
}

HTTP 422 - Unprocessable Entity

CVS is not enabled for the account (no active CVS IMID):

{
	"success": false,
	"message": "convenience store is not configured for this organization (no active CVS IMID)",
	"timestamp": "2026-07-01T09:42:44+07:00"
}

HTTP 502 - Bad Gateway

The payment network failed to issue the payment code. No trx_id is created; it is safe to retry the request:

{
	"success": false,
	"message": "failed to create CVS payment code: ...",
	"timestamp": "2026-07-01T09:42:44+07:00"
}

HTTP 503 - Service Unavailable

The fee or CVS gateway cannot be determined yet. Retry the request.