Senpex API v4 Documentation
Orders
This section represents classical API and contains requests used to create/ update orders and retrieve different data.
Senpex API supports two types of orders:
- Urgent
- Scheduled
The only difference between these requests is the value of the parameter "taken_asap". To create an urgent order "taken_asap" should have "1". In this case the date and time of the order will be considered as a current time. But if you need to create a scheduled order, lets say for tomorrow, "taken_asap" parameter, should have "0" and "schedule_date_local" must be added. You will find this in example below.
All API requests henceforth are required to add client id and secret id in the header
Key | Datatype | Description |
---|---|---|
clientid | String | Your client id |
secretid | String | Your secret id |
orders/dropoff/quote POST
This service allows you to obtain a delivery price estimate by providing the following parameters. It generates a token used in /orders/dropoff request which is valid for 60 minutes to create a new order.
This service allows user to create orders with One pick up address and one or many drop off addresses.
You will obtain a delivery price estimate depending on the size of your package, type of transport you chose and the drop-off address.
To create Urgent order set taken_asap as 1 and schedule_date_local as null.
To create Scheduled order set taken_asap as 0 and schedule_date_local can be set with any future date and time in following format "yyyy-mm-dd HH:MM"
Depending upon the value for taken_asap , this request returns price for either urgent or scheduled order.
A full list of the parameters and their descriptions is shown below.
Request Parameters:
Key | Datatype | Description |
---|---|---|
order_name | string required | Order name |
pack_from_text | string required | Address of pick-up location |
transport_id | integer required | See all available [Transport types] |
item_value | integer required | Estimated cost of your package |
pack_size_id | integer required | See all available [Package size types] |
taken_asap | integer optional | If package has to be delivered urgently, value should be 1 else it is considered as a scheduled delivery and "schedule_date" parameter should also be provided |
schedule_date_local | string optional | Should be provided in UTC format, if "taken_asap" = 0 |
string required | Email which is used at registration in Senpex API Dashboard. | |
show_one_price | integer optional | 1 or 0 (1 = only one price , 0 = both prices), Will show only Scheduled delivery price if schedule_date is provided , otherwise it will show Urgent Delivery price |
promo_code | string optional | Promo code if available |
order_desc | string required | General delivery notes(Usually it is a gate code, apartment number and so on) |
route_desc | string required | General delivery notes(Usually it is a gate code, apartment number and so on) |
rec_name | string required | John Conor |
route_desc | string required | General delivery notes(Usually it is a gate code, apartment number and so on) |
rec_phone | integer required | 6501231234 |
routes | array required | |
routes.route_to_text | string required | Address of drop-off location |
routes.route_desc | string required | Delivery notes used for each drop-off address |
routes.rec_name | string required | The name of Receiver at the drop-off address (can be empty, but in Order Creation process it is required.) |
routes.rec_phone | string required | General delivery notes(Usually it is a gate code, apartment number and so on) |
Response Parameters:
Key | Datatype | Description |
---|---|---|
code | string | It is 0 for successful request execution |
is_user_registered | boolean | Returns true for a registered user |
diff_in_minutes | integer | Difference in minutes |
api_token | string | This token will be used for making payment in create_quick_order service |
order_price | float | Calculated order amount for given parameters |
original_order_price | string | Calculated order amount without discount |
tariff_name | string | The name of Tariff plan |
order_discount | float | Discount amount that has been used for promo code |
tariff_id | string | Id of the tariff plan |
promo_code_info | string | Promotion code if applied |
company_id | string | Id of company |
tariff_duration_mins | string | The maximum time (in minutes) for using this tariff plan . |
distance_miles | float | The distance in mile from the pick-up to drop-off |
distance_time_seconds | string | Time in seconds for covering the distance |
schedule_date | string | Date of the scheduled delivery |
item_value | string | Estimated cost of your package |
pack_size_id | string | See all available [Package size types] |
transport_id | string | See all available [Transport types] |
pack_from_lat | float | The latitude of the pick-up location |
pack_from_lng | float | The longitude of the pick-up location |
routes | string | Route details in string format |
routes_json | string | Route details in json format |
routes.route_to_text | string | The address of drop-off address |
routes.route_desc | string | The route description, if it was passed in the request |
routes.route_rec_name | string | The receiver name, if it was passed in the request |
routes.route_rec_phone | string | The receiver phone, if it was passed in the request |
routes.route_to_lat | float | The Latitude of drop-off address |
routes.route_to_lng | float | The Longitude of drop-off address |
route_distance | float | The distance of that route from pick-up to drop-off location |
route_distance_time | float | The time to cover the distance of the route from pick-up to drop-off location |
tariff_duration_hours | float | Total hours for the delivery |
tariff_duration_days | integer | Total days for the delivery |
expire_mins | integer | The expiry time of the api token (in minutes) . |
HEADERS:
secretid: | {{ secret_id }} |
clientid: | {{ client_id }} |
Body raw
{
"email": "test@senpex.com",
"order_name": "Test order 1",
"pack_from_text": "Santa Clara, USA",
"transport_id": 3,
"item_value": 100,
"pack_size_id": 2,
"taken_asap": 1,
"schedule_date_local": null,
"promo_code": "new25",
"order_desc": "Test package description",
"route_desc": "Test pickup Instructions",
"rec_name": "John",
"rec_phone": "+12345679012",
"routes": [
{
"route_to_text": "185 University Ave, Palo Alto, CA 94301, USA",
"route_desc": "dropoff Instructions",
"rec_name": "John Doe",
"rec_phone": "+12345679019",
"route_to_lat": 37.4447253,
"route_to_lng": -122.1631407
},
{
"route_to_text": "Fremont, CA, USA",
"route_desc": "dropoff Instructions",
"rec_name": "John Doe",
"rec_phone": "+12345679019",
"route_to_lat": 37.4447253,
"route_to_lng": -122.1631407
}
]
}
Example Request curl
curl --location 'https://api.sandbox.senpex.com/api/restfull/v4/orders/dropoff/quote' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data-raw '{
"email": "test@senpex.com",
"order_name": "Test order 1",
"pack_from_text": "Santa Clara, USA",
"transport_id": 3,
"item_value": 100,
"pack_size_id": 2,
"taken_asap": 1,
"schedule_date_local": null,
"promo_code": "new25",
"order_desc": "Test package description",
"route_desc": "Test pickup Instructions",
"rec_name": "John",
"rec_phone": "+12345679012",
"routes": [
{
"route_to_text": "185 University Ave, Palo Alto, CA 94301, USA",
"route_desc": "dropoff Instructions",
"rec_name": "John Doe",
"rec_phone": "+12345679019",
"route_to_lat": 37.4447253,
"route_to_lng": -122.1631407
},
{
"route_to_text": "Fremont, CA, USA",
"route_desc": "dropoff Instructions",
"rec_name": "John Doe",
"rec_phone": "+12345679019",
"route_to_lat": 37.4447253,
"route_to_lng": -122.1631407
}
]
}'
orders/dropoff PUT
This service allows the user to confirm a new order.
To create a new order, first send a POST/orders/dropff/quote request. This will return "api_token" in the response. Using this token user can send this PUT request to confirm this new order. User may choose to add tip in this request while confirming this order. The parameter used to add tip is "tip_amount"
Note: api_token expires in 60 minutes after creating and it can be used for creating one order only.
Any data that was sent through "dropoff/quote" can be updated through this request.
Request Parameters:
Key | Datatype | Description |
---|---|---|
api_token | string required | Token received from get_price request |
string required | Email of API account owner. This field determines the name of sender(partner) and predefined pricing options | |
sender_name | string optional | Name of sender/store/restaurant |
sender_cell | string optional | Phone number of sender/store/restaurant |
sender_desc | string optional | Senders notes and instructions. |
order_desc | string optional | Any delivery notes(Usually it is a gate code, apartment number and so on) |
routes | array | List of routes |
routes.rec_name | string optional | The name of receiver (Should be provided if not provided in "get_price" service) |
routes.rec_phone | string optional | The phone number of receiver (Should be provided if not provided on "get_price" service) |
snpx_user_email | integer optional | 1 = will send an email with password to user, if this email id does not exist in the system, 0 = will not send email |
snpx_order_email | integer optional | 1 = will send email about orders, 0 = will not send email |
snpx_order_not | integer optional | 1 = will send push notifications to a user if "device_id" will be provided, 0 = will not send notifications |
search_courier | integer optional | 1 = start searching for a courier just after creating a package, 0 = will not search for courier until "update_order_nots" will not be requested |
tip_amount | integer optional | Through this parameter tips from clients are being send. By default it is 0 |
Response Parameters:
Key | Datatype | Description |
---|---|---|
inserted_id | integer | The newly created order id |
distance | float | The distance in miles from the pick-up to drop-off |
distance_time | float | Time in seconds to cover the distance |
HEADERS:
secretid: | {{ secret_id }} |
clientid: | {{ client_id }} |
Body raw
{
"email": "test@senpex.com",
"api_token": "{{api_token}}",
"tip_amount": 25
}
Example Request curl
curl --location --request PUT 'https://api.sandbox.senpex.com/api/restfull/v4/orders/dropoff' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data-raw '{
"email": "test@senpex.com",
"api_token": "{{api_token}}",
"tip_amount": 25
}'
orders-list GET
With this request user can retrieve a list and information of most recent 12 orders created for a particular account.
Response Parameters:
Key | Datatype | Description |
---|---|---|
code | string | It is always 0 for successful retrieve response |
data | array | List of all orders |
id | string | The order id |
order_name | string | The name of order |
sender_name | string | The name of order owner |
pack_size_id | string | Size of package |
pack_transport_id | string | Selected transport id |
pack_from_lat | string | Latitude of pick-up address |
pack_from_lng | string | Longitude of pick-up address |
pack_from_text | string | The pick-up address |
taken_asap | string | 1 is for Urgent deliver, 0 for Scheduled delivery |
schedule_date | string | Scheduled date of Order |
distance_miles | string | Distance between pick-up and drop_off address |
distance_time_seconds | string | Time in seconds between pick-up and drop_off address |
pack_map_img | string | The link to google map image |
pack_price | string | The price of the order |
rest_api_vers | string | Version of API that created order |
route_count | string | The count of drop-off addresses |
last_pack_to_lat | string | Latitude of last drop-off address |
last_pack_to_lng | string | Longitude of last drop-off address |
last_pack_to_text | string | The address of last drop_off location |
last_receiver_name | string | The name of receiver on last last drop-off address |
last_receiver_phone_number | string | The phone number of receiver on last drop-off address |
conn_client_name | string | Order Creation Source |
pack_status | string | Order Status |
order_status_text | string | The Order Status text |
courier_name | string | The name of courier if already assigned |
courier_surname | string | The surname of courier if already assigned |
courier_cell | string | The phone number of courier if already assigned |
sender_surname | string | The surname of order owner |
sender_cell | string | The phone number of order owner |
sender_email | string | The email of order owner |
sender_user_id | string | The ID of order owner |
status_sender | string | The Order Status text |
HEADERS:
secretid: | {{ secret_id }} |
clientid: | {{ client_id }} |
Example Request curl
curl --location 'https://api.sandbox.senpex.com/api/restfull/v4/order-list' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data ''
orders-list (Extended search) GET
WIth this request user can retrieve a list and information of 12 orders created for a particular account starting from 13th record/order.
User can choose to set start = "desired row number" in order to retrive a list from a particular record at starting point.
Response Parameters:
Key | Datatype | Description |
---|---|---|
code | string | It is always 0 for successful retrieve response |
data | array | List of all orders |
id | string | The order id |
order_name | string | The name of order |
sender_name | string | The name of order owner |
pack_size_id | string | Size of package |
pack_transport_id | string | Selected transport id |
pack_from_lat | string | Latitude of pick-up address |
pack_from_lng | string | Longitude of pick-up address |
pack_from_text | string | The pick-up address |
taken_asap | string | 1 is for Urgent deliver, 0 for Scheduled delivery |
schedule_date | string | Scheduled date of Order |
distance_miles | string | Distance between pick-up and drop_off address |
distance_time_seconds | string | Time in seconds between pick-up and drop_off address |
pack_map_img | string | The link to google map image |
pack_price | string | The price of the order |
rest_api_vers | string | Version of API that created order |
route_count | string | The count of drop-off addresses |
last_pack_to_lat | string | Latitude of last drop-off address |
last_pack_to_lng | string | Longitude of last drop-off address |
last_pack_to_text | string | The address of last drop_off location |
last_receiver_name | string | The name of receiver on last last drop-off address |
last_receiver_phone_number | string | The phone number of receiver on last drop-off address |
conn_client_name | string | Order Creation Source |
pack_status | string | Order Status |
order_status_text | string | The Order Status text |
courier_name | string | The name of courier if already assigned |
courier_surname | string | The surname of courier if already assigned |
courier_cell | string | The phone number of courier if already assigned |
sender_surname | string | The surname of order owner |
sender_cell | string | The phone number of order owner |
sender_email | string | The email of order owner |
sender_user_id | string | The ID of order owner |
status_sender | string | The Order Status text |
HEADERS:
secretid: | {{ secret_id }} |
clientid: | {{ client_id }} |
PARAMS:
start: | 12 |
Example Request curl
curl --location 'https://api.sandbox.senpex.com/api/restfull/v4/order-list?start=12' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data ''
orders/details/order-id GET
This request allows user to retrieve all details about a specific, previously created order by providing order_id.
Response Parameters:
Key | Datatype | Description |
---|---|---|
code | string | It is always 0 for successful retrieve response |
data | object | List of all orders |
id | string | The order id |
instant_not_url | string | Webhook URL provided by you earlier |
order_name | string | The name of order |
pack_size_id | string | Size of package |
pack_transport_id | string | Selected transport id |
pack_from_lat | string | Latitude of pick-up address |
pack_from_lng | string | Longitude of pick-up address |
pack_from_text | string | The pick-up address |
taken_asap | string | 1 is for Urgent deliver, 0 for Scheduled delivery |
schedule_date | string | Scheduled date of Order |
distance_miles | string | Distance between pick-up and drop_off address |
distance_time_seconds | string | Time in seconds between pick-up and drop_off address |
pack_map_img | string | The link to google map image |
pack_price | string | The price of the order |
rest_api_vers | string | Version of API that created order |
route_count | string | The count of drop-off addresses |
last_pack_to_lat | string | Latitude of last drop-off address |
last_pack_to_lng | string | Longitude of last drop-off address |
last_pack_to_text | string | The address of last drop_off location |
last_receiver_name | string | The name of receiver on last last drop-off address |
last_receiver_phone_number | string | The phone number of receiver on last drop-off address |
conn_client_name | string | Order Creation Source |
pack_status | string | Order Status |
order_status_text | string | The Order Status text |
courier_name | string | The name of courier if already assigned |
courier_surname | string | The surname of courier if already assigned |
courier_cell | string | The phone number of courier if already assigned |
sender_surname | string | The surname of order owner |
sender_cell | string | The phone number of order owner |
sender_email | string | The email of order owner |
sender_user_id | string | The ID of order owner |
status_sender | string | The Order Status text |
order_images | array | List of order images |
order_images.pack_img | string | The link to original image uploaded by sender / courier |
order_images.inserted_date | string | The datetime when image was uploaded |
order_images.img_type | string | 1 = uploaded by sender , 2 uploaded by courier |
order_images.pack_img_status | string | The status of order on which image has been uploaded |
history | array | List of operations on that order |
history.operation_name | string | The name of operation |
history.operation_date | string | The datetime of operation |
history.pack_status | string | Order Status |
routes | array | List of routes |
routes.route_to_text | string | The address of drop-off address |
routes.route_to_lat | string | The Latitude of drop-off address |
routes.route_to_lng | string | The Longitude of drop-off address |
routes.route_status | string | Route Status |
routes.route_delivery_date | string | Datetime when the order was delivered |
rec_phone | string | Receivers phone number |
rec_name | string | Receivers name |
route_delivery_date | string | Receivers order receipt date |
route_distance | string | Route distance |
route_distance_time | string | Route time to reach from pick-up to this drop-off |
If "include_images", "include_history" and "include_routes" are not provided in the request, the response will not have "order_images", "history" and "routes"
HEADERS:
secretid: | {{ secret_id }} |
clientid: | {{ client_id }} |
Example Request curl
curl --location -g 'https://api.sandbox.senpex.com/api/restfull/v4/orders/details/{{new_order_id}}' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data ''
orders/routes/route_id GET
This requests allows user retrieve all route information about a specific route by passing "route id" in the url.
Response Parameters:
Key | Datatype | Description |
---|---|---|
code | string | It is always 0 for successful retrieve response |
data | object | Route details |
route_to_text | string | The address of drop-off address |
route_to_lat | string | The Latitude of drop-off address |
route_to_lng | string | The Longitude of drop-off address |
route_status | string | Route Status |
route_delivery_date | string | Datetime when the order was delivered |
rec_phone | string | Receivers phone number |
rec_name | string | Receivers name |
route_delivery_date | string | Receivers order receipt date |
route_distance | string | Route distance |
route_distance_time | string | Route time to reach from pick-up to this drop-off |
If "include_images", "include_history" and "include_routes" are not provided in the request, the response will not have "order_images", "history" and "routes"
HEADERS:
secretid: | { secret_id } |
clientid: | { client_id } |
Example Request curl
curl --location -g 'https://api.sandbox.senpex.com/api/restfull/v4/orders/routes/{{route_id}}' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data ''
orders/tokens/api_token GET
This request allows user to retrieve all details of an specific, previously created order with the use of api token by passing that api token in the url.
Response Parameters:
Key | Datatype | Description |
---|---|---|
code | string | It is always 0 for successful retrieve response |
data | array | List of all orders |
id | string | The order id |
order_name | string | The name of order |
sender_name | string | The name of order owner |
pack_size_id | string | Size of package |
pack_transport_id | string | Selected transport id |
pack_from_lat | string | Latitude of pick-up address |
pack_from_lng | string | Longitude of pick-up address |
pack_from_text | string | The pick-up address |
taken_asap | string | 1 is for Urgent deliver, 0 for Scheduled delivery |
schedule_date | string | Scheduled date of Order |
distance_miles | string | Distance between pick-up and drop_off address |
distance_time_seconds | string | Time in seconds between pick-up and drop_off address |
pack_map_img | string | The link to google map image |
pack_price | string | The price of the order |
rest_api_vers | string | Version of API that created order |
route_count | string | The count of drop-off addresses |
last_pack_to_lat | string | Latitude of last drop-off address |
last_pack_to_lng | string | Longitude of last drop-off address |
last_pack_to_text | string | The address of last drop_off location |
last_receiver_name | string | The name of receiver on last last drop-off address |
last_receiver_phone_number | string | The phone number of receiver on last drop-off address |
conn_client_name | string | Order Creation Source |
pack_status | string | Order Status |
order_status_text | string | The Order Status text |
courier_name | string | The name of courier if already assigned |
courier_surname | string | The surname of courier if already assigned |
courier_cell | string | The phone number of courier if already assigned |
sender_surname | string | The surname of order owner |
sender_cell | string | The phone number of order owner |
sender_email | string | The email of order owner |
sender_user_id | string | The ID of order owner |
status_sender | string | The Order Status text |
HEADERS:
secretid: | { secret_id } |
clientid: | { client_id } |
Example Request curl
curl --location -g 'https://api.sandbox.senpex.com/api/restfull/v4/orders/tokens/{{pickup_api_token}}' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data ''
orders/order_id/driver-location/ GET
This request retrieves Driver's details for a specific , previously created order.
Request response returns Null if no driver is assigned for this order.
Response Parameters:
Key | Datatype | Description |
---|---|---|
code | string | It is always 0 for successful retrieve response |
data | onj | Driver details |
pack_status | string | Order status |
order_status | string | Order status |
courier_name | string | Name of the assigned courier |
courier_surname | string | Last name of the assigned courier |
courier_phone_number | string | Assigned Courier's phone number |
last_lng | string | Last longitude of the assigned courier's location |
last_lat | string | Last latitude of the assigned courier's location |
last_timezone | string | Courier's time zone |
last_location_date | string | The date that courier has been in this location (UTC TIME) |
last_seen_date | string | The date of courier's last APP usage |
snpx_email | integer | 1 =enabled , 0 = disabled |
snpx_nots | integer | 1 =enabled , 0 = disabled |
snpx_sms | integer | 1 =enabled , 0 = disabled |
snpx_instant_not | string | 1 =enabled , 0 = disabled |
instant_not_url | string |
HEADERS:
secretid: | { secret_id } |
clientid: | { client_id } |
Example Request curl
curl --location -g 'https://api.sandbox.senpex.com/api/restfull/v4/orders/{{new_order_id}}/driver-location/' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data ''
orders/cancel/order-id PUT
With this request, User can cancel a specific , previously created order.
Request Parameters:
Key | Datatype | Description |
---|---|---|
order_id | integer | The unique order id generated with new order creation |
HEADERS:
Key | Datatype | Description |
---|---|---|
refund_amount | float | The refunded amount after order cancellation |
HEADERS:
secretid: | { secret_id } |
clientid: | { client_id } |
Example Request curl
curl --location -g --request PUT 'https://api.sandbox.senpex.com/api/restfull/v4/orders/cancel/{{new_order_id}}' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data ''
orders/pickup/quote POST
This service allows user to obtain a delivery price estimate for one drop off and one or many pickup addresses.
It also generates a token used in /orders/pickup request which is valid for 60 minutes to create a new order.
Request Parameters:
Key | Datatype | Description |
---|---|---|
order_name | string required | Order name |
transport_id | integer required | See all available [Transport types] |
item_value | integer required | Estimated cost of your package |
pack_size_id | integer required | See all available [Package size types] |
taken_asap | integer optional | If package has to be delivered urgently, value should be 1 else it is considered as a scheduled delivery and "schedule_date" parameter should also be provided |
schedule_date_local | string optional | Should be provided in UTC format, if "taken_asap" = 0 |
string required | Email which is used at registration in Senpex API Dashboard. | |
show_one_price | integer optional | 1 or 0 (1 = only one price , 0 = both prices), Will show only Scheduled delivery price if schedule_date is provided , otherwise it will show Urgent Delivery price |
promo_code | string optional | Promo code if available |
order_desc | string required | General delivery notes(Usually it is a gate code, apartment number and so on) |
route_desc | string required | General delivery notes(Usually it is a gate code, apartment number and so on) |
rec_name | string required | John Conor |
route_desc | string required | General delivery notes(Usually it is a gate code, apartment number and so on) |
rec_phone | integer required | 6501231234 |
routes | array required | |
routes.route_to_text | string required | Address of drop-off location |
routes.route_desc | string required | Delivery notes used for each drop-off address |
routes.rec_name | string required | The name of Receiver at the drop-off address (can be empty, but in Order Creation process it is required.) |
routes.rec_phone | string required | General delivery notes(Usually it is a gate code, apartment number and so on) |
Response Parameters:
Key | Datatype | Description |
---|---|---|
code | string | It is 0 for successful request execution |
is_user_registered | boolean | Returns true for a registered user |
diff_in_minutes | integer | Difference in minutes |
api_token | string | This token will be used for making payment in create_quick_order service |
order_price | float | Calculated order amount for given parameters |
original_order_price | string | Calculated order amount without discount |
tariff_name | string | The name of Tariff plan |
order_discount | float | Discount amount that has been used for promo code |
tariff_id | string | Id of the tariff plan |
promo_code_info | string | Promotion code if applied |
company_id | string | Id of company |
tariff_duration_mins | string | The maximum time (in minutes) for using this tariff plan . |
distance_miles | float | The distance in mile from the pick-up to drop-off |
distance_time_seconds | string | Time in seconds for covering the distance |
schedule_date | string | Date of the scheduled delivery |
item_value | string | Estimated cost of your package |
pack_size_id | string | See all available [Package size types] |
transport_id | string | See all available [Transport types] |
pack_from_lat | float | The latitude of the pick-up location |
pack_from_lng | float | The longitude of the pick-up location |
routes | string | Route details in string format |
routes_json | string | Route details in json format |
routes.route_to_text | string | The address of drop-off address |
routes.route_desc | string | The route description, if it was passed in the request |
routes.route_rec_name | string | The receiver name, if it was passed in the request |
routes.route_rec_phone | string | The receiver phone, if it was passed in the request |
routes.route_to_lat | float | The Latitude of drop-off address |
routes.route_to_lng | float | The Longitude of drop-off address |
route_distance | float | The distance of that route from pick-up to drop-off location |
route_distance_time | float | The time to cover the distance of the route from pick-up to drop-off location |
tariff_duration_hours | float | Total hours for the delivery |
tariff_duration_days | integer | Total days for the delivery |
expire_mins | integer | The expiry time of the api token (in minutes) . |
HEADERS:
secretid: | {{ secret_id }} |
clientid: | {{ client_id }} |
Body raw
{
"order_name": "Test ",
"taken_asap": 1,
"schedule_date_local":null,
"transport_id": 1,
"item_value": 200,
"pack_size_id": 1,
"promo_code": "",
"order_desc": "TEST ORDER DESC",
"routes": [
{
"route_to_text": "19590 Stevens Creek Blvd, Cupertino, CA 95014, USA",
"rec_name": "customer client",
"rec_phone": "6507883883"
},
{
"route_to_text":"2898 Homestead Rd, Santa Clara, CA 95051, USA",
"rec_name":"Max",
"rec_phone":"123983276",
"route_desc": 123235
},
{
"route_to_text":"1202 Apollo Way, Sunnyvale, CA 94085, United States",
"rec_name":"Max",
"rec_phone":"123983276",
"route_desc": 123235
},
{
"route_to_text":"1082 East El Camino Real ste 2, Sunnyvale, CA 94087, USA",
"rec_name":"Max",
"rec_phone":"123983276",
"route_desc": 123235
},
{
"route_to_text":"1154 Sonora Court, Sunnyvale, CA 94086, USA ",
"rec_name":"Max",
"rec_phone":"123983276",
"route_desc": 123235
}
]
}
Example Request curl
curl --location 'https://api.sandbox.senpex.com/api/restfull/v4/orders/pickup/quote' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data '{
"order_name": "Test ",
"taken_asap": 1,
"schedule_date_local":null,
"transport_id": 1,
"item_value": 200,
"pack_size_id": 1,
"promo_code": "",
"order_desc": "TEST ORDER DESC",
"routes": [
{
"route_to_text": "19590 Stevens Creek Blvd, Cupertino, CA 95014, USA",
"rec_name": "customer client",
"rec_phone": "6507883883"
},
{
"route_to_text":"2898 Homestead Rd, Santa Clara, CA 95051, USA",
"rec_name":"Max",
"rec_phone":"123983276",
"route_desc": 123235
}
]
}'
orders/pickup PUT
This service allows the user to confirm a new order.
To create a new order, first send a "POST/orders/pickup/quote" request. This will return "api_token" in the response. Using this token user can send this PUT request to confirm new order. User may choose to add tip in this request while confirming this order. The parameter used to add tip is "tip_amount"
Note: api_token expires in 60 minutes after creating and it can be used for creating one order only.
Any data that was sent through "pickup/quote" can be updated through this request.
Request Parameters:
Key | Datatype | Description |
---|---|---|
api_token | string required | Token received from get_price request |
string required | Email of API account owner. This field determines the name of sender(partner) and predefined pricing options | |
sender_name | string optional | Name of sender/store/restaurant |
sender_cell | string optional | Phone number of sender/store/restaurant |
sender_desc | string optional | Senders notes and instructions. |
order_desc | string optional | Any delivery notes(Usually it is a gate code, apartment number and so on) |
routes | array | List of routes |
routes.rec_name | string optional | The name of receiver (Should be provided if not provided in "get_price" service) |
routes.rec_phone | string optional | The phone number of receiver (Should be provided if not provided on "get_price" service) |
snpx_user_email | integer optional | 1 = will send an email with password to user, if this email id does not exist in the system, 0 = will not send email |
snpx_order_email | integer optional | 1 = will send email about orders, 0 = will not send email |
snpx_order_not | integer optional | 1 = will send push notifications to a user if "device_id" will be provided, 0 = will not send notifications |
search_courier | integer optional | 1 = start searching for a courier just after creating a package, 0 = will not search for courier until "update_order_nots" will not be requested |
tip_amount | integer optional | Through this parameter tips from clients are being send. By default it is 0 |
Response Parameters:
Key | Datatype | Description |
---|---|---|
inserted_id | integer | The newly created order id |
distance | float | The distance in miles from the pick-up to drop-off |
distance_time | float | Time in seconds to cover the distance |
HEADERS:
secretid: | {{ secret_id }} |
clientid: | {{ client_id }} |
Body raw
{
"email": "test@senpex.com",
"api_token": "{{api_token}}",
"tip_amount": 25
}
Example Request curl
curl --location --request PUT 'https://api.sandbox.senpex.com/api/restfull/v4/orders/pickup' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data-raw '{
"email": "test@senpex.com",
"api_token": "{{pickup_api_token}}",
"tip_amount": 15
}'
orders/driver/rate PUT
This request allows user to provide rating for a specific driver. To be able to run this request Driver is required to be assigned to an order and using this order id, user can further provide ratings for driver's services.
Request Parameters:
Key | Datatype | Description |
---|---|---|
Order_id | string | The order id |
rate_val | integer | rating for driver |
Response Parameters:
Key | Datatype | Description |
---|---|---|
code | integer | 0 for successful execution |
inserted_id | integer | The distance in miles from the pick-up to drop-off |
msgtext | string | Show message if courier is already rated by you |
HEADERS:
secretid: | {{ secret_id }} |
clientid: | {{ client_id }} |
Body raw
{
"order_id": "{{pickup_neworder_id}}",
"rate_val": "5"
}
Example Request curl
curl --location --request PUT 'https://api.sandbox.senpex.com/api/restfull/v4/orders/driver/rate' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data '{
"order_id": "{{pickup_neworder_id}}",
"rate_val": "5"
}'