XENDIT/TRANSACTION

Payout

Payout related transactions

Payout

Payout request for buyer and seller

Notes
Endpoint
Endpoint Source Method
Authentication
/payout/request
USAPI
POST Yes
Authentication
Type
Token source
Usage
Bearer

argon2id encryption

vlskdfgn>iow358u2rlwnfe!@23q58qwegdf

"Bearer <string>"

Body request
{
  "username": <string>,
  "amount": <integer>,
  "platform" : <string>,
  "bank_channel": <string>,
  "bank_account_name": <string>,
  "bank_account_number": <string>
}
Properties
Properties of Data type Required notes
username
string yes Username affiliated for payout from USAPI
amount
integer yes minimum amount is 50000
platform
string yes Platform lists:
  • ONDELIVERY
  • ONMARKET
bank_channel
string yes

ID of Bank channel. Click the provided link for the list

Bank List Link

bank_account_name
string yes Bank account holder name.
bank_account_number
string yes Bank account number.
Request example
{
    "username": "usernew1",
    "amount": 60000,
    "platform": "ONMARKET",
    "bank_channel": "ID_BCA",
    "bank_account_name": "TEST",
    "bank_account_number": "000000"
}


Result example

200 (OK)

{
    "message": "PAYOUT PROCESSED"
}
Error example

400 Bad Request

User balance is less than requested amount

{
    "message": "Insufficient Fund"
}

Requested amount is less than minimum amount

{
    "message": "must be >= 10000"
}

Parameter(s) required

{
    "message": "Must have required property <parameter>"
}

500 Internal Server Error

{
    "message": "Internal Error"
}

 

Invoice

Invoice for xendit transaction

Invoice

Invoice checkout

Flowchart

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

Reference:
Transaction Flowchart

Endpoint
Endpoint Method
Authentication
/payment-checkout
POST Yes
Authentication
Type
Token source
Server
Description
Bearer {{usapi}}/auth USAPI Buyer's auth
Body request example
{
    "total_amount": 40000,
    "service": "ONMARKET",
    "source": "XENDIT",
    "transaction": [
        {
            "amount": 10000,
            "freight_charge": 5000,
            "insurance_amount": 100,
            "commission_onmarket": 1000,
            "seller_username": "testing123",
            "invoice_onmarket": "INV/ONM/20240124-002B0001"
        },
        {
            "amount": 20000,
            "freight_charge": 5000,
            "insurance_amount": 100,
            "commission_onmarket": 1000,
            "seller_username": "testing12345",
            "invoice_onmarket": "INV/ONM/20240124-002B0002"
        }
    ]
}
Properties
Properties of Data type Required Description
total_amount
integer yes Total nominal amount for the invoice.
service
string yes

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
string yes A way that users pay for a product or service. Possible values: XENDIT, BALANCE, QRIS.
transaction   array<object> yes List of transactions.
amount transaction integer yes Amount of transaction for each store (do not include freight charge and insurance as they'll put in other parameter).
freight_charge transaction integer yes Amount of freight charge for each store.
insurance_amount transaction integer no Amount of insurance for each store.
seller_username transaction string yes Seller ONMARKET username
invoice_onmarket transaction string yes Invoice ID generated by ONMARKET
commission_onmarket transaction integer yes Commission amount charged to seller
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 of Data type Description
xendit_invoice
string invoice 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

invoice transaction string

Invoice ID generated by USAPI

status transaction string

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

 

Example for response ONMARKET with source QRIS

{
    "invoice": "ONM00001N14U00001",
    "xendit_invoice": "qr_7807d58a-3d60-4425-92f9-23d6717701f6",
    "qr_string": "00020101021226570011ID.DANA.WWW011893600915060486424802096048642480303UKE51440014ID.CO.QRIS.WWW0215ID20243148326170303UKE52048999530336054031005802ID5925PT OnIndonesia Sistem Tek6015Kota Jakarta Ut61051424062720115NT2YP2fE3fetkbx60490011ID.DANA.WWW0425MER2021071400774509608641050116304DE92",
    "amount": 100,
    "expired_at": "2024-04-30T05:00:52.643Z"
}
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"
}

 

Invoice

Get invoice

Flowchart
Endpoint
Endpoint Method
Authentication
/invoice/detail GET yes
Authentication
Type
Token source
Server
Bearer {{USAPI}}/auth USAPI
Param request
Properties
Required Description
invoice yes invoice ID generated by USAPI
waybill_number
yes Waybill Number generated by OSAS

Notes: Choose one of param request

demousapi.onindonesia.id/invoice/detail?invoice=OD0001N12D0000b

or

demousapi.onindonesia.id/invoice/detail?waybill_number=OND132456A123

Result example

200 OK

{
    "id": "21",
    "username": "usernew1",
    "type": "ONMARKET CHECKOUT",
    "amount": 10000,
    "xendit_invoice": "658bee8b8013d711637b9a7b",
    "invoice": "OM0001N0CR0000f",
    "status": "PAID",
    "src": "XENDIT",
    "xendit_url": "https://checkout-staging.xendit.co/web/658bee8b8013d711637b9a7b",
    "expired_at": "2023-12-27T11:29:47.812Z",
    "createdAt": "2023-12-27T09:29:48.025Z",
    "updatedAt": "2023-12-27T09:30:00.052Z"
}
Error example

400 Bad request

{
    "message": "Invoice not found"
}

401 Unauthorized

{
    "message": "Auth Error"
}

500 Internal server error

{
    "message": "Internal Error"
}

Invoice

Invoice cancel

Endpoint
Endpoint Method
Authentication
/invoice/cancel POST yes
Authentication
Type
Auth type
Basic Login and password same as USAPI Login
Body request
{
  "platform": "ONMARKET",
  "invoice_id": "OM0003d0CS00009",
  "invoice_onmarket": "INV/ONM/20240124-002B0001",
  "buyer_username": "usernew1"
}
Properties
Properties of Data type Required Description
platform
string yes

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.
invoice_id
string yes invoice ID generated by USAPI
invoice_onmarket
string no1

Invoice ID generated by ONMARKET

 

1if status of the invoice is PAID, it will be refunded to buyer's balance from each store. So invoice_onmarket is required.

buyer_username

string no1

Username from buyer

 

1if status of the invoice is PAID, it will be refunded to buyer's balance. So buyer's username is required.

Result example

200 OK (Invoice status is PAID)

{
  "message": "REFUND IN PROCESS"
}

200 OK (Invoice status is PENDING)

{
  "message": "INVOICE CANCELED"
}
Error example

400 Bad request

{
    "message": "REFUND ALREADY IN PROCESS"
}
{
    "message": "TRANSACTION IS ALREADY CANCELED"
}
{
    "message": "EXPIRED INVOICE"
}

500 Internal server error

{
    "message": "INTERNAL SERVER ERROR"
}

Invoice

Invoice done/completed

Update log:

April 24th, 2024

Change Auth from Bearer to Basic

Endpoint
Endpoint Method
Authentication
/invoice/done POST yes
Authentication
Type
Token source
Server
Basic Login and password same as USAPI Login USAPI
Body request
{
  "platform": "ONMARKET",
  "invoice_id": "OM0003d0CS00009",
  "invoice_onmarket": "INV/ONM/20240124-002B0001"
}
Properties
Properties of Data type Required Description
platform
string yes

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.
invoice_id
string yes invoice ID generated by USAPI
invoice_onmarket
string no1

Invoice ID generated by ONMARKET

 

1if status of the invoice is PAID, it will be refunded to buyer's balance from each store. So invoice_onmarket is required.

Result example

200 OK (Invoice status is PAID)

{
  "message": "TRANSACTION IS COMPLETED"
}
Error example

400 Bad request

{
    "message": "REFUND ALREADY IN PROCESS"
}
{
    "message": "TRANSACTION IS ALREADY CANCELED"
}
{
    "message": "EXPIRED INVOICE"
}
{
    "message": "TRANSACTION IS ALREADY COMPLETED"
}

500 Internal server error

{
    "message": "INTERNAL SERVER ERROR"
}

Balance

Balance related process including get, increment and decrement.

Balance

Get balance

Endpoint
Endpoint Method
Authentication
/balance GET yes
Authentication
Type
Token source
Server
Bearer

{{USAPI}}/auth

usapi.onindonesia.id

demousapi.onindonesia.id


Result example

200 OK

{
    "balance": 40000
}
Error example

401 Unauthorized

{
    "message": "Auth Error"
}

Bank List

Endpoint
Endpoint Method
Authentication
/bank/list
POST no
Authentication
Type
Token source
Server
none    
Body request
{
    "bank_name": <string>,
    "channel_type": <string>
}
Properties
Properties of Data type Required Description
bank_name
string yes Name of the bank
channel_type
string yes

Bank channel type.

Available types:

  1. Bank
  2. E-Wallet


Result example

200 (OK)

[
    {
        "id": 22,
        "bank_channel": "ID_BOC",
        "description": "Bank of China (BOC)",
        "type": "Bank",
        "currency": "IDR",
        "alias": null
    }
]
Error example

Body request example

insert code here