NAV Navbar

Introduction

The Glovo B2B API enables developers to build applications that automate the use of Glovo's logistics network to ship items.

To begin using the API generate your API credentials from your Glovo profile.

Endpoint

The endpoint for the Glovo Business production webapp is: https://api.glovoapp.com.

Headers

The following headers are mandatory:

Data structures

WorkingArea

The WorkingArea is the geographical space where Glovo can pick-up and deliver an order during certain hours of the day. Cross-WorkingArea orders are not supported.

Field Description
code Id of the delivery area (e.g. BCN, MAD, BUE).
polygons List of encoded polylines where a package can be picked-up or delivered.
workingTime WorkingTime during which this area is active.

WorkingTime

WorkingTimes specify the activity hours of a WorkingArea,

Field Description
opening Starting time of the active time range.
duration Duration in minutes of the time range.

Order

Field Description
id Id of the order.
description Description detailing the package to be delivered
creationTime Unix time in seconds of the order creation time.
scheduleTime Unix time in seconds of the scheduled activation time of the order. Optional.
addresses Ordered list of addresses (pickups and deliveries) of the order. Usually your orders will have one PICKUP address and one DELIVERY address.
state Current state of the order (one of SCHEDULED, ACTIVE, DELIVERED, CANCELED).

State of the order

State Description
SCHEDULED The order will be activated on scheduleTime.
ACTIVE The order is either being delivered or about to be.
DELIVERED The delivery has finished succesfully.
CANCELED The order is canceled and it wont be delivered.

Address

Each of the points that are part of the order. Right now you can only create two-point orders.

Field Description
lat Latitude of the address.
lon Longitude of the address.
type PICKUP or DELIVERY depending on what the courier is expected to do at this address.
label Street and number (e.g. 21 Baker St).
details Floor / appartment (e.g. 2nd Floor or blue button of the intercom). Optional.
contactPhone Phone of the sender / recipient at that address. Optional.
contactPerson Name of the sender / recipient at that address. Optional.

Endpoints

GetWorkingAreas

Returns the characteristics of our working areas. Use this data to check for valid pickup and delivery locations and times in your side. A way of doing this can be found in com.google.maps.android.PolyUtil::containsLocation

We recommend you to use aggressive caching for the results of this endpoint in order to avoid unnecessary server-to-server traffic that could make you activate rate limiting.

Request

GET /b2b/working-areas

Response showing a single WorkingArea

{
    "workingAreas": [{
        "code": "BCN",
        "polygons": [
            "<ENCODED POLYLINE>",
            "<ENCODED POLYLINE>"
        ],
        "workingTime": {"from": "09:00", "duration": 120}
    }]
}

EstimateOrderPrice

Provide a price estimation for an order.

The response amount will always be in the minor of the currency (e.g. cents for EUR).

Request

POST /b2b/orders/estimate
{
    "scheduleTime": 12344566,
    "description": "A 30cm by 30cm box",
    "addresses": [
        { 
            "type": "PICKUP",
            "lat": 0.1,
            "lon": 0.3,
            "label": "Calle la X, 29"
        },
        { 
            "type": "DELIVERY",
            "lat": 0.1,
            "lon": 0.3,
            "label": "Calle la X, 30"
        }
    ]
}

Response returning a 5.90 EUR price

{
    "total": {
        "amount": 590,
        "currency": "EUR"
    }
}

CreateOrder

Create a scheduled or immediate order. If you want to schedule an order, provide a scheduleTime. If you don't, it'll be immediately activated for deliver.

Request for a scheduled order

POST /b2b/orders
{
    "scheduleTime": 12344566,
    "description": "A 30cm by 30cm box",
    "addresses": [
        { 
            "type": "PICKUP",
            "lat": 0.1,
            "lon": 0.3,
            "label": "Calle la X, 29"
        },
        { 
            "type": "DELIVERY",
            "lat": 0.1,
            "lon": 0.3,
            "label": "Calle la X, 30"
        }
    ]
}

Response

{
    "id": 123456789,
    "state": "SCHEDULED",
    "scheduleTime": 12344566,
    "description": "A 30cm by 30cm box",
    "addresses": [
        { 
            "type": "PICKUP",
            "lat": 0.1,
            "lon": 0.3,
            "label": "Calle la X, 29"
        },
        { 
            "type": "DELIVERY",
            "lat": 0.1,
            "lon": 0.3,
            "label": "Calle la X, 30"
        }
    ]
}

Request for an immediate order

POST /b2b/orders
{
    "scheduleTime": null,
    "description": "A 30cm by 30cm box",
    "addresses": [
        { 
            "type": "PICKUP",
            "lat": 0.1,
            "lon": 0.3,
            "label": "Calle la X, 29"
        },
        { 
            "type": "DELIVERY",
            "lat": 0.1,
            "lon": 0.3,
            "label": "Calle la X, 30"
        }
    ]
}

RetrieveOrder

Retrieve information about a single order.

Request

GET /b2b/orders/:id

Response

{
    "id": 123456789,
    "state": "SCHEDULED",
    "scheduleTime": 12344566,
    "description": "A 30cm by 30cm box",
    "addresses": [
        { 
            "type": "PICKUP",
            "lat": 0.1,
            "lon": 0.3,
            "label": "Calle la X, 29"
        },
        { 
            "type": "DELIVERY",
            "lat": 0.1,
            "lon": 0.3,
            "label": "Calle la X, 30"
        }
    ]
}

GetOrderTracking

Request

GET /b2b/orders/:id/tracking

Response

{
    "lat": 0.1234,
    "lon": 0.1234
}

Return the position (latitude, longitude) of the courier.

GetCourierContact

Name and contact phone of the courier if the order is active. Error if the order is not active.

Request

GET /b2b/orders/:id/courier-contact

Response

{
    "courier": "Alfonso",
    "phone": "+34666123123"
}

GetOrders

Retrieve a list of orders created after or during from and before to timestamps. Limits or alternative pagination means are yet to be defined.

Request

GET /b2b/orders?from=<TIMESTAMP>&to<TIMESTAMP> 

Response

{
    "orders": [
        // List of orders
    ]
}

CancelOrder

Cancel a scheduled order. Active orders cannot be canceled.

Request

POST /b2b/orders/:id/cancel
{}

Response

{
    "id": 123456789,
    "state": "CANCELED",
    "scheduleTime": 12344566,
    "description": "A 30cm by 30cm box",
    "addresses": [
        { 
            "type": "PICKUP",
            "lat": 0.1,
            "lon": 0.3,
            "label": "Calle la X, 29"
        },
        { 
            "type": "DELIVERY",
            "lat": 0.1,
            "lon": 0.3,
            "label": "Calle la X, 30"
        }
    ]
}