Search in documentation
ctrl+4K
Modules
Authentication
Merchant
Catalog
Order
Events
Logistics
Shipping
Review
Financial
Solutions

Orders outside iFood platform

This section explains how to integrate orders placed outside the iFood platform (without pre-existing orderId) to the On Demand delivery service.
ClientAPIEvent Polling1. Check availabilityGET /merchants/{merchantId}/deliveryAvailabilitiesQuote and delivery windows2. Register orderPOST /merchants/{merchantId}/ordersConfirmation code eventOrder ID + tracking URL3. Cancel order (optional)POST /orders/{orderId}/cancelCANCELLATION_REQUESTED202 AcceptedClientAPIEvent Polling
Before registering the order, check delivery availability to validate coverage and get estimates.
  • Validate coverage area
  • Identify temporary unavailability
  • Get time and cost estimates
  • Avoid registration errors
Although optional, this check prevents errors and allows better operational planning.
GET /shipping/v1.0/merchants/{merchantId}/deliveryAvailabilities?latitude={lat}&longitude={lng}
Required parameters:
  • merchantId (path) - Merchant ID
  • latitude (query) - Delivery address latitude
  • longitude (query) - Delivery address longitude

Response fields

FieldTypeDescription
iduuidQuote ID
expirationAtdatetimeQuote validity (UTC)
createdAtdatetimeCreation date (UTC)
distanceintegerDistance in meters
preparationTimeintegerPreparation time in seconds
quote.grossValuedecimalGross value
quote.discountdecimalDiscount
quote.raisedecimalSurcharge
quote.netValuedecimalNet value
deliveryTime.minintegerMinimum delivery time (seconds)
deliveryTime.maxintegerMaximum delivery time (seconds)
hasPaymentMethodsbooleanIndicates available payment methods
paymentMethods[].methodstringCREDIT, DEBIT or CASH

Example

{
  "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": "Visa",
      "liability": "IFOOD",
      "paymentType": "OFFLINE",
      "method": "CREDIT"
    },
    {
      "id": "93c1c7c7-61f1-4dd9-bb84-62a03254701d",
      "liability": "IFOOD",
      "paymentType": "OFFLINE",
      "method": "CASH"
    }
  ]
}

Error codes

CodeDescription
BadRequestRequest problem. Check data
BadRequestMerchantMerchant unavailable
DeliveryDistanceTooHighAddress outside coverage area
OffOpeningHoursOutside operating hours
OriginNotFoundStore outside logistics area
ServiceAreaMismatchAddress outside coverage area
HighDemandLogistics temporarily unavailable
MerchantStatusAvailabilityMerchant with pending issue
InvalidPaymentMethodsPayment method not accepted
NRELimitExceededDriver limit reached
UnavailableFleetFleet unavailable
Register the order to automatically request a partner driver.
  • A driver will be allocated automatically after registration
  • If delivery is not possible, the order will not be registered
  • Make sure to validate data before sending
For security, a confirmation code (last 4 digits of phone) is automatically generated.

How it works

With code (default):
  • Send customer.phone.type="CUSTOMER" with valid phone
  • Driver will request the code on delivery
  • Customer must be informed beforehand
Without code:
  • Send customer.phone.type="STORE"
  • Code will not be requested
Inform the customer that the driver will request the last 4 digits of their phone. Validation failure may result in cancellation.

For partners without iFood tracking page

Consume the DELIVERY_DROP_CODE_REQUESTED event with metadata.CODE to make the code available to the customer.
POST /shipping/v1.0/merchants/{merchantId}/orders
Required fields marked with *

Customer

FieldTypeDescription
customer.name*stringName (max. 50 characters)
customer.phone.typestringCUSTOMER (default) or STORE
customer.phone.countryCode*stringCountry code (2 digits). Ex: 55
customer.phone.areaCode*stringArea code (2 digits). Ex: 11
customer.phone.number*stringPhone (7-9 digits)
* Not required if customer.phone.type="STORE"

Delivery

FieldTypeDescription
delivery.merchantFee*floatPartner fee
delivery.preparationTimeintegerPreparation time (seconds)
delivery.quoteIduuidQuote ID
delivery.deliveryAddress.postalCode*stringZIP code (8 digits)
delivery.deliveryAddress.streetNumber*stringNumber
delivery.deliveryAddress.streetName*stringStreet (max. 50 characters)
delivery.deliveryAddress.complementstringComplement (max. 50 characters)
delivery.deliveryAddress.referencestringReference (max. 70 characters)
delivery.deliveryAddress.neighborhood*stringNeighborhood (max. 50 characters)
delivery.deliveryAddress.city*stringCity (2-50 characters)
delivery.deliveryAddress.state*stringState (2 letters). Ex: SP
delivery.deliveryAddress.country*stringCountry (2 letters). Ex: BR
delivery.deliveryAddress.coordinates.latitude*floatLatitude
delivery.deliveryAddress.coordinates.longitude*floatLongitude

Items

FieldTypeDescription
items[].id*uuidItem ID
items[].name*stringName (max. 50 characters)
items[].externalCodestringExternal code
items[].quantity*integerQuantity (> 0)
items[].unitPrice*floatUnit price (≥ 0)
items[].price*floatTotal price (quantity * unitPrice)
items[].optionsPrice*floatOptions price (≥ 0)
items[].totalPrice*floatTotal (price + optionsPrice)

Payments

Offline Payment:
FieldTypeDescription
payments.methods[].method*stringCREDIT, DEBIT or CASH
payments.methods[].type*stringOFFLINE
payments.methods[].value*floatValue
payments.methods[].card.brand*stringBrand (if CREDIT/DEBIT)
payments.methods[].cash.changeFor*floatChange (if CASH)
Online Payment: Do not send payments object (processed by merchant)

Other fields

FieldTypeDescription
displayIdstringFriendly ID (max. 4 characters). Ex: A4BC
metadataobjectAdditional information (max. 20 characters)
Use delivery.preparationTime to delay driver allocation.
  • Not sent: Immediate allocation
  • Sent: Allocation after specified time (in seconds)
Provide the most accurate time possible. Incorrect times may result in:
  • Delivery delays
  • Poor customer experience
  • Possible closure due to driver accumulation
{
  "id": "522e4d7e-0ce1-44f3-8cc7-73a9f190a5e8",
  "trackingUrl": "https://meupedido.ifood.com.br/522e4d7e-0ce1-44f3-8cc7-73a9f190a5e8"
}
Polling integration
CodeDescription
BadRequestRequest problem
BadRequestCustomerCustomer unavailable
BadRequestMerchantMerchant unavailable
DeliveryDistanceTooHighOutside coverage area
HighDemandLogistics temporarily unavailable
MerchantEasyDeliveryDisabledService not enabled
OffOpeningHoursOutside operating hours
OriginNotFoundStore outside logistics area
PaymentMethodNotFoundPayment method not found
PaymentTotalInvalidPayment value does not match total
ServiceAreaMismatchAddress outside coverage
NRELimitExceededDriver limit reached
Allows customer to confirm or request address change after order creation.

With iFood tracking page

Customer uses iFood page to confirm/change address.Requirements:
  • Order CANNOT have customer.phone.type="STORE"
  • Valid phone is required for OTP
ImportantSend the correct phone used as WhatsApp to receive the OTP confirmation code.

Without iFood tracking page

Merchant implements own experience using endpoints.Note: iFood will not send OTP. Validation is merchant's responsibility.
POST /shipping/v1.0/orders/{orderId}/userConfirmAddress
Response: 202 Accepted
Event: DELIVERY_ADDRESS_CHANGE_USER_CONFIRMED
POST /shipping/v1.0/orders/{orderId}/deliveryAddressChangeRequest
Required parameters:
  • streetName, neighborhood, city, state, country
  • coordinates (latitude, longitude)
Response deadlineMerchant has 15 minutes to accept/reject. After that, automatic rejection.
Limit: Maximum change of 500m from original coordinateEvent: DELIVERY_ADDRESS_CHANGE_REQUESTED
POST /shipping/v1.0/orders/{orderId}/acceptDeliveryAddressChange
Event: DELIVERY_ADDRESS_CHANGE_ACCEPTEDRegionMismatch Error: Generates automatic DELIVERY_ADDRESS_CHANGE_DENIED event with metadata.action="region-mismatch"
POST /shipping/v1.0/orders/{orderId}/denyDeliveryAddressChange
Event: DELIVERY_ADDRESS_CHANGE_DENIED
CodeStatusDescription
BadRequest400Invalid parameters
OrderNotFound404Order not found or expired (>8h)
ChangeAddressOperationConflict409Conflict with existing operation
ChangeAddressOperationNotStarted409No pending change
MaxDistanceHigherThanAllowed400Change > 500m
RegionMismatch400New address in different region
Cancel orders with salesChannel="POS".
GET /shipping/v1.0/orders/{orderId}/cancellationReasons
Response 200 OK:
[{
  "cancelCodeId": "817",
  "description": "Customer cancelled order through restaurant"
}]
Response 204: Order can no longer be cancelled
POST /shipping/v1.0/orders/{orderId}/cancel
Body:
{
  "reason": "Customer requested cancellation",
  "cancellationCode": "817"
}
Response: 202 AcceptedEvents:
  1. CANCELLATION_REQUESTED
  2. CANCELLED (success) or CANCELLATION_REQUEST_FAILED (failure)
Scoring system based on validation rules.
LevelDescription
LOWLow trust
MODERATEModerate trust
HIGHHigh trust
VERY_HIGHVery high trust
RuleDescription
customer_phone_validValid phone (not STORE, >11 digits)
customer_phone_is_fixedLandline phone (8 digits)
customer_address_confirmedAddress confirmed by customer
customer_address_change_requestedCustomer requested change
merchant_address_change_approvedMerchant approved change
merchant_address_change_deniedMerchant denied change
  • customer_phone_valid:falseLOW
  • customer_phone_is_fixed:trueMODERATE
  • customer_phone_is_fixed:true + customer_address_confirmed:trueVERY_HIGH
  • customer_phone_valid:trueHIGH
  • customer_phone_valid:true + approved change → VERY_HIGH
  • customer_phone_valid:true + denied change → LOW
GET /shipping/v1.0/orders/{orderId}/safeDelivery
Response 200 OK:
{
  "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"
}
Errors:
  • 400 OrderWithoutSafeDelivery: Order without trust rules
  • 404 OrderNotFound: Order not found
NoteThe score may change after order creation based on customer and merchant actions.
Was this page helpful?
Rate your experience in the new Developer portal: