Update Invoice
API ini digunakan untuk update invoice.
Spesification
| Nama API | Update Invoice |
| Http Method | PUT |
| Path | .../api/update/{id} |
Header
header wajib yang harus dikirimkan pada saat request adalah:
| Header | Deskripsi |
|---|---|
| X-Winpay-Timestamp | Waktu tanggal transaksi, dengan format YYYY-MM-DDTHH:mm:ss+07:00. Waktu harus dalam GMT+7 (waktu Jakarta) |
| X-Winpay-Signature | Signature hasil generate dari merchant |
| X-Winpay-Key | Client key merchant |
| Content-Type | harus application/json |
Request
berikut adalah body request yang harus dikirimkan:
| Parameter | Tipe | Wajib | Deskripsi |
|---|---|---|---|
| customer | JSON Object | Y | - |
| customer.name | String | Y | nama customer |
| customer.email | String | O | email customer |
| customer.phone | String | Y | nomor HP/telepon customer |
| invoice | JSON Object | Y | - |
| invoice.ref | String | Y | nomor referensi untuk transaksi terkait |
| invoice.products | Array of JSON Object | Y | - |
| invoice.products[].name | String | Y | nama produk |
| invoice.products[].qty | Integer | Y | jumlah produk |
| invoice.products[].price | Integer | Y | harga produk/nominal yang harus dibayar |
| back_url | String URL/Javascript Back Command | Y | url yang dituju atau ditampilkan setelah customer selesai melakukan pembayaran |
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
berikut adalah body response yang akan diterima:
| Parameter | Tipe | Deskripsi |
|---|---|---|
| responseCode | String | kode respon |
| responseMessage | String | pesan respon |
| responseDate | Date | tanggal respon |
| responseData | JSON Object | - |
| responseData.id | String | id transaksi |
| responseData.ref | String | nomor referensi untuk transaksi terkait |
| responseData.created_at | Date | waktu transaksi terbuat |
| responseData.redirect_url | String | url chackout page |
| responseData.back url | String URL/Javascript Back Command | url yang dituju atau ditampilkan setelah customer selesai melakukan pembayaran |
| responseData.customer | JSON Object | - |
| responseData.customer.name | String | nama customer |
| responseData.customer.email | String | email customer |
| responseData.customer.phone | String | nomor HP/telepon customer |
| responseData.products | Array of JSON Object | - |
| responseData.products[].uuid | String | id untuk transaksi produk terkait |
| responseData.products[].name | String | nama produk |
| responseData.products[].qty | Integer | jumlah produk |
| responseData.products[].price | Integer | harga produk/nominal yang harus dibayar |
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
}
]
}
}