PAPS API (1.0.0)

Download OpenAPI specification:Download

API Support: [email protected] License: Apache 2.0

You can find out more about Swagger at paps-swagger. For this sample, you can use the api key special-key to test the authorization filters.

Introduction

Paps offers an API that allows developers to extend the built-in functionality of these warehousing, delivery, shipping services. The Paps API allows you to create tasks (delivery and shipping).

Before you can integrate a PAPS product or solution, you must configure your development environment to obtain a key, which authorizes your REST API calls. To test your web and mobile applications, you can use [swagger]. You must have a developer account, personal or professional.

Create sandbox accounts

To test your web and mobile apps with mock shipping, create a personal account to represent a buyer and a business account to represent a merchant.

  • fill in the token generated. Note: If you do not have an key, click [Create].
  • Under Sandbox, click Accounts, and then click Create Account.

PAPS security guidelines and best practices

This document provides important security related guidelines and best practices for both development projects and system integrations. The following two main topics are covered:

Authentication

PAPS offers two forms of authentication:

  • API Key
  • OAuth2

OAuth2 - an open protocol to allow secure authorization in a simple and standard method from web, mobile and desktop applications.

Request URL

https://paps-api.papslogistics.com/<path>?apiKey=<apiKey>

Conduct tests here

Reply and error codes

All unsuccessful queries will return a code other than 200

The list of codes explaining only the errors of the services and not the errors from the Developer application :

  • 200 Successful: The request was successful.
  • 400 Bad request : The request cannot continue because it is missing a mandatory parameter. Check that you have set all parameters to execute the request.
  • 401 Unauthorised: The authentication of the request did not go well. You did not include the security key that allows us to authenticate you.
  • 402 Unknown key: The security key in the request is incorrect. Please check that the key is the one that was sent to you by email.
  • 502 Bad gateway: The request cannot be fulfilled at this time. Please try again later

Following these tasks

The API restores, from the shipment number, the history of the known follow-up statuses for the following services:

  • creation of users
  • creation of clients
  • add products
  • upload a catalog
  • creation of delivery and shipping tasks.

It allows a simple integration and a harmonized follow-up of the statuses of these various products. The "event" object gathers the events linked to the flashings of a sending by our services during its routing. These events, which can be redundant, carry codes useful to your information systems.

Terms definition

Definitions of key terms

Security Scheme Type TERMS
terms definition
Authorization URL: https://paps-api.papslogistics.com/oauth/dialog
key terms:
  • S:Small -

    max 5Kg

  • M:Medium -

    more than 5 and 30 Kg

  • L:Large -

    more than 30 and 60Kg

  • XL:A litle wider -

    more than 60 and 100Kg

  • XXL:Very large -

    more than 100Kg

  • customers_auth -

    firstName,lastName,phoneNumber,address

  • parcels_auth -

    packageSize,description,price,amountCollect'

api_key

For this sample, you can use the api key special-key to test the authorization filters.

Security Scheme Type API Key
Header parameter name: api_key

clients

Add a new client 👻

This request is used to add a customer to your top customer list. This is to facilitate and execute an order as fast as possible; it is convenient for an express delivery.

Authorizations:
cookie Parameters
cookieParam
integer <int64>

Some cookie

header Parameters
firstname
required
string
Example: kiamet

customer's FirstName

lastname
required
string
Example: MAV

customer's LastName

phoneNumber
required
number
Example: +221 72 700 60 30

customer's phone

address
required
string
Example: 75 cite keur gorgui, Dakar,Sénégal

Customer's shipping address

email
required
string

Customer's email

company
string
Example: PAPS

Customer's company

specificationAddress
string
Example: PAPS

specific address of the customer

Responses

Request samples

curl -X POST \
  https://api.papslogistics.com/v1/clients/receivers?apiKey=special_key \
  -H 'Content-Type: application.json' \
  -H 'X-Paps-Access-Token: {access_token}' \
  -d '
  {
    "firstname":
    "lastname":
    "phoneNumber":
    "address":
    "email":
    "company":
    "specificationAddress":
  }
'

Response samples

Content type
application/json
{
  • "firstname": "trinhchin",
  • "lastname": "innos",
  • "phoneNumber": 19593855059,
  • "email": "[email protected]",
  • "entreprise": "hinno",
  • "address": "Dakar-Plateau, Dakar, Sénégal",
  • "specificationAddress": "côté boulangerie"
}

retrieve all clients

retrieve....

Authorizations:
cookie Parameters
cookieParam
integer <int64>

Some cookie

header Parameters
firstname
required
string
Example: kiamet

customer's FirstName

lastname
required
string
Example: MAV

customer's LastName

phoneNumber
required
number
Example: +221 72 700 60 30

customer's phone

address
required
string
Example: 75 cite keur gorgui, Dakar,Sénégal

Customer's shipping address

email
required
string

Customer's email

company
string
Example: PAPS

Customer's company

specificationAddress
string
Example: PAPS

specific address of the customer

Responses

Response samples

Content type
application/json
{
  • "receiver_UID": "600aba46c6082a3bca550f15",
  • "receiver_firstname": "daback",
  • "receiver_lastname": "YAPO",
  • "receiver_phone_number": 19593691730,
  • "receiver_email": "[email protected]",
  • "receiver_entreprise": "wetchou",
  • "receiver_address": {
    },
  • "receiver_specification_address": "côté boulangerie",
  • "receiver_client_UID": "600aba46c6082a3bca550f15",
  • "receiver_created_at": "2021-01-21T15:50:32.155Z",
  • "receiver_last_edited_at": "2021-01-22T15:50:32.155Z"
}

users

Create one User 👻

This request is used to add a user. This is to delegate tasks within your team.

Authorizations:
cookie Parameters
cookieParam
integer <int64>

Some cookie

header Parameters
firstname
required
string
Example: kiamet

User FirstName

lastname
required
string
Example: MAV

User LastName

phoneNumber
required
number
Example: +221 72 700 60 30

User phone

job
required
string
Example: responsible for shipments

The name job of the User

email
required
string

User email

profile
required
string
Default: SIMPLE

Select a profile to assign : ADMIN , SIMPLE

pictureURL
string
Example: http://localhost.com/picture/3141321424

The avatar of the User

Responses

Request samples

curl -X POST \
     https://api.papslogistics.com/v1/clients/users?apiKey=special_key \
     -H 'Content-Type: application.json' \
     -H 'X-Paps-Access-Token: {access_token}' \
     -d '
     {
         "firstname": "trinhchin",
         "lastname": "innos",
         "phoneNumber": "+221770000000",
         "email": "[email protected]",
         "job": "hinno",
         "profile": "ADMIN",
         "pictureURL": "http://localhost.com/picture/3141321424"
     }
   '

Response samples

Content type
application/json
{}

catalogues

Add Catalogue ✨

This request is used to add and or store these items. It consists of creating virtual products to store at PAPS to facilitate delivery; useful for saving money!

Authorizations:
cookie Parameters
cookieParam
required
integer <int64>

Some cookie

header Parameters
picture
required
Array of strings <url> <= 20 items
Example: PAPS

specific address of the customer

name
required
string
Example: basket

Name of product

reference
required
string
Example: i280

product reference

description
required
string
Example: bla bla bla

description product

category
required
string
Example: play

category of product

value
required
number
Example: 1599

price of product

volume
number
Example: 9

volume product

packageSize
required
string

total package size (S, M, L, XL, XXL) items

Responses

Request samples

curl -X POST \
    https://api.papslogistics.com/v1/catalogues?apiKey=special_key \
    -H 'Content-Type: application.json' \
    -H 'X-Paps-Access-Token: {access_token}' \
    -d '
    {
        "picture": "http://localhost.com/picture/3141321424",
        "name": "iPhone 12",
        "reference": "£3205",
        "description": "apple iphone gold",
        "category": "Phones & Tablets",
        "value": "800998",
        "volume": "12",
        "packageSize": "S"
    }
  '

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "successfully",
  • "data": "Object<T>"
}

products

Add New Product âš“

This request is used to add and or store these items. It consists of creating virtual products to store at PAPS to facilitate delivery; useful for saving money!

Authorizations:
cookie Parameters
cookieParam
integer <int64>

Some cookie

header Parameters
picture
required
Array of strings <url> <= 1 items
Example: PAPS

specific address of the customer

name
required
string
Example: basket

Name of product

reference
required
string
Example: i280

product reference

description
required
string
Example: bla bla bla

description product

category
required
string
Example: play

category of product

value
required
number
Example: 1599

price of product

volume
number
Example: 9

volume product

packageSize
required
string

total package size (S, M, L, XL, XXL) items

Responses

Request samples

curl -X POST \
    https://api.papslogistics.com/v1/products?apiKey=special_key \
    -H 'Content-Type: application.json' \
    -H 'X-Paps-Access-Token: {access_token}' \
    -d '
    {
        "picture": "http://localhost.com/picture/3141321424",
        "name": "iPhone 12",
        "reference": "£3205",
        "description": "apple iphone gold",
        "category": "Phones & Tablets",
        "value": "800998",
        "volume": "12",
        "packageSize": "S"
    }
  '

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "successfully",
  • "data": "Object<T>"
}

Task

Create Task 🚘

This request is used to create a pickup task. A pickup task refers to an errand where the package is to be picked up and delivered.

Authorizations:
cookie Parameters
cookieParam
integer <int64>

Some cookie

header Parameters
datePickup
required
string <date>
Example: 2021-12-01T08:37:08.432Z

date of pick items

timePickup
required
string
Example: 11:00

time of pick items

vehicleType
required
string <time>

vehicle type : VAN, MINIVAN, SCOOTER

address
required
array
Example: 75 cite keur gorgui, Dakar,Sénégal

Customer's shipping address

required
object
Example: customers_auth

customer's name

required
object
Example: parcels_auth

products to pick

Responses

Request samples

curl -X 'POST' \
'http://localhost:14300/tasks' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"type": "PICKUP",
"datePickup": "2022-01-31T15:05:20.492Z",
"timePickup": "11:00",
"vehicleType": "SCOOTER",
"address": "Dakar-Plateau, Dakar, Sénégal",
"receiver": {
  "firstname": "trinhchin",
  "lastname": "innos",
  "phoneNumber": "+221770000000",
  "email": "[email protected]",
  "entreprise": "hinno",
  "address": "Dakar-Plateau, Dakar, Sénégal",
  "specificationAddress": "côté brioche"
},
"parcels": [
  {
    "packageSize": "S",
    "description": "trinhchin",
    "price": 10000,
    "amountCollect": 10000
  }
]}

Response samples

Content type
application/json
{
  • "job_type": "PICKUP",
  • "job_address": {
    },
  • "job_date": "2020-01-01T00:00:00.000Z",
  • "job_slot_start": 660,
  • "job_slot_end": 780,
  • "job_time": 660,
  • "job_vehicle_type": "SCOOTER"
}

activities

retrieve all activities

You can view the tasks that have been created using this method.

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "code": "40x",
  • "message": "error",
  • "error": "xxxxxxx"
}

Shipping Rate

object

origin address

object

destination address

object

cart item

apiKey
required
string

Your special key generated

Example
{
  • "origin": {
    },
  • "destination": {
    },
  • "items": {
    },
  • "apiKey": "ibes7i7gmpsv326bkz38qkdjfdskjfndn72l1v28mzpb0p7aqq",
  • "petType": "getRates"
}

Shipping Tour

pickupLocation
required
string

pickup address

name
required
string

product name

category
required
any
Default: "otherCategories"
Enum: "otherCategories" "sportingGoods" "videoGamesConsoles" "babyProducts" "fashion" "homeOffice" "householdAppliances" "computers" "electronics" "phonesTablets" "food" "healthBeauty"

select category

additionalInfo
required
string

add description product

packageSize
required
any
Default: "S"
Enum: "S" "M" "L" "XL" "XXL"

select package size

destinationAddress
required
string

destination address (please submit specific address)

vehicle
required
any
Default: "MiniVan"
Enum: "MiniVan" "Truck" "Van"

chose vehicle type

shipDate
required
string <date-time>

Estimated ship date

shipType
string

Type of shipping tour

{
  • "pickupLocation": "Dakar, plateau",
  • "name": "string",
  • "category": "otherCategories",
  • "additionalInfo": "string",
  • "packageSize": "S",
  • "destinationAddress": "Dakar, plateau",
  • "vehicle": "MiniVan",
  • "shipDate": "2019-08-24T14:15:22Z",
  • "shipType": "string"
}