Welcome

Welcome to the documentation of the Urbaner API. Here you have the necessary resources to generate delivery orders, calculate the delivery price and more.

The Urbaner API:

  • It is developed under the standards REST.
  • The available endpoints are resource oriented and return any of the HTTP response codes to indicate a satisfactory or failed result.
  • A JSON object is obtained in the response of each query to any available endpoint. Either for data obtained satisfactorily or errors.
  • To make use of the available endpoints you need to be authenticated. That's why that you must first have an Urbaner account (test or production environment) and get the associated TOKEN.

Integration Process

Here are the steps for a successful integration:

  1. Tests in Sandbox Environment:

    • Account registration in Sandbox environment.
    • Use of the different available endpoints using the Token of the registered account in Sandbox. Any question or suggestion can be sent directly to the integration contacts (see section of Integration Contacts).
  2. Go to Production:

    • Account registration in Production environment.
    • Change of route from API to production and switch the Token (see section Urbaner Environments).

Urbaner Environments

Environment Description Root
Sandbox Here all the necessary tests are performed on the available endpoints. https://api.sandbox.urbaner.com/api/
Production Real use of resources using the data of the account registered. https://middleware.urbaner.com/api/

Integration Contacts

Contact Email Skype
Enzo Ruiz enzo@urbaner.com enzo.ruiz.22

Authentication

To use the resources available in the Urbaner API, it is necessary to have a token that authenticates the account that will be used. There are two ways to obtain said token:

  • Through the WEB.
  • Using the Authentication Endpoint.

Get token via Web

Environment Root
Sandbox https://app.sandbox.urbaner.com
Production https://www.urbaner.com
  1. Registration of an account in the corresponding environment (Initially in sandbox for the necessary tests)

registro1 registro2

  1. Once inside the account, go to the bottom part of the option 'Mi Cuenta'

micuenta1

  1. This is the token that is needed to use the endpoints available in the Urbaner API.

micuenta2

Get token via API

Environment Endpoint
Sandbox https://api.sandbox.urbaner.com/api/client/authenticate/
Production https://middleware.urbaner.com/api/client/authenticate/

1. Send a JSON object with the parameters indicated below:

Parameter Description
email (required) Your account email.
password (required) Password

2. Get the TOKEN from the response:

  token = response['auth_token']
POST
/client/authenticate/

Example

$ curl -X POST https://api.sandbox.urbaner.com/api/client/authenticate/

Request Example

{
  "email": "test@cliente.com",
  "password": "lima123456"
}

Response Example

{
  "client": {
    "id": "1b022f3c-aa98-4a31-nn55-57a893ddc44f",
    "client_type_id": 1,
    "business_name": "",
    "email": "test@cliente.com",
    "fb_id": "",
    "last_name": "Juan",
    "name": "Perez",
    "phone": "949875421",
    "ruc": "12345678912",
    "tradename": "",
    "is_company": false,
    "is_active": true,
    "code_reference": "",
    "img": "/static/img/persona.png",
    "credit": false,
    "collection": false,
    "dni": "",
    "number_of_submissions": "",
    "score": 1,
    "type": {
      "name": "Usuario",
      "description": "Usuario"
    },
    "purse": 0,
    "use_default_address": false,
    "number_of_orders": 0,
    "has_payment_method": false,
    "order_types": [
      {
        "id": 1,
        "code": "EXP",
        "name": "EXPRESS",
        "image": "/media/package_types/express.png",
        "max_points": 20
      },
      {
        "id": 2,
        "code": "SDAY",
        "name": "SAMEDAY",
        "image": "/media/package_types/sameday.png",
        "max_points": 2
      },
      {
        "id": 3,
        "code": "NDAY",
        "name": "NEXTDAY",
        "image": "/media/package_types/nextday.png",
        "max_points": 2
      }
    ],
    "package_types": [
      {
        "id": 1,
        "name": "Bicicleta o Moto",
        "image": "/media/packages/bici.png",
        "description": "",
        "specification": ""
      },
      {
        "id": 2,
        "name": "Moto",
        "image": "/media/packages/moto.png",
        "description": "",
        "specification": ""
      },
      {
        "id": 3,
        "name": "Auto",
        "image": "/media/packages/auto.png",
        "description": "",
        "specification": ""
      }
    ],
    "coupons": [

    ],
    "billing_account_name": "",
    "billing_email": "",
    "billing_address": "",
    "auth_token": "cb9135487asder14afdb6f1cdfc0e583ef2de8f4497",
    "has_expired_invoices": false,
    "is_merchant": false,
    "is_merchant_show": false,
    "is_merchant_pending": false,
    "is_merchant_active": false,
    "my_reference_code": "TEST01",
    "type_origin": "private",
    "allow_initial_price_modification": false,
    "has_payment_debt": false,
    "is_blocked_for_expired_invoices": false,
    "forms": [

    ],
    "user_origin_data": null,
    "security_configuration": {

    },
    "created_order_types": null
  },
  "auth_token": "cb9135487asder14afdb6f1cdfc0e583ef2de8f4497"
}

Basic Values

Here are the list of the basic values that you need to know to make a correct use of some of the main API endpoints like generate a delivery order or price caculation. You will have to use the ID or code specified below.

Order Types

ID Name Description
1 Express The order goes out in search of a courier instantly as notification until one accepts it
2 Sameday The order appears in the courier's inbox for one to accept and be completed during the day. Previous coordination between courier and client for the delivery time.
3 Nextday The order appears in the inbox of the courier for one to accept and be completed in the course of the next day. Previous coordination between courier and client for the delivery time.

Vehicle Types

ID Name Description
1 Bicycle It can be used in short distances and small packages.
2 Motorcycle The most common vehicle to make a delivery.
3 Car It can be used in long distances and packages bigger than bicycle or motorcycle.

Payment Types

Code Name Description
card Bank Card One card associated in your account.
purse Urbaner Purse Urbaner purse amount in your account. It can be charged only by an associated card.
credit Urbaner Credit Urbaner can give credit. Previous coordination.

Order Status

Status Label Description
created Created The order is not searching for a courier. It switches to searching status manually.
searching Searching The order is searching for a courier automatically.
accepted Accepted The order was accepted by a courier.
in_progress In Progress The courier has started the order.
no_courier No Courier The order has not found a courier.
ended Ended The courier has ended the order successfully.
cancelled Cancelled The order was cancelled.

Destination Status

Status Label Description
created Created The destination was created but not initialized.
started Started The courier started the point.
arrived Arrived The courier arrived the point.
failed Failed The courier marked as failed the point.
completed Completed The destination was completed successfully.

Data Structures

Here, each field of the basic structures is specified.

Payment Structure

Field Required Type Description
backend * string Code of your available payment.
args object [Only sent in payment type 'card'] JSON with a field 'bankcard' that recieve and integer (ID of bankcard).

Card Structure

{
    "backend": "card",
    "args": {
        "bankcard": 123
    }
}

Purse Structure

{
    "backend": "purse"
}

Credit Structure

{
    "backend": "credit"
}

Pickup/Dropoff points Structure

Field Required Type Description
contact_person * string Fullname of the Person.
phone * string Phone number.
address * string Address.
latlon * string Coordinates "latitude, longitude".
interior string Specific number of Interior.
special_instructions string Some reference of the address.
email string Email of the point contact.

Pickup/Dropoff Structure

{
    "contact_person": "Visanet",
    "phone": "987945643",
    "address": "Jorge Chavez 184, Miraflores 15074, Peru",
    "latlon": "-12.119847 ,  -77.0370547",
    "interior": "5",
    "special_instructions": "near a supermarket",
    "email": "hello@email.com"
}

Help Endpoints

List Bankcards

Obtain all your registered bankcards.

GET
/client/bankcards/

Example request

$ curl -X GET \
  https://api.sandbox.urbaner.com/api/client/bankcards/ \
  -H 'authorization: token YOUR_TOKEN'

Example response

{
    "previous": null,
    "results": [
        {
            "id": 777,
            "number": "XXXX-XXXX-XXXX-1111",
            "card_type": "VISA"
        },
        {
            "id": 888,
            "number": "XXXX-XXXX-XXXX-1111",
            "card_type": "VISA"
        }
    ],
    "num_pages": 1,
    "current_page": 1,
    "count": 2,
    "next": null
}

Delivery Generation Endpoints

Price Calculation

Obtain the delivery price calculation.

Request fields specification

Field Required Type Description
order_type_id string ID of type of order
destinations * list List of Destinations
package_type_id * string ID of package type.
is_return * boolean If the courier needs to return to the origin point.

Response fields specification

Field Type Description
prices list List of objects with 2 fields: 'order_type' => string, 'price' => decimal.
distance decimal Total meters between pickup point to the final dropoff point.
duration decimal Total seconds between pickup point to the final dropoff point.
POST
/cli/price/

Example request

{
    "destinations": [
        {
            "latlon": "-12.119847 ,  -77.0370547"
        },
        {
            "latlon": "-12.0813873 , -77.07160499999999"
        }
    ],
    "package_type_id": 1,
    "is_return": true
}
$ curl -X POST \
  https://api.sandbox.urbaner.com/api/cli/price/ \
  -H 'authorization: token YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "destinations": [
        {
            "latlon": "-12.119847 ,  -77.0370547"
        },
        {
            "latlon": "-12.0813873 , -77.07160499999999"
        }
    ],
    "package_type_id": 1,
    "is_return": true
}'

Example response

{
    "prices": [
        {
            "order_type": "EXPRESS",
            "price": 21.7
        },
        {
            "order_type": "NEXTDAY",
            "price": 9
        },
        {
            "order_type": "SAMEDAY",
            "price": 11
        }
    ],
    "distance": 14768.7,
    "duration": 1390.7
}

Delivery Generation

Create the delivery order.

Request fields specification

Field Required Type Description
type * string ID of type of order
destinations * list List of Destinations, minimun 2 points.
payment * object Backend of the payment
description * string Description of the order.
vehicle_id * string ID of vehicle.
memo string Memo of the order.
programmed_date timestamp Date and hour of the Order that must be delivered (This parameter only work with EXPRESS Orders and you have to add 5 hours [GMT-5] to your date because our server hour is in UTC)
is_return boolean If the Courier needs to return to the origin point ‘true’, otherwise ‘false’
has_extended_search_time boolean ‘False’ If the Order can be cancelled automatically when the searching time expired or ‘True’ If the time of searching for a Courier can be extended.
coupon string The registered coupon of a client. If you do not have a cupon the do not pass this parameter in the body.

Response fields specification

Field Type Description
id integer ID of the delivery order.
code string Code of the delivery order.
status string Initial status of the delivery order.
tracking string URL of the realtime tracking for the delivery order.
POST
/cli/order/

Example request

{
    "type": "1",
    "destinations": [
    {
      "contact_person": "Visanet",
      "phone": "987945643",
      "address": "Jorge Chavez 184, Miraflores 15074, Peru",
      "latlon": "-12.119847 ,  -77.0370547",
      "interior": "5",
      "special_instructions": "",
      "email": ""
    },
    {
      "contact_person": "Cliente de Visanet",
      "phone": "987456321",
      "address": "Avenida La Marina 550,  Pueblo Libre",
      "latlon": "-12.0813873 , -77.07160499999999",
      "interior": "5",
      "special_instructions": "",
      "email": ""
    }
    ],
    "payment": {
        "backend": "purse"
    },
    "description": "comida",
    "vehicle_id": "2",
    "memo": "Orden #34",
    "programmed_date": "2018-11-10 13:00:00",
    "is_return": "false",
    "has_extended_search_time": "true",
    "coupon": "MY_REGISTERED_COUPON"
}
$ curl -X POST \
  https://api.sandbox.urbaner.com/api/cli/order/ \
  -H 'authorization: token YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "1",
    "destinations": [
    {
      "contact_person": "Visanet",
      "phone": "987945643",
      "address": "Jorge Chavez 184, Miraflores 15074, Peru",
      "latlon": "-12.119847 ,  -77.0370547",
      "interior": "5",
      "special_instructions": "",
      "email": ""
    },
    {
      "contact_person": "Cliente de Visanet",
      "phone": "987456321",
      "address": "Avenida La Marina 550,  Pueblo Libre",
      "latlon": "-12.0813873 , -77.07160499999999",
      "interior": "5",
      "special_instructions": "",
      "email": ""
    }
    ],
    "payment": {
        "backend": "purse"
    },
    "description": "comida",
    "vehicle_id": "2",
    "memo": "Orden #34",
    "programmed_date": "2018-11-10 13:00:00",
    "is_return": "false",
    "has_extended_search_time": "true",
    "coupon": "MY_REGISTERED_COUPON"
}'

Example response

{
    "id": 12345,
    "code": "EXP-qeKoQLYc",
    "status": "searching",
    "tracking": "https://app.sandbox.urbaner.com/tracking/?data=NDc0NjY:1gr9ZS:PQwpezqgL_kynk4tdvm3emygcXQ"
}

Simplify the orders generation

Draft Creation

You can save a draft of the order to rebuild it more quickly.

POST
/client/drafts/

Example request

$ curl -X POST \
  https://api.sandbox.urbaner.com/api/client/drafts/ \
  -H 'Authorization: token YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "1",
    "destinations": [
    {
      "contact_person": "Visanet",
      "phone": "987945643",
      "address": "Jorge Chavez 184, Miraflores 15074, Peru",
      "latlon": "-12.119847 ,  -77.0370547",
      "interior": "5",
      "special_instructions": "",
      "email": ""
    },
    {
      "contact_person": "Cliente de Visanet",
      "phone": "987456321",
      "address": "Avenida La Marina 550,  Pueblo Libre",
      "latlon": "-12.0813873 , -77.07160499999999",
      "interior": "5",
      "special_instructions": "",
      "email": ""
    }
    ],
    "payment": {
        "backend": "purse"
    },
    "description": "comida",
    "vehicle_id": "2",
    "memo": "Orden #34",
    "programmed_date": "2018-11-10 13:00:00",
    "is_return": "false",
    "has_extended_search_time": "true",
    "coupon": "MY_REGISTERED_COUPON"
}'

Example response

{   
    "id": 217,
    "coupon": "MY_REGISTERED_COUPON",
    "price": 0,
    "memo": "Orden #34",
    "type": "1",
    "payment": {
        "backend": "purse"
    },
    "vehicle_id": "2",
    "has_extended_search_time": "true",
    "programmed_date": "2018-11-10 13:00:00",
    "description": "comida",
    "created_at": "2019-02-06T15:06:38.438214Z",
    "destinations": [
        {
            "interior": "5",
            "latlon": "-12.119847 ,  -77.0370547",
            "phone": "987945643",
            "special_instructions": "",
            "contact_person": "Visanet",
            "email": "",
            "address": "Jorge Chavez 184, Miraflores 15074, Peru"
        },
        {
            "interior": "5",
            "latlon": "-12.0813873 , -77.07160499999999",
            "phone": "987456321",
            "special_instructions": "",
            "contact_person": "Cliente de Visanet",
            "email": "",
            "address": "Avenida La Marina 550,  Pueblo Libre"
        }
    ],
    "is_return": "false"
}

Relaunch an Order

Sending the ID of a previously created order you can easily create a similar order.

POST
/cli/relaunch/{id}/

Example request

$ curl -X POST \
  https://api.sandbox.urbaner.com/api/cli/relaunch/123/ \
  -H 'Authorization: token YOUR_TOKEN'

Example response

{
    "id": 124,
    "code": "EXP-N2IJ0M1F",
    "status": "searching",
    "tracking": "https://app.sandbox.urbaner.com/tracking/?data=NDc0OTY:1grPQC:wD0zyEs2Zvi8Ppj5xuCtzHCCTJu"
}

My Orders information

Retrieve Order

Obtain the data of a specific order.

GET
/client/orders/{id}/

Example request

$ curl -X GET \
  https://api.sandbox.urbaner.com/api/client/orders/123/ \
  -H 'Authorization: token YOUR_TOKEN'

Example response

{
    "id": 123,
    "code": "EXP-0fRe1nQy",
    "type": 1,
    "price": 11.2,
    "cancelation_price": 0,
    "waiting_time_price": 0,
    "price_modification": 0,
    "total_price": 11.2,
    "duration": "658.60",
    "distance": "6936.90",
    "description": "comida",
    "memo": "Orden #34",
    "destinations": [
        {
            "number": 1,
            "task": "pickup",
            "task_label": "Recojo",
            "phone": "987945643",
            "email": "",
            "interior": "5",
            "contact_person": "Visanet",
            "name_destination": "Jorge Chavez 184, Miraflores 15074, Peru",
            "special_instructions": "",
            "status": "created",
            "latlon": "-12.119847,-77.0370547",
            "created_at": "2019-02-06T15:42:29+0000",
            "updated_at": "2019-02-06T15:42:29+0000",
            "started_at": null,
            "status_label": "Fecha de creación",
            "arrived_at": null,
            "failed_at": null,
            "completed_at": null,
            "signature": null,
            "photo": null,
            "photo2": null,
            "destination_contact": null,
            "destination_dni": null,
            "collection": null,
            "rating": null,
            "rating_description": null,
            "waiting_time_seconds": 0,
            "leaves_at": null,
            "out_point": null,
            "failed_reason": null,
            "is_secure": false,
            "photos": []
        },
        {
            "number": 2,
            "task": "dropoff",
            "task_label": "Entrega",
            "phone": "987456321",
            "email": "",
            "interior": "5",
            "contact_person": "Cliente de Visanet",
            "name_destination": "Avenida La Marina 550,  Pueblo Libre",
            "special_instructions": "",
            "status": "created",
            "latlon": "-12.0813873,-77.07160499999999",
            "created_at": "2019-02-06T15:42:29+0000",
            "updated_at": "2019-02-06T15:42:29+0000",
            "started_at": null,
            "status_label": "Fecha de creación",
            "arrived_at": null,
            "failed_at": null,
            "completed_at": null,
            "signature": null,
            "photo": null,
            "photo2": null,
            "destination_contact": null,
            "destination_dni": null,
            "collection": null,
            "rating": null,
            "rating_description": null,
            "waiting_time_seconds": 0,
            "leaves_at": null,
            "out_point": null,
            "failed_reason": null,
            "is_secure": false,
            "photos": []
        }
    ],
    "status": "searching",
    "courier": null,
    "package_type": {
        "id": 2,
        "name": "Moto",
        "image": "https://urbaner-delivery-dev.s3.amazonaws.com/media/packages/moto_con_caja_omaleta.png",
        "description": "Hasta 45x45x35cm ó 15Kgs",
        "specification": ""
    },
    "end_date": null,
    "start_date": null,
    "created_at": "2019-02-06T15:42:29+0000",
    "assignment_date": null,
    "programmed_date": null,
    "score": null,
    "score_description": null,
    "url": "https://app.dev.urbaner.com/tracking/?data=NDc0OTE:1grPUk:Ig1HalAzWlRRXC6Q4T6Ur3GsPNQ",
    "is_return": false,
    "collection_type": null,
    "status_label": "Buscando",
    "current_destination_label": "Buscando",
    "current_destination_number": null,
    "expiration_time": 615,
    "payment_type": "purse",
    "has_rated": false,
    "assignment_code": "2afeaf",
    "has_extended_search_time": false,
    "waiting_time_alert": 60,
    "cancellation_reason": null,
    "delivery_window_from": null,
    "delivery_window_to": null,
    "estimated_end_time": null,
    "extra_data": {},
    "city": {
        "country": "Perú",
        "iso_code": "PE",
        "name": "Lima",
        "latlon": "-12.0464,-77.0428",
        "city_code": "1",
        "city_id": "1",
        "timezone": "America/Lima"
    },
    "status_redirect": "active"
}

Retrieve Draft

Get the data of a specific draft.

GET
/client/drafts/{id}/

Example request

$ curl -X GET \
  https://api.sandbox.urbaner.com/api/client/drafts/123/ \
  -H 'Authorization: token YOUR_TOKEN'

Example response

{
    "id": 123,
    "vehicle_id": "2",
    "has_extended_search_time": "true",
    "price": 0,
    "memo": "Orden #34",
    "description": "comida",
    "type": "1",
    "destinations": [
        {
            "interior": "5",
            "latlon": "-12.119847 ,  -77.0370547",
            "phone": "987945643",
            "special_instructions": "",
            "address": "Jorge Chavez 184, Miraflores 15074, Peru",
            "email": "",
            "contact_person": "Visanet"
        },
        {
            "interior": "5",
            "latlon": "-12.0813873 , -77.07160499999999",
            "phone": "987456321",
            "special_instructions": "",
            "address": "Avenida La Marina 550,  Pueblo Libre",
            "email": "",
            "contact_person": "Cliente de Visanet"
        }
    ],
    "created_at": "2019-02-06T15:56:49.586927Z",
    "payment": {
        "backend": "purse"
    },
    "is_return": "true"
}

List Orders

Get all my orders paginated.

GET
/client/orders/

Example request

$ curl -X GET \
  https://api.sandbox.urbaner.com/api/client/orders/ \
  -H 'Authorization: token YOUR_TOKEN'

Example response

{
    "num_pages": 2,
    "current_page": 1,
    "previous": null,
    "next": "https://api.sandbox.urbaner.com/api/client/orders/?page=2",
    "count": 73,
    "results": [
        {
            "id": 123,
            "code": "EXP-N2IJ0M1T",
            "created_at": "2019-02-06T15:47:32+0000",
            "programmed_date": null,
            "status": "searching",
            "status_label": "Buscando",
            "current_destination_label": "Buscando",
            "memo": "Orden #34",
            "description": "comida",
            "distance": "6936.90",
            "duration": "658.60",
            "is_return": false,
            "price": 11.2,
            "cancelation_price": 0,
            "waiting_time_price": 0,
            "price_modification": 0,
            "price_modification_comment": "",
            "total_price": 11.2,
            "url": "https://app.sandbox.urbaner.com/tracking/?data=NDc0OTY:1grPbt:YBcAix2slqD2qwso_vk57fNxNiU",
            "assignment_code": "7ae026",
            "type": 1,
            "package_type": {
                "id": 2,
                "name": "Moto",
                "image": "https://urbaner-delivery-sanbox.s3.amazonaws.com/media/packages/moto_con_caja_omaleta.png",
                "description": "Hasta 45x45x35cm ó 15Kgs",
                "specification": ""
            },
            "payment_type": "purse",
            "courier": null,
            "destinations": [
                {
                    "id": 96090,
                    "contact_person": "Visanet",
                    "name_destination": "Jorge Chavez 184, Miraflores 15074, Peru",
                    "interior": "5",
                    "phone": "987945643",
                    "special_instructions": "",
                    "number": 1,
                    "task": "pickup",
                    "task_label": "Recojo",
                    "email": "",
                    "latlon": "-12.119847,-77.0370547",
                    "created_at": "2019-02-06T15:47:32+0000",
                    "started_at": null,
                    "arrived_at": null,
                    "completed_at": null,
                    "failed_at": null,
                    "status": "created",
                    "status_label": "Fecha de creación"
                },
                {
                    "id": 96091,
                    "contact_person": "Cliente de Visanet",
                    "name_destination": "Avenida La Marina 550,  Pueblo Libre",
                    "interior": "5",
                    "phone": "987456321",
                    "special_instructions": "",
                    "number": 2,
                    "task": "dropoff",
                    "task_label": "Entrega",
                    "email": "",
                    "latlon": "-12.0813873,-77.07160499999999",
                    "created_at": "2019-02-06T15:47:32+0000",
                    "started_at": null,
                    "arrived_at": null,
                    "completed_at": null,
                    "failed_at": null,
                    "status": "created",
                    "status_label": "Fecha de creación"
                }
            ],
            "current_destination_number": null,
            "waiting_time_alert": 60,
            "score": null,
            "score_description": null,
            "has_rated": false,
            "id_order_shop": 0,
            "delivery_window_from": null,
            "delivery_window_to": null,
            "order_batch_code": null
        },
        .
        .
        .
    ]
}

List Drafts

Get all my drafts paginated.

GET
/client/drafts/

Example request

$ curl -X GET \
  https://api.sandbox.urbaner.com/api/client/drafts/ \
  -H 'Authorization: token YOUR_TOKEN'

Example response

{
    "num_pages": 1,
    "current_page": 1,
    "previous": null,
    "next": null,
    "count": 14,
    "results": [
        {
            "id": 123,
            "vehicle_id": "2",
            "has_extended_search_time": "true",
            "price": 0,
            "memo": "Orden #34",
            "description": "comida",
            "type": "1",
            "destinations": [
                {
                    "interior": "5",
                    "latlon": "-12.119847 ,  -77.0370547",
                    "phone": "987945643",
                    "special_instructions": "",
                    "address": "Jorge Chavez 184, Miraflores 15074, Peru",
                    "email": "",
                    "contact_person": "Visanet"
                },
                {
                    "interior": "5",
                    "latlon": "-12.0813873 , -77.07160499999999",
                    "phone": "987456321",
                    "special_instructions": "",
                    "address": "Avenida La Marina 550,  Pueblo Libre",
                    "email": "",
                    "contact_person": "Cliente de Visanet"
                }
            ],
            "created_at": "2019-02-06T15:56:49.586927Z",
            "payment": {
                "backend": "purse"
            },
            "is_return": "true"
        },
        .
        .
        .
    ]
}

Webhooks [in-development]

Configuration

You need to active in your account (Sandbox/Production environment) the webhook option and passing an URL to send the differents order and destination status.

URL Webhook

You should sign in to your account and go to the option 'Mi Cuenta'. Go to the section 'Webhook' and put the URL that we can send the differents order and destination status. If your URL endpoint need some headers (Example: Authorization, etc), then you need to register each header.

Data sent

When a delivery order or destination has changed the status, we will send a POST request with the next fields:

Field Type Description
id integer ID of the delivery order.
status string Status Code of the delivery order.
status_label string Status Label of the delivery order.
destination_status_label string Status Label of the pickup or dropoffs.

The status and content response that we received is saved.

Example request

{
    "id": 123,
    "status": "in_progress",
    "status_label": "In Progress",
    "destination_label": "On the way to pickup"
}

In Development

New incoming changes

NEW Item Structure

Field Required Type Description
code * string Code of your item.
width * float Width of your item.
height * float Height of your item.
depth * float Depth of your item.
weight * float Weight of your item.
quantity integer Quantity of this items. Default 1.

NEW Item Structure

{
    "code": "CODIGOPRO1",
    "width": 8,
    "height": 15,
    "depth": 10,
    "weight": 5,
    "quantity": 1
}

NEW Pickup/Dropoff points Structure

Field Required Type Description
contact_person * string Fullname of the Person.
phone * string Phone number.
address * string Address.
latlon * string Coordinates "latitude, longitude".
interior string Specific number of Interior.
special_instructions string Some reference of the address.
email string Email of the point contact.
package_type_id string The package that contains the list of your items.
items list The list of your items with dimensions.

NEW Pickup/Dropoff Structure

{
    "contact_person": "Visanet",
    "phone": "987945643",
    "address": "Jorge Chavez 184, Miraflores 15074, Peru",
    "latlon": "-12.119847 ,  -77.0370547",
    "interior": "5",
    "special_instructions": "near a supermarket",
    "email": "hello@email.com",
    "package_type_id": "1",
    "items": [
    	{
            "code": "CODIGOPRO1",
            "width": 8,
            "height": 15,
            "depth": 10,
            "weight": 5
        },
        	{
            "code": "CODIGOPRO2",
            "width": 9,
            "height": 10,
            "depth": 15,
            "weight": 8
        }
    ]
}

NEW Delivery Generation

Create the delivery order.

New changes: The 'vehicle_id' is now optional, but you have to put the 'package_type' or the list of items with their dimentions.

Request fields specification

Field Required Type Description
type * string ID of type of order
destinations * list List of Destinations, minimun 2 points.
payment * object Backend of the payment
description * string Description of the order.
vehicle_id string ID of vehicle.
memo string Memo of the order.
programmed_date timestamp Date and hour of the Order that must be delivered (This parameter only work with EXPRESS Orders and you have to add 5 hours [GMT-5] to your date because our server hour is in UTC)
is_return boolean If the Courier needs to return to the origin point ‘true’, otherwise ‘false’
has_extended_search_time boolean ‘False’ If the Order can be cancelled automatically when the searching time expired or ‘True’ If the time of searching for a Courier can be extended.
coupon string The registered coupon of a client. If you do not have a cupon the do not pass this parameter in the body.

Response fields specification

Field Type Description
id integer ID of the delivery order.
code string Code of the delivery order.
status string Initial status of the delivery order.
tracking string URL of the realtime tracking for the delivery order.
POST
/cli/order/

Example request

{
    "type": "1",
    "destinations": [
    {
      "contact_person": "Visanet",
      "phone": "987945643",
      "address": "Jorge Chavez 184, Miraflores 15074, Peru",
      "latlon": "-12.119847 ,  -77.0370547",
      "interior": "5",
      "special_instructions": "",
      "email": ""
    },
    {
      "contact_person": "Cliente de Visanet",
      "phone": "987456321",
      "address": "Avenida La Marina 550,  Pueblo Libre",
      "latlon": "-12.0813873 , -77.07160499999999",
      "interior": "5",
      "special_instructions": "",
      "email": "",
      "package_type_id": "1",
      "items": [
            {
                "code": "CODIGOPRO1",
                "width": 8,
                "height": 15,
                "depth": 10,
                "weight": 5
            },
                {
                "code": "CODIGOPRO2",
                "width": 9,
                "height": 10,
                "depth": 15,
                "weight": 8
            }
        ]
    }
    ],
    "payment": {
        "backend": "purse"
    },
    "description": "comida",
    "vehicle_id": "2",
    "memo": "Orden #34",
    "programmed_date": "2018-11-10 13:00:00",
    "is_return": "false",
    "has_extended_search_time": "true",
    "coupon": "MY_REGISTERED_COUPON"
}
$ curl -X POST \
  https://api.sandbox.urbaner.com/api/cli/order/ \
  -H 'authorization: token YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "1",
    "destinations": [
    {
      "contact_person": "Visanet",
      "phone": "987945643",
      "address": "Jorge Chavez 184, Miraflores 15074, Peru",
      "latlon": "-12.119847 ,  -77.0370547",
      "interior": "5",
      "special_instructions": "",
      "email": ""
    },
    {
      "contact_person": "Cliente de Visanet",
      "phone": "987456321",
      "address": "Avenida La Marina 550,  Pueblo Libre",
      "latlon": "-12.0813873 , -77.07160499999999",
      "interior": "5",
      "special_instructions": "",
      "email": ""
    }
    ],
    "payment": {
        "backend": "purse"
    },
    "description": "comida",
    "vehicle_id": "2",
    "memo": "Orden #34",
    "programmed_date": "2018-11-10 13:00:00",
    "is_return": "false",
    "has_extended_search_time": "true",
    "coupon": "MY_REGISTERED_COUPON"
}'

Example response

{
    "id": 12345,
    "code": "EXP-qeKoQLYc",
    "status": "searching",
    "tracking": "https://app.sandbox.urbaner.com/tracking/?data=NDc0NjY:1gr9ZS:PQwpezqgL_kynk4tdvm3emygcXQ"
}
Urbaner API Documentation