MrSpeedy Business API 1.1
Overview
Business API allows you to automatically place delivery orders in MrSpeedy. You also can manage your orders and subscribe to updates on any changes in them.
First you should register as a client at apitest.mrspeedy.co. If you are unable to receive the SMS code when registering, please ask for it at api@mrspeedy.co, including your phone number in the email.
Integration of MrSpeedy Business API is done in two steps:
- Setting everything up using test environment at robotapitest.mrspeedy.co;
- When it works with apitest, you can switch to production at robot.mrspeedy.co.
When you have successfully tested Business API integration with apitest.mrspeedy.co, please email us at api@mrspeedy.co, so we can enable your access to Business API in production environment.
URL for test requests: https://robotapitest.mrspeedy.co/api/business/1.1
URL for production requests: https://robot.mrspeedy.co/api/business/1.1
API versions are increased with incompatible changes, e.g. changes to data types or removal of request parameters. Non-latest API versions will still be supported for some reasonable time. New requests and parameters in existing requests (e.g. a new field in order structure) can be added at any time without new API versions. You should ignore unknown fields in any API data structures.
If you have any questions or suggestions about the API, please email our support at api@mrspeedy.co.
Requests
All requests to Business API must be made via HTTPS. Only GET and POST request methods are supported. POST requests should send all parameters in the body of the request in JSON format and UTF-8 encoding; GET requests should send parameters in the query string.
All requests must include a HTTP header X-DV-Auth-Token
.
- X-DV-Auth-Token string Required
Secret auth token. Must be sent as a HTTP header.
Your auth token can be found in your Personal cabinet.
Important! Never put your auth token in any public places!
If your token is compromised, it will be possible for anybody to place orders in your name.
Tokens can be changed in your Personal cabinet.
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' 'https://robotapitest.mrspeedy.co/api/business/1.1'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true
}
Responses
Business API responses are in JSON format and UTF-8 encoding.
Successful responses will have HTTP code 200 (OK). Response JSON will always have is_successful
field.
- is_successful boolean
Whether the request was successful or not.
Successful responses will have
true
here.
If there was an error, API response will have HTTP code 400 (Bad Request). The response JSON will have the following fields:
- is_successful boolean
Whether the request was successful or not.
In case of any errors it will be
false
. - errors list
List of error codes.
-
Error codes for request parameters. If
errors
field contains error codeinvalid_parameters
, this field will have detailed parameter errors. Structure of this object corresponds to structure of the request.
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' --data '{"points":[{"address":"JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310","contact_person":{"phone":"6288800000001"}},{}]}' 'https://robotapitest.mrspeedy.co/api/business/1.1/create-order'
HTTP/1.1 400 Bad Request
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": false,
"errors": ["invalid_parameters"],
"parameter_errors": {
"matter": ["required"],
"points": [
null,
{
"address": ["required"],
"contact_person": {
"phone": ["required"]
}
}
]
}
}
API methods
Order price calculation
Use this method to calculate order prices and validate parameters before actually placing the order. It is possible to calculate an incomplete order, but such calculations may be imprecise.
In response to an empty request this method will respond with minimal order price.
You can learn more about our prices at the tariffs page.
Request parameters
-
Delivery contents. Maximum length is 5,000 characters.
Try to make this description useful for the courier. For example, putting a category from your catalog here is better than only a concrete model number. If the item is fragile or oversized, please mention it here.
Default value:
null
. - vehicle_type_id integer
- total_weight_kg integer
Total weight in kilograms.
Default value:
0
. - insurance_amount money
Insured amount.
Default value:
"0.00"
. - is_client_notification_enabled boolean
Whether to send SMS notifications to the client.
Default value:
false
. - is_contact_person_notification_enabled boolean
Whether to send SMS notifications to recipients on addresses.
Default value:
false
. - is_route_optimizer_enabled boolean
Automatically optimize route (addresses will be arranged in the optimal order).
Default value:
false
. - loaders_count integer
Number of necessary loaders to move the delivered goods, including the driver. Maximum is 11.
Default value: 0.
- is_motobox_required boolean
Is motobox required.
Default value:
false
. - payment_method string
Payment method (if different from default).
Default value:
null
. - bank_card_id integer
Bank card ID (required for
bank_card
payment method).Default value:
null
. - points list
List of addresses (points) for the courier to visit. Maximum is 99 points.
Default value:
[]
.- contact_person object
Contact person on the address.
- latitude coordinate / null
Latitude of the location.
Default value:
null
. - longitude coordinate / null
Longitude of the location.
Default value:
null
. - taking_amount money
Backpayment sum to receive from the contact person at the address.
Default value:
"0.00"
. - buyout_amount money
Buyout sum the courier pays to the contact person at the address.
Default value:
"0.00"
. - is_order_payment_here boolean
Money will be paid to the courier at the address.
Default value:
false
. - is_cod_cash_voucher_required boolean
Whether to issue a cashier's check to the recipient at the point.
Default value:
false
. - packages list
Response parameters
- is_successful boolean
Whether the request was successful or not.
- order object
Calculated order data.
- vehicle_type_id integer
Vehicle type.
- total_weight_kg integer
Total weight in kilograms.
- is_client_notification_enabled boolean
Whether to send SMS notifications to the client.
- is_contact_person_notification_enabled boolean
Whether to send SMS notifications to recipients on addresses.
- loaders_count integer
Number of necessary loaders to move the delivered goods, including the driver.
- points list
List of addresses (points) for the courier to visit.
- contact_person object
Contact person on the address.
- latitude coordinate / null
Latitude of the location.
- longitude coordinate / null
Longitude of the location.
- taking_amount money
Backpayment sum to receive from the contact person at the address.
- buyout_amount money
Buyout sum the courier pays to the contact person at the address.
- packages list
List of packages at the point.
- is_cod_cash_voucher_required boolean
Whether to issue a cashier's check to the recipient at the point.
- is_order_payment_here boolean
Money will be paid to the courier at the address.
-
Checkin information when closing a point at the address.
- payment_amount money
Order price.
- delivery_fee_amount money
Delivery fee.
Part of order price (
payment_amount
). - weight_fee_amount money
Large weight fee.
Part of order price (
payment_amount
). - insurance_amount money
Insured amount.
- insurance_fee_amount money
Insurance fee.
Part of order price (
payment_amount
). - loading_fee_amount money
Loading / heavy lifting fee.
Part of order price (
payment_amount
). - money_transfer_fee_amount money
Money handling fee: backpayment transfer, buyout operations.
Part of order price (
payment_amount
). - suburban_delivery_fee_amount money
Extra fee for suburban parts of the courier's route.
Part of order price (
payment_amount
). - overnight_fee_amount money
Extra fee for overnight parts of the courier's route.
Part of order price (
payment_amount
). - discount_amount money
Discount amount.
Part of order price (
payment_amount
). - cod_fee_amount money
Extra fee for issuing a cashier's check.
Part of order price (
payment_amount
). - is_motobox_required boolean
Is motobox required.
- warnings list
Warnings. You will receive these warnings as error codes if you try to create an order with the same data you calculated it with. Empty list of warnings means the order data is valid.
- parameter_warnings object
Parameter warnings. You will receive these warnings as parameter error codes if you try to create an order with the same data you calculated it with.
Request example
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' --data '{"matter":"Documents","points":[{"address":"JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310"},{"address":"Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540"}]}' 'https://robotapitest.mrspeedy.co/api/business/1.1/calculate-order'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": null,
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": null,
"status_description": null,
"matter": "Documents",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": null,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": "2021-01-22T14:04:20+07:00"
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": null
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": null,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": "2021-01-22T15:04:20+07:00"
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": null
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
},
"warnings": ["invalid_parameters"],
"parameter_warnings": {
"points": [{
"contact_person": {
"phone": ["required"]
}
}, {
"contact_person": {
"phone": ["required"]
}
}]
}
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/calculate-order');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data = [
'matter' => 'Documents',
'points' => [
[
'address' => 'JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310',
],
[
'address' => 'Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540',
],
],
];
$json = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": null,
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": null,
"status_description": null,
"matter": "Documents",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": null,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": "2021-01-22T14:04:20+07:00"
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": null
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": null,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": "2021-01-22T15:04:20+07:00"
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": null
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
},
"warnings": ["invalid_parameters"],
"parameter_warnings": {
"points": [{
"contact_person": {
"phone": ["required"]
}
}, {
"contact_person": {
"phone": ["required"]
}
}]
}
}
Placing an order
This API method creates a new delivery order.
Request parameters
- matter string Required
Delivery contents. Maximum length is 5,000 characters.
Try to make this description useful for the courier. For example, putting a category from your catalog here is better than only a concrete model number. If the item is fragile or oversized, please mention it here.
- vehicle_type_id integer
- total_weight_kg integer
Total weight in kilograms.
Default value:
0
. - insurance_amount money
Insured amount.
Default value:
"0.00"
. - is_client_notification_enabled boolean
Whether to send SMS notifications to the client.
Default value:
false
. - is_contact_person_notification_enabled boolean
Whether to send SMS notifications to recipients on addresses.
Default value:
false
. - is_route_optimizer_enabled boolean
Automatically optimize route (addresses will be arranged in the optimal order).
Default value:
false
. - loaders_count integer
Number of necessary loaders to move the delivered goods, including the driver. Maximum is 11.
Default value: 0.
- is_motobox_required boolean
Is motobox required.
Default value:
false
. - payment_method string
Payment method (if different from default).
Default value:
null
. - bank_card_id integer
Bank card ID (required for
bank_card
payment method).Default value:
null
. - points list Required
List of addresses (points) for the courier to visit. The order can contain from 2 to 99 points.
Default value:
[]
.- address string Required
Street address. Maximum length is 350 characters.
We use Google Maps API to geocode addresses.
- contact_person object Required
Contact person on the address.
- phone phone Required
Phone number of the person at the address.
-
- latitude coordinate / null
Latitude of the location.
Default value:
null
. - longitude coordinate / null
Longitude of the location.
Default value:
null
. - taking_amount money
Backpayment sum to receive from the contact person at the address.
Default value:
"0.00"
. - buyout_amount money
Buyout sum the courier pays to the contact person at the address.
Default value:
"0.00"
. - is_order_payment_here boolean
Money will be paid to the courier at the address.
Default value:
false
. - is_cod_cash_voucher_required boolean
Whether to issue a cashier's check to the recipient at the point.
Default value:
null
. - packages list
- ware_code string Required
Vendor code. Maximum length is 255 characters.
Default value:
null
. - description string Required
Description. Maximum length is 1000 characters.
Default value:
null
. - items_count float Required
Amount.
Default value:
0
. - item_payment_amount string Required
Price per item.
Default value:
"0.00"
.
-
-
Response parameters
- is_successful boolean
Whether the request was successful or not.
- order object
The created order.
- order_id integer
Full order ID.
- matter string
Delivery contents.
- order_name string
Order name (short order ID).
- vehicle_type_id integer
Vehicle type.
- created_datetime timestamp
Order creation date and time.
- status string
Order status.
- status_description string
Order status description.
- total_weight_kg integer
Total weight in kilograms.
- is_client_notification_enabled boolean
Whether to send SMS notifications to the client.
- is_contact_person_notification_enabled boolean
Whether to send SMS notifications to recipients on addresses.
- loaders_count integer
Number of necessary loaders to move the delivered goods, including the driver.
- points list
List of addresses (points) for the courier to visit.
- point_id integer
Point ID.
- address string
Street address.
- contact_person object
Contact person on the address.
- phone phone
Phone number of the person at the address.
-
- latitude coordinate
Latitude of the location.
- longitude coordinate
Longitude of the location.
- taking_amount money
Backpayment sum to receive from the contact person at the address.
- buyout_amount money
Buyout sum the courier pays to the contact person at the address.
- packages list
List of packages at the point.
- is_cod_cash_voucher_required boolean
Whether to issue a cashier's check to the recipient at the address.
- is_order_payment_here boolean
Money will be paid to the courier at the address.
-
Checkin information when closing a point at the address.
-
- payment_amount money
Order price.
- delivery_fee_amount money
Delivery fee.
Part of order price (
payment_amount
). - weight_fee_amount money
Large weight fee.
Part of order price (
payment_amount
). - insurance_amount money
Insured amount.
- insurance_fee_amount money
Insurance fee.
Part of order price (
payment_amount
). - loading_fee_amount money
Loading / heavy lifting fee.
Part of order price (
payment_amount
). - money_transfer_fee_amount money
Money handling fee: backpayment transfer, buyout operations.
Part of order price (
payment_amount
). - suburban_delivery_fee_amount money
Extra fee for suburban parts of the courier's route.
Part of order price (
payment_amount
). - overnight_fee_amount money
Extra fee for overnight parts of the courier's route.
Part of order price (
payment_amount
). - discount_amount money
Discount amount.
Part of order price (
payment_amount
). - cod_fee_amount money
Extra fee for issuing a cashier's check.
Part of order price (
payment_amount
). -
Courier parameters.
- courier_id integer
Courier ID.
- surname string
Surname of the courier.
- name string
Name of the courier.
- middlename string
Middlename of the courier.
- phone phone
Phone of the courier.
- latitude coordinate / null
Latitude of the location.
Only for active orders, if the courier is on the way.
- longitude coordinate / null
Longitude of the location.
Only for active orders, if the courier is on the way.
-
- is_motobox_required boolean
Is motobox required.
- payment_method string
Payment method.
-
Request example
Example 1. Create order with default payment method.
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' --data '{"matter":"Documents","points":[{"address":"JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310","contact_person":{"phone":"6288800000001"}},{"address":"Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540","contact_person":{"phone":"6288800000001"}}]}' 'https://robotapitest.mrspeedy.co/api/business/1.1/create-order'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Documents",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/create-order');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data = [
'matter' => 'Documents',
'points' => [
[
'address' => 'JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310',
'contact_person' => [
'phone' => '6288800000001',
],
],
[
'address' => 'Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540',
'contact_person' => [
'phone' => '6288800000001',
],
],
],
];
$json = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Documents",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}
}
Example 2. Create order with bank_card
payment method.
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' --data '{"matter":"Documents","payment_method":"bank_card","bank_card_id":80,"points":[{"address":"JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310","contact_person":{"phone":"6288800000001"}},{"address":"Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540","contact_person":{"phone":"6288800000001"}}]}' 'https://robotapitest.mrspeedy.co/api/business/1.1/create-order'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Documents",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "bank_card",
"bank_card_id": 80
}
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/create-order');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data = [
'matter' => 'Documents',
'payment_method' => 'bank_card',
'bank_card_id' => 80,
'points' => [
[
'address' => 'JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310',
'contact_person' => [
'phone' => '6288800000001',
],
],
[
'address' => 'Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540',
'contact_person' => [
'phone' => '6288800000001',
],
],
],
];
$json = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Documents",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "bank_card",
"bank_card_id": 80
}
}
Example 3. Create order from draft deliveries. First point cannot be delivery.
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' --data '{"matter":"Documents","points":[{"address":"JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310","contact_person":{"phone":"6288800000001"}},{"delivery_id":11712,"address":"Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540","contact_person":{"phone":"6288800000001"}}]}' 'https://robotapitest.mrspeedy.co/api/business/1.1/create-order'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Documents",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": 11712,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/create-order');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data = [
'matter' => 'Documents',
'points' => [
[
'address' => 'JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310',
'contact_person' => [
'phone' => '6288800000001',
],
],
[
'delivery_id' => 11712,
'address' => 'Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540',
'contact_person' => [
'phone' => '6288800000001',
],
],
],
];
$json = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Documents",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": 11712,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}
}
Order editing
This API method can be used to edit an order in statuses: new
, available
, active
or delayed
(Order statuses).
Request parameters
- order_id integer Required
Full order ID.
To edit the order, send any number of extra parameters from order creation.
If modified value is valid, it will be applied to the order.
If a parameter is not sent with the request, its value will not be changed.
If a parameter is sent with null
value, corresponding value will be removed from the order.
When editing a point, always send its ID along with changed values, otherwise a new point will be added to the order. Also, any points with IDs not mentioned in the request will be deleted.
When editing a package, always send its ID along with changed values, otherwise a new package will be added to the point. Also, any packages with IDs not mentioned in the request will be deleted.
See order editing examples to avoid pitfalls.
Response parameters
- is_successful boolean
Whether the request was successful or not.
- order object
Modified order data.
- order_id integer
Full order ID.
- matter string
Delivery contents.
- order_name string
Order name (short order ID).
- vehicle_type_id integer
Vehicle type.
- created_datetime timestamp
Order creation date and time.
- status string
Order status.
- status_description string
Order status description.
- total_weight_kg integer
Total weight in kilograms.
- is_client_notification_enabled boolean
Whether to send SMS notifications to the client.
- is_contact_person_notification_enabled boolean
Whether to send SMS notifications to recipients on addresses.
- loaders_count integer
Number of necessary loaders to move the delivered goods, including the driver.
- points list
List of addresses (points) for the courier to visit.
- point_id integer
Point ID.
- address string
Street address.
- contact_person object
Contact person on the address.
- phone phone
Phone number of the person at the address.
-
- latitude coordinate
Latitude of the location.
- longitude coordinate
Longitude of the location.
- taking_amount money
Backpayment sum to receive from the contact person at the address.
- buyout_amount money
Buyout sum the courier pays to the contact person at the address.
- packages list
List of packages at the point.
- is_cod_cash_voucher_required boolean
Whether to issue a cashier's check to the recipient at the address.
- is_order_payment_here boolean
Money will be paid to the courier at the address.
-
Checkin information when closing a point at the address.
-
- payment_amount money
Order price.
- delivery_fee_amount money
Delivery fee.
Part of order price (
payment_amount
). - weight_fee_amount money
Large weight fee.
Part of order price (
payment_amount
). - insurance_amount money
Insured amount.
- insurance_fee_amount money
Insurance fee.
Part of order price (
payment_amount
). - loading_fee_amount money
Loading / heavy lifting fee.
Part of order price (
payment_amount
). - money_transfer_fee_amount money
Money handling fee: backpayment transfer, buyout operations.
Part of order price (
payment_amount
). - suburban_delivery_fee_amount money
Extra fee for suburban parts of the courier's route.
Part of order price (
payment_amount
). - overnight_fee_amount money
Extra fee for overnight parts of the courier's route.
Part of order price (
payment_amount
). - discount_amount money
Discount amount.
Part of order price (
payment_amount
). - cod_fee_amount money
Extra fee for issuing a cashier's check.
Part of order price (
payment_amount
). -
Courier parameters.
- courier_id integer
Courier ID.
- surname string
Surname of the courier.
- name string
Name of the courier.
- middlename string
Middlename of the courier.
- phone phone
Phone of the courier.
- latitude coordinate / null
Latitude of the location.
Only for active orders, if the courier is on the way.
- longitude coordinate / null
Longitude of the location.
Only for active orders, if the courier is on the way.
-
- is_motobox_required boolean
Is motobox required.
- payment_method string
Payment method.
-
Request example
Example 1. Changing delivery details (matter
) and removing backpayment details (backpayment_details
).
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' --data '{"order_id":1250032,"matter":"Flowers","backpayment_details":null}' 'https://robotapitest.mrspeedy.co/api/business/1.1/edit-order'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Flowers",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/edit-order');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data = [
'order_id' => 1250032,
'matter' => 'Flowers',
'backpayment_details' => null,
];
$json = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Flowers",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}
}
Example 2. Modifying times on a point and adding a new point. First point should be kept as it was.
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' --data '{"order_id":1250032,"points":[{"point_id":202685},{"point_id":202686,"required_start_datetime":"2021-01-22T15:04:20+07:00","required_finish_datetime":"2021-01-22T15:34:20+07:00"},{"address":"JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310","contact_person":{"phone":"6288800000001"}}]}' 'https://robotapitest.mrspeedy.co/api/business/1.1/edit-order'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Flowers",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202687,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T16:04:20+07:00",
"required_finish_datetime": "2021-01-22T16:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/edit-order');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data = [
'order_id' => 1250032,
'points' => [
[
'point_id' => 202685,
],
[
'point_id' => 202686,
'required_start_datetime' => '2021-01-22T15:04:20+07:00',
'required_finish_datetime' => '2021-01-22T15:34:20+07:00',
],
[
'address' => 'JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310',
'contact_person' => [
'phone' => '6288800000001',
],
],
],
];
$json = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Flowers",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202687,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T16:04:20+07:00",
"required_finish_datetime": "2021-01-22T16:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}
}
Example 3. Removing third point from the order.
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' --data '{"order_id":1250032,"points":[{"point_id":202685},{"point_id":202686}]}' 'https://robotapitest.mrspeedy.co/api/business/1.1/edit-order'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Flowers",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/edit-order');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data = [
'order_id' => 1250032,
'points' => [
[
'point_id' => 202685,
],
[
'point_id' => 202686,
],
],
];
$json = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Flowers",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}
}
Example 4. Modifying attributes of a package on second point, remove package on third point, and keep package on first point.
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' --data '{"order_id":1250032,"points":[{"point_id":202685, "packages": [{"order_package_id": 3632252}]},{"point_id":202686, "packages": [{"order_package_id": 3632253, "items_count": 3}]},{"point_id": 202687}]}' 'https://robotapitest.mrspeedy.co/api/business/1.1/edit-order'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Flowers",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [{
"order_package_id": 3632252,
"ware_code": "140012",
"description": "Payung",
"items_count": 1,
"item_payment_amount": 30000.00
}],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [{
"order_package_id": 3632253,
"ware_code": "100112",
"description": "Topi",
"items_count": 3,
"item_payment_amount": 42000.00
}],
"is_cod_cash_voucher_required": true,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202687,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T16:04:20+07:00",
"required_finish_datetime": "2021-01-22T16:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "3600.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/edit-order');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data = [
'order_id' => 1250032,
'points' => [
[
'point_id' => 202685,
'packages' => [
[
'order_package_id' => 3632252,
]
],
],
[
'point_id' => 202686,
'packages' => [
[
'order_package_id' => 3632253,
'items_count' => 3,
]
],
],
[
'point_id' => 202687,
],
],
];
$json = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Flowers",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [{
"order_package_id": 3632252,
"ware_code": "140012",
"description": "Payung",
"items_count": 1,
"item_payment_amount": 30000.00
}],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [{
"order_package_id": 3632253,
"ware_code": "100112",
"description": "Topi",
"items_count": 3,
"item_payment_amount": 42000.00
}],
"is_cod_cash_voucher_required": true,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202687,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T16:04:20+07:00",
"required_finish_datetime": "2021-01-22T16:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "3600.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}
}
Canceling an order
You may cancel an order in statuses: new
, available
, active
or delayed
(Order statuses). If a courier has visited any addresses, the order cannot be canceled.
Request parameters
- order_id integer Required
Full order ID to cancel.
Response parameters
- is_successful boolean
Whether the request was successful or not.
- order object
Canceled order data.
- order_id integer
Full order ID.
- matter string
Delivery contents.
- order_name string
Order name (short order ID).
- vehicle_type_id integer
Vehicle type.
- created_datetime timestamp
Order creation date and time.
- status string
Order status.
- status_description string
Order status description.
- total_weight_kg integer
Total weight in kilograms.
- is_client_notification_enabled boolean
Whether to send SMS notifications to the client.
- is_contact_person_notification_enabled boolean
Whether to send SMS notifications to recipients on addresses.
- loaders_count integer
Number of necessary loaders to move the delivered goods, including the driver.
- points list
List of addresses (points) for the courier to visit.
- point_id integer
Point ID.
- address string
Street address.
- contact_person object
Contact person on the address.
- phone phone
Phone number of the person at the address.
-
- latitude coordinate
Latitude of the location.
- longitude coordinate
Longitude of the location.
- taking_amount money
Backpayment sum to receive from the contact person at the address.
- buyout_amount money
Buyout sum the courier pays to the contact person at the address.
- packages list
List of packages at the point.
- is_cod_cash_voucher_required boolean
Whether to issue a cashier's check to the recipient at the address.
- is_order_payment_here boolean
Money will be paid to the courier at the address.
-
Checkin information when closing a point at the address.
-
- payment_amount money
Order price.
- delivery_fee_amount money
Delivery fee.
Part of order price (
payment_amount
). - weight_fee_amount money
Large weight fee.
Part of order price (
payment_amount
). - insurance_amount money
Insured amount.
- insurance_fee_amount money
Insurance fee.
Part of order price (
payment_amount
). - loading_fee_amount money
Loading / heavy lifting fee.
Part of order price (
payment_amount
). - money_transfer_fee_amount money
Money handling fee: backpayment transfer, buyout operations.
Part of order price (
payment_amount
). - suburban_delivery_fee_amount money
Extra fee for suburban parts of the courier's route.
Part of order price (
payment_amount
). - overnight_fee_amount money
Extra fee for overnight parts of the courier's route.
Part of order price (
payment_amount
). - discount_amount money
Discount amount.
Part of order price (
payment_amount
). - cod_fee_amount money
Extra fee for issuing a cashier's check.
Part of order price (
payment_amount
). -
Courier parameters.
- courier_id integer
Courier ID.
- surname string
Surname of the courier.
- name string
Name of the courier.
- middlename string
Middlename of the courier.
- phone phone
Phone of the courier.
- latitude coordinate / null
Latitude of the location.
Only for active orders, if the courier is on the way.
- longitude coordinate / null
Longitude of the location.
Only for active orders, if the courier is on the way.
-
- is_motobox_required boolean
Is motobox required.
- payment_method string
Payment method.
-
Request example
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' --data '{"order_id":1250032}' 'https://robotapitest.mrspeedy.co/api/business/1.1/cancel-order'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "canceled",
"status_description": "Pelanggan tidak merespons",
"matter": "Documents",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/cancel-order');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data = [
'order_id' => 1250032,
];
$json = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true,
"order": {
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "canceled",
"status_description": "Pelanggan tidak merespons",
"matter": "Documents",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}
}
List of orders
Use this API method to retrieve a list of your orders. The list is sorted by order_id
, descending.
Request parameters
Response parameters
- is_successful boolean
Whether the request was successful or not.
- orders list
List of orders.
- order_id integer
Full order ID.
- matter string
Delivery contents.
- order_name string
Order name (short order ID).
- vehicle_type_id integer
Vehicle type.
- created_datetime timestamp
Order creation date and time.
- status string
Order status.
- status_description string
Order status description.
- total_weight_kg integer
Total weight in kilograms.
- is_client_notification_enabled boolean
Whether to send SMS notifications to the client.
- is_contact_person_notification_enabled boolean
Whether to send SMS notifications to recipients on addresses.
- loaders_count integer
Number of necessary loaders to move the delivered goods, including the driver.
- points list
List of addresses (points) for the courier to visit.
- point_id integer
Point ID.
- address string
Street address.
- contact_person object
Contact person on the address.
- phone phone
Phone number of the person at the address.
-
- latitude coordinate
Latitude of the location.
- longitude coordinate
Longitude of the location.
- taking_amount money
Backpayment sum to receive from the contact person at the address.
- buyout_amount money
Buyout sum the courier pays to the contact person at the address.
- packages list
List of packages at the point.
- is_cod_cash_voucher_required boolean
Whether to issue a cashier's check to the recipient at the address.
- is_order_payment_here boolean
Money will be paid to the courier at the address.
-
Checkin information when closing a point at the address.
-
- payment_amount money
Order price.
- delivery_fee_amount money
Delivery fee.
Part of order price (
payment_amount
). - weight_fee_amount money
Large weight fee.
Part of order price (
payment_amount
). - insurance_amount money
Insured amount.
- insurance_fee_amount money
Insurance fee.
Part of order price (
payment_amount
). - loading_fee_amount money
Loading / heavy lifting fee.
Part of order price (
payment_amount
). - money_transfer_fee_amount money
Money handling fee: backpayment transfer, buyout operations.
Part of order price (
payment_amount
). - suburban_delivery_fee_amount money
Extra fee for suburban parts of the courier's route.
Part of order price (
payment_amount
). - overnight_fee_amount money
Extra fee for overnight parts of the courier's route.
Part of order price (
payment_amount
). - discount_amount money
Discount amount.
Part of order price (
payment_amount
). - cod_fee_amount money
Extra fee for issuing a cashier's check.
Part of order price (
payment_amount
). -
Courier parameters.
- courier_id integer
Courier ID.
- surname string
Surname of the courier.
- name string
Name of the courier.
- middlename string
Middlename of the courier.
- phone phone
Phone of the courier.
- latitude coordinate / null
Latitude of the location.
Only for active orders, if the courier is on the way.
- longitude coordinate / null
Longitude of the location.
Only for active orders, if the courier is on the way.
-
- is_motobox_required boolean
Is motobox required.
- payment_method string
Payment method.
-
- orders_count integer
Total number of found orders for pagination.
Request example
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' 'https://robotapitest.mrspeedy.co/api/business/1.1/orders?status=available'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true,
"orders": [{
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Flowers",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}, {
"order_id": 1250035,
"order_name": "50035",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Flowers",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202694,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202695,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}],
"orders_count": 2
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/orders?status=available');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true,
"orders": [{
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Flowers",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}, {
"order_id": 1250035,
"order_name": "50035",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Flowers",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202694,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}, {
"point_id": 202695,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"estimated_arrival_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}],
"orders_count": 2
}
Courier info and courier location
Use this API method to retrieve a courier info for your order.
If order has status active
(Order statuses) and the courier is on the way, courier location will be returned.
Request parameters
- order_id integer Required
Full order ID to search courier for.
Response parameters
- is_successful boolean
Whether the request was successful or not.
-
Courier parameters.
- courier_id integer
Courier ID.
- surname string
Surname of the courier.
- name string
Name of the courier.
- middlename string
Middlename of the courier.
- phone phone
Phone of the courier.
- latitude coordinate / null
Latitude of the location.
Only for active orders, if the courier is on the way.
- longitude coordinate / null
Longitude of the location.
Only for active orders, if the courier is on the way.
-
Request example
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' 'https://robotapitest.mrspeedy.co/api/business/1.1/courier?order_id=1250032'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true,
"courier": {
"courier_id": 72384,
"surname": "Surname",
"name": "Name",
"middlename": null,
"phone": "6288800000001",
"photo_url": null,
"latitude": "-6.2914558",
"longitude": "106.8322649"
}
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/courier?order_id=1250032');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true,
"courier": {
"courier_id": 72384,
"surname": "Surname",
"name": "Name",
"middlename": null,
"phone": "6288800000001",
"photo_url": null,
"latitude": "-6.2914558",
"longitude": "106.8322649"
}
}
Client profile info
Use this API method to retrieve a client info with allowed payment methods.
Response parameters
- is_successful boolean
Whether the request was successful or not.
- client object
Client parameters.
- legal_type string
Legal type.
- allowed_payment_methods list
Allowed payment methods.
Request example
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' 'https://robotapitest.mrspeedy.co/api/business/1.1/client'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true,
"client": {
"name": "Name",
"phone": "6288800000001",
"email": "test@example.com",
"legal_type": "individual_person",
"allowed_payment_methods": [
"cash",
"bank_card"
]
}
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/client');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true,
"client": {
"name": "Name",
"phone": "6288800000001",
"email": "test@example.com",
"legal_type": "individual_person",
"allowed_payment_methods": [
"cash",
"bank_card"
]
}
}
Available bank cards
Use this API method to retrieve available bank cards to use them in order creation.
Response parameters
Request example
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' 'https://robotapitest.mrspeedy.co/api/business/1.1/bank-cards'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true,
"bank_cards": [
{
"bank_card_id": 80,
"bank_card_number_mask": "411111XXXXXX1111",
"expiration_date": "2029-01-31",
"card_type": "visa"
}
]
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/bank-cards');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true,
"bank_cards": [
{
"bank_card_id": 80,
"bank_card_number_mask": "411111XXXXXX1111",
"expiration_date": "2029-01-31",
"card_type": "visa"
}
]
}
Create draft deliveries
This API method creates a new draft deliveries.
Request parameters
- deliveries list Required
List of deliveries.
- delivery_type string
Delivery type (for now its only
plain
supported).Default value:
plain
- contact_person object Required
Contact person on the address.
- phone phone Required
Phone number of the person at the address.
-
- address string Required
Street address. Maximum length is 350 characters.
We use Google Maps API to geocode addresses.
- taking_amount money
Backpayment sum to receive from the contact person at the address.
Default value:
"0.00"
. - buyout_amount money
Buyout sum the courier pays to the contact person at the address.
Default value:
"0.00"
. - is_cod_cash_voucher_required boolean
Whether to issue a cashier's check to the recipient at the point.
Default value:
null
. - is_motobox_required boolean
Is motobox required.
Default value:
false
. - is_door_to_door boolean
Delivery from door to door.
Default value:
false
. - is_return_to_first_point_required boolean
Is return to pick-up point required.
Default value:
false
. - matter string Required
Delivery contents. Maximum length is 5,000 characters.
Try to make this description useful for the courier. For example, putting a category from your catalog here is better than only a concrete model number. If the item is fragile or oversized, please mention it here.
- insurance_amount money
Insured amount.
Default value:
"0.00"
. - weight_kg integer Required
Weight in kilograms.
- packages list
- ware_code string Required
Vendor code. Maximum length is 255 characters.
Default value:
null
. - description string Required
Description. Maximum length is 1000 characters.
Default value:
null
. - items_count float Required
Amount.
Default value:
0
. - item_payment_amount money Required
Price per item.
Default value:
"0.00"
.
-
-
Response parameters
- is_successful boolean
Whether the request was successful or not.
- deliveries list
List of created deliveries.
- delivery_id integer
Unique delivery ID.
- delivery_type string
Delivery type (for now its only
plain
supported). - client_id integer
Client ID.
- address string
Street address.
- status string
Delivery status.
- status_datetime timestamp
Delivery status change date and time.
- created_datetime timestamp
Delivery creation date and time.
- contact_person object
Contact person on the address.
- required_start_datetime timestamp
How early the courier may arrive at the address.
- required_finish_datetime timestamp
How late the courier may arrive at the address.
- taking_amount money
Backpayment sum to receive from the contact person at the address.
- buyout_amount money
Buyout sum the courier pays to the contact person at the address.
- is_cod_cash_voucher_required boolean
Whether to issue a cashier's check to the recipient at the address.
- is_motobox_required boolean
Is motobox required (only for draft).
- is_door_to_door boolean
Delivery from door to door (only for draft).
- is_return_to_first_point_required boolean
Is return to pick-up point required (only for draft).
- insurance_amount money
Insured amount (only for draft).
- weight_kg integer
Weight, in kilograms (only for draft).
-
Courier parameters.
- courier_id integer
Courier ID.
- surname string
Surname of the courier.
- name string
Name of the courier.
- middlename string
Middlename of the courier.
- phone phone
Phone of the courier.
- latitude coordinate / null
Latitude of the location.
Only for active orders, if the courier is on the way.
- longitude coordinate / null
Longitude of the location.
Only for active orders, if the courier is on the way.
-
- packages list
List of packages at the delivery point.
-
Request example
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' --data '{"deliveries":[{"matter":"Documents","address":"JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310","weight_kg":1,"contact_person":{"phone":"6288800000001"}},{"matter":"Flowers","address":"Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540","weight_kg":2,"contact_person":{"phone":"6288800000001"}}]}' 'https://robotapitest.mrspeedy.co/api/business/1.1/create-deliveries'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true,
"deliveries": [
{
"delivery_id": 11712,
"delivery_type": "plain",
"order_id": null,
"client_id": 180179,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"status": "draft",
"status_datetime": "2021-01-22T13:34:20+07:00",
"created_datetime": "2021-01-22T13:34:20+07:00",
"order_name": null,
"order_payment_amount": null,
"delivery_price_amount": null,
"point_id": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"note": null,
"building_number": null,
"apartment_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"invisible_mile_navigation_instructions": null,
"required_start_datetime": null,
"required_finish_datetime": null,
"taking_amount": "0.00",
"buyout_amount": "0.00",
"is_cod_cash_voucher_required": false,
"is_motobox_required": false,
"is_door_to_door": false,
"is_return_to_first_point_required": false,
"matter": "Documents",
"insurance_amount": "0.00",
"weight_kg": 1,
"packages": [],
"checkin_issue_name": null
},
{
"delivery_id": 11713,
"delivery_type": "plain",
"order_id": null,
"client_id": 180179,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"status": "draft",
"status_datetime": "2021-01-22T13:34:20+07:00",
"created_datetime": "2021-01-22T13:34:20+07:00",
"order_name": null,
"order_payment_amount": null,
"delivery_price_amount": null,
"point_id": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"note": null,
"building_number": null,
"apartment_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"invisible_mile_navigation_instructions": null,
"required_start_datetime": null,
"required_finish_datetime": null,
"taking_amount": "0.00",
"buyout_amount": "0.00",
"is_cod_cash_voucher_required": false,
"is_motobox_required": false,
"is_door_to_door": false,
"is_return_to_first_point_required": false,
"matter": "Flowers",
"insurance_amount": "0.00",
"weight_kg": 2,
"packages": [],
"checkin_issue_name": null
}
]
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/create-deliveries');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data = [
'deliveries' => [
[
'matter' => 'Documents',
'address' => 'JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310',
'weight_kg' => 1,
'contact_person' => [
'phone' => '6288800000001',
],
],
[
'matter' => 'Flowers',
'address' => 'Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540',
'weight_kg' => 2,
'contact_person' => [
'phone' => '6288800000001',
],
],
],
];
$json = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true,
"deliveries": [
{
"delivery_id": 11712,
"delivery_type": "plain",
"order_id": null,
"client_id": 180179,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"status": "draft",
"status_datetime": "2021-01-22T13:34:20+07:00",
"created_datetime": "2021-01-22T13:34:20+07:00",
"order_name": null,
"order_payment_amount": null,
"delivery_price_amount": null,
"point_id": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"note": null,
"building_number": null,
"apartment_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"invisible_mile_navigation_instructions": null,
"required_start_datetime": null,
"required_finish_datetime": null,
"taking_amount": "0.00",
"buyout_amount": "0.00",
"is_cod_cash_voucher_required": false,
"is_motobox_required": false,
"is_door_to_door": false,
"is_return_to_first_point_required": false,
"matter": "Documents",
"insurance_amount": "0.00",
"weight_kg": 1,
"packages": [],
"checkin_issue_name": null
},
{
"delivery_id": 11713,
"delivery_type": "plain",
"order_id": null,
"client_id": 180179,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"status": "draft",
"status_datetime": "2021-01-22T13:34:20+07:00",
"created_datetime": "2021-01-22T13:34:20+07:00",
"order_name": null,
"order_payment_amount": null,
"delivery_price_amount": null,
"point_id": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"note": null,
"building_number": null,
"apartment_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"invisible_mile_navigation_instructions": null,
"required_start_datetime": null,
"required_finish_datetime": null,
"taking_amount": "0.00",
"buyout_amount": "0.00",
"is_cod_cash_voucher_required": false,
"is_motobox_required": false,
"is_door_to_door": false,
"is_return_to_first_point_required": false,
"matter": "Flowers",
"insurance_amount": "0.00",
"weight_kg": 2,
"packages": [],
"checkin_issue_name": null
}
]
}
Edit draft deliveries
This API method can be used to edit draft deliveries in statuses: draft
, invalid
(Delivery statuses).
Request parameters
- deliveries list Required
List of deliveries.
- delivery_id integer Required
Unique delivery ID to edit.
-
To edit delivery send any number of extra parameters from draft deliveries creation.
If modified value is valid, it will be applied to delivery.
If a parameter is not sent with the request, its value will not be changed.
If a parameter is sent withnull
value, corresponding value will be removed from delivery.When editing a package, always send its ID along with changed values, otherwise a new package will be added to delivery. Also, any packages with IDs not mentioned in the request will be deleted.
See deliveries editing example to avoid pitfalls.
-
Response parameters
- is_successful boolean
Whether the request was successful or not.
- deliveries list
List of modified deliveries.
- delivery_id integer
Unique delivery ID.
- delivery_type string
Delivery type (for now its only
plain
supported). - client_id integer
Client ID.
- address string
Street address.
- status string
Delivery status.
- status_datetime timestamp
Delivery status change date and time.
- created_datetime timestamp
Delivery creation date and time.
- contact_person object
Contact person on the address.
- required_start_datetime timestamp
How early the courier may arrive at the address.
- required_finish_datetime timestamp
How late the courier may arrive at the address.
- taking_amount money
Backpayment sum to receive from the contact person at the address.
- buyout_amount money
Buyout sum the courier pays to the contact person at the address.
- is_cod_cash_voucher_required boolean
Whether to issue a cashier's check to the recipient at the address.
- is_motobox_required boolean
Is motobox required (only for draft).
- is_door_to_door boolean
Delivery from door to door (only for draft).
- is_return_to_first_point_required boolean
Is return to pick-up point required (only for draft).
- insurance_amount money
Insured amount (only for draft).
- weight_kg integer
Weight, in kilograms (only for draft).
-
Courier parameters.
- courier_id integer
Courier ID.
- surname string
Surname of the courier.
- name string
Name of the courier.
- middlename string
Middlename of the courier.
- phone phone
Phone of the courier.
- latitude coordinate / null
Latitude of the location.
Only for active orders, if the courier is on the way.
- longitude coordinate / null
Longitude of the location.
Only for active orders, if the courier is on the way.
-
- packages list
List of packages at the delivery point.
-
Request example
Changing first delivery details (matter
) and removing additional information (note
).
Modifying attributes of the second deliveries first package, remove third package, and keep second package.
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' --data '{"deliveries":[{"delivery_id":11712,"matter":"Flowers","note":null},{"delivery_id":11713,"packages":[{"delivery_package_id":32251,"items_count":3},{"delivery_package_id":32252}]}]}' 'https://robotapitest.mrspeedy.co/api/business/1.1/edit-deliveries'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true,
"deliveries": [
{
"delivery_id": 11712,
"delivery_type": "plain",
"order_id": null,
"client_id": 180179,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"status": "draft",
"status_datetime": "2021-01-22T13:34:20+07:00",
"created_datetime": "2021-01-22T13:34:20+07:00",
"order_name": null,
"order_payment_amount": null,
"delivery_price_amount": null,
"point_id": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"note": null,
"building_number": null,
"apartment_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"invisible_mile_navigation_instructions": null,
"required_start_datetime": null,
"required_finish_datetime": null,
"taking_amount": "0.00",
"buyout_amount": "0.00",
"is_cod_cash_voucher_required": false,
"is_motobox_required": false,
"is_door_to_door": false,
"is_return_to_first_point_required": false,
"matter": "Flowers",
"insurance_amount": "0.00",
"weight_kg": 1,
"packages": [],
"checkin_issue_name": null
},
{
"delivery_id": 11713,
"delivery_type": "plain",
"order_id": null,
"client_id": 180179,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"status": "draft",
"status_datetime": "2021-01-22T13:34:20+07:00",
"created_datetime": "2021-01-22T13:34:20+07:00",
"order_name": null,
"order_payment_amount": null,
"delivery_price_amount": null,
"point_id": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"note": null,
"building_number": null,
"apartment_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"invisible_mile_navigation_instructions": null,
"required_start_datetime": null,
"required_finish_datetime": null,
"taking_amount": "0.00",
"buyout_amount": "0.00",
"is_cod_cash_voucher_required": false,
"is_motobox_required": false,
"is_door_to_door": false,
"is_return_to_first_point_required": false,
"matter": "Flowers",
"insurance_amount": "0.00",
"weight_kg": 2,
"packages": [
{
"delivery_package_id": 32251,
"ware_code": "100111",
"description": "Payung",
"items_count_units": "pieces",
"items_count": 3,
"item_payment_amount": 30000.00
},
{
"delivery_package_id": 32252,
"ware_code": "100112",
"description": "Topi",
"items_count_units": "pieces",
"items_count": 1,
"item_payment_amount": 42000.00
}
],
"checkin_issue_name": null
}
]
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/edit-deliveries');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data = [
'deliveries' => [
[
'delivery_id' => 11712,
'matter' => "Flowers",
'note' => null,
],
[
'delivery_id' => 11713,
'packages' => [
[
'delivery_package_id' => 32251,
'items_count' => 3,
],
[
'delivery_package_id' => 32252,
],
],
],
],
];
$json = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true,
"deliveries": [
{
"delivery_id": 11712,
"delivery_type": "plain",
"order_id": null,
"client_id": 180179,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"status": "draft",
"status_datetime": "2021-01-22T13:34:20+07:00",
"created_datetime": "2021-01-22T13:34:20+07:00",
"order_name": null,
"order_payment_amount": null,
"delivery_price_amount": null,
"point_id": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"note": null,
"building_number": null,
"apartment_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"invisible_mile_navigation_instructions": null,
"required_start_datetime": null,
"required_finish_datetime": null,
"taking_amount": "0.00",
"buyout_amount": "0.00",
"is_cod_cash_voucher_required": false,
"is_motobox_required": false,
"is_door_to_door": false,
"is_return_to_first_point_required": false,
"matter": "Flowers",
"insurance_amount": "0.00",
"weight_kg": 1,
"packages": [],
"checkin_issue_name": null
},
{
"delivery_id": 11713,
"delivery_type": "plain",
"order_id": null,
"client_id": 180179,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"status": "draft",
"status_datetime": "2021-01-22T13:34:20+07:00",
"created_datetime": "2021-01-22T13:34:20+07:00",
"order_name": null,
"order_payment_amount": null,
"delivery_price_amount": null,
"point_id": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"note": null,
"building_number": null,
"apartment_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"invisible_mile_navigation_instructions": null,
"required_start_datetime": null,
"required_finish_datetime": null,
"taking_amount": "0.00",
"buyout_amount": "0.00",
"is_cod_cash_voucher_required": false,
"is_motobox_required": false,
"is_door_to_door": false,
"is_return_to_first_point_required": false,
"matter": "Flowers",
"insurance_amount": "0.00",
"weight_kg": 2,
"packages": [
{
"delivery_package_id": 32251,
"ware_code": "100111",
"description": "Payung",
"items_count_units": "pieces",
"items_count": 3,
"item_payment_amount": 30000.00
},
{
"delivery_package_id": 32252,
"ware_code": "100112",
"description": "Topi",
"items_count_units": "pieces",
"items_count": 1,
"item_payment_amount": 42000.00
}
],
"checkin_issue_name": null
}
]
}
Delete draft deliveries
You may delete draft deliveries in statuses: invalid
, draft
(Delivery statuses). Delivery can not be deleted, if order was created from this draft delivery.
Request parameters
- delivery_ids list Required
List of unique delivery IDs to delete.
Response parameters
- is_successful boolean
Whether the request was successful or not.
Request example
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' --data '{"delivery_ids":[11712, 11713]}' 'https://robotapitest.mrspeedy.co/api/business/1.1/delete-deliveries'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/delete-deliveries');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data = [
'delivery_ids' => [11712, 11713],
];
$json = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true
}
List of deliveries
Use this API method to retrieve a list of your deliveries. The list is sorted by delivery_id
, descending.
Request parameters
- delivery_ids list
List of delivery IDs to search for.
Default value:
null
. - search_text string
Search in fields:
order_id
,client_order_id
,address
,contact_person.name
,contact_person.phone
.Default value:
null
. - status string
- offset integer
Number of deliveries to skip for paginaton.
Default value:
0
- count integer
Maximum number of deliveries to be returned. Cannot be higher than 100.
Default value:
100
.
Response parameters
- is_successful boolean
Whether the request was successful or not.
- deliveries list
List of deliveries found.
- delivery_id integer
Unique delivery ID.
- delivery_type string
Delivery type (for now its only
plain
supported). - client_id integer
Client ID.
- address string
Street address.
- status string
Delivery status.
- status_datetime timestamp
Delivery status change date and time.
- created_datetime timestamp
Delivery creation date and time.
- contact_person object
Contact person on the address.
- required_start_datetime timestamp
How early the courier may arrive at the address.
- required_finish_datetime timestamp
How late the courier may arrive at the address.
- taking_amount money
Backpayment sum to receive from the contact person at the address.
- buyout_amount money
Buyout sum the courier pays to the contact person at the address.
- is_cod_cash_voucher_required boolean
Whether to issue a cashier's check to the recipient at the address.
- is_motobox_required boolean
Is motobox required (only for draft).
- is_door_to_door boolean
Delivery from door to door (only for draft).
- is_return_to_first_point_required boolean
Is return to pick-up point required (only for draft).
- insurance_amount money
Insured amount (only for draft).
- weight_kg integer
Weight, in kilograms (only for draft).
-
Courier parameters.
- courier_id integer
Courier ID.
- surname string
Surname of the courier.
- name string
Name of the courier.
- middlename string
Middlename of the courier.
- phone phone
Phone of the courier.
- latitude coordinate / null
Latitude of the location.
Only for active orders, if the courier is on the way.
- longitude coordinate / null
Longitude of the location.
Only for active orders, if the courier is on the way.
-
- packages list
List of packages at the delivery point.
-
- deliveries_count integer
Total number of deliveries found for pagination.
Request example
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' 'https://robotapitest.mrspeedy.co/api/business/1.1/deliveries?status=draft'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true,
"deliveries": [
{
"delivery_id": 11712,
"delivery_type": "plain",
"order_id": null,
"client_id": 180179,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"status": "draft",
"status_datetime": "2021-01-22T13:34:20+07:00",
"created_datetime": "2021-01-22T13:34:20+07:00",
"order_name": null,
"order_payment_amount": null,
"delivery_price_amount": null,
"point_id": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"note": null,
"building_number": null,
"apartment_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"invisible_mile_navigation_instructions": null,
"required_start_datetime": null,
"required_finish_datetime": null,
"taking_amount": "0.00",
"buyout_amount": "0.00",
"is_cod_cash_voucher_required": false,
"is_motobox_required": false,
"is_door_to_door": false,
"is_return_to_first_point_required": false,
"matter": "Documents",
"insurance_amount": "0.00",
"weight_kg": 1,
"packages": [],
"checkin_issue_name": null
},
{
"delivery_id": 11713,
"delivery_type": "plain",
"order_id": null,
"client_id": 180179,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"status": "draft",
"status_datetime": "2021-01-22T13:34:20+07:00",
"created_datetime": "2021-01-22T13:34:20+07:00",
"order_name": null,
"order_payment_amount": null,
"delivery_price_amount": null,
"point_id": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"note": null,
"building_number": null,
"apartment_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"invisible_mile_navigation_instructions": null,
"required_start_datetime": null,
"required_finish_datetime": null,
"taking_amount": "0.00",
"buyout_amount": "0.00",
"is_cod_cash_voucher_required": false,
"is_motobox_required": false,
"is_door_to_door": false,
"is_return_to_first_point_required": false,
"matter": "Flowers",
"insurance_amount": "0.00",
"weight_kg": 2,
"packages": [],
"checkin_issue_name": null
}
],
"deliveries_count": 2
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/deliveries?status=available');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true,
"deliveries": [
{
"delivery_id": 11712,
"delivery_type": "plain",
"order_id": null,
"client_id": 180179,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"status": "draft",
"status_datetime": "2021-01-22T13:34:20+07:00",
"created_datetime": "2021-01-22T13:34:20+07:00",
"order_name": null,
"order_payment_amount": null,
"delivery_price_amount": null,
"point_id": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"note": null,
"building_number": null,
"apartment_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"invisible_mile_navigation_instructions": null,
"required_start_datetime": null,
"required_finish_datetime": null,
"taking_amount": "0.00",
"buyout_amount": "0.00",
"is_cod_cash_voucher_required": false,
"is_motobox_required": false,
"is_door_to_door": false,
"is_return_to_first_point_required": false,
"matter": "Documents",
"insurance_amount": "0.00",
"weight_kg": 1,
"packages": [],
"checkin_issue_name": null
},
{
"delivery_id": 11713,
"delivery_type": "plain",
"order_id": null,
"client_id": 180179,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"status": "draft",
"status_datetime": "2021-01-22T13:34:20+07:00",
"created_datetime": "2021-01-22T13:34:20+07:00",
"order_name": null,
"order_payment_amount": null,
"delivery_price_amount": null,
"point_id": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"note": null,
"building_number": null,
"apartment_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"invisible_mile_navigation_instructions": null,
"required_start_datetime": null,
"required_finish_datetime": null,
"taking_amount": "0.00",
"buyout_amount": "0.00",
"is_cod_cash_voucher_required": false,
"is_motobox_required": false,
"is_door_to_door": false,
"is_return_to_first_point_required": false,
"matter": "Flowers",
"insurance_amount": "0.00",
"weight_kg": 2,
"packages": [],
"checkin_issue_name": null
}
],
"deliveries_count": 2
}
Make routes from deliveries
This API method can calculate routes from draft deliveries. The received data can be used when creating an order.
Request parameters
-
- start_point object Required
Start point, where to pickup goods for delivery.
- address string Required
Street address. Maximum length is 350 characters.
We use Google Maps API to geocode addresses.
- latitude coordinate / null
Latitude of the location.
Default value:
null
. - longitude coordinate / null
Longitude of the location.
Default value:
null
.
-
- deliveries list Required
List of deliveries.
- delivery_id integer
Delivery ID.
-
Response parameters
- is_successful boolean
Whether the request was successful or not.
- routes list
Built routes.
- route_points list
Points in route.
- latitude coordinate
Latitude of the location.
- longitude coordinate
Longitude of the location.
- address string
Street address.
-
- warnings list
Warnings. You will receive these warnings as error codes if you try to create an order with the same data you calculated it with. Empty list of warnings means the order data is valid.
- parameter_warnings object
Parameter warnings. You will receive these warnings as parameter error codes if you try to create an order with the same data you calculated it with.
Request example
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' --data '{"start_point":{"address":"JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310","required_start_datetime":"2021-01-22T13:34:20+07:00","required_finish_datetime":"2021-01-22T14:04:20+07:00"},"deliveries":[{"delivery_id":11712},{"delivery_id":11713},{"delivery_id":11714},{"delivery_id":11715}]}' 'https://robotapitest.mrspeedy.co/api/business/1.1/make-deliveries-routes'
HTTP/1.1 200 OK
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": true,
"routes": [
{
"route_points": [
{
"delivery_id": null,
"latitude": "-6.3037234",
"longitude": "106.6886525",
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"required_start_datetime": "2021-01-22T13:34:20+07:00",
"required_finish_datetime": "2021-01-22T14:04:20+07:00"
},
{
"delivery_id": 11712,
"latitude": "-6.2914558",
"longitude": "106.8322649",
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"required_start_datetime": "2021-01-22T14:34:20+07:00",
"required_finish_datetime": "2021-01-22T15:04:20+07:00"
},
{
"delivery_id": 11715,
"latitude": "-6.3037234",
"longitude": "106.6886525",
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00"
}
]
},
{
"route_points": [
{
"delivery_id": null,
"latitude": "-6.3037234",
"longitude": "106.6886525",
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"required_start_datetime": "2021-01-22T13:34:20+07:00",
"required_finish_datetime": "2021-01-22T14:04:20+07:00"
},
{
"delivery_id": 11714,
"latitude": "-6.3037234",
"longitude": "106.6886525",
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:04:20+07:00"
},
{
"delivery_id": 11713,
"latitude": "-6.2914558",
"longitude": "106.8322649",
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T16:04:20+07:00"
}
]
}
],
"warnings": [],
"parameter_warnings": null
}
PHP
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://robotapitest.mrspeedy.co/api/business/1.1/make-deliveries-routes');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['X-DV-Auth-Token: SECRET_AUTH_TOKEN']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data = [
'start_point' => [
'address' => 'JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310',
'required_start_datetime' => '2021-01-22T13:34:20+07:00',
'required_finish_datetime' => '2021-01-22T14:04:20+07:00',
],
'deliveries' => [
['delivery_id' => 11712],
['delivery_id' => 11713],
['delivery_id' => 11714],
['delivery_id' => 11715],
],
];
$json = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
$result = curl_exec($curl);
if ($result === false) {
throw new Exception(curl_error($curl), curl_errno($curl));
}
echo $result;
{
"is_successful": true,
"routes": [
{
"route_points": [
{
"delivery_id": null,
"latitude": "-6.3037234",
"longitude": "106.6886525",
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"required_start_datetime": "2021-01-22T13:34:20+07:00",
"required_finish_datetime": "2021-01-22T14:04:20+07:00"
},
{
"delivery_id": 11712,
"latitude": "-6.2914558",
"longitude": "106.8322649",
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"required_start_datetime": "2021-01-22T14:34:20+07:00",
"required_finish_datetime": "2021-01-22T15:04:20+07:00"
},
{
"delivery_id": 11715,
"latitude": "-6.3037234",
"longitude": "106.6886525",
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00"
}
]
},
{
"route_points": [
{
"delivery_id": null,
"latitude": "-6.3037234",
"longitude": "106.6886525",
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"required_start_datetime": "2021-01-22T13:34:20+07:00",
"required_finish_datetime": "2021-01-22T14:04:20+07:00"
},
{
"delivery_id": 11714,
"latitude": "-6.3037234",
"longitude": "106.6886525",
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:04:20+07:00"
},
{
"delivery_id": 11713,
"latitude": "-6.2914558",
"longitude": "106.8322649",
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T16:04:20+07:00"
}
]
}
],
"warnings": [],
"parameter_warnings": null
}
Notification about order changes
You may enter a Callback URL in your Personal cabinet and we will send notifications about order changes to that URL.
Data will be sent via HTTP method POST in JSON format and UTF-8 encoding.
Request parameters
- X-DV-Signature string
Signature of the request data. Use it to verify that the request actually came from our servers.
The signature will be sent as a HTTP header.
To verify the signature, calculate a HMAC hash using SHA256 and Callback Secret Key, which can be found in your Personal cabinet.
- event_datetime timestamp
Event date and time.
- event_type string
Event type:
order_created
- if order created,order_changed
- if order params changed. - order object
Order data.
- order_id integer
Full order ID.
- matter string
Delivery contents.
- order_name string
Order name (short order ID).
- vehicle_type_id integer
Vehicle type.
- created_datetime timestamp
Order creation date and time.
- status string
Order status.
- status_description string
Order status description.
- total_weight_kg integer
Total weight in kilograms.
- is_client_notification_enabled boolean
Whether to send SMS notifications to the client.
- is_contact_person_notification_enabled boolean
Whether to send SMS notifications to recipients on addresses.
- loaders_count integer
Number of necessary loaders to move the delivered goods, including the driver.
- points list
List of addresses (points) for the courier to visit.
- point_id integer
Point ID.
- address string
Street address.
- contact_person object
Contact person on the address.
- phone phone
Phone number of the person at the address.
-
- latitude coordinate
Latitude of the location.
- longitude coordinate
Longitude of the location.
- taking_amount money
Backpayment sum to receive from the contact person at the address.
- buyout_amount money
Buyout sum the courier pays to the contact person at the address.
- packages list
List of packages at the point.
- is_cod_cash_voucher_required boolean
Whether to issue a cashier's check to the recipient at the address.
- is_order_payment_here boolean
Money will be paid to the courier at the address.
-
Checkin information when closing a point at the address.
-
- payment_amount money
Order price.
- delivery_fee_amount money
Delivery fee.
Part of order price (
payment_amount
). - weight_fee_amount money
Large weight fee.
Part of order price (
payment_amount
). - insurance_amount money
Insured amount.
- insurance_fee_amount money
Insurance fee.
Part of order price (
payment_amount
). - loading_fee_amount money
Loading / heavy lifting fee.
Part of order price (
payment_amount
). - money_transfer_fee_amount money
Money handling fee: backpayment transfer, buyout operations.
Part of order price (
payment_amount
). - suburban_delivery_fee_amount money
Extra fee for suburban parts of the courier's route.
Part of order price (
payment_amount
). - overnight_fee_amount money
Extra fee for overnight parts of the courier's route.
Part of order price (
payment_amount
). - discount_amount money
Discount amount.
Part of order price (
payment_amount
). - cod_fee_amount money
Extra fee for issuing a cashier's check.
Part of order price (
payment_amount
). -
Courier parameters.
- courier_id integer
Courier ID.
- surname string
Surname of the courier.
- name string
Name of the courier.
- middlename string
Middlename of the courier.
- phone phone
Phone of the courier.
- latitude coordinate / null
Latitude of the location.
Only for active orders, if the courier is on the way.
- longitude coordinate / null
Longitude of the location.
Only for active orders, if the courier is on the way.
-
- is_motobox_required boolean
Is motobox required.
- payment_method string
Payment method.
-
If your URL responds with any HTTP status other than 200 (OK), our server will treat it as an error. We will then retry to send the request with increasing intervals between attempts for 24 hours until we get HTTP status 200 in response.
If a successful response was not received after 24 hours, we will stop retrying. In this case an email notification will be sent to your address.
Example of a callback handler
PHP
<?php
if (!isset($_SERVER['HTTP_X_DV_SIGNATURE'])) {
echo 'Error: Signature not found';
exit;
}
$data = file_get_contents('php://input');
$signature = hash_hmac('sha256', $data, 'CALLBACK_SECRET_KEY');
if ($signature != $_SERVER['HTTP_X_DV_SIGNATURE']) {
echo 'Error: Signature is not valid';
exit;
}
echo $data;
{
"event_datetime": "2021-01-22T13:34:20+07:00",
"event_type": "order_created",
"order": {
"order_id": 1250032,
"order_name": "50032",
"vehicle_type_id": 8,
"created_datetime": "2021-01-22T13:34:20+07:00",
"finish_datetime": null,
"status": "available",
"status_description": "available",
"matter": "Documents",
"total_weight_kg": 0,
"is_client_notification_enabled": false,
"is_contact_person_notification_enabled": false,
"loaders_count": 0,
"backpayment_details": null,
"points": [{
"point_id": 202685,
"delivery_id": null,
"client_order_id": null,
"address": "JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310",
"latitude": "-6.3037234",
"longitude": "106.6886525",
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": {
"recipient_full_name": "Luvie Mevia Azzahra",
"recipient_position": null
},
"tracking_url": null
}, {
"point_id": 202686,
"delivery_id": null,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"latitude": "-6.2914558",
"longitude": "106.8322649",
"required_start_datetime": "2021-01-22T15:04:20+07:00",
"required_finish_datetime": "2021-01-22T15:34:20+07:00",
"arrival_start_datetime": null,
"arrival_finish_datetime": null,
"courier_visit_datetime": null,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"taking_amount": "0.00",
"buyout_amount": "0.00",
"note": null,
"packages": [],
"is_cod_cash_voucher_required": false,
"is_order_payment_here": false,
"building_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"apartment_number": null,
"invisible_mile_navigation_instructions": null,
"place_photo_url": null,
"sign_photo_url": null,
"checkin": null,
"tracking_url": null
}],
"payment_amount": "15000.00",
"delivery_fee_amount": "15000.00",
"weight_fee_amount": "0.00",
"insurance_amount": "0.00",
"insurance_fee_amount": "0.00",
"loading_fee_amount": "0.00",
"money_transfer_fee_amount": "0.00",
"suburban_delivery_fee_amount": "0.00",
"overnight_fee_amount": "0.00",
"discount_amount": "0.00",
"backpayment_amount": "0.00",
"cod_fee_amount": "0.00",
"backpayment_photo_url": null,
"itinerary_document_url": null,
"waybill_document_url": null,
"courier": null,
"is_motobox_required": false,
"payment_method": "cash",
"bank_card_id": null
}
}
Notification about delivery changes
You may enter a Callback URL and enable delivery callback in your Personal cabinet and we will send notifications about delivery changes to that URL.
Data will be sent via HTTP method POST in JSON format and UTF-8 encoding.
Request parameters
- X-DV-Signature string
Signature of the request data. Use it to verify that the request actually came from our servers.
The signature will be sent as a HTTP header.
To verify the signature, calculate a HMAC hash using SHA256 and Callback Secret Key, which can be found in your Personal cabinet.
- event_datetime timestamp
Event date and time.
- event_type string
Event type:
delivery_created
- if delivery created,delivery_changed
- if delivery params changed. - delivery object
Delivery data.
- delivery_id integer
Unique delivery ID.
- delivery_type string
Delivery type (for now its only
plain
supported). - client_id integer
Client ID.
- address string
Street address.
- status string
Delivery status.
- status_datetime timestamp
Delivery status change date and time.
- created_datetime timestamp
Delivery creation date and time.
- contact_person object
Contact person on the address.
- required_start_datetime timestamp
How early the courier may arrive at the address.
- required_finish_datetime timestamp
How late the courier may arrive at the address.
- taking_amount money
Backpayment sum to receive from the contact person at the address.
- buyout_amount money
Buyout sum the courier pays to the contact person at the address.
- is_cod_cash_voucher_required boolean
Whether to issue a cashier's check to the recipient at the address.
- is_motobox_required boolean
Is motobox required (only for draft).
- is_door_to_door boolean
Delivery from door to door (only for draft).
- is_return_to_first_point_required boolean
Is return to pick-up point required (only for draft).
- insurance_amount money
Insured amount (only for draft).
- weight_kg integer
Weight, in kilograms (only for draft).
-
Courier parameters.
- courier_id integer
Courier ID.
- surname string
Surname of the courier.
- name string
Name of the courier.
- middlename string
Middlename of the courier.
- phone phone
Phone of the courier.
- latitude coordinate / null
Latitude of the location.
Only for active orders, if the courier is on the way.
- longitude coordinate / null
Longitude of the location.
Only for active orders, if the courier is on the way.
-
- packages list
List of packages at the delivery point.
-
If your URL responds with any HTTP status other than 200 (OK), our server will treat it as an error. We will then retry to send the request with increasing intervals between attempts for 24 hours until we get HTTP status 200 in response.
If a successful response was not received after 24 hours, we will stop retrying. In this case an email notification will be sent to your address.
Example of a callback handler
PHP
<?php
if (!isset($_SERVER['HTTP_X_DV_SIGNATURE'])) {
echo 'Error: Signature not found';
exit;
}
$data = file_get_contents('php://input');
$signature = hash_hmac('sha256', $data, 'CALLBACK_SECRET_KEY');
if ($signature != $_SERVER['HTTP_X_DV_SIGNATURE']) {
echo 'Error: Signature is not valid';
exit;
}
echo $data;
{
"event_datetime": "2021-01-22T13:34:20+07:00",
"event_type": "delivery_created",
"delivery": {
"delivery_id": 11712,
"delivery_type": "plain",
"order_id": 1250032,
"client_id": 180198,
"client_order_id": null,
"address": "Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540",
"status": "active",
"status_datetime": "2021-01-22T13:34:20+07:00",
"created_datetime": "2021-01-22T13:34:20+07:00",
"order_name": "50032",
"order_payment_amount": "15000.00",
"delivery_price_amount": "15000.00",
"point_id": 203902,
"contact_person": {
"name": null,
"phone": "6288800000001"
},
"note": null,
"building_number": null,
"apartment_number": null,
"entrance_number": null,
"intercom_code": null,
"floor_number": null,
"invisible_mile_navigation_instructions": null,
"required_start_datetime": "2021-01-22T14:04:20+07:00",
"required_finish_datetime": "2021-01-22T14:34:20+07:00",
"taking_amount": "0.00",
"buyout_amount": "0.00",
"is_cod_cash_voucher_required": false,
"is_motobox_required": false,
"is_door_to_door": false,
"is_return_to_first_point_required": false,
"matter": null,
"insurance_amount": "0.00",
"weight_kg": 0,
"packages": [],
"checkin_issue_name": null
}
}
Parameter data types
- boolean
Boolean value:
true
orfalse
. - integer
Integer number without fractions.
- string
A JSON string. Example:
"active"
. - timestamp
Date and time according to ISO 8601: YYYY-MM-DDTHH:MM:SSZ. Example:
"2021-01-22T13:34:20+07:00"
.Please use this exact format with semicolon in the timezone. Other ISO 8601 variants are not supported by Business API.
- float
Floating point number with fractional part.
- list
A JSON list. Example:
[{"address":"JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310"}, {"address":"Jl. Raya Ragunan No.39, RT.1/RW.2, Ps. Minggu, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12540"}]
. - object
A JSON object. Example:
{"address":"JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310"}
. - money
Money amount (Rp). This is a JSON string to prevent rounding errors. Examples:
"190"
,"-49"
. - phone
A JSON string with phone number. Example:
"6288800000001"
. - null
Empty value:
null
.
Order statuses
- new
Newly created order, waiting for verification from our dispatchers.
- available
Order was verified and is available for couriers.
- active
A courier was assigned and is working on the order.
- completed
Order is completed.
- reactivated
Order was reactivated and is again available for couriers.
- draft
The order is a draft and will not be delivered as such. You can create an actual order out of the draft in your Personal cabinet.
- canceled
Order was canceled.
- delayed
Order execution was delayed by a dispatcher.
Delivery statuses
- invalid
Invalid draft delivery
- draft
Draft delivery
- planned
Planned delivery (No courier assigned)
- active
Delivery in process (Courier on the way)
- finished
Delivery finished (Courier delivered the parcel)
- canceled
Delivery canceled
- delayed
Delivery delayed
- failed
Delivery failed (Courier could not find a customer)
- courier_assigned
Courier assigned, but still not departed
- courier_departed
Courier departed to the pick-up point
- parcel_picked_up
Courier took parcel at the pick-up point
- courier_arrived
Courier has arrived and is waiting for a customer
- deleted
Delivery deleted
Vehicle types
-
1 — Car / SUV / pickup (deliveries under 500 kg). Forbidden to use when placing a new order.
-
2 — Minivan (under 700 kg). Forbidden to use when placing a new order.
-
3 — Van (under 1000 kg). Forbidden to use when placing a new order.
-
7 — Car.
-
8 — Motorbike.
Payment methods
-
cash — payment_methods.cash
-
non_cash — payment_methods.non_cash
-
bank_card — payment_methods.bank_card
Error codes
Request error codes
- unexpected_error
Unexpected error. Please let us know at api@mrspeedy.co.
- invalid_api_version
Unknown API version. Available versions are 1.0 and 1.1.
- required_api_upgrade
Requested API version was discontinued. You should use the latest version instead.
- requests_limit_exceeded
You have reached an API usage limit.
Limits are: 100 requests per minute, 5 000 requests per 24 hours.
- required_auth_token
X-DV-Auth-Token
header is missing from the request. - invalid_auth_token
X-DV-Auth-Token
you are sending is invalid. - required_method_get
HTTP method GET is required.
- required_method_post
HTTP method POST is required.
- invalid_post_json
POST request body must be in JSON format.
- invalid_parameters
Request parameters contain errors. Look at
parameter_errors
response field for details. - unapproved_contract
Your agreement is not approved yet (for legal entities).
- service_unavailable
Our service is temporarily unavailable. Please try again later.
- invalid_api_method
Unknown API method was requested.
- buyout_not_allowed
You do not have access to buyout feature.
- order_cannot_be_edited
Order cannot be edited.
- order_cannot_be_canceled
Order cannot be canceled.
- insufficient_balance
Your balance is too low (for legal entities).
- buyout_amount_limit_exceeded
Total buyout amount in your active orders is too large. You do not have sufficient balance / credit limit to place the new order.
- route_not_found
Route not found.
- total_payment_amount_limit_exceeded
Exceeded maximum order price.
- order_is_duplicate
Duplicate order rejected
- insufficient_funds
Insufficient funds on your bank card
- card_payment_failed
Bank card payment failed
Request example
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' 'https://robotapitest.mrspeedy.co/api/business/1.1/unknown'
HTTP/1.1 400 Bad Request
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": false,
"errors": ["invalid_api_method"],
"parameter_errors": null
}
Parameter error codes
- required
Required parameter was not provided.
- unknown
Unknown parameter was encountered.
- invalid_list
Invalid JSON list.
- invalid_object
Invalid JSON object.
- invalid_boolean
Invalid boolean.
- invalid_date
Invalid date or time.
- invalid_date_format
Invalid date and time format.
- invalid_float
Invalid floating point number.
- invalid_integer
Invalid integer number.
- invalid_string
Invalid string.
- invalid_order
Order ID was not found.
- invalid_point
Point ID was not found.
- invalid_order_status
Invalid order status.
- invalid_vehicle_type
Invalid vehicle type.
- invalid_courier
Invalid courier ID.
- invalid_phone
Invalid phone number.
- invalid_region
Address is out of the delivery area for the region.
- invalid_order_package
Package was not found
- invalid_delivery_id
Delivery ID was not found
- invalid_delivery_package
Package ID for delivery was not found
- invalid_delivery_status
Invalid delivery status
- invalid_bank_card
Bank card ID was not found
- invalid_url
Invalid url
- invalid_enum_value
Invalid enum value
- different_regions
Addresses from different regions are not allowed.
- address_not_found
Address geocoding failed. Check your address with Google Maps service.
- min_length
String value is too short.
- max_length
String value is too long.
- min_date
Date and time is older than possible.
- max_date
Date and time is later than possible.
- min_size
List size is too small.
- max_size
List size is too large.
- min_value
Value is too small.
- max_value
Value is too large.
- cannot_be_past
Date and time cannot be in the past.
- start_after_end
Incorrect time interval. Start time should be earlier than the end.
- earlier_than_previous_point
Incorrect time interval. Time cannot be earlier than previous point time.
- coordinates_out_of_bounds
Point coordinates are outside acceptable delivery areas
- not_nullable
Value can not be null
- not_allowed
Parameter not allowed
- order_payment_only_one_point
Order payment can be specified only for one point
- cod_agreement_required
COD agreement required
Request example
CURL
curl --include --header 'X-DV-Auth-Token: SECRET_AUTH_TOKEN' --data '{"points":[{"address":"JL. Jawa, Blok J1 No. 31, Komplek Nusaloka, Tangerang, Rw. Mekar Jaya, Serpong, Kota Tangerang Selatan, Banten 15310","contact_person":{"phone":"6288800000001"}},{}]}' 'https://robotapitest.mrspeedy.co/api/business/1.1/create-order'
HTTP/1.1 400 Bad Request
Date: Fri, 22 Jan 2021 06:34:20 GMT
Content-Type: application/json; charset=utf-8
{
"is_successful": false,
"errors": ["invalid_parameters"],
"parameter_errors": {
"matter": ["required"],
"points": [
null,
{
"address": ["required"],
"contact_person": {
"phone": ["required"]
}
}
]
}
}
Changelog
Version 1.0
- 23.11.2017
New error codes:
route_not_found
,invalid_region
,different_regions
. - 31.05.2018
Allowed to send order IDs list for orders API method.
- 20.07.2018
New API method courier to get courier info.
- 23.10.2018
New error code
earlier_than_previous_point
. - 18.04.2019
Field
receipt_document_url
is always null. - 29.11.2019
New error codes:
coordinates_out_of_bounds
,total_payment_amount_limit_exceeded
. - 14.01.2020
Added new field to order parameters:
is_motobox_required
. - 11.03.2020
Added methods to manage deliveries: Create draft deliveries, Edit draft deliveries, Delete draft deliveries, List of deliveries.
Added callbacks to deliveries (Notification about delivery changes).
New error codes:
invalid_delivery_id
,invalid_delivery_package
,invalid_delivery_status
- 08.07.2020
Added methods to pay with bank card (for some countries): Available bank cards, Client profile info (helps get allowed payment methods)
Added
payment_method
parameter (Placing an order).New error codes:
invalid_bank_card
,insufficient_funds
,card_payment_failed
- 22.09.2020
Added ability to create order from draft deliveries (see example 3): Placing an order
Added method to calculate routes from draft deliveries: Make routes from deliveries
Version 1.1
- 18.04.2019
Field
receipt_document_url
is no longer available in order info.