Skip to main content

Invoice checkout

Flowchart

Source:
https://cahskuy.stoplight.io/docs/OND/3c78799259e69-payment-checkout

Reference:
Transaction Flowchart

Endpoint
EndpointMethod
Authentication
/payment-checkout
POSTYes
Authentication
Type
Token source
Server
Description
Bearer{{usapi}}/authUSAPIBuyer's auth
Body request example
{
    "total_amount": 40000,
    "service": "ONMARKET",
    "source": "XENDIT",
    "transaction": [
        {
            "amount": 10000,
            "freight_charge": 5000,
            "insurance_amount": 100,
            "seller_username": "testing123",
            "invoice_onmarket": "INV/ONM/20240124-002B0001"
        },
        {
            "amount": 20000,
            "freight_charge": 5000,
            "insurance_amount": 100,
            "seller_username": "testing12345",
            "invoice_onmarket": "INV/ONM/20240124-002B0002"
        }
    ]
}
Properties
Properties ofData typeRequiredDescription
total_amount
integeryesTotal nominal amount for the invoice.
service
stringyes

ONINDONESIA services.
Possible values:

  • ONDELIVERY means the source of the transaction comes from ondelivery.
  • ONTICKET means the source of the transaction comes from onticket.
  • ONMARKET means the source of the transaction comes from onmarket.
source
stringyesA way that users pay for a product or service. Possible values: XENDIT or BALANCE.
transaction array<object>yesList of transactions.
amounttransactionintegeryesAmount of transaction for each store (do not include freight charge and insurance as they'll put in other parameter).
freight_chargetransactionintegeryesAmount of freight charge for each store.
insurance_amounttransactionintegernoAmount of insurance for each store.
seller_usernametransactionstringyesSeller ONMARKET username
invoice_onmarkettransactionstringyesInvoice ID generated by ONMARKET
Response example

200 (OK)

Example response for ONMARKET

{
    "payment_url": "https://checkout-staging.xendit.co/latest/65ba1b78f603539c068ef753",
    "invoice": "ONM0001N11V0000x",
    "xendit_invoice": "65ba1b78f603539c068ef753",
    "expired_at": "2024-01-31T12:05:44.155Z",
    "transaction": [
        {
            "invoice_onmarket": "INV/ONM/20240124-002B0001",
            "status": "PENDING"
        },
        {
            "invoice_onmarket": "INV/ONM/20240124-002B0002",
            "status": "PENDING"
        }
    ]
}
Properties
Properties ofData typeDescription
xendit_invoice
stringinvoice ID generated by XENDIT and translated by USAPI
payment_url
string

Public URL for this invoice

expired_at
timestampz

ISO date and time that the invoice expires.

transaction
array<object>

List of transactions

invoicetransactionstring

Invoice ID generated by USAPI

statustransactionstring

Status showing whether the invoice has been paid

Possible values: 

  • PENDING means the invoice has been successfully created but yet to be paid
  • PAID means the invoice has been paid
  • EXPIRED means the invoice expired before your customer paid
Error response

400 Bad Request

Some parameters may contain invalid values or some parameters are not present.
{
    "message": "Invalid JSON Format"
}

Balance is not enough for doing transaction

{
    "message": "Insufficient balance"
}

401 Unauthorized

Authentication header is not valid or missing
{
    "message": "Auth Error"
}

500 Internal server error

Internal server error
{
    "message": "Internal server error"
}