Senpex API v4 Documentation

Points

It is a special service which is designed to cover needs of companies which receive a huge number of requests for delivery during a certain period of time. It doesn't matter whether it's a pick-up or drop-off request. By this API module Senpex platform is able to accumulate multiple destination points and organize them in orders with high efficiency with the use of route optimization algorithm.


points/dropoff POST

https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff

This request allows user to create single point orders for drop off or pick up addresses.

By this request external application sends to Senpex system information about the address that supposed to be served. By default this unit have the status "Ready for delivery". Once the status changed Senpex system will send to external application notification via Webhook.

Request Parameters:

Key Datatype Description
client_id string

required

Your client ID (Pass in header)
secret_id string

required

Your secret ID (Pass in header)
access_key string

required

Fulfillment ID from the external application
rec_name string

required

Name of recipient
rec_phone integer

required

Phone number of the recipient
rec_desc string

optional

Apartment number, gate code and other notes.
rec_address string

required

Address of the recipient
rec_email string

required

Email of the recipient

Response Parameters:

Key Datatype Description
code integer 0, means successful operation
inserted_id integer Internal fulfilment ID

HEADERS:

secretid: {{ secret_id }}
clientid: {{ client_id }}

Example Request curl

points/dropoff - example request
      
             
          curl --location 'https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data-raw '{
    "access_key": "Order001",
    "rec_name": "Jack London",
  "rec_phone": "1002003000",
  "rec_desc": " Description that will be visible to driver",
  "rec_address": "490 Lincoln St, Santa Clara, CA 95050",
  "rec_email": "test@test.com"
}'
        
      
    

points/dropoff GET

https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff?start=10

This Request allows user to retrieve order details for the orders listed after the 10th record. User can customize this list of orders by setting the Start parameter in url to a desired number of row.

HEADERS:

secretid: {{ secret_id }}
clientid: {{ client_id }}

PARAMS:

start: 10

Example Request curl

points/dropoff - example request
      
             
          curl --location 'https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff?start=10' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data ''
        
      
    

points/dropoff/ID GET

https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff/{dropoff_id}

This request retrieves order details of a particular, previously created order by passing order id in the endpoint url.

Order id is generated by the system when user creates a new order.

HEADERS:

secretid: {{ secret_id }}
clientid: {{ client_id }}

Example Request curl

points/dropoff/ID - example request
      
             
          curl --location -g 'https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff/{{dropoff_id}}' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data ''
        
      
    

points/dropoff/access_key/7 GET

https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff/access_key/order000

This request retrieves all the details of a specific , previously created order by providing the access key in the endpoint url for that particular order. Access key is the order name provided by the user and is not case sensitive.

HEADERS:

secretid: {{ secret_id }}
clientid: {{ client_id }}

Example Request curl

points/dropoff/access_key/7 - example request
      
             
          curl --location 'https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff/access_key/order000' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data ''
        
      
    

points/dropoff/track/ID GET

https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff/track/{dropoff_id}

This request allows user to track the order status by using order id in the url.

Tracking information includes response parameters like status_id, pack_status, route_status, along with courier information.

HEADERS:

secretid: {{ secret_id }}
clientid: {{ client_id }}

Body raw

body example code
      
             
      {"pack_size_id":"1"}
    
      
    

Example Request curl

points/dropoff/track/ID - example request
      
             
          curl --location -g --request GET 'https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff/track/{{dropoff_id}}' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data '{"pack_size_id":"1"}'
        
      
    

points/dropoff/track/access_key/7 GET

https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff/track/access_key/test order123}

This request allows user to track the order status by using Access Key in the url.

Tracking information includes response parameters like status_id, pack_status, route_status, along with courier information.

HEADERS:

secretid: {{ secret_id }}
clientid: {{ client_id }}

Body raw

body example code
      
             
      {"pack_size_id":"1"}
    
      
    

Example Request curl

points/dropoff/track/access_key/7 - example request
      
             
          curl --location --request GET 'https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff/track/access_key/test order123' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data '{"pack_size_id":"1"}'
        
      
    

points/dropoff-delivery-ready PUT

https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff-delivery-ready

This request allows user to change the status of a previously created order which is ready for delivery.

This status can be sent after order created, Draft orders, Delivery Attempt failed and Returned to Senpex warehouse statuses.

For example courier tried to deliver the package, but recipient was not at home and it has been returned back and status is "delivery attempt failed " then it can be again marked as for ready for delivery using this request.

In Response parameters, inserted id: -1 indicates that status is changed successfully.

HEADERS:

secretid: {{ secret_id }}
clientid: {{ client_id }}

Body raw

body example code
      
             
      { "id":"786" }
    
      
    

Body raw

body example code
      
             
      {"pack_size_id":"1"}
    
      
    

Example Request curl

points/dropoff-delivery-ready - example request
      
             
          curl --location --request PUT 'https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff-delivery-ready' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data '{
    "id":"786"
}'
        
      
    

points/dropoff-laboratory-ready PUT

https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff-laboratory-ready

This request allows user to change order status from 'Delivered to recipient' to 'Ready for pick-up'

This request can be sent only after a parcel is delivered to recipient.

In Response parameters, inserted id: -1 indicates that status is changed successfully.

HEADERS:

secretid: {{ secret_id }}
clientid: {{ client_id }}

Body raw

body example code
      
             
      { "id":"786" }
    
      
    

Body raw

body example code
      
             
      {"pack_size_id":"1"}
    
      
    

Example Request curl

points/dropoff-laboratory-ready - example request
      
             
          curl --location --request PUT 'https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff-laboratory-ready' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data '{
    "id":"786"
}'
        
      
    

points/dropoff-received PUT

https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff-received

This request allows user to change the status of an order from 'Delivered to laboratory' to 'Drop-off received'.

This request can be sent only after a parcel is delivered to the laboratory or final destination.

In Response parameters, inserted id: -1 indicates that status is changed successfully.

HEADERS:

secretid: {{ secret_id }}
clientid: {{ client_id }}

Body raw

body example code
      
             
      { "id":"786" }
    
      
    

Body raw

body example code
      
             
      {"pack_size_id":"1"}
    
      
    

Example Request curl

points/dropoff-received - example request
      
             
          curl --location --request PUT 'https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff-received' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data '{
    "id":"786"
}'
        
      
    

Create dropoff/routes POST

https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff/route

It is a modified and improved endpoint helping to pass through it additional information about the destination point. Unlike the /points/dropoff it contains 3 additional parameters:

  • "pickup_address"
  • "pickup_time"
  • "pickup_address_text"

This gives our platform a possibility to retrieve more accurate data and conduct more flexible and efficient route optimization and planning, taking into consideration different pick-up points and various time windows.

Request Parameters:

Key Datatype Description
client_id string

required

Your client ID
secret_id string

required

Your secret ID
access_key string

required

Fulfillment ID from the external application
pickup_address string

required

Pick-up address
pickup_time integer

required

Pick-up time
pickup_address_text string

optional

Additional information about pick-up address(apt. number, special directions etc..)
rec_name string

required

Name of recipient
rec_phone integer

required

Phone number of the recipient
rec_desc integer

required

Apartment number, gate code and other notes.
rec_address string

required

Address of the recipient
rec_email string

required

Email of the recipient

HEADERS:

secretid: {{ secret_id }}
clientid: {{ client_id }}

Body raw

body example code
      
             
      {
      "access_key": "Route01",
      "pickup_address": "1220 tasman drive, Sunnyvale CA",
      "pickup_address_text": "Test pick-up text",
      "pickup_time": "2023-02-22 10:30",
      "rec_name": "Ms.C",
      "rec_phone": " 1002003000",
      "rec_desc": " Description that will be visible to driver",
      "rec_address": "4168 Technology Drive,Fremont, CA",
      "rec_email": "test@test.com"
      }
    
      
    

Body raw

body example code
      
             
      {"pack_size_id":"1"}
    
      
    

Example Request curl

dropoff/routes - example request
      
             
          curl --location 'https://api.sandbox.senpex.com/api/restfull/v4/points/dropoff/route' \
--header 'secretid: {{secret_id}}' \
--header 'clientid: {{client_id}}' \
--data-raw '{
  "access_key": "Route01",
  "pickup_address": "1220 tasman drive, Sunnyvale CA",
  "pickup_address_text": "Test pick-up text",
  "pickup_time": "2023-02-22 10:30",
  "rec_name": "Ms.C",
  "rec_phone": " 1002003000",
  "rec_desc": " Description that will be visible to driver",
  "rec_address": "4168 Technology Drive,Fremont, CA",
  "rec_email": "test@test.com"
}'