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:
The merchant is in a business model that allows this request (if the merchant is full service, the order is already delivered by our logistics and it is not possible to request a partner delivery person)
The order is for delivery (it is not possible to request for Pick Up orders)
The delivery area is covered by partner delivery people
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
Definitions
Orders on the iFood platform and outside it
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.
Contracting the Service
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.
Requirements for Homologation
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.
The application must be able to
Make requests on /polling endpoint regularly every 30 seconds;
Send /acknowledgment signal for every event received after a polling request;
Receive, confirm and dispatch an Sob Demanda order for now (orderType = DELIVERY / orderTiming = IMMEDIATE / salesChannel = POS);
Receive and cancel an order delivery for now (orderType = DELIVERY / orderTiming = IMMEDIATE / salesChannel = POS). It is mandatory to provide a list with all the codes/reasons for cancellation provided in the documentation;
Update the status of an order canceled by the customer or iFood;
Update the status of an order that may have been confirmed/canceled by another application such as Order Manager;
Receive the same event more than once in the polling and discard it if this event was delivered more than once;
Accept or reject an address change.
Should be able to check the collection code and know if the code has been validated.
Non-functional requirements:
The token renewing can only be performed when it's about to expire or immediately after it expires.
The application must respect the rate limit policies of each endpoint.
Desirable:
The printed tab should follow the model suggested in the documentation.
Display on the screen and/or printed tab where the delivery person should leave the order (which comes in the delivery.observations field)
Integration Flow
To integrate an order from outside iFood and request a delivery partner, you need to follow the following steps:
Orders outside the iFood platform
Integration Flow
Delivery Availability
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:
merchantId - ID of the merchant that will request delivery
latitude - latitudinal coordinate of the delivery address
longitude - longitudinal coordinate of the delivery address
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"]}
Order Registration
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.
Delivery Confirmation Code
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.
I don't want my order to have a Delivery Confirmation Code
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.
How to enable the Delivery Confirmation Code
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.
Partners using the iFood tracking page
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.
Partners who do not use the iFood tracking page
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.
Order details
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
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.
Preparation Time
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
Without Preparation Time: If the delivery.preparationTime field is not sent, the delivery person will be allocated immediately after the order is confirmed, following the current model.
With Preparation Time: When the 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.
Metadata
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
Responses
Success
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:
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.
Errors
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"]}
Confirmation or change of delivery address
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.
Partners using iFood's tracking page
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 do not use iFood's tracking page
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.
Address Confirmation
To confirm the address, simply make the request POST /userConfirmAddress passing the following parameters:
orderId - ID of the order that will have the address confirmed
/shipping/v1.0/orders/:orderId/userConfirmAddress
Responses
Success
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.
Error
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
Request for address change
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
orderId* the ID of the order that will have the address confirmed
streetName* the street name to which the address will be changed.
streetNumber the street number to which the address will be changed.
complement the complement of the address to which it will be changed.
reference the reference of the address to which it will be changed.
neighborhood* the neighborhood to which the address will be changed.
city* the city to which the address will be changed.
state* the state to which the address will be changed.
country* the country to which the address will be changed.
coordinates* the coordinates to which the address will be changed.
coordinates.latitude* the latitude to which the address will be changed.
coordinates.longitude* the longitude to which the address will be changed.
This endpoint returns HTTP Status 202, with nothing in the response bodyThe polling will receive an event of DELIVERY_ADDRESS_CHANGE_REQUESTED when therequest is successful.
Error
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.
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.
Error
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.
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.
Error
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
Cancellation
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.
This endpoint returns the HTTP status code 200 OK if the order can be canceled, along with its possible cancellation codes and descriptions. If the order can no longer be canceled, the endpoint will return the HTTP status code 204 No Content. The response body contains:
cancelCodeId - cancellation reason code
description - cancellation reason description
[{"cancelCodeId": "817","description": "O cliente cancelou o pedido pelo restaurante"}]
Erros
This endpoint returns the HTTP status code 500 Internal Server Error if an error occurs when requesting the delivery cancellation codes.
Nome
Descrição
InternalServerError
Internal Server Error
{"code": "InternalServerError","message": "Internal server error."}
To perform the cancellation, you must make a request to the endpoint POST /cancel, passing the following parameters:
orderID - Order Id
reason - Text with the description of the reason
cancellationCode - Cancellation code
/shipping/v1.0/orders/<orderId>/cancel
Responses
Success
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.
Error
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"]}
Delivery Confidence Level
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.
We will have the following levels of confidence in delivery
Nome
Descrição
LOW
Low
MODERATE
Moderate
HIGH
High
VERY_HIGH
Very high
The calculation of the delivery confidence level will be based on the following rules
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.
Exemplos de como ficariam os níveis de confiança na entrega:
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.
Consulta do nível de confiança na entrega
To find out the level of confidence in the delivery of your order, just send the GET /safeDelivery request passing the following parameters.
orderId - ID of the order that will have the delivery security level consulted.
/shipping/v1.0/orders/:orderId/safeDelivery
Respostas
Sucesso
This endpoint returns the http status code 200 OK if the order is eligible for delivery security. The response body contains:
rules - contains a map of the type [string]boolean containing the rule and situation.
score - level of confidence in the delivery of the order generated based on the rules defined in the rules field.
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"]}
Orders on the iFood platform
Integration Flow
Delivery Availability
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:
orderId - ID of the order already existing on the iFood platform to request delivery
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"]}
Delivery Request
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.
orderId - ID of the order already existing on the iFood platform to request delivery
quoteId - ID of the quote previously requested to request delivery
/shipping/v1.0/orders/<orderId>/requestDriver
Responses
Success
This endpoint returns the http status code 202 Accepted if the request is successfully registered.
Errors
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"]}
Cancellation
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.
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.
Error
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"]}