pandago-API-version-1.1.0-1
pandago-API-version-1.1.0-1
pandago-API-version-1.1.0-1
version 1.1.0
Introduction
The pandago API provides system-to-system integration to facilitate on-demand courier delivery
service requests. Each integration is scoped as a specific Brand using a ClientID. Each delivery
request will be called an Order.
Client
Client represents a single integration for a specific Brand. Client information will include the
following:
● Customer known name of the Brand/Branch
● Address of the Brand/Branch that includes Latitude and Longitude.
A Client would typically represent a logistical system that manages a Brand with a few branch
locations. This system will usually manage or will need an order allocation to distribute order to
its branches. The pandago API supports dynamic pick-up location that allows orders to be
picked up from any branch location.
Integration Step(s)
1. Register a Client as a Brand with pandago.
2. Register all Branches/Outlets which relates to the Brand.
3. Use
Note: Accuracy of branch’s latitude and longitude is important for the branch matching process
the same ClientID when submitting orders from any branch within the registered Brand.
Ordering Step(s)
1. The Sender address must be specified when submitting an Order.
The Sender latitude and longitude will be used to find the matching Branch/Outlet with a
tight tolerance.
Note: system will reject the order when it fails to find the matching Branch/Outlet latitude and longitude.
Order
Order is the principal object that encompasses the package delivery process from the start to
the end. Once a new order is submitted, pandago will respond with the order details and will
start looking for an available courier. OrderID should be used to get updates on the order
status.
Status Updates
Order status updates can be obtained from the following method:
1. Push method
A Callback URL can be provided as part of the Client information. This will allow the
pandago API to push status updates to the Callback URL.
2. Pull method
A Get Order endpoint can be pulled periodically to get the latest status.
Available Statuses
Status Description
DELAYED Order delivery has been delayed and estimated delivery time has
been updated
PAID Order has been fully paid already and courier will not collect any
amount from the end customer
CASH_ON_DELIVERY Courier will collect payment (order amount) from the end customer
upon delivery
*For the billing of the pandago delivery fee, this will be settled separately according to the
agreed billing schedule and process
Getting Started
These are the steps to start using the pandago API:
1. Generate Key Pair (Private Key and Public Key) to support secure communication with
the pandago API.
Follow these commands on a terminal:
# Generate private key
# output: client.pem file
openssl genrsa -out client.pem 2048
Name Customer known name for your Brand or Branch Store ABC
3. The pandago representative will provide you with ClientID, KeyID and Scope that your
service will need to generate an Access Token for thepandago API.
Attribute Example Description
Authentication
All pandago API endpoints support OAuth 2.0 authentication protocol.
Your service will need to generate an Access Token using your service Private Key, ClientID,
KeyID and Scope from the pandago Authenticator.
Host
Sandbox environment
https://sts-asia-st.deliveryhero.io
https://sts-asia.deliveryhero.io
POST oauth2/token
Request
Header
Content-Type: application/x-www-form-urlencoded
Body
There are 2 steps to generate the body.
1. Generate assertion as a signed token in Javascript Web Token (JWT) format.
This is the payload structure of the token:
{
"alg":"RS256",
"typ":"JWT",
"kid": "{{KeyID}}"
}
.
{
"iss":"{{ClientID}}",
"sub":"{{ClientID}}",
"jti":"{{random uuid}}",
"exp":{{unix timestamp in the future}},
"aud":"https://sts.deliveryhero.io"
}
And use the Private Key to sign the token.
2. Construct the following body
grant_type=client_credentials;
client_id={{ClientID}};
client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer;
client_assertion={{SignedJWT}};
scope={{Scope}};
Example
Response
Header
Content-Type: application/json
Body
Attribute Type Required Description
Example:
{
“access_token”:”{{AccessToken}}”,
“expires_in”:”{{expirity in seconds}}”
}
Orders
Features
POST /api/v1/orders/fee
Request
Header
Content-Type: application/json
Authorization: Bearer {{AccessToken}}
Body
See Submit New Order > Request > Body
Response
Success
This is the expected response upon successful estimation of the order’s fee.
Header
Body
Attribute Type Required Description
client_order_id string no Your system reference id for this order (default: empty)
Invalid Payload
This error response covers any invalid formatting of the request payload and the issue will be
described in the response message.
Header
Body
Attribute Type Required Description
Example
{
“message”: “Invalid request payload\n - recipient.phone_number is required”
}
Header
Body
Attribute Type Required Description
Example
{
“message”: “No Branch found that is close enough to the given sender coordinates”
}
Server Error
This error response covers any internal issues which prevent the service to estimate the order’s
fee.
Header
Body
Attribute Type Required Description
Example
{
“message”: “Unable to proceed, something went wrong”
}
POST /api/v1/orders/time
Request
Header
Content-Type: application/json
Authorization: Bearer {{AccessToken}}
Body
See Submit New Order > Request > Body
Response
Success
This is the expected response upon successful estimation of the order’s time.
Header
Body
Attribute Type Required Description
client_order_id string no Your system reference id for this order (default: empty)
Example:
{
“client_order_id”: ”client-ref-000001”,
“estimated_pickup_time”:“2018-09-13T01:30:52.123Z”,
“estimated_delivery_time”:“2018-09-13T01:45:52.123Z”
}
Invalid Payload
This error response covers any invalid formatting of the request payload and the issue will be
described in the response message.
Header
Body
Attribute Type Required Description
Example
{
“message”: “Invalid request payload\n - recipient.phone_number is required”
}
Body
Attribute Type Required Description
Example
{
“message”: “No Branch found that is close enough to the given sender coordinates”
Server Error
This error response covers any internal issues which prevent the service from estimating the
order’s time.
Header
Body
Attribute Type Required Description
Example
{
“message”: “Unable to proceed, something went wrong”
}
Request
Header
Content-Type: application/json
Authorization: Bearer {{AccessToken}}
Body
Attribute Type Required Description
client_order_id string no Your system reference id for this order (default: empty)
sender.phone_number string yes Phone number of sender following ITU-T E.164 standard
sender.location.notes string no Notes relevant for rider for pick-up (default: blank)
description string(255) yes Describe all item(s) in the order that will be used for
verification (max of 255 characters)
Example:
{
“sender”: {
“name”:”pandago”,
“phone_number”:”+650000000”,
“location”: {
“address”:”1 2nd Street #08-01”,
“latitude”:1.2923742,
“longitude”:103.8486029,
“notes”: “use the left side door”,
}
},
“recipient”: {
“name”:”Merlion”,
“phone_number”:”+650000000”,
“location”: {
“address”:”20 Esplanade Drive”,
“latitude”:1.2857488,
“longitude”:103.8548608,
“notes”: “use lift A and leave at the front door”,
}
},
“amount”: 23.50,
“payment_method”:”PAID”,
}
Response(s)
Success
This is the expected response upon successful creation of the order.
Header
client_order_id string no Your system reference id for this order (default: empty)
sender.phone_number string yes Phone number of sender following ITU-T E.164 standard
sender.location.notes string no Notes relevant for rider for pick-up (default: blank)
recipient.location.notes string no Notes relevant for rider for drop-off (default: blank)
amount float no Price of the order that customer paid (default: 0.0)
description string( no Any relevant description about the order (max of 255
255) characters) (default: blank)
timeline.estimated_delivery_ti string no Estimated delivery time in ISO Datetime (default: blank) yes
created_at int yes Created time in UNIX timestamp updated_at int yes Updated time in
UNIX timestamp
Example:
{
“order_id”:“y0ud-000001”,
“client_order_id”: “client-ref-000001”,
“recipient”: {
“name”:”Merlion”,
“phone_number”:”+650000000”,
“location”: {
“Address”:”20 1st Street #08-01”,
“latitude”:1.2857488,
“longitude”:103.8548608,
“notes”:”place the item on the footstool”
}
},
“payment_method”:”PAID”,
“coldbag_needed”:false,
“amount”:10.2,
“description”:”new decoration for Merlion’s footstool”
“status”:”NEW”,
“delivery_fee”:8.17,
“timeline”: {
“estimated_pickup_time”:“”,
“estimated_delivery_time”:“”,
},
“driver”: {
“id”:””,
“created_at”:1536802000, “updated_at”:1536802000 }
Invalid Payload
“name”:””,
“phone_number”:””
},
This error response covers any invalid formatting of the request payload and the issue will be
described in the response message.
Header
Body
Attribute Type Required Description
Example
{
“message”: “Invalid request payload\n - recipient.phone_number is required”
}
Header
Body
Attribute Type Required Description
Example
{
“message”: “No Branch found that is close enough to the given sender coordinates”
}
Server Error
This error response covers any internal issues which prevent the service to process the order
creation.
Header
Body
Attribute Type Required Description
Example
{
“message”: “Unable to proceed, something went wrong”
}
GET /api/v1/orders/{{OrderID}}
Request
Header
Content-Type: application/json
Authorization: Bearer {{AccessToken}}
Response
Success
This is the expected response upon successful read of the order details.
Header
Body
See Submit New Order > Response > Body
Not Found
This response represents when the desired order does not exist.
Header
Body
Attribute Type Required Description
Example
{
“message”: “Order not found”
}
Server Error
This error response covers any internal issues which prevent the service to read the order
details.
Header
Body
Attribute Type Required Description
Example
{
“message”: “Unable to proceed, something went wrong”
}
GET /api/v1/orders/{{OrderID}}/coordinates
Request
Header
Content-Type: application/json
Authorization: Bearer {{AccessToken}}
Response
Success
This is the expected response upon successful read of the order’s coordinates.
Header
Body
Attribute Type Required Description
client_order_id string no Your system reference id for this order (default: empty)
Example:
{
“client_order_id”: “client-ref-000001”,
“latitude”:1.2857488,
“longitude”:103.8548608,
“updated_at”:1536802252
}
Not Found
This response represents when the desired order does not exist.
Header
Body
Attribute Type Required Description
Example
{
“message”: “Order not found”
}
Server Error
This error response covers any internal issues which prevent the service to read the order
details.
Header
Body
Attribute Type Required Description
Example
{
“message”: “Unable to proceed, something went wrong”
}
DELETE /api/v1/orders/{{OrderID}}
Request
Header
Content-Type: application/json
Authorization: Bearer {{AccessToken}}
Body
Attribute Type Required Description
Example:
{
“reason”:”customer cancel the order”
}
Response
Success
This is the expected response upon successful order cancellation.
Header
Body
-No Content
Uncancellable
This response represents that the desired order is no longer cancellable.
Header
Body
Attribute Type Required Description
Example
{
“message”: “Order is not cancellable”
}
Not Found
This response represents when the desired order does not exist.
Header
Body
Attribute Type Required Description
Example
{
“message”: “Order not found”
}
Server Error
This error response covers any internal issues which prevent the service to cancel the order.
Header
Body
Attribute Type Required Description
Example
{
“message”: “Unable to proceed, something went wrong”
}
Request
Header
Content-Type: application/json
Body
Attribute Type Required Description
client_order_id string no Your system reference id for this order (default: empty)
Example:
{
“order_id”:“y0ud-000001”,
“client_order_id”: “client-ref-000001”,
“status”:”PICKED_UP”,
“timeline”: {
“estimated_pickup_time”:“2018-09-13T01:30:52.123Z”,
“estimated_delivery_time”:“2018-09-13T01:45:52.123Z”,
},
“driver”: {
“id”:”12324”,
},
“created_at”:1536802000,
“updated_at”:1536802252
}