Pricing (Instant)
Anda harus melakukan peningkatan sdk ke versi 1.2.0 untuk dapat menggunakan fitur ini https://github.com/kiriminaja/php/releases/tag/1.2.0
Disclaimer
Kami menggunakan base url yang berbeda dengan express, diharapkan untuk memperhatikan base url anda. Response yang disediakan api instant sedikit berbeda dengan api prod yaitu:
{
"status": true,
"text": "string",
"result": "object|null"
}
Disarankan untuk menggunakan SDK untuk pembungkus yang lebih baik
PHP
$payload = new ShippingPriceInstantData();
$payload->weight = 1000;
$payload->origin_address = "BOKO";
$payload->origin_long = 1.00;
$payload->origin_lat = 1.00;
$payload->destination_address = "BOKO";
$payload->destination_long = 1.00;
$payload->destination_lat = 1.00;
$payload->item_price = 1000;
$call = KiriminAja::getPriceInstant($payload);
Request
Param | Type | Nullable | Remark |
---|---|---|---|
service | array | yes | Bisa diisi dengan gosend , grab_express , dan borzo |
item_price | int | no | Nilai barang yang akan dikirim |
origin | object | no | Data pengirim (lihat tabel alamat dibawah) |
destination | object | no | Data penerima (lihat tabel alamat dibawah) |
weight | int | no | Berat barang yang akan dikirim dalam satuan gram |
Alamat
Param | Type | Nullable | Remark |
---|---|---|---|
lat | float | no | Latitude |
long | float | no | Longitude |
address | string | no | Detail alamat berupa nama jalan atau detail lain |
Response Sample
{
"status": true,
"text": "success",
"method": "mitra_pricing",
"result": [
{
"name": "gosend",
"costs": [
{
"service_type": "instant",
"estimation": "1-2 hours",
"price": {
"admin_fee": 1000,
"shipping_costs": 54000,
"total_price": 55000
}
},
{
"service_type": "sameday",
"estimation": "6-8 hours",
"price": {
"admin_fee": 1000,
"shipping_costs": 31500,
"total_price": 32500
}
}
],
"insurances": [
{
"value": 500,
"type": "silver"
},
{
"value": 1000,
"type": "gold"
}
]
},
{
"name": "borzo",
"costs": [
{
"service_type": "instant",
"estimation": null,
"price": {
"admin_fee": 1500,
"shipping_costs": 8800,
"total_price": 10300
}
}
],
"insurances": [
{
"value": 500,
"type": "silver"
},
{
"value": 1000,
"type": "gold"
}
]
}
],
"code": null
}
Table of Contents