Deliverect Endpoints

EnvironmentBase URLDescription
Staginghttps://api.staging.deliverect.comFor any integration partner accessing endpoints in our Staging (test) Environment
Productionhttps://api.deliverect.comFor any integration partner accessing endpoints in our Production (live) Environment

%%{init: {'theme': 'base', 'themeVariables': {'background': '#ffffff', 'mainBkg': '#ffffff'}}}%%

sequenceDiagram
    autonumber
    actor Customer
    participant Channel as Ordering Channel
    participant Deliverect
    participant Dispatch as Dispatch Partner<br/>(courier network)
    participant POS

    Note over Deliverect,Dispatch: 1. Validate Availability
    Customer->>Channel: Places order needing delivery
    Channel->>Deliverect: Order with delivery address
    Deliverect->>Dispatch: POST validate (channelLinkId,<br/>deliveryLocations, pickupTime)
    Dispatch-->>Deliverect: 200 OK { available, validationId<br/>(valid 10 min), price, ETAs }
    Note right of Deliverect: Check "available" flag, not just 200.<br/>If false -> no job created

    Note over Deliverect,Dispatch: 2. Create Delivery Job (if canDeliver/available)
    Deliverect->>Dispatch: POST create_job (jobId, pickupLocation,<br/>deliveryLocations, ageCheck)
    Dispatch-->>Deliverect: 200 { canDeliver, externalJobId,<br/>courier, price, ETAs }
    Deliverect->>POS: Inject order into POS

    Note over Deliverect,Dispatch: 3. Update Delivery Job (optional changes)
    Deliverect->>Dispatch: POST updateJob (pickup time / items /<br/>dropoff changes)
    Dispatch-->>Deliverect: 200 { canDeliver, courier, ETAs }

    Note over Dispatch,Channel: 4. Delivery Status Updates (Partner -> Deliverect)
    loop For each status change
        Dispatch->>Deliverect: POST /fulfillment/generic/events<br/>(status, ETAs, courier, trackingUrl)
        Deliverect-->>Dispatch: 200 OK
        Deliverect->>Channel: Relay courier/delivery update
    end
    Note right of Dispatch: Statuses: <br>EN_ROUTE_TO_PICKUP (83),<br/>ARRIVED_AT_PICKUP (85),<br/>EN_ROUTE_TO_DROPOFF (87),<br/>ARRIVED_AT_DROPOFF (89),<br/>DELIVERED (90)

    Note over Deliverect,Dispatch: 5. Cancellation (optional)
    Channel->>Deliverect: Order / delivery canceled
    Deliverect->>Dispatch: POST cancel_job (jobId, deliveryLocations, courier)
    Dispatch-->>Deliverect: { status: confirmed, reason, price }