Docs Shipping
Sending orders made on the iFood platform: This module allows merchants to send orders made on the iFood platform (Orders that already have an orderId). This is especially useful for merchants who have their own delivery people, but who may need the iFood delivery service in situations of overload or lack of delivery people. To use this service modality, it must be contracted through the Services menu of the Partner Portal. Otherwise, it will not be possible to register orders, check delivery availability, or request a delivery person.
Eligibility This delivery modality is not available for any order. The order will only be eligible when it meets some criteria such as:
Pick Up
orders)Envio de pedidos realizados através de outros canais de venda: O módulo também permite que os merchants enviem pedidos que foram realizados através de outros canais de venda, como telefone, WhatsApp, aplicativo ou site próprio (Pedidos que não possuem um orderId pré-existente). Para maiores informações sobre o Sob Demanda, acesse https://news.ifood.com.br/entrega-facil-o-delivery-do-ifood-fora-do-app/
Sending orders made through other sales channels: The module also allows merchants to send orders that were made through other sales channels, such as telephone, WhatsApp, own app or website (Orders that do not have a pre-existing orderId). For more information about iFood Delivery, visit Sob Demanda out of iFood App
Orders on the iFood platform are those that already have an orderId, containing the necessary information from the restaurant and the customer to carry out the quote and request.
On the other hand, orders outside the iFood platform do not have a pre-existing orderId, as they are not originated internally. In this case, additional information is necessary to carry out the quote and request.
To use the module, Sob Demanda must be contracted through the Services menu on the Partner Portal. Otherwise, it will not be possible to register orders, check delivery availability or request a delivery person.
These criteria are applicable only for integrators who wish to integrate exclusively with the Shipping module when contracting delivery services for orders outside the iFood platform. For integrators who also wish to use the Orders module, the Orders homologation criteria applies. For those that are already homologated, it will not be required to do a new homologation in order to use the Shipping module.
To integrate an order from outside iFood and request a delivery partner, you need to follow the following steps:
Before registering an order external to iFood, it is important to check the availability of delivery. It is possible that the address is not within the coverage area and even if the address is within the area, it is possible that there is some temporary unavailability in the region, such as a temporarily reduced delivery radius. Through this query it is also possible to obtain the estimated time window for the delivery of the order to inform the customer.
This step is not mandatory but querying this API before registering the order prevents errors from happening and allows the store to plan ahead the preparation of the order.
To check the logistics availability, just make the GET /deliveryAvailabilities request passing the following parameters:
/shipping/v1.0/merchants/123f78cf-2879-44f7-92b7-1e4668dda999/deliveryAvailabilities?latitude=-23.455575&longitude=-46.669957
This endpoint returns the http status code 200 OK if logistics are available. The response body contains:
{
"id": "57cd1046-2e06-446f-a2dd-18a518212c3c",
"expirationAt": "2023-08-18T19:49:06Z",
"createdAt": "2023-08-17T19:49:06Z",
"distance": 3000,
"preparationTime": 60,
"quote": {
"grossValue": 7.99,
"discount": 0,
"raise": 0,
"netValue": 7.99
},
"deliveryTime": {
"min": 1200,
"max": 1800
},
"hasPaymentMethods": true,
"paymentMethods": [
{
"id": "21c65a8c-f29e-463f-b0bd-240edeb593c4",
"brand": "CardBrand",
"liability": "IFOOD",
"paymentType": "OFFLINE",
"method": "CREDIT"
},
{
"liability": "IFOOD",
"paymentType": "OFFLINE",
"method": "CASH",
"id": "93c1c7c7-61f1-4dd9-bb84-62a03254701d"
}
]
}
This endpoint returns the http status code 400 Bad Request if logistics are not available to deliver the order to this location or from that merchant’s location.
Name | Description |
---|---|
BadRequest | Model validation |
BadRequestMerchant | Partner unavailable |
DeliveryDistanceTooHigh | The delivery address exceeds the logistics area served by iFood |
OffOpeningHours | The order is outside the operating hours of iFood logistics |
OriginNotFound | We do not yet deliver in your region, as your store is outside the iFood logistics area |
ServiceAreaMismatch | The delivery address is outside our coverage area |
HighDemand | iFood logistics is temporarily unavailable. Please try again later |
MerchantStatusAvailability | Restaurant with pendency, call the Support |
InvalidPaymentMethods | The payment method chosen by the customer is not accepted by the iFood machine |
NRELimitExceeded | Your store has many partner delivery drivers waiting. Release delivery drivers so you can request the Sob Demanda delivery. |
{
"code": "DeliveryDistanceTooHigh",
"message": "Sob Demanda not available: the delivery address is more than 10 km from your store",
"details": ["Delivery distance too high"]
}
This endpoint returns the http status code 500 Internal Server Error in case there is any failure to register this order.
Name | Description |
---|---|
InternalServerError | Internal server error |
{
"code": "InternalServerError",
"message": "Ops. There was a failure. Try again in a few moments.",
"details": ["Internal server error"]
}
To register an order and request a partner delivery person, simply make the POST /orders passing the order information in the body.
Attention! A partner delivery person will be automatically allocated after successfully registering an order through this endpoint. If delivery is not possible, the order is not registered and an error is returned.
To ensure the security of deliveries and avoid cases of lost orders, a delivery confirmation code will be generated. This code consists of the last 4 digits of the end consumer's phone number provided in the order. The iFood delivery person will request this sequence of numbers when making the delivery.
If you don't have access to the customer's phone number or don't want to provide it, you will need to send customer.phone.type="STORE"
so that the delivery confirmation code is not requested.
For the order to have the delivery confirmation code enabled, the customer's phone number must be provided and this phone number must be valid, as only then will the customer be able to provide the correct delivery confirmation code to the iFood delivery person.
Attention! The end consumer must be informed that the iFood delivery person will request the confirmation code, and that this code refers to the last 4 digits of their phone number. If the consumer is not aware of the code at the time of delivery, the order will be canceled, resulting in a poor experience for the customer and losses for the restaurant.
The confirmation code will be available on the iFood tracking page so that the end consumer can provide the correct code to the iFood delivery person.
To provide the confirmation code if you do not use the iFood tracking page, it will be necessary to consume the attribute metadata.CODE
from the DELIVERY_DROP_CODE_REQUESTED
event so that the code is passed on to the end consumer. This event will be propagated only in situations where the confirmation code is mandatory, therefore if the event is not sent, it means that delivery confirmation will not be necessary.
Attention! When the delivery confirmation code is validated, we will propagate the DELIVERY_DROP_CODE_VALIDATION_SUCCESS
event. If this event is not sent, the code will not have been validated.
Below are all the order fields to be registered on iFood.
Note: Fields marked with an asterisk (*) are mandatory.
Name | Type | Description |
---|---|---|
customer* | object | Customer data. |
customer.name* | string | Informs the customer's name. Format: Free text, limited to 50 characters. |
customer.phone* | object | Customer phone data. |
customer.phone.type | string | Customer phone type. Possible values are STORE or CUSTOMER. If not send it will be CUSTOMER. |
customer.phone.countryCode* | string | Specifies the country code. Format: A 2-digit number. Ex: 55. Not required if customer.phone.type STORE. |
customer.phone.areaCode* | string | Informs the area code of a location. Format: A 2-digit number. Ex: 41. Not required if customer.phone.type STORE. |
customer.phone.Number* | string | Informs the customer's phone number. Format: A 7 to 9 digit number Ex: 995663945. Not required if customer.phone.type STORE. |
delivery* | object | Customer delivery data. |
delivery.merchantFee* | float | Partner billing fee |
delivery.preparationTime | integer | Informs the order preparation time in seconds |
delivery.quoteId | string | ID of the previously requested quote to request the delivery |
delivery.deliveryAddress | object | Customer delivery address data. |
delivery.deliveryAddress.postalCode* | string | Informs the postal code of the customer's delivery address. Format: An 8-digit number. Ex: 82510290 |
delivery.deliveryAddress.streetNumber* | string | Informs the customer’s delivery address number. |
delivery.deliveryAddress.streetName* | string | Informs the customer's street name. Format: Free, limited to 50 characters. |
delivery.deliveryAddress.complement | string | Informs the customer's complement (block, apartment, etc.). Format: Free, limited to 50 characters. |
delivery.deliveryAddress.reference | string | Informs the customer's reference pointFormat: Free, limited to 70 characters. |
delivery.deliveryAddress.neighborhood* | string | Informs the neighborhood of the customer's address. Format: Free, limited to 50 characters. |
delivery.deliveryAddress.city* | string | Informs the city of the customer's address. Format: Free, with a minimum of 2 and a maximum of 50 characters. |
delivery.deliveryAddress.state* | string | Informs the state of the customer's address. Format: Two letters, representing the acronym of the corresponding state. Ex: AZ |
delivery.deliveryAddress.country* | string | Informs the country of the customer's address. Format: Two letters Ex: US |
delivery.deliveryAddress.coordinates* | object | Coordinates data |
delivery.deliveryAddress.coordinates.latitude* | float | Informs the latitude of the customer's address. |
delivery.deliveryAddress.coordinates.longitude* | float | Informs the longitude of the customer's address. |
items* | array of objects | Data for each order item. |
items.id* | uuid | Item ID |
items.name* | string | Informs the name of the item Format: Free, limited to 50 characters. |
items.externalCode | string | Item code in your app |
items.quantity* | integer | Informs the quantity of items. Value must be greater than zero. |
items.unitPrice* | float | Represents the unit price of each item. Value must be greater than or equal zero. |
items.options | array of objects | Add-on data |
items.options.id* | uuid | Informs the complement identifier |
items.options.name* | string | Informs the name of the add-on Format: Free, limited to 50 characters. |
items.options.externalCode | string | Item code in your app |
items.options.index* | integer | Informs the index in the trim array. |
items.options.quantity* | integer | Informs the quantity of that garnish. |
items.options.unitPrice* | float | Informs the unit price of the garnish. |
items.options.price* | float | Informs the total garnish price options.price = options.quantity * options.unitPrice. |
items.price* | float | Informs the total price of the product price = quantity * unitPrice. Value must be greater than or equal zero. |
items.optionsPrice* | float | Informs the total price of the garnishes. Value must be greater than or equal zero. |
items.totalPrice* | float | Informs the total price totalPrice = price + optionsPrice. Value must be greater than or equal zero. |
payments | object | Informs the payment methods |
payments.methods | array of objects | Payment methods. Required if it's an OFFLINE payment |
payments.methods.method* | string | CREDIT , DEBIT or CASH (only one option) |
payments.methods.type* | string | Payment type i.e OFFLINE |
payments.methods.value* | float | Amount paid through the informed method |
payments.methods.card | object | Credit/debit card. Required if it's an CREDIT/DEBIT method |
payments.methods.card.brand* | string | Credit/debit card brand |
payments.methods.cash | object | Cash Payment. Required if it's an CASH method |
payments.methods.cash.changeFor* | float | Value in cash that the driver will receive. |
displayId | string | Friendly ID to facilitate the identification of the order by the store and driver. Format: Up to 4 alphanumeric digits. Ex: A4BC |
metadata | object | Metadata for additional information, required, order identification.Ex: M3019, idPDV501248, POS identifier Format: Limit of 20 |
metadata.prop1* | Dictionary<string, string> | Additional information |
{
"customer": {
"name": "Customer Name",
"phone": {
"type": "CUSTOMER",
"countryCode": "55",
"areaCode": "11",
"number": "999999999"
}
},
"delivery": {
"merchantFee": 0,
"preparationTime": 900,
"quoteId": "3d2a7e2c-34ad-4b72-9ee5-79cec2b482a7",
"deliveryAddress": {
"postalCode": "69923000",
"streetNumber": "100",
"streetName": "Ramal Bujari",
"complement": "",
"neighborhood": "Centro",
"city": "Bujari",
"state": "AC",
"country": "BR",
"reference": "Perto da padaria",
"coordinates": {
"latitude": -9.822159,
"longitude": -67.948475
}
}
},
"items": [
{
"id": "7b956744-38f6-418a-90fa-22676b53e6d1",
"name": "Produto Teste",
"externalCode": "123456",
"quantity": 1,
"unitPrice": 1,
"price": 1,
"optionsPrice": 0,
"totalPrice": 1,
"options": []
}
],
"payments": {
"methods": [
{
"method": "CREDIT",
"type": "OFFLINE",
"value": 1,
"card": {
"brand": "CardBrand"
}
}
]
},
"displayId" : "AB3D",
"metadata": {
"additionalProp1": "string"
}
}
Offline Payments the delivery person will receive the order amount upon delivery via iFood card machine or in cash depending on the sent method, it is necessary to send the payment object.
It is necessary that the quote has this payment method in the list of paymentMethods
, otherwise an error will be returned.
Online payments We do not process online payments, this payment is collected by the Merchant, so it is not necessary to send the payment object.
To improve efficiency and customer satisfaction, the delivery.preparationTime
field can be used to indicate the time required to prepare the order before the delivery person is allocated. This field is optional and, if not sent, the current immediate allocation model will be maintained.
How to use Preparation Time
delivery.preparationTime
field is not sent, the delivery person will be allocated immediately after the order is confirmed, following the current model.delivery.preparationTime
field is sent, the delivery person will be allocated only after the specified preparation time. In this case, the delivery.preparationTime
field should be sent with the value corresponding to the necessary time in seconds. For example, if the preparation time is 15 minutes, send delivery.preparationTime=900
. This allows the restaurant to have the necessary time to prepare the order before the delivery person is allocated.Attention! It is important that the informed preparation time is as accurate as possible to avoid delivery delays and ensure a good customer experience. Providing an incorrect preparation time can result in a poor customer experience and losses for the restaurant, such as closure due to an accumulation of delivery persons.
The metadata field allows you to add supplementary information to the order. This information is not passed on to the driver's app or the order manager.
/shipping/v1.0/merchants/<merchantId>/orders
This endpoint returns the http status code 202 Accepted if the order is successfully registered and the delivery partner is allocated without any problems. The response body contains:
{
"id": "522e4d7e-0ce1-44f3-8cc7-73a9f190a5e8",
"trackingUrl": "https://meupedido.ifood.com.br/522e4d7e-0ce1-44f3-8cc7-73a9f190a5e8"
}
Are orders that are external to iFood made available in the polling?
Yes. The order that was registered to be delivered by one of the iFood delivery partners is processed by our infrastructure and made available in the Order API polling. The salesChannel="POS"
field identifies orders that were imported and came from another acquisition channel.
Is it possible to track an order delivered by Sob Demanda?
Yes. After the order is successfully registered, the order ID is returned, which can be consulted in the tracking endpoint of the Order API.
This endpoint returns the http status code 400 Bad Request in case the logistics are not available to deliver the order or there is a failure to register this order.
Name | Description |
---|---|
BadRequest | Model validation |
BadRequestCustomer | Customer unavailable |
BadRequestMerchant | Partner unavailable |
DeliveryDistanceTooHigh | The delivery address exceeds the logistics area served by iFood |
HighDemand | iFood logistics is temporarily unavailable. Please try again later |
MerchantEasyDeliveryDisabled | The service is not enabled |
OffOpeningHours | The order is outside the operating hours of iFood logistics |
OriginNotFound | We do not yet deliver in your region, as your store is outside the iFood logistics area |
PaymentMethodNotFound | The payment method chosen by the customer is not accepted by the iFood machine |
PaymentTotalInvalid | The amount paid through the informed method does not match the total purchase value (the values of “value” and “totalPrice” do not match) |
ServiceAreaMismatch | The delivery address is outside our coverage area |
NRELimitExceeded | Your store has many partner delivery drivers waiting. Release delivery drivers so you can request the Sob Demanda delivery. |
{
"code": "DeliveryDistanceTooHigh",
"message": "Sob Demanda not available: the delivery address is more than 10 km from your store",
"details": ["Delivery distance too high"]
}
This endpoint returns the http status code 500 Internal Server Error if there is any failure to register this request.
Name | Description |
---|---|
InternalServerError | Internal Server Error |
{
"code": "InternalServerError",
"message": "Ops. There was a failure. Try again in a few moments.",
"details": ["Internal server error"]
}
Through this flow, the customer can confirm their address or request a change to it. In cases where there is a change in the delivery address, a validation process will occur by the partner, where the approval or refusal of the request will be decided.
Customers who track their orders through the tracking page provided by iFood have the option to confirm the delivery address or request a change. For this to be possible, it is necessary that the order has not been created with the attribute customer.phone.type="STORE".
Attention! Make sure to send the correct customer phone number, used as WhatsApp, so that the change confirmation code (OTP) is sent. This procedure is essential to ensure the security of the partner, the customer, and the delivery.
Partners who choose to create their own experience of confirmation or request for change of delivery address must implement the endpoints responsible for this flow.
Attention! In this flow, iFood does not perform any change confirmation process with the sending of an OTP code. The responsibility to validate and ensure this process is up to the partner.
To confirm the address, simply make the request POST /userConfirmAddress passing the following parameters:
/shipping/v1.0/orders/:orderId/userConfirmAddress
This endpoint returns HTTP Status 202, with nothing in the response body The polling will receive an event of DELIVERY_ADDRESS_CHANGE_USER_CONFIRMED when the request is successful.
This endpoint returns the http status code 400 Bad Request if the expected parameters are not provided.
Name | Description |
---|---|
BadRequest | Model validation |
{
"code": "BadRequest",
"message": "There was a problem reading the information. Check the information sent.",
"details": [
"Field 'OrderID' must be in uuid format."
]
}
This endpoint returns the http status code 404 Not Found if the order is not found, is completed or canceled, or was created more than 8 hours ago.
Name | Description |
---|---|
OrderNotFound | Order not found |
{
"code": "OrderNotFound",
"message": "Order not found.",
"details": []
}
This endpoint returns the http status code 409 Operation Conflict if there is a conflict in the operation, such as trying to confirm the address of an order with pending/confirmed/denied change.
Name | Description |
---|---|
ChangeAddressOperationConflict | Conflict in address change operations. |
{
"code": "ChangeAddressOperationConflict",
"message": "There is a conflict in the confirmation/request for address change of this order, it may already have the address confirmed by thecustomer, or a pending/completed change request",
"details": []
}
This endpoint returns the http status code 500 Internal Server Error if there is any failure to register this order.
Name | Description |
---|---|
InternalServerError | Internal server error |
When a change of delivery address is requested, an event DELIVERY_ADDRESS_CHANGE_REQUESTED will be generated and sent via polling. This event indicates that the address change has been requested, and the new requested address will be available in the metadata.address attribute.
Important! After submitting the request for a change of delivery address, the partner will have up to 15 minutes to accept or deny the request. If no action is taken within this period, the request will be automatically denied.
To request an address change, simply make the request POST /deliveryAddressChangeRequest passing the following parameters:
The parameters marked with * are mandatory
/shipping/v1.0/orders/:orderId/deliveryAddressChangeRequest
This endpoint returns HTTP Status 202, with nothing in the response body
The polling will receive an event of DELIVERY_ADDRESS_CHANGE_REQUESTED when therequest is successful.
This endpoint returns the http status code 400 Bad Request if the expected parameters are not provided.
Name | Description |
---|---|
BadRequest | Model validation |
MaxDistanceHigherThanAllowed | If the address change exceeds 500m. |
{
"code": "BadRequest",
"message": "There was a problem reading the information. Check the information sent.",
"details": [
"Field 'StreetName' is mandatory.",
"Field 'Neighborhood' is mandatory.",
"Field 'City' is mandatory.",
"Field 'State' is mandatory.",
"Field 'Country' is mandatory.",
"Field 'Latitude' is mandatory.",
"Field 'Longitude' is mandatory."
]
}
This endpoint returns the http status code 404 Not Found if the order is not found, is completed or canceled, or was created more than 8 hours ago.
Name | Description |
---|---|
OrderNotFound | Order not found |
{
"code": "OrderNotFound",
"message": "Order not found.",
"details": []
}
This endpoint returns the http status code 409 Operation Conflict if there is a conflict in the operation, such as trying to confirm the address of an order with pending/confirmed/denied change.
Name | Description |
---|---|
ChangeAddressOperationConflict | Conflict in address change operations. |
{
"code": "ChangeAddressOperationConflict",
"message": "There is a conflict in the confirmation/request for address change of this order, it may already have the address confirmed by the customer, or a pending/completed change request",
"details": []
}
This endpoint returns the http status code 500 Internal Server Error if there is any failure to register this order.
Name | Description |
---|---|
InternalServerError | Internal server error |
To approve the address change, simply make the request POST /acceptDeliveryAddressChange passing the following parameters:
/shipping/v1.0/orders/:orderId/acceptDeliveryAddressChange
This endpoint returns HTTP Status 202, with nothing in the response body The polling will receive an event of DELIVERY_ADDRESS_CHANGE_ACCEPTED when the request is successful.
This endpoint returns the http status code 400 Bad Request if the expected parameters are not provided.
When the error name is RegionMismatch an DELIVERY_ADDRESS_CHANGE_DENIED event will be sent with the action="region-mismatch"
Name | Description |
---|---|
BadRequest | Model validation |
RegionMismatch | The new address is not in the same region as the original |
{
"code": "BadRequest",
"message": "There was a problem reading the information. Check the information sent.",
"details": [
"Field 'OrderID' must be in uuid format."
]
}
This endpoint returns the http status code 404 Not Found if the order is not found, is completed or canceled, or was created more than 8 hours ago.
Name | Description |
---|---|
OrderNotFound | Order not found |
{
"code": "OrderNotFound",
"message": "Order not found.",
"details": []
}
This endpoint returns the http status code 409 Operation Conflict if there is a conflict in the operation, such as trying to confirm the address of an order with pending/confirmed/denied change.
Name | Description |
---|---|
ChangeAddressOperationConflict | Conflict in address change operations. |
ChangeAddressOperationNotStarted | There is no pending address change. |
{
"code": "ChangeAddressOperationConflict",
"message": "There is a conflict in the confirmation/request for address change of this order, it may already have the address confirmed by the customer, or a pending/completed change request",
"details": []
}
This endpoint returns the http status code 500 Internal Server Error if there is any failure to register this order.
Name | Description |
---|---|
InternalServerError | Internal server error |
To deny the address change, simply make the request POST /denyDeliveryAddressChange passing the following parameters:
/shipping/v1.0/orders/:orderId/denyDeliveryAddressChange
This endpoint returns HTTP Status 202, with nothing in the response body The polling will receive an event of DELIVERY_ADDRESS_CHANGE_DENIED when the request is successful.
This endpoint returns the http status code 400 Bad Request if the expected parameters are not provided.
Name | Description |
---|---|
BadRequest | Model validation |
{
"code": "BadRequest",
"message": "There was a problem reading the information. Check the information sent.",
"details": [
"Field 'OrderID' must be in uuid format."
]
}
This endpoint returns the HTTP status code 404 Not Found if the order is not found, is completed or cancelled, or was created more than 8 hours ago.
Name | Description |
---|---|
OrderNotFound | Order not found |
{
"code": "OrderNotFound",
"message": "Order not found.",
"details": []
}
This endpoint returns the HTTP status code 409 Operation Conflict if there is a conflict in the operation, such as trying to confirm the address of an order with a pending/confirmed/rejected change.
Name | Description |
---|---|
ChangeAddressOperationConflict | Conflict in address change operations. |
ChangeAddressOperationNotStarted | There is no pending address change. |
{
"code": "ChangeAddressOperationConflict",
"message": "There is a conflict in the confirmation/request for address change of this order, it may already have the address confirmed by the customer, or a pending/completed change request",
"details": []
}
This endpoint returns the HTTP status code 500 Internal Server Error if there is a failure to register this order.
Name | Description |
---|---|
InternalServerError | Internal server error |
To cancel a delivery request for orders that are not from the iFood platform, it is crucial to understand some conditions. Firstly, only orders with the salesChannel
attribute set as POS
can be cancelled. Any order that does not fit this context cannot be cancelled through the Shipping module.
To get the list of valid cancellation codes for an order, you can use the endpoint GET /cancellationReasons.
To perform the cancellation, you must make a request to the endpoint POST /cancel, passing the following parameters:
/shipping/v1.0/orders/<orderId>/cancel
This endpoint returns HTTP Status 202, with nothing in the response body
The polling will receive a CANCELLATION_REQUESTED event when the request is successful and subsequently the CANCELLED
or CANCELLATION_REQUEST_FAILED
events in case of success or failure.
This endpoint returns the http status code 400 Bad Request if the expected parameters are not provided.
Name | Description |
---|---|
BadRequest | Model validation |
{
"code": "BadRequest",
"message": "There was a problem reading information. Check the information sent.",
"details": [
"Field 'OrderID' must be in uuid format."
]
}
This endpoint returns the http status code 500 Internal Server Error if there is a failure when requesting the delivery cancellation.
Name | Description |
---|---|
InternalServerError | Internal server error |
{
"code": "InternalServerError",
"message": "Oops. There was a failure. Try again in a few moments.",
"details": ["Internal server error"]
}
To enhance the security of your delivery, we have developed a set of rules that allow us to qualify the level of confidence in the delivery. This qualification is based on the parameters informed during the creation of the order and on the change or confirmation of the address made by the customer after the creation of the order.
Nome | Descrição |
---|---|
LOW | Low |
MODERATE | Moderate |
HIGH | High |
VERY_HIGH | Very high |
Name | Description |
---|---|
customer_phone_valid | (The informed phone is different from customer.phone.type="STORE") and (they are not only repeated numbers or numbers in sequence (ex: 123456789)) and (the phone has more than 11 digits). |
customer_phone_is_fixed | The phone is a landline with 8 digits. |
customer_address_confirmed | The delivery address was confirmed by the end customer. |
customer_address_change_requested | The customer requested a change of the delivery address. |
customer_address_change_approved | The partner approved the change of the delivery address. |
customer_address_change_denied | The partner rejected the change of the delivery address. |
Order with customer_phone_is_valid:false
will have a LOW
score.
Order with customer_phone_is_fixed:true
will have a MODERATE
score.
Order with customer_phone_is_fixed:true
and customer_address_confirmed:true
will have a VERY_HIGH
score.
Order with customer_phone_is_valid:true
will have a HIGH
score.
Order with customer_phone_is_valid:true
and customer_address_change_requested:true
and merchant_address_change_approved:true
will have a VERY_HIGH
score.
Order with customer_phone_is_valid:true
and customer_address_change_requested:true
and merchant_address_change_denied:true
will have a LOW
score.
The delivery confidence level can be changed after the order is created. Actions taken after the order is created, such as confirming the address or requesting a change of address, have a direct impact on the delivery confidence level.
To find out the level of confidence in the delivery of your order, just send the GET /safeDelivery request passing the following parameters.
/shipping/v1.0/orders/:orderId/safeDelivery
This endpoint returns the http status code 200 OK if the order is eligible for delivery security. The response body contains:
{
"rules": {
"customer_address_change_requested": false,
"customer_address_confirmed": false,
"customer_phone_is_fixed": false,
"customer_phone_valid": true,
"merchant_address_change_approved": false,
"merchant_address_change_denied": false
},
"score": "HIGH"
}
This endpoint returns the http status code 400 Bad Request if the expected parameters are not provided.
Name | Description |
---|---|
BadRequest | Model validation |
OrderWithoutSafeDelivery | Order does not have delivery confidence rules |
BadRequest
{
"code": "BadRequest",
"message": "There was a problem reading information. Check the information sent.",
"details": [
"Field 'OrderID' must be in uuid format."
]
}
OrderWithoutSafeDelivery
{
"code": "OrderWithoutSafeDelivery",
"message": "Order without delivery confidence rules.",
"details": []
}
This endpoint returns the http status code 404 Not Found if the order is not found.
Nome | Descrição |
---|---|
OrderNotFound | Order not found |
{
"code": "OrderNotFound",
"message": "Order not found.",
"details": []
}
Este endpoint retorna o http status code 500 Internal Server Error caso ocorra alguma falha ao consultar esse pedido.
Nome | Descrição |
---|---|
InternalServerError | Erro interno do servidor |
{
"code": "InternalServerError",
"message": "Oops. There was a failure. Please try again in a few moments.",
"details": ["Internal server error"]
}
Before registering a delivery request, it is important to consult the quote/delivery availability. It is possible that the address is not within the coverage area and even if the address is within the area, there may be some temporary unavailability in the region, such as temporarily reduced delivery radius. Through this consultation, it is also possible to obtain the estimated time window for the order delivery to inform the customer.
This step is not mandatory, but performing the consultation before registering the order prevents errors from occurring and allows the store to plan the preparation of the order.
To consult the logistics quote for a pre-existing order within the iFood platform, just make the request GET /deliveryAvailabilities passing the following parameters:
/shipping/v1.0/orders/<orderId>/deliveryAvailabilities
This endpoint returns the http status code 200 OK if logistics are available. The response body contains:
{
"id": "57cd1046-2e06-446f-a2dd-18a518212c3c",
"expirationAt": "2023-08-18T19:49:06Z",
"createdAt": "2023-08-17T19:49:06Z",
"distance": 3000,
"preparationTime": 60,
"quote": {
"grossValue": 7.99,
"discount": 0,
"raise": 0,
"netValue": 7.99
},
"deliveryTime": {
"min": 1200,
"max": 1800
},
"hasPaymentMethods": true,
"paymentMethods": [
{
"id": "21c65a8c-f29e-463f-b0bd-240edeb593c4",
"brand": "CardBrand",
"liability": "IFOOD",
"paymentType": "OFFLINE",
"method": "CREDIT"
}
]
}
This endpoint returns the http status code 400 Bad Request if logistics are not available to deliver the order at this location or for this merchant.
Name | Description |
---|---|
BadRequest | Model validation |
BadRequestMerchant | Partner unavailable |
DeliveryDistanceTooHigh | The delivery address exceeds the logistics area served by iFood |
OffOpeningHours | The order is outside the operating hours of iFood logistics |
OriginNotFound | We do not yet deliver in your region, as your store is outside the iFood logistics area |
ServiceAreaMismatch | The delivery address is outside our coverage area |
HighDemand | iFood logistics is temporarily unavailable. Please try again later |
MerchantStatusAvailability | Restaurant with pendency, call the Support |
InvalidPaymentMethods | The payment method chosen by the customer is not accepted by the iFood machine |
SaturatedOfflinePayment | At the moment, the pay on delivery option is unavailable |
NRELimitExceeded | Your store has many partner delivery drivers waiting. Release delivery drivers so you can request the Sob Demanda delivery. |
{
"code": "DeliveryDistanceTooHigh",
"message": "iFood Delivery unavailable: the delivery address is more than 10 Km from your store.",
"details": ["Delivery distance too high"]
}
This endpoint returns the http status code 500 Internal Server Error if there is a failure when registering this order.
Nome | Descrição |
---|---|
InternalServerError | Internal server error |
{
"code": "InternalServerError",
"message": "Oops. There was a failure. Try again in a few moments.",
"details": ["Internal server error"]
}
To request the delivery person agreeing with the returned quote, use the following endpoint POST /requestDriver passing in the body the order information.
This endpoint is asynchronous. When your request is processed you will receive a REQUEST_DRIVER
event confirming that the request has been made and then the result of the request, which can be: REQUEST_DRIVER_SUCCES
or REQUEST_DRIVER_FAILED
.
Attention! A partner delivery person will be automatically allocated after the request through this endpoint. If it is not possible to make the delivery, the delivery request is not registered and an error is returned.
/shipping/v1.0/orders/<orderId>/requestDriver
This endpoint returns the http status code 202 Accepted if the request is successfully registered.
This endpoint returns the http status code 400 Bad Request if logistics are not available to deliver the order or there is a failure when registering this order.
Name | Description |
---|---|
BadRequest | Model validation |
BadRequestCustomer | Customer unavailable |
BadRequestMerchant | Partner unavailable |
DeliveryDistanceTooHigh | The delivery address exceeds the logistics area served by iFood |
HighDemand | iFood logistics is temporarily unavailable. Please try again later |
MerchantEasyDeliveryDisabled | The service is not enabled |
OffOpeningHours | The order is outside the operating hours of iFood logistics |
OriginNotFound | We do not yet deliver in your region, as your store is outside the iFood logistics area |
ServiceAreaMismatch | The delivery address is outside our coverage area |
MerchantStatusAvailability | Restaurant with pendency, call the Support |
InvalidPaymentMethods | The payment method chosen by the customer is not accepted by the iFood machine |
SaturatedOfflinePayment | At the moment, the pay on delivery option is unavailable |
NRELimitExceeded | Your store has many partner delivery drivers waiting. Release delivery drivers so you can request the Sob Demanda delivery. |
{
"code": "DeliveryDistanceTooHigh",
"message": "iFood Delivery unavailable: the delivery address is more than 10 Km from your store.",
"details": ["Delivery distance too high"]
}
This endpoint returns the http status code 500 Internal Server Error if there is a failure when registering this order.
Nome | Descrição |
---|---|
InternalServerError | Internal server error |
{
"code": "InternalServerError",
"message": "Oops. There was a failure. Try again in a few moments.",
"details": ["Internal server error"]
}
To cancel the request for an iFood delivery person without the need to cancel the order, the delivery cancellation must be performed through the endpoint POST /orders/{id}/cancelRequestDriver.
The cancellation will only be carried out if it is requested before the delivery person's acceptance, in this case no fee will be charged from the store. If it is necessary to cancel after the delivery person's acceptance, the rules established in Order Cancellation must be followed.
The endpoint is asynchronous. When your request is processed, the store will receive a DELIVERY_CANCELLATION_REQUEST_ACCEPTED event, in case of success, or DELIVERY_CANCELLATION_REQUEST_REJECTED, in case of failure. See all the details of these events in this section.
Important The action is irreversible. After canceling the request for a delivery person, it will not be possible to reverse this service. For a new delivery person to be requested, a new delivery person request must be made.
/shipping/v1.0/orders/<orderId>/cancelRequestDriver
This endpoint returns HTTP Status 202, with nothing in the response body The polling will receive a DELIVERY_CANCELLATION_REQUESTED event when the request is successfully sent.
This endpoint returns the http status code 400 Bad Request if the expected parameters are not provided.
Name | Description |
---|---|
BadRequest | Model validation |
{
"code": "BadRequest",
"message": "There was a problem reading information. Check the information sent.",
"details": [
"Field 'OrderID' must be in uuid format."
]
}
This endpoint returns the http status code 500 Internal Server Error if there is a failure when requesting the delivery cancellation.
Name | Description |
---|---|
InternalServerError | Internal server error |
{
"code": "InternalServerError",
"message": "Oops. There was a failure. Try again in a few moments.",
"details": ["Internal server error"]
}