Invoice checkout
Source:
https://cahskuy.stoplight.io/docs/OND/3c78799259e69-payment-checkout
Endpoint
| Endpoint | Method |
Authentication |
|
/payment-checkout
|
POST | Yes |
Authentication
| Type |
Token source |
Server |
| Bearer | {{usapi}}/auth | USAPI |
Body request example
{
"amount": 15000,
"service": "ONMARKET",
"source": "XENDIT",
"xendit_methods": []
}
| Properties |
Properties of | Data type | Required | Description |
| amount | integer | yes | Nominal amount for the invoice | |
| service | string | yes |
ONINDONESIA services.
|
|
| source | string | yes | A way that users pay for a product or service. Possible values: XENDIT or BALANCE. | |
| xendit_methods | array[string] | yes |
The specific payment channel used to pay the invoice. Possible values for e-wallet:
Bank transfer (virtual account) is not supported yet due to high fees. Value can be empty (ie. [ ]) |
|
| xendit_ttl | integer | no |
Duration of time in seconds that the end customer is given to pay the invoice before expiration (in seconds). (Required if source == XENDIT). Default value = 7200 |
Response example
200 (OK)
Example response for ONMARKET
{
"invoice": "ONM0001N0CL00003",
"status": "PENDING",
"payment_url": "https://checkout-staging.xendit.co/web/6583c2f0a468d1052ecd3b46",
"xendit_invoice": "6583c2f0a468d1052ecd3b46",
"expired_at": "2023-12-27T11:29:47.812Z"
}
| Properties |
Properties of | Data type | Description |
| invoice | string | invoice ID generated by USAPI | |
| status | string |
Status showing whether the invoice has been paid Possible values:
|
|
| payment_url | string |
Public URL for this invoice |
|
| xendit_invoice | string |
Invoice ID generated by Xendit |
|
| expired_at | timestampz |
ISO date and time that the invoice expires. |
Error response
400 Bad Request
Some parameters may contain invalid values or some parameters are not present.
{
"message": "Invalid JSON Format"
}
401 Unauthorized
Authentication header is not valid or missing
{
"message": "Auth Error"
}
500 Internal server error
Internal server error
{
"message": "Internal server error"
}