Pada halaman ini, akan dijelaskan penggunaaan API untuk berinterakasi dengan tabel Product Price.
API List
Method ini digunakan untuk mendapatkan data price yang tersedia.
Request
| METHOD | URL |
|---|---|
| GET | http://apiv2.mitrabunso.com/public/product/price/list/{id_user}/{id_product}/{offsite}/{limit} |
Parameter yang digunakan pada method ini adalah sebagai berikut:
| METHOD | Parameter | Wajib | Tipe | Keterangan |
|---|---|---|---|---|
| GET | id_user | YA | STRING | 36 digit id user |
| GET | id_product | YA | STRING | 36 digit id product |
| GET | offsite | YA | int | offsite data |
| GET | limit | YA | int | limit data |
| HEAD | Authorization | YA | Bearer Token | Bearer Token Login |
| GET | q | TIDAK | STRING | Parameter untuk pencarian |
| GET | orderBy | TIDAK | STRING | Parameter untuk pengurutan berdasarkan data |
Response
{
"message": "Data retrieved successfully",
"show": 2,
"total": 2,
"data": [
{
"deleted_at": null,
"status": "1",
"id": "56139d43-3409-4a78-ad3f-e9f678170759",
"price": "25000",
"product": "13628104-90c3-41a9-9074-c5c8b386f720",
"startDate": "2022-10-08 00:00:00",
"endDate": "2022-10-08 23:59:00",
"shop": "03a0da07-1b3f-4512-81ed-0c01310666e4",
"shopName": "Online Shop",
"created": {
"date": "2022-10-08 15:00:26.000000",
"timezone_type": 3,
"timezone": "Asia/Bangkok"
},
"updated": {
"date": "2022-10-08 15:00:26.000000",
"timezone_type": 3,
"timezone": "Asia/Bangkok"
},
"createdBy": "2888cc3b-0478-4e85-be41-7baf74fedf36",
"updatedBy": "",
"createdByName": "Andika Pratama",
"updatedByName": null
},
{
"deleted_at": null,
"status": "1",
"id": "644ef4a0-db8e-4737-a91d-6e3473908f98",
"price": "25000",
"product": "13628104-90c3-41a9-9074-c5c8b386f720",
"startDate": "2022-10-08 00:00:00",
"endDate": "2022-10-08 23:59:00",
"shop": "03a0da07-1b3f-4512-81ed-0c01310666e4",
"shopName": "Online Shop",
"created": {
"date": "2022-10-08 15:02:07.000000",
"timezone_type": 3,
"timezone": "Asia/Bangkok"
},
"updated": {
"date": "2022-10-08 15:02:07.000000",
"timezone_type": 3,
"timezone": "Asia/Bangkok"
},
"createdBy": "2888cc3b-0478-4e85-be41-7baf74fedf36",
"updatedBy": "",
"createdByName": "Andika Pratama",
"updatedByName": null
}
]
}
API Create
Method ini digunakan untuk memasukan data price.
Request
| METHOD | URL |
|---|---|
| POST | http://apiv2.mitrabunso.com/public/product/price/create/{id_user}/{id_product} |
Parameter yang digunakan pada method ini adalah sebagai berikut:
| METHOD | Parameter | Wajib | Tipe | Keterangan |
|---|---|---|---|---|
| GET | id_user | YA | STRING | 36 digit id user |
| GET | id_product | YA | STRING | 36 digit id product |
| HEAD | Authorization | YA | Bearer Token | Bearer Token Login |
| POST | price | YA | INT | Harga untuk produk |
| POST | shop | YA | STRING | 36 digit id shop |
| POST | startDate | YA | DATETIME | Tanggal mulai berlaku |
| POST | endDate | YA | DATETIME | Tanggal selesai berlaku |
Response
{
"message": "Data added successfully",
"data": {
"deleted_at": null,
"status": "1",
"id": "56139d43-3409-4a78-ad3f-e9f678170759",
"price": "25000",
"product": "13628104-90c3-41a9-9074-c5c8b386f720",
"startDate": "2022-10-08 00:00:00",
"endDate": "2022-10-08 23:59:00",
"shop": "03a0da07-1b3f-4512-81ed-0c01310666e4",
"shopName": null,
"created": {
"date": "2022-10-08 15:00:26.000000",
"timezone_type": 3,
"timezone": "Asia/Bangkok"
},
"updated": {
"date": "2022-10-08 15:00:26.000000",
"timezone_type": 3,
"timezone": "Asia/Bangkok"
},
"createdBy": "2888cc3b-0478-4e85-be41-7baf74fedf36",
"updatedBy": "",
"createdByName": null,
"updatedByName": null
}
}
API Update
Method ini digunakan untuk mengubah data price.
Request
| METHOD | URL |
|---|---|
| POST | http://apiv2.mitrabunso.com/public/product/price/update/{id_user}/{id_product}/{id_price} |
Parameter yang digunakan pada method ini adalah sebagai berikut:
| METHOD | Parameter | Wajib | Tipe | Keterangan |
|---|---|---|---|---|
| GET | id_user | YA | STRING | 36 digit id user |
| GET | id_product | YA | STRING | 36 digit id product |
| GET | id_price | YA | STRING | 36 digit id price |
| HEAD | Authorization | YA | Bearer Token | Bearer Token Login |
| POST | price | YA | INT | Harga untuk produk |
| POST | shop | YA | STRING | 36 digit id shop |
| POST | startDate | YA | DATETIME | Tanggal mulai berlaku |
| POST | endDate | YA | DATETIME | Tanggal selesai berlaku |
Response
{
"message": "Data updated successfully",
"data": {
"deleted_at": null,
"status": "1",
"id": "56139d43-3409-4a78-ad3f-e9f678170759",
"price": "25500",
"product": "13628104-90c3-41a9-9074-c5c8b386f720",
"startDate": "2022-10-08 00:00:00",
"endDate": "2022-10-08 23:59:00",
"shop": "22ba9428-a4d2-4c44-ba35-417c6878f16a",
"shopName": null,
"created": {
"date": "2022-10-08 15:00:26.000000",
"timezone_type": 3,
"timezone": "Asia/Bangkok"
},
"updated": {
"date": "2022-10-08 15:04:03.000000",
"timezone_type": 3,
"timezone": "Asia/Bangkok"
},
"createdBy": "2888cc3b-0478-4e85-be41-7baf74fedf36",
"updatedBy": "2888cc3b-0478-4e85-be41-7baf74fedf36",
"createdByName": null,
"updatedByName": null
}
}
API Details
Method ini digunakan untuk mendapatkan data details price.
Request
| METHOD | URL |
|---|---|
| POST | http://apiv2.mitrabunso.com/public/product/price/details/{id_user}/{id_product}/{id_price} |
Parameter yang digunakan pada method ini adalah sebagai berikut:
| METHOD | Parameter | Wajib | Tipe | Keterangan |
|---|---|---|---|---|
| GET | id_user | YA | STRING | 36 digit id user |
| GET | id_product | YA | STRING | 36 digit id product |
| GET | id_price | YA | STRING | 36 digit id price |
| HEAD | Authorization | YA | Bearer Token | Bearer Token Login |
Response
{
"message": "Data retrieved successfully",
"data": {
"deleted_at": null,
"status": "1",
"id": "56139d43-3409-4a78-ad3f-e9f678170759",
"price": "25000",
"product": "13628104-90c3-41a9-9074-c5c8b386f720",
"startDate": "2022-10-08 00:00:00",
"endDate": "2022-10-08 23:59:00",
"shop": "03a0da07-1b3f-4512-81ed-0c01310666e4",
"shopName": null,
"created": {
"date": "2022-10-08 15:00:26.000000",
"timezone_type": 3,
"timezone": "Asia/Bangkok"
},
"updated": {
"date": "2022-10-08 15:00:26.000000",
"timezone_type": 3,
"timezone": "Asia/Bangkok"
},
"createdBy": "2888cc3b-0478-4e85-be41-7baf74fedf36",
"updatedBy": "",
"createdByName": null,
"updatedByName": null
}
}
API Delete
Method ini digunakan untuk menghapus data produk price.
Request
| METHOD | URL |
|---|---|
| DELETE | http://apiv2.mitrabunso.com/public/product/price/delete/{id_user}/{id_product}/{id_price} |
Parameter yang digunakan pada method ini adalah sebagai berikut:
| METHOD | Parameter | Wajib | Tipe | Keterangan |
|---|---|---|---|---|
| GET | id_user | YA | STRING | 36 digit id user |
| GET | id_product | YA | STRING | 36 digit id product |
| GET | id_price | YA | STRING | 36 digit id price |
| HEAD | Authorization | YA | Bearer Token | Bearer Token Login |
Response
{
"message": "data deleted successfully"
}