Send Invoice and Generate Virtual Account

Description: Partner sends several outstanding invoices. The maximum number of invoices to be sent with this service is 500.

Sender: Espay Partner

Receiver: Espay System

API URL

Endpoint Development: https://sandbox-api.espay.id/rest/virtualaccount/sendinvoice
Endpoint Production: https://api.espay.id/rest/virtualaccount/sendinvoice

Request Example:
Field Name Atribut Mandatory Description
rq_uuid ANS 255 TRUE Request Identifier. Unique ID to identify the request message with other messages. E.g.: 123ABC-DEF456
rq_datetime ANS 19 TRUE Date and time in client’s application server when the message is sent.
Format : YYYY-MM-DD HH:MM:SS
Ex : 2014-12-17 12:30:45
signature ANS 64 TRUE Signature (see Signature Algorithm)
comm_code AN 32 TRUE Community Code
ccy AN 3 TRUE Transaction currency
invoices JSON TRUE Maximum 500 lines of JSON
Example:
{
"INVZSKSK022": {
"member_code":"18032018",
"member_name":"Arief",
"amount":20000,
"total_amount":20000,
"number_of_installment":"12",
"installment_amount":"2000000",
"balance_payment_amount":"2000000",
"description":"VA Payment Test",
"billing_date":"05"
},
"INVZSKSK023": {
"member_code":"18032019",
"member_name":"Sahid",
"amount":30000,
"total_amount":30000,
"number_of_installment":"12",
"installment_amount":"3000000",
"balance_payment_amount":"3000000",
"description":"VA Payment Test",
"billing_date":"05"
}
}
Detail: {"doc_no":{"member_code":"18032018","member_name":"Arief (Non mandatory)",
"amount":20000,"total_amount":20000"number_of_installment":"12",
"installment_amount":"2000000","balance_payment_amount":"2000000 (Non mandatory)","description":"VA Payment Test (Non mandatory)","billing_date":"05"}}
total_invoices N 3 TRUE Maximum 500 lines of JSON
Number of invoice lines must be the same with total_invoices.
Example: 500

Response Example:
Field Name Atribut Mandatory Description
rq_uuid ANS 255 TRUE Request Identifier. Unique ID to identify the request message with other messages. Ex : 123ABC-DEF456
rs_datetime ANS 19 TRUE Date and time in application server when client’s request is replied.
Format : YYYY-MM-DD HH:MM:SS
Ex : 2014-12-17 12:30:45
error_code AN TRUE Error Code
error_message ANS FALSE Error Description
invoices JSON TRUE Invoice Description
Example:
{
"INVZSKSK022": {
"error_code":"0002",
"error_msg":"Data not listed= Document No",
"doc_ref_no":""
},
"INVZSKSK023": {
"error_code":"0000",
"error_msg":"success",
"doc_ref_no":"DOC010101",
"list_va": {
"008": {
"bank_code": "008",
"va_number": "6280615238775939",
"expired": "2018-05-17 14:00:00",
"description": "VA Payment Test"
},
"009": {
"bank_code": "009",
"va_number": "8871215238775939",
"expired": "2018-05-17 14:00:00",
"description": "VA Payment Test"
}
}
}
}
- 0000 = Success
- else = Fail
invoices_success JSON TRUE Invoice Description
Example:
{
"INVZSKSK022": {
"error_code":"0002",
"error_msg":"Data not listed = Document No",
"doc_ref_no":""
},
"INVZSKSK023": {
"error_code":"0000",
"error_msg":"success",
"doc_ref_no":"DOC010101",
"list_va": {
"008": {
"bank_code": "008",
"va_number": "6280615238775939",
"expired": "2018-05-17 14:00:00",
"description": "VA Payment Test"
},
"009": {
"bank_code": "009",
"va_number": "8871215238775939",
"expired": "2018-05-17 14:00:00",
"description": "VA Payment Test"
}
}
}
}
- 0000 = Success
- else = Fail
invoices_error JSON TRUE Invoice Description
Example:
{
"INVZSKSK024" : {
"doc_ref_no" : "",
"error_code" : "0001",
"error_msg" : "Mandatory field left empty = Billing Date"
},
"INVZSKSK025" : {
"doc_ref_no" : "",
"error_code" : "0002",
"error_msg" : "Data already listed = Document No"
}
}
total_invoice ANS TRUE Total invoices processed
  

Sample Request

POST /rest/virtualaccount/sendinvoice HTTP/1.1 Host: sandbox-api.espay.id Connection: keep-alive Content-Length: 250 Content-Type: application/x-www-form-urlencoded Accept: */* rq_uuid=80784df2-accb-46fc-92f4-8d3103b38408 &rq_datetime=2021-10-23 22:51:45 &signature=e7bb3339e618b6fb8ce3035edc83456813efb962e9f2c2b286e92387615b6f15 &comm_code=SGWBUKUKUSC &ccy=IDR &invoices=[{"INVZSKSK023": {"member_code":"18032019","member_name":"Sahid","amount":30000,"total_amount":30000,"number_of_installment":"12","installment_amount":"3000000","balance_payment_amount":"3000000","description":"VA Payment Test","billing_date":"05"}}Detail: {"doc_no":{"member_code":"18032018","member_name":"Arief (Non mandatory)","amount":20000,"total_amount":20000"number_of_installment":"12","installment_amount":"2000000","balance_payment_amount":"2000000 (Non mandatory)","description":"VA Payment Test (Non mandatory)","billing_date":"05"}}] &total_invoices=1
  

Sample Response:

{ "rq_uuid": "80784df2-accb-46fc-92f4-8d3103b38408", "rs_datetime": "2021-10-23 22:51:45", "error_code": "0000", "error_message": "", "invoices" : { "INVZSKSK023": { "error_code":"0000", "error_msg":"success", "doc_ref_no":"DOC010101", "list_va": { "008": { "bank_code": "008", "va_number": "6280615238775939", "expired": "2018-05-17 14:00:00", "description": "Test Pembayaran VA" }, "009": { "bank_code": "009", "va_number": "8871215238775939", "expired": "2018-05-17 14:00:00", "description": "Test Pembayaran VA" } } } }, "invoices_success" :{ "INVZSKSK023": { "error_code":"0000", "error_msg":"success", "doc_ref_no":"DOC010101", "list_va": { "008": { "bank_code": "008", "va_number": "6280615238775939", "expired": "2018-05-17 14:00:00", "description": "Test Pembayaran VA" }, "009": { "bank_code": "009", "va_number": "8871215238775939", "expired": "2018-05-17 14:00:00", "description": "Test Pembayaran VA" } } } }, "invoices_error" : "", "total_invoice" : "1" }