Skip to main content

Create Invoice

This API is used to create/request invoices.

Spesification

Nama APICreate Invoice
Http MethodPOST
Path.../api/create

The mandatory headers that must be sent at the time of the request are:

HeaderDescription
X-Winpay-TimestampTime of transaction date, with format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in order GMT+7 (time Jakarta)
X-Winpay-SignatureSignature generated from merchant
X-Winpay-KeyClient key merchant
Content-Typemust application/json

Request

Here is the body request that must be sent:

ParametersData TypeMandatoryDescription
customerJSON ObjectY-
customer.nameStringYcustomer name
customer.emailStringOemail customer
customer.phoneStringYcustomer's mobile number/phone number
invoiceJSON ObjectY-
invoice.refStringYreference number for related transaction
invoice.productsArray of JSON ObjectY-
invoice.products[].nameStringYProduct Name
invoice.products[].qtyIntegerYnumber of products
invoice.products[].priceIntegerYProduct price/nominal to be paid
back_urlString URL/Javascript Back CommandYThe intended URL or displayed after the customer has finished making a payment
intervalIntegerYSetting Expired for Requested Channel (in minutes)

Request Sample

{
"customer": {
"name": "Delina Prasetya",
"email": "[email protected]",
"phone": "082342341"
},
"invoice": {
"ref": "111130",
"products": [
{
"name": "01002676",
"qty": 1,
"price": 260000
}
]
},
"back_url": "https://your-invoice-url.com",
"interval": 120
}

Response

Here is the body response that will be received :

ParametersData TypeDescription
responseCodeStringResponse code
responseMessageStringResponse message
responseDateDateResponse date
responseDataJSON Object-
responseData.idStringTransaction ID
responseData.refStringreference number for related transaction
responseData.created_atDateTime the transaction was made
responseData.redirect_urlStringurl chackout page
responseData.back urlString URL/Javascript Back CommandThe intended URL or displayed after the customer has finished making a payment
responseData.customerJSON Object-
responseData.customer.nameStringCustomer Name
responseData.customer.emailStringCustomer Email
responseData.customer.phoneStringcustomer's mobile number/phone number
responseData.productsArray of JSON Object-
responseData.products[].uuidStringID for related product transaction
responseData.products[].nameStringProduct Name
responseData.products[].qtyIntegernumber of products
responseData.products[].priceIntegerProduct price/nominal to be paid

Response Sample

{
"responseCode": "2010300",
"responseMessage": "Invoice created",
"responseDate": "2023-10-25T14:12:14+07:00",
"responseData": {
"id": "2edff262-6228-4da1-96d7-729bf9fc85f0",
"ref": "0000001792131232161",
"created_at": "2023-10-25 14:12:14",
"redirect_url": "https://checkout.winpay.id/upu90zxyid",
"back_url": "https://your-invoice-url.com",
"customer": {
"name": "Delina Prasetya",
"email": "[email protected]",
"phone": "082342341"
},
"products": [
{
"uuid": "92cd6096-ab4a-4e79-be61-c4cdbeedd281",
"name": "01002676",
"qty": 1,
"price": 260000
}
]
}
}