Skip to content
Proud to collaborate with Microsoft for Startups

ifood.connection.begin-authorization ​

Start a merchant's authorization of the registered iFood application

Request the user code a merchant types into the iFood Portal.

Overview ​

PropertyValue
Workflow typeLinear
LibraryApp-ifood
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
organization_uuidstringYes——
app_connection_uuidstringNo—The ifood_app connection whose registered application the merchant authorizes. Required normally. On a deployment locked to its own configured application it must be OMITTED -- supplying it is refused rather than ignored, because ignoring it would let you believe you authorized against your application when you authorized against the deployment's.
connection_uuidstringNo—An existing merchant connection to authorize. Omit it on a first run and supply connection_name instead -- the journey creates the connection, because nothing else can.
connection_namestringNo—Names the merchant connection to create when connection_uuid is omitted. Re-running with the same name resumes that journey rather than starting a second one.
data_environmentstringNoproductionRecorded on a newly created connection; ignored for an existing one.
workflow_run_idstringNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
organization_uuidstringYes——
app_connection_uuidstringNo—The ifood_app connection whose registered application the merchant authorizes. Required normally. On a deployment locked to its own configured application it must be OMITTED -- supplying it is refused rather than ignored, because ignoring it would let you believe you authorized against your application when you authorized against the deployment's.
connection_uuidstringNo—An existing merchant connection to authorize. Omit it on a first run and supply connection_name instead -- the journey creates the connection, because nothing else can.
connection_namestringNo—Names the merchant connection to create when connection_uuid is omitted. Re-running with the same name resumes that journey rather than starting a second one.
data_environmentstringNoproductionRecorded on a newly created connection; ignored for an existing one.
workflow_run_idstringNo——
merchant_connection_uuidstringYes—The merchant connection holding the verifier; pass this to complete-authorization
connection_createdbooleanYes—True when this run created the connection rather than resuming one
user_codestringYes——
verification_urlstringNo——
verification_url_completestringNo——
expires_inintegerNo——
verifier_storedbooleanYes——
requested_atstringYes——
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_stepjsonNo——
failed_layerintegerNo——
failed_at_statestringNo——
errorstringNo——
error_typestringNo——
failed_atstringNo——
provider_request_refstringNo——
retryablebooleanNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
initiatedYesNo—execute—
executingNoNo—complete—
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
initiatedexecuteexecuting—
executingcompletecompleted—
* (any state)failfailed—

Outcomes ​

OutcomeTypeDescriptionState Data Keys
requestedSUCCESSA user code was issued for the merchant to authorizeuser_code, verification_url_complete, expires_in
failedFAILUREThe user-code request failedfailure_reason, failure_type, retryable

Business Errors ​

CodeMessage Template
IFOOD_ORGANIZATION_CONTEXT_INVALIDAuthenticated organization context is missing or does not match the workflow input
IFOOD_CONNECTION_NOT_FOUNDiFood connection {connection_uuid} was not found in the authenticated organization
IFOOD_CONNECTION_WRONG_PROVIDERConnection {connection_uuid} is not an iFood connection
IFOOD_CONNECTION_SERVICE_UNAVAILABLEThe shared cloud connection service is unavailable
IFOOD_PROVIDER_CAPABILITY_MISSINGThe installed iFood provider does not expose the required API operation
IFOOD_AUTHENTICATION_FAILEDiFood rejected the connection credentials or bearer token
IFOOD_PROVIDER_REQUEST_FAILEDThe iFood API request failed
IFOOD_RESPONSE_SHAPE_INVALIDThe iFood Merchant API returned an invalid merchant record
IFOOD_PAGINATION_INVALIDMerchant page must be at least 1 and limit must be between 1 and 100
IFOOD_SALES_WINDOW_INVALIDSales dates must use YYYY-MM-DD, be ordered, and span no more than 8 inclusive days
IFOOD_SALES_PAGINATION_INVALIDSales page must be a zero-based integer
IFOOD_SALES_RESPONSE_SHAPE_INVALIDThe iFood Financial Sales API returned an invalid response
IFOOD_FINANCIAL_EVENTS_WINDOW_INVALIDFinancial Events dates must use YYYY-MM-DD, be ordered, and span no more than 33 inclusive days
IFOOD_SETTLEMENTS_WINDOW_INVALIDSettlements dates must use YYYY-MM-DD, be ordered, and span no more than 90 inclusive days
IFOOD_FINANCIAL_PAGINATION_INVALIDFinancial page must be one-based and page_size must be between 100 and 300
IFOOD_FINANCIAL_EVENTS_RESPONSE_SHAPE_INVALIDThe iFood Financial Events API returned an invalid response
IFOOD_SETTLEMENTS_RESPONSE_SHAPE_INVALIDThe iFood Settlements API returned an invalid response
IFOOD_DATA_ENVIRONMENT_INVALIDdata_environment must be exactly 'production' or 'homologation'
IFOOD_DATA_ENVIRONMENT_UNSUPPORTEDThe installed iFood provider does not support data_environment; upgrade ltinteg-cloud-connections to request homologation records

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "ifood.connection.begin-authorization",
  "initial_data": {
    "organization_uuid": "value"
  }
}