Senpex Api For Customer
API Overview
Welcome to the Senpex API documentation. You can use the Senpex API to provide same-day delivery to your customers by one click.
Through the Senpex API, your application will be able to create and manage orders as well as retrieve the details and status updates on those select orders. The Senpex API is organized around REST and has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes.
Preliminary Notes
To use the Senpex API, the Client has to register on https://dev.senpex.com . After successful registration, the client has to request for approval from the Senpex support team by making a call 650-514-6350. Upon approval, the client will receive an email with the link to Senpex API.
Requirements
The API requires credit card details which must be entered after logging in to your account by navigating to Billing details in account profile. Please take a note that by default Senpex will immediately provide a price for end user that will be expected to be paid for, however, the pricing is not determined by Senpex. The vendor is given the freedom to choose their own pricing structure. Thereby, the customer will use client secret keys that will be provided by Senpex, but the end user will have the ability to re-generate the secret keys for safety.
What to start with?
If you are ready to integrate with our API and have already created Client Account, continue here Sign In - if you don't have one, you can register by clicking here Sign Up
Once your account is created and you login with these credentials, you will be automatically provided with a client_id and secret_id. Additionally, you will need to add your own Google Maps API Key to the dashboard.
To create your own Google Maps API Key, visit: https://developers.google.com Create a new account or register with an existing one. After you’re logged in, go to the Products/Cloud and click “Go to console”. Then go to “APIs & Services”/Dashboard/Credentials and click “Create Credentials”/API key. After creating your API key, you will need to activate the Geocoding API, Directions API, Distance matrix API, Geolocation API, Places API, Time Zone API.
Once you get a Google API key, verify it here. After verification, paste it in Senpex API Dashboard.
Note! Please, keep these keys secured and do not embed them in any client-side code.
Add your Credit card by navigating to Billing details in your account profile.
Environments
Every integration starts with the Test Environment. Credentials and all required information for both environments will be provided by Senpex Support Team.
- Baselink for Test Environment - https://api.sandbox.senpex.com/api/restfull/v4/
- Baselink for Production - https://api.production.senpex.com/api/restfull/v4
- Images Test server: https://imagesfiles.sandbox.senpex.com/image_list/
- Images Prod server: https://imagesfiles.production.senpex.com/image_list/
Dictionary Definitions
Available Transport Types
Senpex platform provides five different types of transportation vehicle for delivering orders depending on the size of the order. As a default transport type, set up 'Car'
ID | Transport type | Definition |
---|---|---|
1 | Car | Set type as Car, if the estimated total weight of the order is Small, Medium and Large that can be accommodated easily. |
3 | SUV | Set type as SUV, for Large loads with big value. |
8 | Pickup Truck | Set type as Pickup Truck, for Heavy and Big Size loads. |
9 | Large Van | Set type as Large Van, for Heavy and Big Size loads. |
Package Size Types
ID | Size | Definition |
---|---|---|
1 | Small (1-25 lbs) | Boxes 15 in., envelopes, food, flowers and other items be- tween 0 - 25 Lbs |
2 | Medium (26 – 50 lbs) | Boxes 30 in., small appliance, tools, meals, and other items between 25 - 50 Lbs |
3 | Large (51 – 70 lbs) | Boxes 45 in., appliance, supplies and other items between 50 - 70 Lbs (Not requires lifting equipment) |
4 | Heavy Load (71 - 150 Lbs) | Major appliance, carpets, mattresses, equipment, furniture and other items between 70 - 150 Lbs |
5 | Not Heavy but Big Size (up to 70 Lbs) | Big and lightweight items: Containers, tanks, Home Cinema, Octobass, polystyrene and other items up to 70 Lbs |
As a default package size set up 'Small'
Order Status
API provides different statuses for the Order that is placed.
ID | Status | Definition |
---|---|---|
0 | Draft Order | Order has not been placed yet, but is saved as a draft . |
5 | Waiting for pay | Order is placed and is awaiting payment. |
7 | Scheduled order | Order is scheduled for a future date and time. |
8 | Repeated order | Root order for scheduled orders. |
10 | Paid order | Order payment is done |
20 | Courier selected | Courier service is selected for the order |
25 | Arrived to pickup location | Courier arrived to pickup location |
30 | Item in transit | Package is in transit for delivery |
35 | Arrived to drop-off location | Driver arrived |
40 | Item is delivered | Package is delivered |
50 | Item not given | Package is not delivered |
90 | Reported order | Order is reported for some incident |
100 | Cancelled order | Order is cancelled by customer |
Route Status
Route status for any order will be “0” if the order is not yet taken by the courier.
ID | Status | Definition |
---|---|---|
0 | Order not taken | Order not taken by the courier |
30 | Order is taken | Order is taken by the courier |
40 | Order is delivered | Order is delivered |
Courier Package Cancellation Reasons
A courier can be cancelled anytime. This list shows the available reason for cancellation.
ID | Reason | Definition |
---|---|---|
1 | Personal Problems | Courier cancelled due to personal problems. |
2 | Car Problems | Courier cancelled due to car problems. |
3 | Other issues | Courier cancelled due to other issues. |
Errors
Each REST API request results is giving error information:
ID | Error | Meaning |
---|---|---|
28 | StripeError | Unable to perform operation. Message: This value must be greater than or equal to 1. |
38 | EmptyValueError | (parameter) cannot be empty, eg: order name cannot be empty |
35 | MileError | Maximum 300 miles accepted |
50 | DataVarNotFound | Receiver phone number cannot be found |
58 | NoCreditCard | You don’t have linked credit card |
59 | SecretIDNotFound | Secret id not found |
60 | ClientIDNotFound | Client id not found |
61 | CompanyIsDisable | This Key is disabled by Snpx administration. Contact us . |
62 | SecretIsWrong | Secret or Client key is wrong |
63 | ApiTokenNotFound | This token cannot be found |
64 | ApiTokenNotYours | This token is not belongs to you |
65 | ApiTokenPriceExpired | This price is expired |
66 | ApiThisOrderAlreadyPaid | This order is already paid |
67 | RouteCountError | Routes count should be between 1 and 5. You provided 0 |
68 | ScheduleDateLow | Schedule date cannot be less than current date |
69 | ApiNotApprovedByAdmin | This API has not been approved by Senpex. Please, contact the Senpex support team. |
70 | ApiNotApprovedByOwner | You should enable you API on your “API Configuration” panel |
71 | APIPaymentDetailsNotFound | Your should assign your credit card to be able to use API |
73 | WrongEmailFormat | Please enter email in correct format |
13 | PackNotFound | You don't have access to this order, or it was canceled. |
5 | NotNumberValueError | order_id should be numeric |
14 | PackIncorrectStatus | You cannot do this operation on this order. Current status Cancelled pack. Acceptable statuses |
-50 | DataVarNotFound | Receiver name for 1 cannot be found |
-50 | DataVarNotFound | Receiver phone number for 1 cannot be found |
-5279 | RoutesNotArray | The list of routes should be provided in array |
-1081 | NotCorrespondingTransportForSize | Not corresponding transport_id for current pack_size. Allowed transports(1) |
-1282 | DataNotJson | Request body is not in JSON format |
-1126 | WrongOrderName | alphabetical and numerical symbols accepted |
-3250 | OrderNotExists | Order ID is not exist |
-23123 | PriceNotFound | Price information not found |
-10000 | GoogleAPICannotFindAddress | Google API cannot find required address |