Pada halaman ini, akan dijelaskan penggunaaan API untuk modul order.
API List
Method ini digunakan untuk mendapatkan data order yang tersedia.
Request
| METHOD | URL |
|---|---|
| GET | http://apiv2.mitrabunso.com/public/order/orders/list/{id_user}/{offsite}/{limit} |
Parameter yang digunakan pada method ini adalah sebagai berikut:
| METHOD | Parameter | Wajib | Tipe | Keterangan |
|---|---|---|---|---|
| GET | id_user | YA | STRING | 36 character id user |
| 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 | status | TIDAK | STRING | Parameter untuk memilih order berdasarkan status order |
Response
{
"message": "Data retrieved successfully",
"data": [
{
"customer": {
"name": "Luthfi",
"phone": "6285223177777",
"address": "Jl. Raya Barat, Kp.Ciputri Gang Bintang Cell RT.03/RW.07 Desa.Singasari. Kec.Singaparna, Kab.Tasikmalaya, Jawa Barat.\r\nSingaparna 46412",
"provinceCode": null,
"provinceName": "",
"cityCode": null,
"cityName": "",
"districtCode": null,
"districtName": "",
"postCode": null
},
"sender": {
"name": "Ebar Kennedy",
"phone": "6282165077777"
},
"order": {
"invoice": "INV20220505MPL22907777",
"courierId": "a9727718-2ab9-4a90-8b94-d2ca8ded9b8a",
"courierName": "JNE(OKE)",
"shippingCost": "0",
"shopId": "22ba9428-a4d2-4c44-ba35-417c6878f16a",
"shopName": "Ebar Kennedy",
"awb": "TJE2348621107726",
"adminNote": null,
"customerNote": "",
"totalCost": 70000,
"labelImage": null,
"printType": "2",
"assign": null,
"order_id": "b5d588bc-afc5-45f5-a6d5-dde8ef3a20b0"
},
"details": [
{
"productId": "01768bec-0bfe-4a40-97c5-48ecfc93d5ca",
"qty": 1,
"productPrice": 70000,
"totalPrice": 70000,
"productName": "Silicone Cover Iphone XR Pink (Phone Case)"
}
],
"updatedAWB": "TJE2348621107726",
"createdAt": "2022-09-20 05:36:50",
"processedAt": null,
"sentAt": null,
"status": "NEW",
"updatedInvoice": "INV20220505MPL2290502811"
}
],
"total": 23645,
"show": 1
}
API Total Sumarry Order
Method ini digunakan untuk mengambil data sumarry order.
Request
| METHOD | URL |
|---|---|
| GET | http://apiv2.mitrabunso.com/public/order/orders/total_summary/{id_user} |
Parameter yang digunakan pada method ini adalah sebagai berikut:
| METHOD | Parameter | Wajib | Tipe | Keterangan |
|---|---|---|---|---|
| GET | id_user | YA | STRING | 36 charakter id user |
| HEAD | Authorization | YA | Bearer Token | Bearer Token Login |
Response
{
"message": "data retrieved successfully",
"data": {
"NEW": 10,
"PROCESSED": 76,
"SENT": 18591,
"DRAFT": 15
}
}
API Create
Method ini digunakan untuk memasukan data order.
Request
| METHOD | URL |
|---|---|
| POST | http://apiv2.mitrabunso.com/public/order/orders/create/{id_user} |
Parameter yang digunakan pada method ini adalah sebagai berikut:
| METHOD | Parameter | Wajib | Tipe | Keterangan |
|---|---|---|---|---|
| GET | id_user | YA | STRING | 36 charakter id user |
| HEAD | Authorization | YA | Bearer Token | Bearer Token Login |
| POST | data | YA | JSON | Data order |
Contoh JSON data:
{
"customer": {
"name": "Order Test #1",
"phone": "6281777777",
"address": "JL. Order #1 no 2",
"provinceCode": "PR002",
"provinceName": "Bangka Belitung",
"cityCode": "C011",
"cityName": "Kab. Bangka Barat",
"districtCode": "D0060",
"districtName": "Tempilang",
"postCode": "33365"
},
"sender": {
"name": "ALTHACELL.COM",
"phone": "628382888888"
},
"order": {
"invoice": "ANDI2022101112595401",
"courierId": "1ce46391-c1d1-4dc9-bcad-8d7a8140714c",
"courierName": "Lion Parcel",
"shopId": "02badb7c-a3ff-4e64-97f7-a3b82044dd83",
"shopName": "ALTHASHOP",
"shippingCost": "0",
"awb": "ABC-DE0001",
"adminNote": "Silicone Cover Samsung Note 10 plus Pink (Phone Case)(1pcs) - Rp.30000,",
"totalCost": 30000,
"labelImage": null,
"printType": "2",
"assign": null
},
"details": [
{
"productId": "0209640b-5767-4a39-9511-3c62ac15fb94",
"qty": 1,
"productPrice": 30000,
"totalPrice": 30000,
"productName": "Silicone Cover Samsung Note 10 plus Pink (Phone Case)"
}
]
}
Response
{
"message": "Data has been created succesfully.",
"data": {
"order": [
{
"order_first_state": "{\"customer\":{\"name\":\"Order Test #1\",\"phone\":\"6281382987777\",\"address\":\"a\",\"provinceCode\":null,\"provinceName\":\"\",\"cityCode\":null,\"cityName\":\"\",\"districtCode\":null,\"districtName\":\"\",\"postCode\":null},\"sender\":{\"name\":\"ALTHACELL.COM\",\"phone\":\"6283827513353\"},\"order\":{\"invoice\":\"ANDI2022101115075801\",\"courierId\":\"17cd69d0-0c3d-4886-9c93-7977000bade1\",\"courierName\":\"JNT Reguler\",\"shopId\":\"02badb7c-a3ff-4e64-97f7-a3b82044dd83\",\"shopName\":\"ALTHASHOP\",\"shippingCost\":\"0\",\"awb\":null,\"adminNote\":null,\"totalCost\":10000,\"labelImage\":null,\"printType\":\"2\",\"assign\":null,\"order_id\":\"d8e9a7f7-f0f7-4fb9-af5b-c80841b068a4\"},\"details\":[{\"productId\":\"02ca87fa-069a-473f-88f9-daf04407398d\",\"qty\":1,\"productPrice\":10000,\"totalPrice\":10000,\"productName\":\"Silicone Cover Samsung S9 Abu-abu (Phone Case)\"}]}",
"deleted_at": null,
"id": "d8e9a7f7-f0f7-4fb9-af5b-c80841b068a4",
"customerId": "484193d5-b38c-48ad-bce7-3e773581a303",
"customerName": "Order Test #1",
"customerAddress": "a",
"senderAddress": null,
"senderId": "91a5dc05-6ad6-4ef6-ad25-46cde23fe89b",
"senderName": "ALTHACELL.COM",
"courierId": "17cd69d0-0c3d-4886-9c93-7977000bade1",
"courierName": "JNT Reguler",
"shippingCost": "0",
"status": "NEW",
"printStatus": "0",
"labelImage": null,
"shopId": "02badb7c-a3ff-4e64-97f7-a3b82044dd83",
"shopName": "ALTHASHOP",
"invoice": "ANDI2022101115075801",
"awb": "",
"totalPrice": null,
"totalProduct": null,
"customerNote": null,
"adminNote": "",
"created": {
"date": "2022-10-11 15:08:14.000000",
"timezone_type": 3,
"timezone": "Asia/Bangkok"
},
"updated": {
"date": "2022-10-11 15:08:14.000000",
"timezone_type": 3,
"timezone": "Asia/Bangkok"
},
"processed": null,
"sent": null,
"createdBy": "",
"updatedBy": "",
"createdByName": null,
"updatedByName": null
}
],
"products": [
{
"detailsId": "6d8de4aa-3519-4b87-9012-ab72bffedb28",
"productId": "02ca87fa-069a-473f-88f9-daf04407398d",
"productName": "Silicone Cover Samsung S9 Abu-abu",
"productPrice": "10000",
"qty": "1"
}
]
}
}
API Create Batch
Method ini digunakan untuk memasukan banyak data order sekaligus.
Request
| METHOD | URL |
|---|---|
| POST | http://apiv2.mitrabunso.com/public/order/orders/batch_create/{id_user} |
Parameter yang digunakan pada method ini adalah sebagai berikut:
| METHOD | Parameter | Wajib | Tipe | Keterangan |
|---|---|---|---|---|
| GET | id_user | YA | STRING | 36 charakter id user |
| HEAD | Authorization | YA | Bearer Token | Bearer Token Login |
| POST | batchData | YA | JSON | Data order |
Contoh JSON batchData :
[
{
"customer": {
"name": "BASRYBABAS",
"phone": "628128927777",
"address": "PERUMNAS BUMI TELUKJAMBE JL.BALADEWA Blok U no 285 (PERUMNNAS) (PERUMNNAS), KAB. KARAWANG, TELUKJAMBE TIMUR, JAWA BARAT, ID, 41331",
"provinceCode": "PR009",
"provinceName": "Jawa Barat",
"cityCode": "C072",
"cityName": "Kab. Karawang",
"districtCode": "D0722",
"districtName": "Tirtamulya",
"postCode": "41372"
},
"sender": {
"name": "Cesing Hoki",
"phone": "6282389877777"
},
"order": {
"invoice": "TESTCREATEDBY",
"courierId": "17cd69d0-0c3d-4886-9c93-7977000bade1",
"courierName": "Reguler (Cashless)-J&T Express",
"shippingCost": "10000",
"shopId": "06d48eba-b46c-439f-b82a-212456a97f2f",
"shopName": "CESING HOKI",
"awb": "JP7638199648",
"adminNote": null,
"customerNote": "",
"totalCost": 50000,
"labelImage": null,
"printType": "2",
"assign": null
},
"details": [
{
"productId": "01768bec-0bfe-4a40-97c5-48ecfc93d5ca",
"qty": 1,
"productPrice": 50000,
"totalPrice": 50000,
"productName": "Silicone Cover Iphone XR Pink (Phone Case)"
}
]
}
]
Response
{
"message": "Data has been created succesfully.",
"data": {
"invoices": [
"e83ebf28-8999-4b83-a2c0-c5f1c0a35e97"
]
},
"total": 1
}
API Details
Method ini digunakan untuk mendapatkan data details order.
Request
| METHOD | URL |
|---|---|
| GET | http://apiv2.mitrabunso.com/public/order/orders/details/{id_user}/{id_order} |
Parameter yang digunakan pada method ini adalah sebagai berikut:
| METHOD | Parameter | Wajib | Tipe | Keterangan |
|---|---|---|---|---|
| GET | id_user | YA | STRING | 36 character id user |
| GET | id_order | YA | STRING | 36 character id order |
| HEAD | Authorization | YA | Bearer Token | Bearer Token Login |
Response
{
"message": "Data retrieved successfully",
"data": {
"order": [
{
"order_first_state": "{\"customer\":{\"name\":\"Order Test #1\",\"phone\":\"6281382987777\",\"address\":\"a\",\"provinceCode\":null,\"provinceName\":\"\",\"cityCode\":null,\"cityName\":\"\",\"districtCode\":null,\"districtName\":\"\",\"postCode\":null},\"sender\":{\"name\":\"ALTHACELL.COM\",\"phone\":\"6283827517777\"},\"order\":{\"invoice\":\"ANDI2022101115075801\",\"courierId\":\"17cd69d0-0c3d-4886-9c93-7977000bade1\",\"courierName\":\"JNT Reguler\",\"shopId\":\"02badb7c-a3ff-4e64-97f7-a3b82044dd83\",\"shopName\":\"ALTHASHOP\",\"shippingCost\":\"0\",\"awb\":null,\"adminNote\":null,\"totalCost\":10000,\"labelImage\":null,\"printType\":\"2\",\"assign\":null,\"order_id\":\"c0aaa297-b030-4fd2-910b-4ada38c28ed0\"},\"details\":[{\"productId\":\"02ca87fa-069a-473f-88f9-daf04407398d\",\"qty\":1,\"productPrice\":10000,\"totalPrice\":10000,\"productName\":\"Silicone Cover Samsung S9 Abu-abu (Phone Case)\"}]}",
"deleted_at": null,
"id": "c0aaa297-b030-4fd2-910b-4ada38c28ed0",
"customerId": "484193d5-b38c-48ad-bce7-3e773581a303",
"customerName": "Order Test #1",
"customerAddress": "a",
"senderAddress": null,
"senderId": "91a5dc05-6ad6-4ef6-ad25-46cde23fe89b",
"senderName": "ALTHACELL.COM",
"courierId": "17cd69d0-0c3d-4886-9c93-7977000bade1",
"courierName": "JNT Reguler",
"shippingCost": "0",
"status": "NEW",
"printStatus": "0",
"labelImage": null,
"shopId": "02badb7c-a3ff-4e64-97f7-a3b82044dd83",
"shopName": "ALTHASHOP",
"invoice": "ANDI2022101115075801",
"awb": "",
"totalPrice": null,
"totalProduct": null,
"customerNote": null,
"adminNote": "",
"created": {
"date": "2022-10-11 15:08:46.000000",
"timezone_type": 3,
"timezone": "Asia/Bangkok"
},
"updated": {
"date": "2022-10-11 15:08:46.000000",
"timezone_type": 3,
"timezone": "Asia/Bangkok"
},
"processed": null,
"sent": null,
"createdBy": "",
"updatedBy": "",
"createdByName": null,
"updatedByName": null
}
],
"products": [
{
"detailsId": "5bdbe95c-3bd1-43d6-b475-c07b00726db7",
"productId": "02ca87fa-069a-473f-88f9-daf04407398d",
"productName": "Silicone Cover Samsung S9 Abu-abu",
"productPrice": "10000",
"qty": "1"
}
]
}
}
API SMART Order
Method ini digunakan untuk mendapatkan data template yang sesuai dengan form order.
Request
| METHOD | URL |
|---|---|
| POST | http://apiv2.mitrabunso.com/public/smartorder/fetch/{id_user} |
Parameter yang digunakan pada method ini adalah sebagai berikut:
| METHOD | Parameter | Wajib | Tipe | Keterangan |
|---|---|---|---|---|
| GET | id_user | YA | STRING | 36 character id user |
| HEAD | Authorization | YA | Bearer Token | Bearer Token Login |
| POST | text | YA | JSON | JSON data inputan |
| POST | marketplace | YA | STRING | Id marketplace |
| POST | shop | YA | STRING | Id shop |
| POST | excel | YA | INT | Parameter menandakan bahwa data yang diinput berasal dari file excel |
| POST | excel | YA | INT | Parameter menandakan bahwa file yang diinput memiliki header |
Contoh JSON text:
[
[
"TESTCREATEDBY",
"Perlu Dikirim",
"",
"JP7638199648",
"Reguler (Cashless)-J&T Express",
"Antar ke Counter",
"2022-06-20 15:33",
"",
"2022-06-16 11:49",
"2022-06-16 15:33",
"",
"Samsung Galaxy A53 5G GKK Armor 360 Full Protective Slim Back Matte Cover Case Casing",
"",
"HITAM",
"50.000",
"50.000",
1,
"50.000",
"0",
"0",
"0",
"100 gr",
1,
"100 gr",
"0",
"0",
"0",
"N",
"0",
"0",
0,
"0",
"10.000",
"0",
"0",
"61.000",
"10.000",
"Warna HITAM FULL",
"",
"sh9lwtzlse",
"BASRYBABAS",
"6281289298109",
"PERUMNAS BUMI TELUKJAMBE JL.BALADEWA Blok U no 285 (PERUMNNAS) (PERUMNNAS), KAB. KARAWANG, TELUKJAMBE TIMUR, JAWA BARAT, ID, 41331",
"KAB. KARAWANG",
"JAWA BARAT",
""
]
]
Response
{
"message": "Data fetched successfully",
"data": {
"TESTCREATEDBY": {
"invoice": "TESTCREATEDBY",
"awb": "JP7638199648",
"shippingCost": "10.000",
"note": "Warna HITAM FULL",
"customer_name": "BASRYBABAS",
"customer_number": "6281289297777",
"customer_address": "PERUMNAS BUMI TELUKJAMBE JL.BALADEWA Blok U no 285 (PERUMNNAS) (PERUMNNAS), KAB. KARAWANG, TELUKJAMBE TIMUR, JAWA BARAT, ID, 41331",
"cityName": "KAB. KARAWANG",
"provinceName": "JAWA BARAT",
"rawText": "TESTCREATEDBY|Perlu Dikirim||JP7638199648|Reguler (Cashless)-J&T Express|Antar ke Counter|2022-06-20 15:33||2022-06-16 11:49|2022-06-16 15:33||Samsung Galaxy A53 5G GKK Armor 360 Full Protective Slim Back Matte Cover Case Casing||HITAM|50.000|50.000|1|50.000|0|0|0|100 gr|1|100 gr|0|0|0|N|0|0|0|0|10.000|0|0|61.000|10.000|Warna HITAM FULL||sh9lwtzlse|BASRYBABAS|6281289298109|PERUMNAS BUMI TELUKJAMBE JL.BALADEWA Blok U no 285 (PERUMNNAS) (PERUMNNAS), KAB. KARAWANG, TELUKJAMBE TIMUR, JAWA BARAT, ID, 41331|KAB. KARAWANG|JAWA BARAT||",
"productDetected": [
{
"product": "",
"qty": 1,
"price": "50.000",
"text": "Samsung Galaxy A53 5G GKK Armor 360 Full Protective Slim Back Matte Cover Case Casing",
"notes": ""
}
],
"courierDetected": {
"courier": "17cd69d0-0c3d-4886-9c93-7977000bade1",
"status": "1",
"text": "Reguler (Cashless)-J&T Express"
}
}
}
}
API Proccessed List
Method ini digunakan untuk mendapatkan data order yang telah diproses (menuggu dikirim).
Request
| METHOD | URL |
|---|---|
| GET | http://apiv2.mitrabunso.com/public/order/orders/processed_list/{id_user} |
Parameter yang digunakan pada method ini adalah sebagai berikut:
| METHOD | Parameter | Wajib | Tipe | Keterangan |
|---|---|---|---|---|
| GET | id_user | YA | STRING | 36 character id user |
| HEAD | Authorization | YA | Bearer Token | Bearer Token Login |
| GET | q | TIDAK | STRING | Parameter untuk pencarian |
Response
{
"message": "data retrieved successfully",
"data": [
{
"totalLabels": "18",
"printStatus": "2",
"processed": "2022-09-02 16:11:21"
},
{
"totalLabels": "23",
"printStatus": "1",
"processed": "2022-07-15 10:35:16"
},
{
"totalLabels": "18",
"printStatus": "1",
"processed": "2022-07-15 10:11:36"
},
{
"totalLabels": "16",
"printStatus": "1",
"processed": "2022-07-15 09:53:50"
},
{
"totalLabels": "9",
"printStatus": "1",
"processed": "2022-07-15 09:32:06"
},
{
"totalLabels": "35",
"printStatus": "1",
"processed": "2022-07-15 09:11:16"
},
{
"totalLabels": "3",
"printStatus": "1",
"processed": "2022-07-14 17:36:01"
},
{
"totalLabels": "3",
"printStatus": "1",
"processed": "2022-07-14 17:26:12"
},
{
"totalLabels": "1",
"printStatus": "1",
"processed": "2022-07-14 17:21:42"
},
{
"totalLabels": "14",
"printStatus": "1",
"processed": "2022-07-14 17:12:31"
},
{
"totalLabels": "2",
"printStatus": "1",
"processed": "2022-07-14 17:07:25"
},
{
"totalLabels": "3",
"printStatus": "1",
"processed": "2022-07-14 17:02:25"
},
{
"totalLabels": "7",
"printStatus": "1",
"processed": "2022-07-14 16:54:29"
},
{
"totalLabels": "6",
"printStatus": "1",
"processed": "2022-07-14 16:48:00"
},
{
"totalLabels": "20",
"printStatus": "1",
"processed": "2022-07-14 16:30:11"
},
{
"totalLabels": "2",
"printStatus": "1",
"processed": "2022-07-14 16:28:38"
},
{
"totalLabels": "1",
"printStatus": "1",
"processed": "2022-07-14 16:24:30"
},
{
"totalLabels": "2",
"printStatus": "1",
"processed": "2022-07-14 16:04:23"
},
{
"totalLabels": "1",
"printStatus": "1",
"processed": "2022-07-14 15:59:02"
},
{
"totalLabels": "2",
"printStatus": "1",
"processed": "2022-07-14 15:36:34"
}
]
}
API Print Order
Method ini digunakan untuk mendapatkan data order yang akan di-print (label).
Request
| METHOD | URL |
|---|---|
| POST | http://apiv2.mitrabunso.com/public/order/orders/print_order/{id_user}/{timestamp}/{print_status} |
Parameter yang digunakan pada method ini adalah sebagai berikut:
| METHOD | Parameter | Wajib | Tipe | Keterangan |
|---|---|---|---|---|
| GET | id_user | YA | STRING | 36 character id user |
| GET | timestamp | YA | DATETIME | Waktu order diprosess |
| GET | print_status | YA | INT | Parameter penanda berapa kali API diakses (label telah diprint) |
| HEAD | Authorization | YA | Bearer Token | Bearer Token Login |
Response
{
"message": "data processed successfully",
"data": {
"data": [
{
"customer": {
"name": "Deasy",
"phone": "6282210177777",
"address": "Perum Mahkota Simprug, Jl. Mahkota V blok C2 no 8",
"provinceCode": "PR003",
"provinceName": "Banten",
"cityCode": "C021",
"cityName": "Kota Tangerang",
"districtCode": "D0226",
"districtName": "Ciledug",
"postCode": "15153"
},
"sender": {
"name": "Hoolo",
"phone": "6285375777777"
},
"order": {
"invoice": "INV20220714MPL2488808764",
"courierId": "66e7219a-2fc3-40b1-b795-baaccd9d894c",
"courierName": "GoSendInstant Courier",
"shippingCost": "51000",
"shopId": "13d15650-d87a-4fa3-9fd3-19435a73c752",
"shopName": "Tokopedia Hoolo",
"awb": null,
"adminNote": "PEMBELI BUTUH CEPAT",
"customerNote": null,
"totalCost": 105000,
"labelImage": null,
"printType": "2",
"assign": null,
"order_id": "7e676736-a970-4e8d-be81-e3a84875c137"
},
"details": [
{
"productId": "12e8b75c-f903-49bc-8ce1-d6031b7a2ca3",
"qty": 1,
"productPrice": 105000,
"totalPrice": 105000,
"productName": "DOUBLE GLASS Magnetic Samsung S10 Plus Silver "
}
]
}
],
"total": 1
}
}