Create Invoice
This API is used to create/request invoices.
Spesification
| Nama API | Create Invoice |
| Http Method | POST |
| Path | .../api/create |
Header
The mandatory headers that must be sent at the time of the request are:
| Header | Description |
|---|---|
| X-Winpay-Timestamp | Time of transaction date, with format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in order GMT+7 (time Jakarta) |
| X-Winpay-Signature | Signature generated from merchant |
| X-Winpay-Key | Client key merchant |
| Content-Type | must application/json |
Request
Here is the body request that must be sent:
| Parameters | Data Type | Mandatory | Description |
|---|---|---|---|
| customer | JSON Object | Y | - |
| customer.name | String | Y | customer name |
| customer.email | String | O | email customer |
| customer.phone | String | Y | customer's mobile number/phone number |
| invoice | JSON Object | Y | - |
| invoice.ref | String | Y | reference number for related transaction |
| invoice.products | Array of JSON Object | Y | - |
| invoice.products[].name | String | Y | Product Name |
| invoice.products[].qty | Integer | Y | number of products |
| invoice.products[].price | Integer | Y | Product price/nominal to be paid |
| back_url | String URL/Javascript Back Command | Y | The intended URL or displayed after the customer has finished making a payment |
| interval | Integer | Y | Setting 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 :
| Parameters | Data Type | Description |
|---|---|---|
| responseCode | String | Response code |
| responseMessage | String | Response message |
| responseDate | Date | Response date |
| responseData | JSON Object | - |
| responseData.id | String | Transaction ID |
| responseData.ref | String | reference number for related transaction |
| responseData.created_at | Date | Time the transaction was made |
| responseData.redirect_url | String | url chackout page |
| responseData.back url | String URL/Javascript Back Command | The intended URL or displayed after the customer has finished making a payment |
| responseData.customer | JSON Object | - |
| responseData.customer.name | String | Customer Name |
| responseData.customer.email | String | Customer Email |
| responseData.customer.phone | String | customer's mobile number/phone number |
| responseData.products | Array of JSON Object | - |
| responseData.products[].uuid | String | ID for related product transaction |
| responseData.products[].name | String | Product Name |
| responseData.products[].qty | Integer | number of products |
| responseData.products[].price | Integer | Product 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
}
]
}
}