v3

v3

Endpoint URL

Staging

https://us-central1-fleet-staging-2333a.cloudfunctions.net

Production

will be provided after SIT

 


Login and Get Session Token bUSINESS Provider

Description

To acquire authorization token

Endpoint

/login

Method

POST


Request Headers

{ "Content-Type": "application/json" }


Request Body

Field

Data type

Required

Description

Field

Data type

Required

Description

email

string

yes

email credential

password

string

yes

password


Sample Request Body

{ "email": "sandbox_dev@gmail.com", "password": "password" }

Sample Response

Status: 200 OK! { "success": true, "results": { "apiKey": "fb77c9653bf5e736d191b46bbfed7c2bd", "clientId": "SANDBOX_DEV", "sessionToken": "b45e2fb77c9653bf5e736d19e1fd18ebbffd0f6d3dd25af118e5eb38851bf4d" } }

 

Field

Description

Field

Description

apiKey

Generated hash on client-side to be used on succeeding API request

clientId

Reference Client ID

sessionToken

Generated hash on every API login to be used on succeeding API requests.
Expires after 20 minutes.

 

  • Session token expires after 20 minutes of use.

  • Session duration refreshes every login or on API (createPost, getPost, etc.) calls given that the token is still valid.

  • QUOTA_EXCEEDED error message occurs when you reach a certain number of login API request per second. For bulk API calls, please use the login API once and reuse the session token. You may also retry the operation after 1-2 seconds.

Error Messages:

Invalid Email

Status: 401 Unauthorized {     "success": false,     "results": "EMAIL_NOT_FOUND" }

 

Invalid Password

Status: 401 Unauthorized { "success": false, "results": "INVALID_PASSWORD" }

 

Quota Limit Exceeded Error

Status: 401 Unauthorized { "success": false, "results": "QUOTA_EXCEEDED : Exceeded quota for verifying passwords." }

Login v2 BUSINESSProvider

Description

Login V2 that uses JWT Auth

Endpoint

/loginV2

Method

POST

 

Request Headers

KEY

VALUE

KEY

VALUE

Content-Type

application/json

 

Request Body

Field

Data type

Required

Description

Field

Data type

Required

Description

email

string

yes

email credential

password

string

yes

password

{ "email": "sample@email.com", "password": "1234456" }

Sample Response

{ "success": true, "results": { "accessTokenExpiresAt": 1650941635051, "refreshTokenExpiresAt": 1653532435052, "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnQiOiJTQU5EQk9YX0RFViIsImxtaUF1dGhLZXkiOiIyRjlCNTdGQTlDNzRGOEUwQ0YyM0NCMDUyQjJDNDM4RTBBRDhEOTUxREE5QzczQkM1QjZEQUYxOEZDMDNFMjVBIiwiZW1haWwiOiJjaHJpc0BkZXYuZmxlZXQucGgiLCJpYXQiOjE2NTA5NDA0MzUsImV4cCI6MTY1MDk0MTYzNX0.5ulcbOQkNP5ESFmf8xVvGhdEi_U7tPb32Uvyqpevp_I", "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnQiOiJTQU5EQk9YX0RFViIsImxtaUF1dGhLZXkiOiIyRjlCNTdGQTlDNzRGOEUwQ0YyM0NCMDUyQjJDNDM4RTBBRDhEOTUxREE5QzczQkM1QjZEQUYxOEZDMDNFMjVBIiwiZW1haWwiOiJjaHJpc0BkZXYuZmxlZXQucGgiLCJjbGllbnRBcGlLZXkiOiJiMmY1YzVhNi1hZGIwLTQ5MTktODZkMy1mMzIwNTdlN2RlZGMiLCJpYXQiOjE2NTA5NDA0MzUsImV4cCI6MTY1MzUzMjQzNX0.eKG-NTpoApJ314nQ2Vgj8mZF8QrwV7oUuEmZLif3JrI" } }
  • To use Login API v2 on our existing endpoints (e.g. /getpost), “x-access-token" must be defined in the HEADERS instead of the "Auth-token" and value for it should be “Bearer {{accessToken}}”.

  • apiKey is no longer required to be defined in the Parameters on our existing endpoints
    (e.g. /getpost) if “x-access-token" is defined in the Headers.

Error Messages:

Invalid Email

Status: 401 Unauthorized {     "success": false,     "results": "INVALID_EMAIL" }

Invalid Password

Status: 401 Unauthorized {     "success": false,     "results": "INVALID_PASSWORD" }

Get Partners Business Provider

Description

To get the list of your preferred partners

Endpoint

/getPartners

Method

GET


Request Headers

Login V1

{ "Auth-Token": "<Auth token acquired on api LOGIN>" }

Login V2

As an alternative, “x-access-token” for our login v2 can be used instead of using the “auth-token” for our login v1. Value for it will be “Bearer {{accessToken}}“. See below:

{ "x-access-token": "Bearer <Access token acquired on api LOGIN V2>" }

To use "x-access-token" for our Login V2 successfully, “auth-token” must no longer be defined in the headers.

Query parameters (URL)

Login V1

{ "apiKey": "<apiKey will be acquired on login API>" }

Login V2

There is no need to define the apiKey in the parameters for our LoginV2.


Sample Response

Status: 200 OK! { "success": true, "results": [ { "id": "SANDBOX_BUSINESS", "name": "Sandbox Business", "serviceType": "onDemand" }, { "id": "SANDBOX_QA", "name": "Sandbox_QA", "serviceType": "scheduled" } ] }

 

Get List of Areas Business

Description

To get the list of areas

Endpoint

/getListOfAreas

Method

GET


Request Headers

Login V1

{ "Auth-Token": "<Auth token acquired on api LOGIN>" }

Login V2

As an alternative, “x-access-token” for our login v2 can be used instead of using the “auth-token” for our login v1. Value for it will be “Bearer {{accessToken}}“. See below:

{ "x-access-token": "Bearer <Access token acquired on api LOGIN V2>" }

To use "x-access-token" for our Login V2 successfully, “auth-token” must no longer be defined in the headers.


Query parameters (URL)

Login V1

{ "apiKey": "<apiKey will be acquired on login API>" }

Login V2

There is no need to define the apiKey in the parameters for our LoginV2.


Sample Response

Status: 200 OK! { "success": true, "results": [ { "id": "-KnmC5Y0pFYBquoDL1zo", "info": { "code": "A1", "name": "Area 1", "stores": [ "-LDnYzs1xbK-FeQ0VPFr" ] } } ] }

Get List of Stores/Hubs BUSINESS

Description

To get the list of stores/hubs

Endpoint

/getListOfStores

Method

GET


Request Headers

Login V1

{ "Auth-Token": "<Auth token acquired on api LOGIN>" }

Login V2

As an alternative, “x-access-token” for our login v2 can be used instead of using the “auth-token” for our login v1. Value for it will be “Bearer {{accessToken}}“. See below:

{ "x-access-token": "Bearer <Access token acquired on api LOGIN V2>" }

To use "x-access-token" for our Login V2 successfully, “auth-token” must no longer be defined in the headers.

Query parameters (URL)

Login V1

{ "apiKey": "<apiKey will be acquired on login API>", "areaCode": "<area code acquired from getListOfAreas API>" }

Login V2

There is no need to define the apiKey in the parameters for our LoginV2.

{ "areaCode": "<area code acquired from getListOfAreas API>" }


Sample URL

https://us-central1-fleet-staging-2333a.cloudfunctions.net /getListOfStores?apiKey=7c5dd55738b964944f9357bcc7f45ce6d857ff18&areaCode=A1


Sample Response

Status: 200 OK! { "success": true, "results": [ { "id": "-LDnYzs1xbK-FeQ0VPFr", "info": { "address": "7391 Building 9 Bakawan St. Corner Mayapis St., San Antonio Village, Makati, 1203 Metro Manila", "advanceStart": false, "code": "main_store", "default": true, "latitude": 14.5601823, "longitude": 121.00680469999998, "name": "Main Store", "province": "Metro Manila", "provinceKey": "MM" } } ], "total": 1 }

Get Provider's Create Post v3 Template Business

Description

Get provider’s create post template and meta fields schema for createPost v3 API.
For integration only

Endpoint

/v3/getCreatePostTemplate

Method

GET


Request Headers

Login V1

{ "Auth-Token": "<Auth token acquired on api LOGIN>" }

Login V2

As an alternative, “x-access-token” for our login v2 can be used instead of using the “auth-token” for our login v1. Value for it will be “Bearer {{accessToken}}“. See below:

{ "x-access-token": "Bearer <Access token acquired on api LOGIN V2>" }

To use "x-access-token" for our Login V2 successfully, “auth-token” must no longer be defined in the headers.

Query parameters (URL)

Field

Required

Description

Field

Required

Description

apiKey

yes

API key from login API

There is no need to define the apiKey in the parameters for our LoginV2.

partnerId

yes

Client id of desired partner’s create post template and meta fields schema. Can be acquired through getPartners API

isAutoReattempt

no

Set to true to get create post template of your configured auto reattempt providers. This will disregard the value of your partnerId if set to true.

Sample Request

https://us-central1-fleet-dev-ph.cloudfunctions.net/v3/getCreatePostTemplate?apiKey=7c5dd55738b964944f9357bcc7f45ce6d857ff18&partnerId=SANDBOX_DX

 



Sample Response

status: 200 OK! { "success": true, "result": { "requestBody": { "refNo": "", "pickupDetails": { "customerName": "", "contactNumber": "", "emailAddress": "", "lat": 0, "long": 0, "tags": [], "remarks": "", "barangay": "", "province": "", "postalCode": "", "pickupDateTime": "", "pickupAddress": "", "pickupCity": "" }, "deliveryDetails": { "customerName": "", "contactNumber": "", "emailAddress": "", "lat": 0, "long": 0, "tags": [], "remarks": "", "barangay": "", "province": "", "postalCode": "", "deliveryDateTime": "", "deliveryAddress": "", "deliveryCity": "", "itemDescription": "", "itemPrice": 0, "codAmount": 0, "productSize": "", "length": 0, "width": 0, "height": 0, "weight": 0, "metaFields": { "shipment": "" } } }, "metaFieldSchema": { "shipment": { "required": true, "type": "string", "description": "Shipment/Parcel Size", "values": [ "big-pouch", "box" ], "details": [ { "value": "big-pouch", "description": "Big Pouch (100 pesos within metro manila)" }, { "value": "box", "description": "Box" } ] } } } }


Meta fields schema

Field

Data type

Description

Field

Data type

Description

type

string

data type of a meta field.

Can either be object or string

required

boolean

indicator if meta field is required

description

string

description of a meta field

values

array

options/values for the specified meta field

details

array

in depth description of options/values

properties

object

details for object type meta fields

Get Quotation bUSINESS

Description

To get the list of available product’s information and rates based on location per provider.

Endpoint

/getQuotation

Method

POST

  • Price quotation is not available for partners with “on demand” service type.

  • Inches is used as a unit of measurement for length, width and height. (Please see sample request response).

  • Kg is used as a unit of measurement for weight. (Please see sample request response).


Request Headers

 

Request Headers

Login V1

{ "Auth-Token": "<Auth token acquired on api LOGIN>", "Content-Type": "application/json" }

Login V2

As an alternative, “x-access-token” for our login v2 can be used instead of using the “auth-token” for our login v1. Value for it will be “Bearer {{accessToken}}“. See below:

{ "x-access-token": "Bearer <Access token acquired on api LOGIN V2>" }

To use "x-access-token" for our Login V2 successfully, “auth-token” must no longer be defined in the headers.

Request Params

{ "apiKey": "<apiKey will be acquired on login API>", "partnerId": "<provider’s id, can be acquired on getPartners API >" }

There is no need to define the apiKey in the parameters for our LoginV2.


Request Body

Field

Data type

Required

Description

Field

Data type

Required

Description

pickup

object

yes

object for pickup address

delivery

object

yes

object for delivery address

Fields of pickup and delivery:

Field

Data Type

Required

Max Length

Description

Field

Data Type

Required

Max Length

Description

province

string

yes

60

province

city

string

yes

60

city

barangay

string

no

60

barangay


Sample Request Body

{ "pickup": { "province": "metro manila", "city": "pasig city", "barangay": "pinagbuhatan" }, "delivery": { "province": "rizal", "city": "cainta", "barangay": "san andres" } }

Sample Response (Serviceable area)

Status: 200 OK! { "success": true, "result": { "destinations": [ "REGION 4-A" "NCR" ], "estimatedPickupDays": 3, "estimatedDeliveryDays": 6, "products": [ { "size": "L", "price": 165, "description": "12 x 18 x 2", "name": "Large Pouch", "length": 12, "width": 18, "height": 2, "weight": 3 }, { "size": "XL", "price": 310, "description": "18 x 12 x 9", "name": "Box", "length": 18, "width": 12, "height": 9, "weight": 6 } ] } }

Sample Response (Not serviceable area)

Status: 400 Bad Request { "success": false, "result": "Pickup/delivery location is not serviceable by the selected provider." }

Error Messages:

Missing Partner Id

Status: 400 Bad Request { "success": false, "message": "Missing partnerId. Please check your dashboard documentation." }

Invalid Partner Id

Status: 400 Bad Request { "success": false, "message": "Invalid partner id. Either it's not existing or you don't have rights to post to the partner." }

Service type “On Demand”

Status: 400 Bad Request { "success": false, "message": "Price quotation is not yet available for on demand providers." }

Create Post v3 Business

Description

To create a post based on providers serviceable area.

Endpoint

/v3/createPost

Method

POST


Request Headers

Login V1

{ "Auth-Token": "<Auth token acquired on api LOGIN>", "Content-Type": "application/json" }

Login V2

As an alternative, “x-access-token” for our login v2 can be used instead of using the “auth-token” for our login v1. Value for it will be “Bearer {{accessToken}}“. See below:

{ "x-access-token": "Bearer <Access token acquired on api LOGIN V2>" "Content-Type": "application/json" }

To use "x-access-token" for our Login V2 successfully, “Auth-Token” must no longer be defined in the headers.

Query parameters (URL)

{ "apiKey": "<REQUIRED, apiKey will be acquired on login API>", "partnerId": "<REQUIRED, preferred partner/provider, can be acquired on getPartners API>" }

There is no need to define the apiKey in the parameters for our LoginV2.

  • To view the Deliveries PH address library, kindly refer to this pages:

  • Lat/long fields is required for on demand providers.

  • Barangay field is not required but will affect the accuracy of identifying if the pickup/delivery location is serviceable by the provider or not.

  • Availability of product sizes varies to each providers and pickup/delivery location.

  • To be able to get the available sizes and price of a provider, see /getQuotation API.

  • productSize field is currently not available for on demand providers. Leave an empty string instead.

metaFields:

  • Meta fields are special fields requested by the provider that needs input from the customer.

  • To to get provider’s meta fields schema, see /getCreatePostTemplate API.


Request Body Fields:

Field

Data Type

Required

Max Length

Description

Field

Data Type

Required

Max Length

Description

refNo

string

yes

30

reference number of post

isDraft

boolean

no

n/a

set true to save post as draft.

source

string

no

origin/source of post, can be one of the ff:

Shopify

isAutoReattempt

boolean

no

Set to true to assign as auto reattempt post. This will disregard the value of your partnerId on params if set to true.

businessStoreId

string

no

create a post by store/hub, empty string or null will assign to default store.

see /getListOfStores API for the id.

pickupDetails

object

yes

object for pickup details

deliveryDetails

object

yes

object for delivery details

isPSGC

boolean

no

 

Set to true to receive PSGC address format


Fields of pickupDetails

Field

Data Type

Required

Max Length

Description

Field

Data Type

Required

Max Length

Description

senderName

string

yes

80

name of sender

contactNumber

string

yes

20

contact number of sender. Must be a valid contact number

emailAddress

string

no

60

email address of sender

pickupDateTime

string

yes

n/a

date and time of pickup
Format: YYYY-MM-DDTHH:mm


If past dated, it will be overridden by the current time + 5 mins.

pickupAddress

string

yes

350

pickup address

pickupCity

string

yes

60

pickup city

province

string

yes

60

pickup province

barangay

string

no

60

pickup barangay

note: not required but will affect the accuracy of identifying if the location is serviceable by the provider.

postalCode

string

no

10

pickup postal code

lat

number

yes (for onDemand providers)

n/a

latitude of pickup location

long

number

yes (for onDemand providers)

longitude of pickup location

tags

array

no

list of tag id, can be get through getTags API

remarks

string

no

350

pickup remarks


Fields of deliveryDetails

Field

Data Type

Required

Max Length

Description

Field

Data Type

Required

Max Length

Description

recipientName

string

yes

80

name of recipient

contactNumber

string

yes

20

contact number of receiver. Must be a valid number

emailAddress

string

no

60

email address of receiver

deliveryDateTime

string

yes

n/a

date and time of deliver.
Format: YYYY-MM-DDTHH:mm

deliveryAddress

string

yes

350

delivery address

deliveryCity

string

yes

60

delivery city

province

string

yes

60

delivery province

barangay

string

no

60

delivery barangay

note: not required but will affect the accuracy of identifying if the location is serviceable by the provider.

postalCode

string

no