Update Invoice
This API is used for updating invoices
Spesification
| API Name | Update Invoice |
| Http Method | PUT |
| Path | .../api/update/{id} |
Header
The mandatory header that must be sent during a request is header:
| Header | Description |
|---|---|
| X-Winpay-Timestamp | Transaction date and format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in order GMT+7 (Time Jakarta) |
| X-Winpay-Signature | Signature generated by the merchant |
| X-Winpay-Key | Client key merchant |
| Content-Type | must application/json |
Request
The following 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 phone number |
| invoice | JSON Object | Y | - |
| invoice.ref | String | Y | reference number for the related transaction |
| invoice.products | Array of JSON Object | Y | - |
| invoice.products[].name | String | Y | Product Name |
| invoice.products[].qty | Integer | Y | product quantity |
| invoice.products[].price | Integer | Y | product price/amount to be paid |
| back_url | String URL/Javascript Back Command | Y | The URL that is directed to or displayed after the customer completes the payment |
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"
}
Response
The following is the body response that will be received:
| Parameters | Data Type | Description |
|---|---|---|
| responseCode | String | respon code |
| responseMessage | String | message respon |
| responseDate | Date | date respon |
| responseData | JSON Object | - |
| responseData.id | String | iD transaction |
| responseData.ref | String | Reference number for the related transaction |
| responseData.created_at | Date | Transaction time is made |
| responseData.redirect_url | String | url chackout page |
| responseData.back url | String URL/Javascript Back Command | The URL that is directed to or displayed after the customer has completed the payment |
| responseData.customer | JSON Object | - |
| responseData.customer.name | String | customer name |
| responseData.customer.email | String | email customer |
| responseData.customer.phone | String | customer phone number |
| responseData.products | Array of JSON Object | - |
| responseData.products[].uuid | String | ID is for transactions related to products |
| responseData.products[].name | String | product name |
| responseData.products[].qty | Integer | product quantity |
| responseData.products[].price | Integer | product price/amount to be paid |
Response Sample
{
"responseCode": "2000300",
"responseMessage": "Invoice Updated",
"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
}
]
}
}