Introduction
The following document is intended for DeliGoo partners, who intend to integrate their system / shop.
The DeliGoo API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded requests, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
In case of any problems, feel free to contact with us.
Available environments
Test environment:
https://preproduction-app.deligoo.pl/
Production environment:
https://app.deligoo.pl/
Healthcheck
Authorization
Communication with the Deligoo API requires sending an access token in the Authorization
header. To move on, you must adopt yourself using the data received from the site.
If you do not have login details yet contact us.
Authorization: Bearer XYZ
Get an access token
Example
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/sign_in
Request method
POST
Request headers
Accept: application/json
Content-Type: application/json
Request body
{
"email": "demo@example.com",
"password": "Demo123!"
}
Response headers
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0MjkiLCJzY3AiOiJhcGlfcG
Response body
{
"success": true
}
Endpoint allows you to get an access token using email and password.
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/sign_in
Request method
POST
Request parameters
Parameter | Required | Description |
---|---|---|
YES | Account address e-mail | |
password | YES | Account password |
Destroy an access token
Example
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/sign_out
Request method
DELETE
Request headers
Accept: application/json
Content-Type: application/json
Authorization: Bearer XYZ
Response body
{
"success": true
}
Endpoint allows you to destroy an access token.
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/sign_out
Request method
DELETE
Request headers
Parameter | Required | Description |
---|---|---|
Authorization | YES | Access token granted after sign in |
Retrive the details of an account
Example
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/sign_out
Request method
DELETE
Request headers
Accept: application/json
Content-Type: application/json
Authorization: Bearer XYZ
Response body
{
"data": {
"id": 1,
"name": "Partner"
}
}
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/me
Request method
GET
Request headers
Parameter | Required | Description |
---|---|---|
Authorization | YES | Access token granted after sign in |
Webhooks
Introduction
Receive event notifications with webhooks
DeliGoo uses webhooks to notify your application when an event happens in your account. Webhooks are particularly useful for asynchronous events like when a driver will be assigned to order, or an order will be canceled by a client.
Not all integrations require webhooks. Keep reading to learn more about what webhooks are and when you should use them.
What are webhooks
Webhooks refers to a combination of elements that collectively create a notification and reaction system within a larger integration.
Metaphorically, webhooks are like a phone number that DeliGoo calls to notify you of activity in your account. The activity could be the creation of a new order or the driver assignment to your order. The webhook endpoint is the person answering that call who takes actions based upon the specific information it receives.
Non-metaphorically, the webhook endpoint is just more code on your server, which could be written in Ruby, PHP, Node.js, or whatever. The webhook endpoint has an associated URL (e.g., https://example.com/webhooks). The notifications are Event objects. This Event object contains all the relevant information about what just happened, including the type of event and the data associated with that event.
When to use webhooks
Many events that occur within a account have synchronous results–immediate and direct–to an executed request. For example, a successful request to create an order immediately returns an Order object. Such requests don’t require webhooks, as the key information is already available.
Some events that occur within a account are asynchronous: happening at a later time and not directly in response to your code’s execution. Most commonly these involve Orders API.
With these and similar APIs, System needs to notify your integration about changes to the status of an object so your integration can take subsequent steps.
The specific actions your webhook endpoint may take differs based upon the event. Some examples include: - Notifing customer about who and when deliver an order
Check signatures
Verify the events that DeliGoo sends to your webhook endpoints
DeliGoo can sign the webhook events it sends to your endpoints by including a signature in each event’s Signature header. This allows you to verify that the events were sent by DeliGoo, not by a third party. You can verify signatures either using our official library, or manually using your own solution.
Before you can verify signatures, you need to retrieve your endpoint’s secret from your Dashboard’s Webhooks settings. Select an endpoint that you want to obtain the secret for, then click the Click to reveal button.
DeliGoo generates a unique secret key for each endpoint. After this setup, DeliGoo starts to sign each webhook it sends to the endpoint.
Preventing replay attacks
A replay attack is when an attacker intercepts a valid payload and its signature, then re-transmits them. To mitigate such attacks, DeliGoo includes a timestamp in the Signature header. Because this timestamp is part of the signed payload, it is also verified by the signature, so an attacker cannot change the timestamp without invalidating the signature. If the signature is valid but the timestamp is too old, you can have your application reject the payload.
DeliGoo generates the timestamp and signature each time an event is sent to your endpoint. If DeliGoo retries an event (e.g., your endpoint previously replied with a non-2xx status code), then a new signature and timestamp is generated for the new delivery attempt.
Verify signatures manually
The Signature
header included in each signed event contains a timestamp and one or more signatures. The timestamp is prefixed by t=
, and each signature is prefixed by a scheme. Schemes start with v, followed by an integer. Currently, the only valid live signature scheme is v1
.
DeliGoo generates signatures using a hash-based message authentication code (HMAC) with SHA-256. To prevent downgrade attacks, you should ignore all schemes that are not v1.
Step 1: Extract the timestamp and signatures from the header
Split the header, using the , character as the separator, to get a list of elements. Then split each element, using the = character as the separator, to get a prefix and value pair.
The value for the prefix t corresponds to the timestamp, and v1 corresponds to the signature (or signatures). You can discard all other elements.
Step 2: Prepare the signed_payload string
The signed_payload string is created by concatenating:
- The timestamp (as a string)
- The character .
- The actual JSON payload (i.e., the request body)
Step 3: Determine the expected signature
Compute an HMAC with the SHA256 hash function. Use the endpoint’s signing secret as the key, and use the signed_payload string as the message.
Step 4: Compare the signatures
Compare the signature in the header to the expected signature. For an equality match, compute the difference between the current timestamp and the received timestamp, then decide if the difference is within your tolerance.
To protect against timing attacks, use a constant-time string comparison to compare the expected signature to each of the received signatures.
Create a webhook endpoint
Add a new endpoint in your application. You can act on certain events by checking the key field of the event object sent in the request body. For now, let’s print to standard output to make sure our webhook is working. In this example we use Sinatra framework and our official library.
Start your server after adding the new endpoint.
require 'stripe'
require 'sinatra'
require 'json'
require 'webhooks'
# Using the Sinatra framework
set :port, 4242
post '/webhooks' do
header = request.headers['Signature']
payload = begin
JSON.parse(request.body.read)
rescue JSON::ParserError => e
status 400
return
end
secret = begin
# NOTE: Set your secret key associated with your webhook endpoint using payload.
rescue
status 400
return
end
begin
Webhooks::Signatures::VerifyHeaderService.new(secret: secret).call(header: header, payload: payload)
rescue Webhooks::Signatures::Errors::SignatureVerificationError => e
status 400
return
end
# NOTE: Here we have verified payload properly.
case payload.dig('data', 'key')
when 'orders.created'
puts 'Order created'
when 'orders.pickups.set_as_assigned'
puts 'Order pickup assigned'
when 'orders.deliveries.set_as_assigned'
puts 'Order delivery assigned'
end
status 200
end
Orders
The order object
Order statuses
waiting
- waiting for client confirmationpending
- waiting for driver assignmentstarted
- started by drivercompleted
- successfully completedcanceled
- canceled by client, partner, driver or systemfailed
- discarded - in case when pickup had already started
Point statuses - pickup / delivery
pending
- waiting for driver assignmentassigned
- assigned to driverstarted
- started by driverin_progress
- on the way by driverfinished
- finished by drivercanceled
- canceled by client, partner, driver or systemfailed
- discarded - in case when pickup had already started
Create an order without shop
Example
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/orders
Request method
POST
Request headers
Accept: application/json
Content-Type: application/json
Authorization: Bearer XYZ
Request body
{
"form_data": {
"provider": "api",
"price_subunit": 5200,
"price_delivery_subunit": 1000,
"price_packaging_subunit": 200,
"pickup_at": "2020-12-04T14:05:47.387+01:00",
"payment_form": "paid",
"details": {
"dishes": [
{
"quantity": 1,
"title": "Dish 1",
"price_subunit": 2000,
"total_price_subunit": 3200,
"packaging_cost_amount_subunit": 200,
"toppings": [
{
"title": "topping 1",
"price_subunit": 500,
"quantity": 1
},
{
"title": "topping 2",
"price_subunit": 500,
"quantity": 1
}
]
},
{
"quantity": 1,
"title": "Dish 2",
"price_subunit": 2000,
"total_price_subunit": 2000,
"price": 20,
"total_price": 40
}
]
},
"external_id": "cbfb93ac-b9ae-413f-a415-2830f17318a4",
"webhook_url": "http://localhost:3000/api/test_app/v1/webhooks/real",
"pickup_attributes": {
"postal_code": "30-320",
"city": "Kraków",
"street": "Generała Bohdana Zielińskiego",
"house_number": "11",
"phone": "123456789"
},
"delivery_attributes": {
"postal_code": "30-622",
"city": "Kraków",
"street": "Dietla",
"house_number": "52",
"flat_number": "5",
"staircase": "1",
"floor": "2",
"access_code": "123456",
"phone": "123456789",
"email": "test@example.com",
"first_name": "Jan",
"last_name": "Kowalski"
},
"order_comment_attributes": {
"description": "Order description"
},
"customer_comment_attributes": {
"description": "Customer description"
},
"packages": {
"ecommerce-size-a": 2,
"ecommerce-size-b": 1,
"ecommerce-size-c": 3
},
"weight": 15.0,
"service_type": "express"
}
}
Response body
{
"data": {
"id": 245,
"uid": "2947381",
"uuid": "b0e015a2-2abb-4f7e-bb4d-fc0e8bf623ed",
"returned_order_id": null,
"returned": false,
"team_id": 6,
"driver_id": null,
"distance": 3.29,
"payment_form": "paid",
"rating": null,
"description": "Lokal: \nDoręczenie: Dietla 52/5, 30-622 Kraków\nNumer zamówienia: 2947381 []\nMieszkanie: 5\nKlatka: 1\nPiętro: 2\nKod dostępu: 123456\n --\nForma płatności: Zapłacono\n --\nIlość sztuk: \nGabaryt A: 2 szt | Gabaryt B: 1 szt | Gabaryt C: 3 szt\nUwagi od klienta: Customer description\nUwagi do zamówienia: Order description",
"provider": "api",
"state": "pending",
"adding_state": "processing",
"step": null,
"pickup": {
"id": 440,
"type": "Order::Pickup",
"name": null,
"address": "Generała Bohdana Zielińskiego 11, 30-320 Kraków",
"formatted_address": "Genera%C5%82a+Bohdana+Zieli%C5%84skiego+11%2C+Krak%C3%B3w",
"lat": 50.044735,
"lng": 19.919628,
"estimated_time": null,
"time": null,
"late": 0,
"phone": "123 456 789",
"state": "pending",
"created_at": "2021-07-07T13:06:12.245+02:00",
"sumup_payment_url": "sumupmerchant://pay/1.0?affiliate-key=&app-id=&amount=62.0¤cy=PLN&title=_2947381&callback=http://localhost:3000/paid",
"pair_id": 441,
"pair_state": "pending",
"order_id": 245,
"orderable_id": 245,
"driver_id": null,
"description": "Lokal: \nDoręczenie: Dietla 52/5, 30-622 Kraków\nNumer zamówienia: 2947381 []\nMieszkanie: 5\nKlatka: 1\nPiętro: 2\nKod dostępu: 123456\n --\nForma płatności: Zapłacono\n --\nIlość sztuk: \nGabaryt A: 2 szt | Gabaryt B: 1 szt | Gabaryt C: 3 szt\nUwagi od klienta: Customer description\nUwagi do zamówienia: Order description",
"order_uid": "2947381",
"orderable_uid": "2947381",
"arrived_at": null,
"estimated_arrived_at": null,
"finished_at": null,
"finished_lat": null,
"finished_lng": null,
"order_full_price": 62.0,
"orderable_full_price": 62.0,
"order_payment_form": "paid",
"orderable_payment_form": "paid",
"authorization_types": null,
"authorization_code": null,
"client_interface_type": null,
"index": null,
"sms_templates": []
},
"delivery": {
"id": 441,
"type": "Order::Delivery",
"name": null,
"address": "Dietla 52/5, 30-622 Kraków",
"formatted_address": "Dietla+52%2C+Krak%C3%B3w",
"lat": 50.053493,
"lng": 19.94265,
"estimated_time": null,
"time": null,
"late": 0,
"phone": "123 456 789",
"state": "pending",
"created_at": "2021-07-07T13:06:12.248+02:00",
"sumup_payment_url": "sumupmerchant://pay/1.0?affiliate-key=&app-id=&amount=62.0¤cy=PLN&title=_2947381&callback=http://localhost:3000/paid",
"pair_id": 440,
"pair_state": "pending",
"order_id": 245,
"orderable_id": 245,
"driver_id": null,
"description": "Lokal: \nDoręczenie: Dietla 52/5, 30-622 Kraków\nNumer zamówienia: 2947381 []\nMieszkanie: 5\nKlatka: 1\nPiętro: 2\nKod dostępu: 123456\n --\nForma płatności: Zapłacono\n --\nIlość sztuk: \nGabaryt A: 2 szt | Gabaryt B: 1 szt | Gabaryt C: 3 szt\nUwagi od klienta: Customer description\nUwagi do zamówienia: Order description",
"order_uid": "2947381",
"orderable_uid": "2947381",
"arrived_at": null,
"estimated_arrived_at": null,
"finished_at": null,
"finished_lat": null,
"finished_lng": null,
"order_full_price": 62.0,
"orderable_full_price": 62.0,
"order_payment_form": "paid",
"orderable_payment_form": "paid",
"authorization_types": null,
"authorization_code": null,
"client_interface_type": null,
"index": null,
"sms_templates": []
},
"created_at": "2021-07-07T13:06:12.237+02:00",
"perform_at": "2021-07-07T13:06:12.196+02:00",
"pickup_at": "2020-12-04T14:05:47.387+01:00",
"delivery_at": null,
"amount": 6,
"price": 52.0,
"price_subunit": 5200,
"price_delivery": 10.0,
"price_delivery_subunit": 1000,
"price_packaging": 2.0,
"price_packaging_subunit": 200,
"price_additional": null,
"price_additional_subunit": 0,
"discount_code_value": null,
"details": {
"dishes": [
{
"quantity": 1,
"title": "Dish 1",
"price_subunit": 2000,
"total_price_subunit": 3200,
"packaging_cost_amount_subunit": 200,
"toppings": [
{
"title": "topping 1",
"price_subunit": 500,
"quantity": 1
},
{
"title": "topping 2",
"price_subunit": 500,
"quantity": 1
}
]
},
{
"quantity": 1,
"title": "Dish 2",
"price_subunit": 2000,
"total_price_subunit": 2000,
"price": 20,
"total_price": 40
}
],
"notes": "Notes"
},
"cancellation_reason": null,
"canceled_by": null,
"return_reason": null,
"external_id": "cbfb93ac-b9ae-413f-a415-2830f17318a4",
"delivery_method": "delivery_now",
"full_price": 62.0,
"packages": {
"ecommerce-size-a": 2,
"ecommerce-size-b": 1,
"ecommerce-size-c": 3
},
"order_is_ready": false,
"online_payment": false,
"transport_types": [
"car"
],
"client_comment": null,
"order_comment": "Order description",
"customer_comment": "Customer description",
"tracking_url": "http://localhost:3000/orders/tracking/b0e015a2-2abb-4f7e-bb4d-fc0e8bf623ed",
"customer_contact_detail": {
"id": 425,
"first_name": "Jan",
"last_name": "Kowalski",
"humanized_full_address": "Dietla 52/5, 30-622 Kraków",
"phone": "123456789",
"email": "test@example.com",
"city": "Kraków",
"street": "Dietla",
"house_number": "52",
"flat_number": "5",
"postal_code": "30-622",
"floor": "2",
"access_code": "123456",
"lat": "50.053493",
"lng": "19.94265",
"street_suggestion": "Dietla",
"city_suggestion": "Kraków",
"staircase": "1",
"company_name": null,
"language": null,
"delivery_method": "delivery",
"created_at": "2021-05-19T13:29:52.716+02:00",
"updated_at": "2021-05-19T15:04:03.509+02:00"
},
"invoice": null,
"publication_interval": 30,
"publish_at": null,
"management_kind": null,
"weight": 15.0,
"payment_status": "in_progress",
"has_drinks": false,
"ordinal_number": null,
"has_label": false,
"pickup_in": -309480,
"automatic_confirmation": false,
"service_type": "express",
"events": [
{
"trackable_id": 245,
"trackable_type": "Order::Regular",
"key": "orders.created",
"data": {
"id": 245,
"uid": "2947381",
"team_name": "Krzysztof",
"team_uuid": "bcf31da0-74d8-4628-9c69-ee053daf0e48",
"external_id": "cbfb93ac-b9ae-413f-a415-2830f17318a4"
},
"text": "Zlecenie zostało utworzone.",
"created_at": "2021-07-07T13:06:12.373+02:00"
},
{
"trackable_id": 245,
"trackable_type": "Order::Regular",
"key": "orders.set_as_waiting",
"data": {
"id": 245,
"uid": "2947381",
"external_id": "cbfb93ac-b9ae-413f-a415-2830f17318a4"
},
"text": "Zlecenie oczekuje na akceptację.",
"created_at": "2021-07-07T13:06:12.410+02:00"
},
{
"trackable_id": 245,
"trackable_type": "Order::Regular",
"key": "orders.set_as_pending",
"data": {
"id": 245,
"uid": "2947381",
"external_id": "cbfb93ac-b9ae-413f-a415-2830f17318a4"
},
"text": "Zlecenie jest przetwarzane.",
"created_at": "2021-07-07T13:06:12.476+02:00"
}
],
"webhook_endpoint": {
"id": 4,
"url": "http://localhost:3000/api/test_app/v1/webhooks/real",
"secret": "038bed0387e7a3e6528e32c81f31af521186c052da4b8ef3b444b2fb7458e354",
"created_at": "2021-05-19T15:04:04.614+02:00",
"updated_at": "2021-05-19T15:04:04.614+02:00"
}
},
"meta": {}
}
Endpoint allows you to add a new order.
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/orders
Request method
POST
Request body
Order
Parameter | Required | Description |
---|---|---|
price_subunit | YES | Order amount |
pickup_at | YES | Earliest pickup time in format: 2020-12-04T14:21:13.369+01:00 |
payment_form | YES | Payment methods: paid , card , cash |
delivery_method | YES | Available options: delivery_now |
price_delivery_subunit | NO | Delivery costs |
price_packaging_subunit | NO | Packaging cost |
details | NO | Order components |
external_id | NO | External order number / ID / UUID |
weight | NO | Order weight |
service_type | YES | Service types: express , sameday |
order_comment_attributes | NO | Order comment attributes |
customer_comment_attributes | NO | Customer comment attributes |
packages | NO | Order packages attributes |
automatic_confirmation | NO | true/false |
details
Parameter | Required | Description |
---|---|---|
dishes | YES | Array of dishes |
notes | NO | Notes |
dishes
Parameter | Required | Description |
---|---|---|
quantity | YES | Quantity |
title | YES | Title |
price_subunit | YES | Single dish price |
total_price_subunit | YES | Total price |
packaging_cost_amount_subunit | NO | Packaging cost amount |
toppings | NO | Array of toppings |
toppings
Parameter | Required | Description |
---|---|---|
title | YES | Title |
price_subunit | YES | Price |
quantity | YES | Quantity |
Point - pickup_attributes / delivery_attributes
Parameter | Required | Description |
---|---|---|
postal_code | YES | Postal code |
city | YES | City |
street | YES | Street |
house_number | YES | House number |
flat_number | NO | Flat number |
staircase | NO | Staircase |
floor | NO | Floor |
access_code | NO | Access code to staircase |
lat | NO | Latitude |
lng | NO | Longitude |
phone | YES | Phone number |
NO | ||
first_name | NO | First name |
last_name | NO | Last name |
notes | NO | Notes |
order_comment_attributes
Parameter | Required | Description |
---|---|---|
description | No | Description |
customer_comment_attributes
Parameter | Required | Description |
---|---|---|
description | No | Description |
packages
Parameter | Required | Description |
---|---|---|
ecommerce-size-a | No | Quantity |
ecommerce-size-b | No | Quantity |
ecommerce-size-c | No | Quantity |
big-pizza | NO | Quantity |
standard-dish | NO | Quantity |
own-packaging | NO | Quantity |
Create an order with shop
Example
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/clients/<ID>/orders
Request method
POST
Request Headers
Accept: application/json
Content-Type: application/json
Authorization: Bearer XYZ
Request Body
{
"form_data": {
"provider": "api",
"automatic_confirmation": "true",
"price_subunit": 5200,
"price_delivery_subunit": 1000,
"price_packaging_subunit": 200,
"pickup_at": "2020-12-04T09:00:39.097+01:00",
"delivery_method": "delivery_now",
"payment_form": "paid",
"details": {
"dishes": [
{
"quantity": 1,
"title": "Dish 1",
"price_subunit": 2000,
"total_price_subunit": 3200,
"packaging_cost_amount_subunit": 200,
"toppings": [
{
"title": "topping 1",
"price_subunit": 500,
"quantity": 1
},
{
"title": "topping 2",
"price_subunit": 500,
"quantity": 1
}
]
},
{
"quantity": 1,
"title": "Dish 2",
"price_subunit": 2000,
"total_price_subunit": 2000
}
],
"notes": "Notes"
},
"external_id": "ce172d4e-8452-40eb-ab31-216c5219a060",
"webhook_url": "http://preproduction-app.deligoo.pl/api/test_app/v1/webhooks/real",
"customer_contact_detail_attributes": {
"postal_code": "30-622",
"city": "Kraków",
"street": "Dietla",
"house_number": "52",
"flat_number": "5",
"staircase": "1",
"floor": "2",
"access_code": "123456",
"phone": "123456789",
"email": "test@example.com",
"first_name": "Jan",
"last_name": "Kowalski"
},
"order_comment_attributes": {
"description": "Order description"
},
"customer_comment_attributes": {
"description": "Customer description"
},
"packages": {
"ecommerce-size-a": 2,
"ecommerce-size-b": 1,
"ecommerce-size-c": 3
},
"weight": 15.0
}
}
Response body
{
"data": {
"id": 244,
"uid": "9100308",
"uuid": "da3ce5a4-f87a-4cc9-b24a-6719930b9c56",
"returned_order_id": null,
"returned": false,
"team_id": 6,
"driver_id": null,
"distance": 1.47,
"payment_form": "paid",
"rating": null,
"description": "Lokal: Restauracja Krzysztof\nDoręczenie: Dietla 52/5, 30-622 Kraków\nNumer zamówienia: 9100308 [2]\nMieszkanie: 5\nKlatka: 1\nPiętro: 2\nKod dostępu: 123456\n --\nForma płatności: Zapłacono\n --\nIlość sztuk: \nGabaryt A: 2 szt | Gabaryt B: 1 szt | Gabaryt C: 3 szt\nUwagi od klienta: Customer description\nUwagi do zamówienia: Order description",
"provider": "api",
"state": "pending",
"adding_state": "processing",
"step": null,
"pickup": {
"id": 438,
"type": "Order::Pickup",
"name": "Restauracja Krzysztof",
"address": "Dietla 29, 31-070 Kraków, Polska",
"formatted_address": "Dietla+29%2C+Krak%C3%B3w%2C+Polska",
"lat": 50.0505517,
"lng": 19.9404809,
"estimated_time": null,
"time": null,
"late": 0,
"phone": "987 654 321",
"state": "pending",
"created_at": "2021-07-07T11:49:18.096+02:00",
"sumup_payment_url": "sumupmerchant://pay/1.0?affiliate-key=&app-id=&amount=62.0¤cy=PLN&title=Restauracja Krzysztof_9100308&callback=http://localhost:3000/paid",
"pair_id": 439,
"pair_state": "pending",
"order_id": 244,
"orderable_id": 244,
"driver_id": null,
"description": "Lokal: Restauracja Krzysztof\nDoręczenie: Dietla 52/5, 30-622 Kraków\nNumer zamówienia: 9100308 [2]\nMieszkanie: 5\nKlatka: 1\nPiętro: 2\nKod dostępu: 123456\n --\nForma płatności: Zapłacono\n --\nIlość sztuk: \nGabaryt A: 2 szt | Gabaryt B: 1 szt | Gabaryt C: 3 szt\nUwagi od klienta: Customer description\nUwagi do zamówienia: Order description",
"order_uid": "9100308",
"orderable_uid": "9100308",
"arrived_at": null,
"estimated_arrived_at": null,
"finished_at": null,
"finished_lat": null,
"finished_lng": null,
"order_full_price": 62.0,
"orderable_full_price": 62.0,
"order_payment_form": "paid",
"orderable_payment_form": "paid",
"authorization_types": [
"code_upon_delivery"
],
"authorization_code": null,
"client_interface_type": "deligoo",
"index": null,
"sms_templates": []
},
"delivery": {
"id": 439,
"type": "Order::Delivery",
"name": null,
"address": "Dietla 52/5, 30-622 Kraków",
"formatted_address": "Dietla+52%2C+Krak%C3%B3w",
"lat": 50.053493,
"lng": 19.94265,
"estimated_time": null,
"time": null,
"late": 0,
"phone": "123 456 789",
"state": "pending",
"created_at": "2021-07-07T11:49:18.098+02:00",
"sumup_payment_url": "sumupmerchant://pay/1.0?affiliate-key=&app-id=&amount=62.0¤cy=PLN&title=Restauracja Krzysztof_9100308&callback=http://localhost:3000/paid",
"pair_id": 438,
"pair_state": "pending",
"order_id": 244,
"orderable_id": 244,
"driver_id": null,
"description": "Lokal: Restauracja Krzysztof\nDoręczenie: Dietla 52/5, 30-622 Kraków\nNumer zamówienia: 9100308 [2]\nMieszkanie: 5\nKlatka: 1\nPiętro: 2\nKod dostępu: 123456\n --\nForma płatności: Zapłacono\n --\nIlość sztuk: \nGabaryt A: 2 szt | Gabaryt B: 1 szt | Gabaryt C: 3 szt\nUwagi od klienta: Customer description\nUwagi do zamówienia: Order description",
"order_uid": "9100308",
"orderable_uid": "9100308",
"arrived_at": null,
"estimated_arrived_at": null,
"finished_at": null,
"finished_lat": null,
"finished_lng": null,
"order_full_price": 62.0,
"orderable_full_price": 62.0,
"order_payment_form": "paid",
"orderable_payment_form": "paid",
"authorization_types": [
"code_upon_delivery"
],
"authorization_code": "956939",
"client_interface_type": "deligoo",
"index": null,
"sms_templates": []
},
"created_at": "2021-07-07T11:49:18.087+02:00",
"perform_at": "2021-07-07T11:49:18.042+02:00",
"pickup_at": "2020-12-04T09:00:39.097+01:00",
"delivery_at": null,
"amount": 6,
"price": 52.0,
"price_subunit": 5200,
"price_delivery": 10.0,
"price_delivery_subunit": 1000,
"price_packaging": 2.0,
"price_packaging_subunit": 200,
"price_additional": null,
"price_additional_subunit": 0,
"discount_code_value": null,
"details": {
"dishes": [
{
"quantity": 1,
"title": "Dish 1",
"price_subunit": 2000,
"total_price_subunit": 3200,
"packaging_cost_amount_subunit": 200,
"toppings": [
{
"title": "topping 1",
"price_subunit": 500,
"quantity": 1
},
{
"title": "topping 2",
"price_subunit": 500,
"quantity": 1
}
]
},
{
"quantity": 1,
"title": "Dish 2",
"price_subunit": 2000,
"total_price_subunit": 2000
}
],
"notes": "Notes"
},
"cancellation_reason": null,
"canceled_by": null,
"return_reason": null,
"external_id": "ce172d4e-8452-40eb-ab31-216c5219a060",
"delivery_method": "delivery_now",
"full_price": 62.0,
"packages": {
"ecommerce-size-a": 2,
"ecommerce-size-b": 1,
"ecommerce-size-c": 3
},
"order_is_ready": false,
"online_payment": false,
"transport_types": [
"car"
],
"client_comment": null,
"order_comment": "Order description",
"customer_comment": "Customer description",
"tracking_url": "http://localhost:3000/orders/tracking/da3ce5a4-f87a-4cc9-b24a-6719930b9c56",
"customer_contact_detail": {
"id": 425,
"first_name": "Jan",
"last_name": "Kowalski",
"humanized_full_address": "Dietla 52/5, 30-622 Kraków",
"phone": "123456789",
"email": "test@example.com",
"city": "Kraków",
"street": "Dietla",
"house_number": "52",
"flat_number": "5",
"postal_code": "30-622",
"floor": "2",
"access_code": "123456",
"lat": "50.053493",
"lng": "19.94265",
"street_suggestion": "Dietla",
"city_suggestion": "Kraków",
"staircase": "1",
"company_name": null,
"language": null,
"delivery_method": "delivery",
"created_at": "2021-05-19T13:29:52.716+02:00",
"updated_at": "2021-05-19T15:04:03.509+02:00"
},
"invoice": null,
"publication_interval": 30,
"publish_at": null,
"management_kind": "create_and_receive_orders",
"weight": 15.0,
"payment_status": "in_progress",
"has_drinks": false,
"ordinal_number": 2,
"has_label": false,
"pickup_in": -309708,
"automatic_confirmation": true,
"service_type": "sameday",
"events": [
{
"trackable_id": 244,
"trackable_type": "Order::Regular",
"key": "orders.created",
"data": {
"id": 244,
"uid": "9100308",
"team_name": "Krzysztof",
"team_uuid": "bcf31da0-74d8-4628-9c69-ee053daf0e48",
"external_id": "ce172d4e-8452-40eb-ab31-216c5219a060"
},
"text": "Zlecenie zostało utworzone.",
"created_at": "2021-07-07T11:49:18.358+02:00"
},
{
"trackable_id": 244,
"trackable_type": "Order::Regular",
"key": "orders.set_as_waiting",
"data": {
"id": 244,
"uid": "9100308",
"external_id": "ce172d4e-8452-40eb-ab31-216c5219a060"
},
"text": "Zlecenie oczekuje na akceptację.",
"created_at": "2021-07-07T11:49:18.444+02:00"
},
{
"trackable_id": 244,
"trackable_type": "Order::Regular",
"key": "orders.set_as_pending",
"data": {
"id": 244,
"uid": "9100308",
"external_id": "ce172d4e-8452-40eb-ab31-216c5219a060"
},
"text": "Zlecenie jest przetwarzane.",
"created_at": "2021-07-07T11:49:18.584+02:00"
}
],
"webhook_endpoint": {
"id": 3,
"url": "http://preproduction-app.deligoo.pl/api/test_app/v1/webhooks/real",
"secret": "dd6651b4db50cde9f971c8505bb1b0038c6630b0d3dafb142d2626af8d07c4a5",
"created_at": "2021-05-19T13:29:53.170+02:00",
"updated_at": "2021-05-19T13:29:53.170+02:00"
}
},
"meta": {}
}
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/clients/<ID>/orders
Request method
POST
Request headers
Parameter | Required | Description |
---|---|---|
Authorization | YES | Access token granted after sign in |
Request parameters
Parameter | Required | Description |
---|---|---|
ID | TRUE | ID of an client |
Request body
Order
Parameter | Required | Description |
---|---|---|
price_subunit | YES | Order amount |
pickup_at | YES | Earliest pickup time in format: 2020-12-04T14:21:13.369+01:00 |
payment_form | YES | Payment methods: paid , card , cash |
price_delivery_subunit | NO | Delivery costs |
price_packaging_subunit | NO | Packaging cost |
details | NO | Order components |
external_id | NO | External order number / ID / UUID |
weight | NO | Order weight |
order_comment_attributes | NO | Order comment attributes |
customer_comment_attributes | NO | Customer comment attributes |
packages | NO | Order packages attributes |
automatic_confirmation | NO | true/false |
details
Parameter | Required | Description |
---|---|---|
dishes | YES | Array of dishes |
notes | NO | Notes |
dishes
Parameter | Required | Description |
---|---|---|
quantity | YES | Quantity |
title | YES | Title |
price_subunit | YES | Single dish price |
total_price_subunit | YES | Total price |
packaging_cost_amount_subunit | NO | Packaging cost amount |
toppings | NO | Array of toppings |
toppings
Parameter | Required | Description |
---|---|---|
title | YES | Title |
price_subunit | YES | Price |
quantity | YES | Quantity |
Point - pickup_attributes / delivery_attributes
Parameter | Required | Description |
---|---|---|
postal_code | YES | Postal code |
city | YES | City |
street | YES | Street |
house_number | YES | House number |
flat_number | NO | Flat number |
staircase | NO | Staircase |
floor | NO | Floor |
access_code | NO | Access code to staircase |
lat | NO | Latitude |
lng | NO | Longitude |
phone | YES | Phone number |
NO | ||
first_name | NO | First name |
last_name | NO | Last name |
notes | NO | Notes |
order_comment_attributes
Parameter | Required | Description |
---|---|---|
description | No | Description |
customer_comment_attributes
Parameter | Required | Description |
---|---|---|
description | No | Description |
packages
Parameter | Required | Description |
---|---|---|
ecommerce-size-a | No | Quantity |
ecommerce-size-b | No | Quantity |
ecommerce-size-c | No | Quantity |
big-pizza | NO | Quantity |
standard-dish | NO | Quantity |
own-packaging | NO | Quantity |
Retrive an order
Example
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/orders/<ID>
Request method
GET
Request headers
Accept: application/json
Content-Type: application/json
Authorization: Bearer XYZ
Request parameters
id: 244
Response
{
"data": {
"id": 244,
"uid": "9100308",
"uuid": "da3ce5a4-f87a-4cc9-b24a-6719930b9c56",
"returned_order_id": null,
"returned": false,
"team_id": 6,
"driver_id": null,
"distance": 1.47,
"payment_form": "paid",
"rating": null,
"description": "Lokal: Restauracja Krzysztof\nDoręczenie: Dietla 52/5, 30-622 Kraków\nNumer zamówienia: 9100308 [2]\nMieszkanie: 5\nKlatka: 1\nPiętro: 2\nKod dostępu: 123456\n --\nForma płatności: Zapłacono\n --\nIlość sztuk: \nGabaryt A: 2 szt | Gabaryt B: 1 szt | Gabaryt C: 3 szt\nUwagi od klienta: Customer description\nUwagi do zamówienia: Order description",
"provider": "api",
"state": "pending",
"adding_state": "processing",
"step": null,
"pickup": {
"id": 438,
"type": "Order::Pickup",
"name": "Restauracja Krzysztof",
"address": "Dietla 29, 31-070 Kraków, Polska",
"formatted_address": "Dietla+29%2C+Krak%C3%B3w%2C+Polska",
"lat": 50.0505517,
"lng": 19.9404809,
"estimated_time": null,
"time": null,
"late": 0,
"phone": "987 654 321",
"state": "pending",
"created_at": "2021-07-07T11:49:18.096+02:00",
"sumup_payment_url": "sumupmerchant://pay/1.0?affiliate-key=&app-id=&amount=62.0¤cy=PLN&title=Restauracja Krzysztof_9100308&callback=http://localhost:3000/paid",
"pair_id": 439,
"pair_state": "pending",
"order_id": 244,
"orderable_id": 244,
"driver_id": null,
"description": "Lokal: Restauracja Krzysztof\nDoręczenie: Dietla 52/5, 30-622 Kraków\nNumer zamówienia: 9100308 [2]\nMieszkanie: 5\nKlatka: 1\nPiętro: 2\nKod dostępu: 123456\n --\nForma płatności: Zapłacono\n --\nIlość sztuk: \nGabaryt A: 2 szt | Gabaryt B: 1 szt | Gabaryt C: 3 szt\nUwagi od klienta: Customer description\nUwagi do zamówienia: Order description",
"order_uid": "9100308",
"orderable_uid": "9100308",
"arrived_at": null,
"estimated_arrived_at": null,
"finished_at": null,
"finished_lat": null,
"finished_lng": null,
"order_full_price": 62.0,
"orderable_full_price": 62.0,
"order_payment_form": "paid",
"orderable_payment_form": "paid",
"authorization_types": [
"code_upon_delivery"
],
"authorization_code": null,
"client_interface_type": "deligoo",
"index": null,
"sms_templates": []
},
"delivery": {
"id": 439,
"type": "Order::Delivery",
"name": null,
"address": "Dietla 52/5, 30-622 Kraków",
"formatted_address": "Dietla+52%2C+Krak%C3%B3w",
"lat": 50.053493,
"lng": 19.94265,
"estimated_time": null,
"time": null,
"late": 0,
"phone": "123 456 789",
"state": "pending",
"created_at": "2021-07-07T11:49:18.098+02:00",
"sumup_payment_url": "sumupmerchant://pay/1.0?affiliate-key=&app-id=&amount=62.0¤cy=PLN&title=Restauracja Krzysztof_9100308&callback=http://localhost:3000/paid",
"pair_id": 438,
"pair_state": "pending",
"order_id": 244,
"orderable_id": 244,
"driver_id": null,
"description": "Lokal: Restauracja Krzysztof\nDoręczenie: Dietla 52/5, 30-622 Kraków\nNumer zamówienia: 9100308 [2]\nMieszkanie: 5\nKlatka: 1\nPiętro: 2\nKod dostępu: 123456\n --\nForma płatności: Zapłacono\n --\nIlość sztuk: \nGabaryt A: 2 szt | Gabaryt B: 1 szt | Gabaryt C: 3 szt\nUwagi od klienta: Customer description\nUwagi do zamówienia: Order description",
"order_uid": "9100308",
"orderable_uid": "9100308",
"arrived_at": null,
"estimated_arrived_at": null,
"finished_at": null,
"finished_lat": null,
"finished_lng": null,
"order_full_price": 62.0,
"orderable_full_price": 62.0,
"order_payment_form": "paid",
"orderable_payment_form": "paid",
"authorization_types": [
"code_upon_delivery"
],
"authorization_code": "956939",
"client_interface_type": "deligoo",
"index": null,
"sms_templates": []
},
"created_at": "2021-07-07T11:49:18.087+02:00",
"perform_at": "2021-07-07T11:49:18.042+02:00",
"pickup_at": "2020-12-04T09:00:39.097+01:00",
"delivery_at": null,
"amount": 6,
"price": 52.0,
"price_subunit": 5200,
"price_delivery": 10.0,
"price_delivery_subunit": 1000,
"price_packaging": 2.0,
"price_packaging_subunit": 200,
"price_additional": null,
"price_additional_subunit": 0,
"discount_code_value": null,
"details": {
"notes": "Notes",
"dishes": [
{
"title": "Dish 1",
"quantity": 1,
"toppings": [
{
"title": "topping 1",
"quantity": 1,
"price_subunit": 500
},
{
"title": "topping 2",
"quantity": 1,
"price_subunit": 500
}
],
"price_subunit": 2000,
"total_price_subunit": 3200,
"packaging_cost_amount_subunit": 200
},
{
"title": "Dish 2",
"quantity": 1,
"price_subunit": 2000,
"total_price_subunit": 2000
}
]
},
"cancellation_reason": null,
"canceled_by": null,
"return_reason": null,
"external_id": "ce172d4e-8452-40eb-ab31-216c5219a060",
"delivery_method": "delivery_now",
"full_price": 62.0,
"packages": {
"ecommerce-size-a": 2,
"ecommerce-size-b": 1,
"ecommerce-size-c": 3
},
"order_is_ready": false,
"online_payment": false,
"transport_types": [
"car"
],
"client_comment": null,
"order_comment": "Order description",
"customer_comment": "Customer description",
"tracking_url": "http://localhost:3000/orders/tracking/da3ce5a4-f87a-4cc9-b24a-6719930b9c56",
"customer_contact_detail": {
"id": 425,
"first_name": "Jan",
"last_name": "Kowalski",
"humanized_full_address": "Dietla 52/5, 30-622 Kraków",
"phone": "123456789",
"email": "test@example.com",
"city": "Kraków",
"street": "Dietla",
"house_number": "52",
"flat_number": "5",
"postal_code": "30-622",
"floor": "2",
"access_code": "123456",
"lat": "50.053493",
"lng": "19.94265",
"street_suggestion": "Dietla",
"city_suggestion": "Kraków",
"staircase": "1",
"company_name": null,
"language": null,
"delivery_method": "delivery",
"created_at": "2021-05-19T13:29:52.716+02:00",
"updated_at": "2021-05-19T15:04:03.509+02:00"
},
"invoice": null,
"publication_interval": 30,
"publish_at": null,
"management_kind": "create_and_receive_orders",
"weight": 15.0,
"payment_status": "in_progress",
"has_drinks": false,
"ordinal_number": 2,
"has_label": false,
"pickup_in": -309708,
"automatic_confirmation": true,
"service_type": "sameday",
"events": [
{
"trackable_id": 244,
"trackable_type": "Order::Regular",
"key": "orders.created",
"data": {
"id": 244,
"uid": "9100308",
"team_name": "Krzysztof",
"team_uuid": "bcf31da0-74d8-4628-9c69-ee053daf0e48",
"external_id": "ce172d4e-8452-40eb-ab31-216c5219a060"
},
"text": "Zlecenie zostało utworzone.",
"created_at": "2021-07-07T11:49:18.358+02:00"
},
{
"trackable_id": 244,
"trackable_type": "Order::Regular",
"key": "orders.set_as_waiting",
"data": {
"id": 244,
"uid": "9100308",
"external_id": "ce172d4e-8452-40eb-ab31-216c5219a060"
},
"text": "Zlecenie oczekuje na akceptację.",
"created_at": "2021-07-07T11:49:18.444+02:00"
},
{
"trackable_id": 244,
"trackable_type": "Order::Regular",
"key": "orders.set_as_pending",
"data": {
"id": 244,
"uid": "9100308",
"external_id": "ce172d4e-8452-40eb-ab31-216c5219a060"
},
"text": "Zlecenie jest przetwarzane.",
"created_at": "2021-07-07T11:49:18.584+02:00"
}
],
"webhook_endpoint": {
"id": 3,
"url": "http://preproduction-app.deligoo.pl/api/test_app/v1/webhooks/real",
"secret": "dd6651b4db50cde9f971c8505bb1b0038c6630b0d3dafb142d2626af8d07c4a5",
"created_at": "2021-05-19T13:29:53.170+02:00",
"updated_at": "2021-05-19T13:29:53.170+02:00"
}
},
"meta": {}
}
Endpoint allows you to retrievs the details of an order.
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/orders/<ID>
Request method
GET
Request headers
Parameter | Required | Description |
---|---|---|
Authorization | YES | Access token granted after sign in |
Request parameters
Parameter | Required | Description |
---|---|---|
ID | TRUE | ID of an order |
Fetch orders list
Example
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/orders/
Request method
GET
Request headers
Content-Type: application/json
Authorization: Bearer XYZ
Request parameters
date: 2021-10-08
per: 10
page: 1
Response
{"data":
[{"id": 475,
"uid": "4609782",
"uuid": "f91dcebd-1647-44b4-bcd9-2eca92d35853",
"returned_order_id": nil,
"returned": false,
"client_id": 2,
"team_id": 1,
"driver_id": 4,
"proposed_driver_id": nil,
"reassigned": false,
"force_assignment": false,
"distance": "6.06",
"distance_for_car": "6.06",
"distance_for_bicycle": "5.64",
"distance_for_scooter": "6.06",
"payment_form": "paid",
"rating": nil,
"description": "Lokal: Tandroi Roti\nDoręczenie: Nowohucka 1, 31-580 Kraków\nNumer zamówienia: 4609782 [8]\n --\nZAPŁACONE\n --\nIlość sztuk: \nDanie standard | pizza do 32 cm: 1 szt",
"provider": "deligoo",
"state": "published",
"adding_state": "assigned",
"step": "notes",
"pickup":
{"id": 914,
"type": "Order::Pickup",
"first_name": nil,
"last_name": nil,
"company_name": "Tandroi Roti",
"name": "Tandroi Roti",
"phone": "123 123 123",
"humanized_full_address": "Dietla 1, Kraków, Polska",
"address": "Dietla 1, Kraków, Polska",
"formatted_address": "Dietla+1%2C+Krak%C3%B3w%2C+Polska",
"place_id": nil,
"lat": 50.0535741,
"lng": 19.9426141,
"city_suggestion": nil,
"street_suggestion": nil,
"city": nil,
"postal_code": nil,
"street": nil,
"house_number": nil,
"flat_number": nil,
"floor": nil,
"staircase": nil,
"access_code": nil,
"language": nil,
"estimated_time": "2021-10-07T11:58:52.000+02:00",
"duration": 100,
"time": "2021-10-07T11:58:59.000+02:00",
"late": 0,
"state": "published",
"created_at": "2021-10-07T11:39:33.938+02:00",
"sumup_payment_url": "",
"pair_id": 915,
"pair_state": "published",
"order_id": 475,
"orderable_id": 475,
"driver_id": 4,
"description": "Lokal: Tandroi Roti\nDoręczenie: Nowohucka 1, 31-580 Kraków\nNumer zamówienia: 4609782 [8]\n --\nZAPŁACONE\n --\nIlość sztuk: \nDanie standard | pizza do 32 cm: 1 szt",
"order_uid": "4609782",
"orderable_uid": "4609782",
"arrived_at": nil,
"estimated_arrived_at": nil,
"finished_at": nil,
"finished_lat": nil,
"finished_lng": nil,
"order_full_price": 0.0,
"orderable_full_price": 0.0,
"order_payment_form": "paid",
"orderable_payment_form": "paid",
"authorization_types": nil,
"authorization_type": nil,
"authorization_code": nil,
"authorization_signature": nil,
"client_interface_type": "deligoo",
"index": nil,
"sms_templates": []},
"delivery":
{"id": 915,
"type": "Order::Delivery",
"first_name": nil,
"last_name": nil,
"company_name": nil,
"name": nil,
"phone": "666 666 666",
"humanized_full_address": "Nowohucka 1, 31-580 Kraków",
"address": "Nowohucka 1, 31-580 Kraków",
"formatted_address": "Nowohucka+1%2C+Krak%C3%B3w",
"place_id": nil,
"lat": 50.069819,
"lng": 20.00556,
"city_suggestion": "Kraków",
"street_suggestion": "Nowohucka",
"city": "Kraków",
"postal_code": "31-580",
"street": "Nowohucka",
"house_number": "1",
"flat_number": "",
"floor": "",
"staircase": "",
"access_code": "",
"language": nil,
"estimated_time": "2021-10-07T12:32:24.000+02:00",
"duration": 400,
"time": "2021-10-07T12:32:24.000+02:00",
"late": 0,
"state": "published",
"created_at": "2021-10-07T11:39:33.941+02:00",
"sumup_payment_url": "",
"pair_id": 914,
"pair_state": "published",
"order_id": 475,
"orderable_id": 475,
"driver_id": 4,
"description": "Lokal: Tandroi Roti\nDoręczenie: Nowohucka 1, 31-580 Kraków\nNumer zamówienia: 4609782 [8]\n --\nZAPŁACONE\n --\nIlość sztuk: \nDanie standard | pizza do 32 cm: 1 szt",
"order_uid": "4609782",
"orderable_uid": "4609782",
"arrived_at": nil,
"estimated_arrived_at": nil,
"finished_at": nil,
"finished_lat": nil,
"finished_lng": nil,
"order_full_price": 0.0,
"orderable_full_price": 0.0,
"order_payment_form": "paid",
"orderable_payment_form": "paid",
"authorization_types": nil,
"authorization_type": nil,
"authorization_code": nil,
"authorization_signature": nil,
"client_interface_type": "deligoo",
"index": nil,
"sms_templates": []},
"created_at": "2021-10-07T11:39:33.935+02:00",
"perform_at": "2021-10-07T11:39:40.140+02:00",
"pickup_at": "2021-10-07T11:54:40.134+02:00",
"delivery_at": "2021-10-07T12:22:39.000+02:00",
"amount": 1,
"full_price": 0.0,
"full_price_subunit": 0,
"price": 0.0,
"price_subunit": 0,
"price_delivery": 0.0,
"price_delivery_subunit": 0,
"price_packaging": 0.0,
"price_packaging_subunit": 0,
"price_additional": 0.0,
"price_additional_subunit": 0,
"delivery_cost_subunit": 0,
"discount_code_value": 0.0,
"discount_code_value_subunit": 0,
"details": {},
"cancellation_reason": nil,
"canceled_by": nil,
"return_reason": nil,
"external_id": nil,
"delivery_method": "delivery_now",
"packages": {"standard-dish": 1},
"order_is_ready": false,
"online_payment": false,
"transport_types": ["car"],
"client_comment": nil,
"order_comment": nil,
"customer_comment": nil,
"tracking_url": "http://localhost:3000/orders/tracking/4609782",
"customer_contact_detail":
{"id": 338,
"first_name": nil,
"last_name": nil,
"humanized_full_address": "Nowohucka 1, 31-580 Kraków",
"phone": "666666666",
"email": nil,
"city": "Kraków",
"street": "Nowohucka",
"house_number": "1",
"flat_number": "",
"postal_code": "31-580",
"floor": "",
"access_code": "",
"lat": "50.069819",
"lng": "20.00556",
"street_suggestion": "Nowohucka",
"city_suggestion": "Kraków",
"staircase": "",
"company_name": nil,
"language": nil,
"delivery_method": "delivery",
"created_at": "2021-10-07T11:17:51.263+02:00",
"updated_at": "2021-10-07T11:17:51.263+02:00"},
"invoice": nil,
"publication_interval": 30,
"publish_at": "2021-10-07T11:25:22.000+02:00",
"management_kind": "create_and_receive_orders",
"weight": 0.0,
"payment_status": nil,
"has_drinks": false,
"ordinal_number": 8,
"has_label": false,
"pickup_in": 15,
"automatic_confirmation": false,
"service_type": "direct",
"pickup_range_start_time": "2021-10-07T12:19:33.935+02:00",
"pickup_range_end_time": "2021-10-07T12:39:33.935+02:00",
"client_allowed_receive_actions": [],
"sumup_payment_url": "",
"authorization_types": nil,
"authorization_type": nil,
"client_interface_type": "deligoo",
"is_buffered": false,
"driver":
{"id": 4,
"team_id": 1,
"team": {"id": 1, "uuid": "ecca6eaa-f29c-47e6-9cba-462fc712184a", "name": "Kraków", "is_test": false, "api_enabled": true},
"name": "Jan Kowalski",
"email": "jan@example.com",
"display_name": "Jan K.",
"phone": "111111111",
"transport_type": "car",
"transport": "own_car",
"payment_collection_system": nil,
"lat": 50.01659,
"lng": 19.947149,
"payment_forms": ["cash", "card", "paid"],
"telegram_chat_link": nil}},
{"id": 474,
"uid": "6310540",
"uuid": "93504f84-be55-41d9-af1b-d9425570a3b7",
"returned_order_id": nil,
"returned": false,
"client_id": 2,
"team_id": 1,
"driver_id": 4,
"proposed_driver_id": nil,
"reassigned": true,
"force_assignment": false,
"distance": "2.04",
"distance_for_car": "2.04",
"distance_for_bicycle": "1.49",
"distance_for_scooter": "2.04",
"payment_form": "paid",
"rating": nil,
"description": "Lokal: Tandroi Roti\nDoręczenie: Jana Zamoyskiego 26, 30-523 Kraków\nNumer zamówienia: 6310540 [7]\n --\nZAPŁACONE\n --\nIlość sztuk: \nDanie standard | pizza do 32 cm: 1 szt",
"provider": "deligoo",
"state": "published",
"adding_state": "assigned",
"step": "notes",
"pickup":
{"id": 912,
"type": "Order::Pickup",
"first_name": nil,
"last_name": nil,
"company_name": "Tandroi Roti",
"name": "Tandroi Roti",
"phone": "123 123 123",
"humanized_full_address": "Dietla 1, Kraków, Polska",
"address": "Dietla 1, Kraków, Polska",
"formatted_address": "Dietla+1%2C+Krak%C3%B3w%2C+Polska",
"place_id": nil,
"lat": 50.0535741,
"lng": 19.9426141,
"city_suggestion": nil,
"street_suggestion": nil,
"city": nil,
"postal_code": nil,
"street": nil,
"house_number": nil,
"flat_number": nil,
"floor": nil,
"staircase": nil,
"access_code": nil,
"language": nil,
"estimated_time": "2021-10-07T12:02:00.000+02:00",
"duration": 100,
"time": "2021-10-07T12:02:00.000+02:00",
"late": 0,
"state": "published",
"created_at": "2021-10-07T11:32:02.656+02:00",
"sumup_payment_url": "",
"pair_id": 913,
"pair_state": "published",
"order_id": 474,
"orderable_id": 474,
"driver_id": 4,
"description": "Lokal: Tandroi Roti\nDoręczenie: Jana Zamoyskiego 26, 30-523 Kraków\nNumer zamówienia: 6310540 [7]\n --\nZAPŁACONE\n --\nIlość sztuk: \nDanie standard | pizza do 32 cm: 1 szt",
"order_uid": "6310540",
"orderable_uid": "6310540",
"arrived_at": nil,
"estimated_arrived_at": nil,
"finished_at": nil,
"finished_lat": nil,
"finished_lng": nil,
"order_full_price": 0.0,
"orderable_full_price": 0.0,
"order_payment_form": "paid",
"orderable_payment_form": "paid",
"authorization_types": nil,
"authorization_type": nil,
"authorization_code": nil,
"authorization_signature": nil,
"client_interface_type": "deligoo",
"index": nil,
"sms_templates": []},
"delivery":
{"id": 913,
"type": "Order::Delivery",
"first_name": nil,
"last_name": nil,
"company_name": nil,
"name": nil,
"phone": "222 222 222",
"humanized_full_address": "Jana Zamoyskiego 26, 30-523 Kraków",
"address": "Jana Zamoyskiego 26, 30-523 Kraków",
"formatted_address": "Jana+Zamoyskiego+26%2C+Krak%C3%B3w",
"place_id": nil,
"lat": 50.04207,
"lng": 19.945985,
"city_suggestion": "Kraków",
"street_suggestion": "Jana Zamoyskiego",
"city": "Kraków",
"postal_code": "30-523",
"street": "Jana Zamoyskiego",
"house_number": "26",
"flat_number": "",
"floor": "",
"staircase": "",
"access_code": "",
"language": nil,
"estimated_time": "2021-10-07T12:12:23.000+02:00",
"duration": 400,
"time": "2021-10-07T12:12:23.000+02:00",
"late": 0,
"state": "published",
"created_at": "2021-10-07T11:32:02.657+02:00",
"sumup_payment_url": "",
"pair_id": 912,
"pair_state": "published",
"order_id": 474,
"orderable_id": 474,
"driver_id": 4,
"description": "Lokal: Tandroi Roti\nDoręczenie: Jana Zamoyskiego 26, 30-523 Kraków\nNumer zamówienia: 6310540 [7]\n --\nZAPŁACONE\n --\nIlość sztuk: \nDanie standard | pizza do 32 cm: 1 szt",
"order_uid": "6310540",
"orderable_uid": "6310540",
"arrived_at": nil,
"estimated_arrived_at": nil,
"finished_at": nil,
"finished_lat": nil,
"finished_lng": nil,
"order_full_price": 0.0,
"orderable_full_price": 0.0,
"order_payment_form": "paid",
"orderable_payment_form": "paid",
"authorization_types": nil,
"authorization_type": nil,
"authorization_code": nil,
"authorization_signature": nil,
"client_interface_type": "deligoo",
"index": nil,
"sms_templates": []},
"created_at": "2021-10-07T11:32:02.653+02:00",
"perform_at": "2021-10-07T11:40:36.002+02:00",
"pickup_at": "2021-10-07T12:02:00.000+02:00",
"delivery_at": "2021-10-07T12:14:06.000+02:00",
"amount": 1,
"full_price": 0.0,
"full_price_subunit": 0,
"price": 0.0,
"price_subunit": 0,
"price_delivery": 0.0,
"price_delivery_subunit": 0,
"price_packaging": 0.0,
"price_packaging_subunit": 0,
"price_additional": 0.0,
"price_additional_subunit": 0,
"delivery_cost_subunit": 0,
"discount_code_value": 0.0,
"discount_code_value_subunit": 0,
"details": {},
"cancellation_reason": nil,
"canceled_by": nil,
"return_reason": nil,
"external_id": nil,
"delivery_method": "delivery_now",
"packages": {"standard-dish": 1},
"order_is_ready": false,
"online_payment": false,
"transport_types": ["car", "scooter", "bicycle"],
"client_comment": nil,
"order_comment": nil,
"customer_comment": nil,
"tracking_url": "http://localhost:3000/orders/tracking/6310540",
"customer_contact_detail":
{"id": 337,
"first_name": nil,
"last_name": nil,
"humanized_full_address": "Jana Zamoyskiego 26, 30-523 Kraków",
"phone": "222222222",
"email": nil,
"city": "Kraków",
"street": "Jana Zamoyskiego",
"house_number": "26",
"flat_number": "",
"postal_code": "30-523",
"floor": "",
"access_code": "",
"lat": "50.04207",
"lng": "19.945985",
"street_suggestion": "Jana Zamoyskiego",
"city_suggestion": "Kraków",
"staircase": "",
"company_name": nil,
"language": nil,
"delivery_method": "delivery",
"created_at": "2021-09-14T14:16:29.918+02:00",
"updated_at": "2021-09-14T14:16:29.918+02:00"},
"invoice": nil,
"publication_interval": 30,
"publish_at": "2021-10-07T11:47:00.000+02:00",
"management_kind": "create_and_receive_orders",
"weight": 0.0,
"payment_status": nil,
"has_drinks": false,
"ordinal_number": 7,
"has_label": false,
"pickup_in": 21,
"automatic_confirmation": false,
"service_type": "direct",
"pickup_range_start_time": "2021-10-07T12:12:02.653+02:00",
"pickup_range_end_time": "2021-10-07T12:32:02.653+02:00",
"client_allowed_receive_actions": [],
"sumup_payment_url": "",
"authorization_types": nil,
"authorization_type": nil,
"client_interface_type": "deligoo",
"is_buffered": false,
"driver":
{"id": 4,
"team_id": 1,
"team": {"id": 1, "uuid": "ecca6eaa-f29c-47e6-9cba-462fc712184a", "name": "Kraków", "is_test": false, "api_enabled": true},
"name": "Jan Kowalski",
"email": "jan@example.com",
"display_name": "Jan K",
"phone": "111111111",
"transport_type": "car",
"transport": "own_car",
"payment_collection_system": nil,
"lat": 50.01659,
"lng": 19.947149,
"payment_forms": ["cash", "card", "paid"],
"telegram_chat_link": nil}}],
"meta": {}
}
Endpoint allows you to fetch orders for specified day.
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/orders
Request method
GET
Request headers
Parameter | Required | Description |
---|---|---|
Authorization | YES | Access token granted after sign in |
Request parameters
Parameter | Required | Description |
---|---|---|
date | NO | Default: current date |
per | NO | Default: 10 |
page | NO | Default: 1 |
Cancel an order
Example
Request url
http://preproduction-app.deligoo.pl/api/partners_app/v1/orders/125/cancel
Request method
PUT
Request headers
Accept: application/json
Content-Type: application/json
Authorization: Bearer XYZ
Request parameters
id: 244
Response body
{
"data": {
"id": 244,
"uid": "9100308",
"uuid": "da3ce5a4-f87a-4cc9-b24a-6719930b9c56",
"returned_order_id": null,
"returned": false,
"team_id": 6,
"driver_id": null,
"distance": 1.47,
"payment_form": "paid",
"rating": null,
"description": "Lokal: Restauracja Krzysztof\nDoręczenie: Dietla 52/5, 30-622 Kraków\nNumer zamówienia: 9100308 [2]\nMieszkanie: 5\nKlatka: 1\nPiętro: 2\nKod dostępu: 123456\n --\nForma płatności: Zapłacono\n --\nIlość sztuk: \nGabaryt A: 2 szt | Gabaryt B: 1 szt | Gabaryt C: 3 szt\nUwagi od klienta: Customer description\nUwagi do zamówienia: Order description",
"provider": "api",
"state": "canceled",
"adding_state": "added",
"step": null,
"pickup": {
"id": 438,
"type": "Order::Pickup",
"name": "Restauracja Krzysztof",
"address": "Dietla 29, 31-070 Kraków, Polska",
"formatted_address": "Dietla+29%2C+Krak%C3%B3w%2C+Polska",
"lat": 50.0505517,
"lng": 19.9404809,
"estimated_time": null,
"time": null,
"late": 0,
"phone": "987 654 321",
"state": "canceled",
"created_at": "2021-07-07T11:49:18.096+02:00",
"sumup_payment_url": "sumupmerchant://pay/1.0?affiliate-key=&app-id=&amount=62.0¤cy=PLN&title=Restauracja Krzysztof_9100308&callback=http://localhost:3000/paid",
"pair_id": 439,
"pair_state": "canceled",
"order_id": 244,
"orderable_id": 244,
"driver_id": null,
"description": "Lokal: Restauracja Krzysztof\nDoręczenie: Dietla 52/5, 30-622 Kraków\nNumer zamówienia: 9100308 [2]\nMieszkanie: 5\nKlatka: 1\nPiętro: 2\nKod dostępu: 123456\n --\nForma płatności: Zapłacono\n --\nIlość sztuk: \nGabaryt A: 2 szt | Gabaryt B: 1 szt | Gabaryt C: 3 szt\nUwagi od klienta: Customer description\nUwagi do zamówienia: Order description",
"order_uid": "9100308",
"orderable_uid": "9100308",
"arrived_at": null,
"estimated_arrived_at": null,
"finished_at": null,
"finished_lat": null,
"finished_lng": null,
"order_full_price": 62.0,
"orderable_full_price": 62.0,
"order_payment_form": "paid",
"orderable_payment_form": "paid",
"authorization_types": [
"code_upon_delivery"
],
"authorization_code": null,
"client_interface_type": "deligoo",
"index": null,
"sms_templates": []
},
"delivery": {
"id": 439,
"type": "Order::Delivery",
"name": null,
"address": "Dietla 52/5, 30-622 Kraków",
"formatted_address": "Dietla+52%2C+Krak%C3%B3w",
"lat": 50.053493,
"lng": 19.94265,
"estimated_time": null,
"time": null,
"late": 0,
"phone": "123 456 789",
"state": "canceled",
"created_at": "2021-07-07T11:49:18.098+02:00",
"sumup_payment_url": "sumupmerchant://pay/1.0?affiliate-key=&app-id=&amount=62.0¤cy=PLN&title=Restauracja Krzysztof_9100308&callback=http://localhost:3000/paid",
"pair_id": 438,
"pair_state": "canceled",
"order_id": 244,
"orderable_id": 244,
"driver_id": null,
"description": "Lokal: Restauracja Krzysztof\nDoręczenie: Dietla 52/5, 30-622 Kraków\nNumer zamówienia: 9100308 [2]\nMieszkanie: 5\nKlatka: 1\nPiętro: 2\nKod dostępu: 123456\n --\nForma płatności: Zapłacono\n --\nIlość sztuk: \nGabaryt A: 2 szt | Gabaryt B: 1 szt | Gabaryt C: 3 szt\nUwagi od klienta: Customer description\nUwagi do zamówienia: Order description",
"order_uid": "9100308",
"orderable_uid": "9100308",
"arrived_at": null,
"estimated_arrived_at": null,
"finished_at": null,
"finished_lat": null,
"finished_lng": null,
"order_full_price": 62.0,
"orderable_full_price": 62.0,
"order_payment_form": "paid",
"orderable_payment_form": "paid",
"authorization_types": [
"code_upon_delivery"
],
"authorization_code": "956939",
"client_interface_type": "deligoo",
"index": null,
"sms_templates": []
},
"created_at": "2021-07-07T11:49:18.087+02:00",
"perform_at": "2021-07-07T11:49:18.042+02:00",
"pickup_at": "2020-12-04T09:00:39.097+01:00",
"delivery_at": null,
"amount": 6,
"price": 52.0,
"price_subunit": 5200,
"price_delivery": 10.0,
"price_delivery_subunit": 1000,
"price_packaging": 2.0,
"price_packaging_subunit": 200,
"price_additional": null,
"price_additional_subunit": 0,
"discount_code_value": null,
"details": {
"notes": "Notes",
"dishes": [
{
"title": "Dish 1",
"quantity": 1,
"toppings": [
{
"title": "topping 1",
"quantity": 1,
"price_subunit": 500
},
{
"title": "topping 2",
"quantity": 1,
"price_subunit": 500
}
],
"price_subunit": 2000,
"total_price_subunit": 3200,
"packaging_cost_amount_subunit": 200
},
{
"title": "Dish 2",
"quantity": 1,
"price_subunit": 2000,
"total_price_subunit": 2000
}
]
},
"cancellation_reason": null,
"canceled_by": "partner",
"return_reason": null,
"external_id": "ce172d4e-8452-40eb-ab31-216c5219a060",
"delivery_method": "delivery_now",
"full_price": 62.0,
"packages": {
"ecommerce-size-a": 2,
"ecommerce-size-b": 1,
"ecommerce-size-c": 3
},
"order_is_ready": false,
"online_payment": false,
"transport_types": [
"car"
],
"client_comment": null,
"order_comment": "Order description",
"customer_comment": "Customer description",
"tracking_url": "http://localhost:3000/orders/tracking/da3ce5a4-f87a-4cc9-b24a-6719930b9c56",
"customer_contact_detail": {
"id": 425,
"first_name": "Jan",
"last_name": "Kowalski",
"humanized_full_address": "Dietla 52/5, 30-622 Kraków",
"phone": "123456789",
"email": "test@example.com",
"city": "Kraków",
"street": "Dietla",
"house_number": "52",
"flat_number": "5",
"postal_code": "30-622",
"floor": "2",
"access_code": "123456",
"lat": "50.053493",
"lng": "19.94265",
"street_suggestion": "Dietla",
"city_suggestion": "Kraków",
"staircase": "1",
"company_name": null,
"language": null,
"delivery_method": "delivery",
"created_at": "2021-05-19T13:29:52.716+02:00",
"updated_at": "2021-05-19T15:04:03.509+02:00"
},
"invoice": null,
"publication_interval": 30,
"publish_at": null,
"management_kind": "create_and_receive_orders",
"weight": 15.0,
"payment_status": "failed",
"has_drinks": false,
"ordinal_number": 2,
"has_label": false,
"pickup_in": -309708,
"automatic_confirmation": true,
"service_type": "sameday"
},
"meta": {}
}
Endpoint allows you cancel an order.
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/orders/<ID>/cancel
Request method
PUT
Request headers
Parameter | Required | Description |
---|---|---|
Authorization | YES | Access token granted after sign in |
Request parameters
Parameter | Required | Description |
---|---|---|
ID | YES | ID of an order |
Shops
Fetch shops for specified postal code
Example
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/clients/for_postal_code
Request method
GET
Request headers
Accept: application/json
Content-Type: application/json
Authorization: Bearer XYZ
Request body
{
"postal_code": "00-013"
}
Response body
{
"data": [
{
"delivery_zones": [
{
"id": 35,
"polygon": "LINESTRING(20.970506245546364 52.09763545524179, 20.868882710390118 52.11956462642918, 20.764512593202614 52.168444690302564, 20.742539936952614 52.24250512112835, 20.79472499554636 52.30804643018896, 20.866136128358857 52.35504197422328, 20.9959338414089 52.38019762243741, 21.100303958596395 52.35336442165708, 21.182701419533892 52.30636709436617, 21.245872806252642 52.23409537914335, 21.248619388283892 52.17686686547802, 21.166221927346392 52.12293738788872, 21.017906497658892 52.10438404121464, 20.970506245546364 52.09763545524179)",
"created_at": "2021-07-14T09:45:13.158+02:00",
"updated_at": "2021-07-14T09:45:13.158+02:00"
}
],
"name": "Shop 6",
"phone": "123456789",
"lat": 52.25650599999999,
"lng": 20.983941,
"address": "al. Jana Pawła II 82, 00-204 Warszawa, Polska",
"city": "Warszawa",
"uuid": "0cd02fe6-a6ed-4eaa-9cc2-4597f60d25c0",
"id": 20165371
},
{
"delivery_zones": [
{
"id": 35,
"polygon": "LINESTRING(20.970506245546364 52.09763545524179, 20.868882710390118 52.11956462642918, 20.764512593202614 52.168444690302564, 20.742539936952614 52.24250512112835, 20.79472499554636 52.30804643018896, 20.866136128358857 52.35504197422328, 20.9959338414089 52.38019762243741, 21.100303958596395 52.35336442165708, 21.182701419533892 52.30636709436617, 21.245872806252642 52.23409537914335, 21.248619388283892 52.17686686547802, 21.166221927346392 52.12293738788872, 21.017906497658892 52.10438404121464, 20.970506245546364 52.09763545524179)",
"created_at": "2021-07-14T09:45:13.158+02:00",
"updated_at": "2021-07-14T09:45:13.158+02:00"
}
],
"name": "Shop 4",
"phone": "123456789",
"lat": 52.1795193,
"lng": 21.0041999,
"address": "Wołoska 12, 02-675 Warszawa, Polska",
"city": "Warszawa",
"uuid": "a4f29224-10c8-4a4b-ac83-4b142b607d7e",
"id": 20165369
},
{
"delivery_zones": [
{
"id": 35,
"polygon": "LINESTRING(20.970506245546364 52.09763545524179, 20.868882710390118 52.11956462642918, 20.764512593202614 52.168444690302564, 20.742539936952614 52.24250512112835, 20.79472499554636 52.30804643018896, 20.866136128358857 52.35504197422328, 20.9959338414089 52.38019762243741, 21.100303958596395 52.35336442165708, 21.182701419533892 52.30636709436617, 21.245872806252642 52.23409537914335, 21.248619388283892 52.17686686547802, 21.166221927346392 52.12293738788872, 21.017906497658892 52.10438404121464, 20.970506245546364 52.09763545524179)",
"created_at": "2021-07-14T09:45:13.158+02:00",
"updated_at": "2021-07-14T09:45:13.158+02:00"
}
],
"name": "Shop 1",
"phone": "123456789",
"lat": 52.2125194,
"lng": 20.9556897,
"address": "al. Jerozolimskie 179, Warszawa, Polska",
"city": "Warszawa",
"uuid": "82995957-ce3c-4dc0-b8b9-788d88d6f878",
"id": 20165366
}
],
"meta": {
"api_enabled": true
}
}
Endpoint allows you to fetch nearest shops for specified postal code.
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/clients/for_postal_code
Request method
GET
Request body
Parameter | Required | Description |
---|---|---|
postal_code | YES | Postal code ie. 00-013 |
Fetch shops for specified address
Example
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/clients/for_address
Request method
GET
Request headers
Accept: application/json
Content-Type: application/json
Authorization: Bearer XYZ
Request body
{
"city": "Warszawa",
"street": "Wołoska",
"house_number": "1"
}
Response body
{
"data": [
{
"delivery_zones": [
{
"id": 35,
"polygon": "LINESTRING(20.970506245546364 52.09763545524179, 20.868882710390118 52.11956462642918, 20.764512593202614 52.168444690302564, 20.742539936952614 52.24250512112835, 20.79472499554636 52.30804643018896, 20.866136128358857 52.35504197422328, 20.9959338414089 52.38019762243741, 21.100303958596395 52.35336442165708, 21.182701419533892 52.30636709436617, 21.245872806252642 52.23409537914335, 21.248619388283892 52.17686686547802, 21.166221927346392 52.12293738788872, 21.017906497658892 52.10438404121464, 20.970506245546364 52.09763545524179)",
"created_at": "2021-07-14T09:45:13.158+02:00",
"updated_at": "2021-07-14T09:45:13.158+02:00"
}
],
"name": "Shop 4",
"phone": "123456789",
"lat": 52.1795193,
"lng": 21.0041999,
"address": "Wołoska 12, 02-675 Warszawa, Polska",
"city": "Warszawa",
"uuid": "a4f29224-10c8-4a4b-ac83-4b142b607d7e",
"id": 20165369
},
{
"delivery_zones": [
{
"id": 35,
"polygon": "LINESTRING(20.970506245546364 52.09763545524179, 20.868882710390118 52.11956462642918, 20.764512593202614 52.168444690302564, 20.742539936952614 52.24250512112835, 20.79472499554636 52.30804643018896, 20.866136128358857 52.35504197422328, 20.9959338414089 52.38019762243741, 21.100303958596395 52.35336442165708, 21.182701419533892 52.30636709436617, 21.245872806252642 52.23409537914335, 21.248619388283892 52.17686686547802, 21.166221927346392 52.12293738788872, 21.017906497658892 52.10438404121464, 20.970506245546364 52.09763545524179)",
"created_at": "2021-07-14T09:45:13.158+02:00",
"updated_at": "2021-07-14T09:45:13.158+02:00"
}
],
"name": "Shop 1",
"phone": "123456789",
"lat": 52.2125194,
"lng": 20.9556897,
"address": "al. Jerozolimskie 179, Warszawa, Polska",
"city": "Warszawa",
"uuid": "82995957-ce3c-4dc0-b8b9-788d88d6f878",
"id": 20165366
},
{
"delivery_zones": [
{
"id": 35,
"polygon": "LINESTRING(20.970506245546364 52.09763545524179, 20.868882710390118 52.11956462642918, 20.764512593202614 52.168444690302564, 20.742539936952614 52.24250512112835, 20.79472499554636 52.30804643018896, 20.866136128358857 52.35504197422328, 20.9959338414089 52.38019762243741, 21.100303958596395 52.35336442165708, 21.182701419533892 52.30636709436617, 21.245872806252642 52.23409537914335, 21.248619388283892 52.17686686547802, 21.166221927346392 52.12293738788872, 21.017906497658892 52.10438404121464, 20.970506245546364 52.09763545524179)",
"created_at": "2021-07-14T09:45:13.158+02:00",
"updated_at": "2021-07-14T09:45:13.158+02:00"
}
],
"name": "Shop 6",
"phone": "123456789",
"lat": 52.25650599999999,
"lng": 20.983941,
"address": "al. Jana Pawła II 82, 00-204 Warszawa, Polska",
"city": "Warszawa",
"uuid": "0cd02fe6-a6ed-4eaa-9cc2-4597f60d25c0",
"id": 20165371
}
],
"meta": {
"api_enabled": true
}
}
Endpoint allows you to fetch nearest shops for specified postal code.
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/clients/for_address
Request method
GET
Request body
Parameter | Required | Description |
---|---|---|
city | YES | City |
street | YES | Street |
house_number | YES | House number |
Teams (Cities)
Fetch available teams with delivery zones
Example
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/teams
Request method
GET
Request headers
Accept: application/json
Content-Type: application/json
Authorization: Bearer XYZ
Response body
{
"data": [
{
"connected_team_ids": [
20164614
],
"delivery_zones": [],
"postal_codes": [],
"load_value": 0,
"traffic_value": 60,
"dynamic_buffer_real_value": 10,
"id": 1053016,
"uuid": "794cf097-7418-4ec8-a5f3-1e352a0d64c9",
"name": "Bydgoszcz",
"is_test": false,
"api_enabled": true
},
{
"connected_team_ids": [
1053016
],
"delivery_zones": [
{
"id": 31,
"polygon": "LINESTRING(20.970506245546364 52.09763545524179, 20.868882710390118 52.11956462642918, 20.764512593202614 52.168444690302564, 20.742539936952614 52.24250512112835, 20.79472499554636 52.30804643018896, 20.866136128358857 52.35504197422328, 20.9959338414089 52.38019762243741, 21.100303958596395 52.35336442165708, 21.182701419533892 52.30636709436617, 21.245872806252642 52.23409537914335, 21.248619388283892 52.17686686547802, 21.166221927346392 52.12293738788872, 21.017906497658892 52.10438404121464, 20.970506245546364 52.09763545524179)",
"created_at": "2021-07-14T08:22:20.080+02:00",
"updated_at": "2021-07-14T08:22:20.080+02:00"
}
],
"postal_codes": ["30-611", "30-652"],
"load_value": 0,
"traffic_value": null,
"dynamic_buffer_real_value": 10,
"id": 20164614,
"uuid": "e69f7032-c355-4346-b5df-5130d0f98600",
"name": "Warszawa",
"is_test": false,
"api_enabled": true
}
],
"meta": {
"api_enabled": true
}
}
Endpoint allows you to fetch all teams with specified polygons and connected teams.
Addresses
Distance calculation
Example
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/addresses/calculate_distance
Request method
POST
Request headers
Accept: application/json
Content-Type: application/json
Authorization: Bearer XYZ
Request parameters
{
"origin": { "city": "Kraków", "street": "Malwowa", "house_number": "13", "postal_code": "30-611" },
"destination": { "city": "Kraków", "street": "Kapelanka", "house_number": "12", "postal_code": "30-347" }
}
Response body
{
"distance": "1.3", "unit": "km"
}
Endpoint allows you to calculate distance between points
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/addresses/calculate_distance
Request method
POST
Request body
Parameter | Required | Description |
---|---|---|
origin | YES | Object like in example |
destination | YES | Object like in example |
Autocomplete for city
Example
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/addresses/city_suggestions
Request method
GET
Request headers
Accept: application/json
Content-Type: application/json
Authorization: Bearer XYZ
Request parameters
{
"city": "Kra"
}
Response body
{
"data": [
{
"city": "Kraków"
},
{
"city": "Kraśnik"
},
{
"city": "Krasnystaw"
},
{
"city": "Krapkowice"
},
{
"city": "Krasne"
},
{
"city": "Sępólno Krajeńskie"
},
{
"city": "Kraczkowa"
},
{
"city": "Krasnobród"
},
{
"city": "Strzelce Krajeńskie"
},
{
"city": "Kruszyn Krajeński"
}
],
"meta": {}
}
Endpoint allows you to receive a list of proposed cities
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/addresses/city_suggestions
Request method
GET
Request body
Parameter | Required | Description |
---|---|---|
city | YES | The first letters of the city |
Autocomplete for street
Example
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/addresses/street_suggestions
Request method
GET
Request headers
Accept: application/json
Content-Type: application/json
Authorization: Bearer XYZ
Request parameters
{
"city": "Kraków",
"street": "Kra"
}
Response body
{
"data": [
{
"street": "Matematyków Krakowskich"
},
{
"street": "Armii Kraków"
},
{
"street": "Krakowska"
},
{
"street": "Armii Krajowej"
},
{
"street": "Krakowiaków"
},
{
"street": "Ignacego Krasickiego"
}
],
"meta": {}
}
Endpoint allows you to receive a list of proposed streets
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/addresses/street_suggestions
Request method
GET
Request body
Parameter | Required | Description |
---|---|---|
city | YES | City name |
street | YES | The first letters of the street |
Find postal code for address
Example
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/addresses/find_postal_code
Request method
GET
Request headers
Accept: application/json
Content-Type: application/json
Authorization: Bearer XYZ
Request parameters
{
"city": "Kraków",
"street": "Krakowska",
"house_number": 2
}
Response body
{
"data": {
"postal_code": "31-062"
},
"meta": {}
}
Endpoint allows you to receive a postal code for given address
Request url
https://preproduction-app.deligoo.pl/api/partners_app/v1/addresses/find_postal_code
Request method
GET
Request body
Parameter | Required | Description |
---|---|---|
city | YES | City name |
street | YES | Street name |
house_number | YES | House number |