ELAELA Docs

External fulfillment

Offer source-managed deliveries to ELA while keeping your own order and verification workflow.

At a glance

The opt-in contract supports CLICK bike deliveries with one or two pickups and one customer handoff. Receipt reserves capacity; source-authorized rider assignment creates one ELA invoice obligation.

Enable the integration

ELA must provision a fixed source coordination endpoint, a separate signing secret, source-managed customer communications and your cancellation policy. Request fulfillments:read and fulfillments:write on an active organization API key. These capabilities are not enabled by default. Organization, key and requests must use the same LIVE or SANDBOX workspace.

Quote and create an offer

  1. Quote the exact route

    POST /partner-api/fulfillment-quotes with serviceType CLICK, pickups and delivery. Each stop has sourceStopId, name, address, latitude, longitude and phone. Stop IDs must be distinct. Pickup order is preserved.

  2. Create with durable source identity

    POST /partner-api/fulfillments with the same route plus sourceOrderId, sourceAttemptId, generation, sourceTrackingReference, quoteId, currency NGN, quotedAmountKobo and pickupVerification. Each pickup verification contains sourceStopId and a four-character string pickupCode, including leading zeroes. Do not send the customer delivery code.

  3. Recover a lost response

    GET /partner-api/fulfillments/by-source?sourceOrderId=...&sourceAttemptId=...&generation=1 returns the original receipt. Repeating creation with another request key and the same identity/payload recovers the same fulfillment after quote expiry. Identity/payload mismatch is 409.

Every mutation requires Idempotency-Key: 8–128 letters, numbers, colons, underscores or hyphens. Reuse the same key and payload after an uncertain response. Amounts are integer kobo; timestamps are ISO 8601. Successful fulfillment mutations return HTTP 200. The generated API reference defines required, optional and nullable fields.

Authorize one winning rider

ELA persists an operation before POSTing to your configured source endpoint. protocolVersion is 1. kind is CLAIM, RELEASE or VERIFY_DELIVERY. Common fields are operationId, dataMode (LIVE or SANDBOX), organizationId, fulfillmentId, sourceOrderId, sourceAttemptId, generation, riderId, quotedAmountKobo and currency. CLAIM includes driver and assignment origin. RELEASE includes actorId, reason and cancellationFeeKobo. VERIFY_DELIVERY carries verificationCode on the initial request; recovery sends lookupOnly:true without retaining the customer code.

Source decision responsejson
{  "operationId": "copy-the-request-operation-id",  "decision": "AUTHORIZED",  "reference": "your-stable-decision-reference"}

Verify X-ELA-Source-Signature: t=<unix-seconds>,v1=<hex-hmac-sha256> over the exact raw body using HMAC-SHA256(secret, timestamp + "." + rawBody). Reject timestamps outside five minutes and compare signatures in constant time. X-ELA-Source-Operation must match operationId. Sign the exact HTTP 200 response body in the same way with X-ELA-Source-Signature. Responses must fit 32 KiB and arrive within five seconds.

Persist each decision atomically with source ownership or verification. Replays return that decision. decision is AUTHORIZED, REJECTED or PENDING; reference is 1–128 characters. Optional code is INVALID_CODE, LOCKED, STALE_ASSIGNMENT or UNAVAILABLE. Unknown lookup-only operations return PENDING. Coordinate CLAIM with internal rider/admin assignment under one source ownership lock.

Rider actions, SLA timers and contacts

Request optional riderWorkflowVersion: 1 during ELA integration provisioning. This applies only to new fulfillments. Deploy compatible rider apps before enabling it; older apps cannot accept these orders. Existing integrations and ordinary bookings retain their current behavior. Your source owns business actions and SLA rules; ELA retains assignment, physical handoff safeguards and billing.

Handle signed RIDER_WORKFLOW and RIDER_ACTION requests at the same provisioned source endpoint. Both include protocolVersion: 1, riderWorkflowVersion: 1, operationId, organizationId, dataMode, fulfillmentId, sourceOrderId, sourceAttemptId, generation and riderId. Bind every response to all those identity fields. An AUTHORIZED response must contain workflow. Never choose a callback URL from an order.

workflow contains version: 1, a positive increasing revision, evaluatedAt, expiresAt and up to 16 items. Expiry must be after evaluation and at most 120 seconds later. Each item has id, reference, label, optional sourceStopId and bounded actions, timers and contacts. Stop IDs must belong to this fulfillment. Use a new revision when business state, action meaning or contact access changes. A paused timer deadline may advance without changing that revision.

Actions contain id, label, stage (PICKUP, TRANSIT or DELIVERY), input (CONFIRM, LOCATION or CODE), available, optional unavailableReason and blocks. Blocks may require the action before PICKUP, DEPARTURE, DELIVERY_ARRIVAL or COMPLETION. IDs identify a single action instance and cannot be reused for a different meaning. RIDER_ACTION includes itemId, actionId, expected revision and server-attributed performedBy. LOCATION sends latitude, longitude, accuracyMeters, capturedAt and isMocked; validate current source rules. CODE sends ephemeral verificationCode as a string; preserve leading zeroes.

Persist an action intent before applying its existing source transition, fence current ownership and return a durable AUTHORIZED, REJECTED or PENDING receipt. Replays and lookupOnly:true use the same operationId. For a workflow action that was never received, atomically save and return a REJECTED tombstone; a delayed initial send must return that rejection. This permits a safe new attempt after a crash before source delivery. Recovery must resume partial work idempotently and never apply another financial charge. Do not persist or log plaintext verification codes.

Optional action milestone is PICKUP_ARRIVAL (PICKUP stage, item sourceStopId required) or DELIVERY_ARRIVAL (TRANSIT stage). Both require LOCATION input. ELA commits that physical arrival and the current route stop atomically only after your signed acceptance; the rider sees one action in Update trip status. Publish only one action per physical arrival and remove it from the accepted workflow. Keep the accepted receipt durable even while the corresponding ELA webhook is in flight. These effects cannot complete delivery or bypass vendor release or customer verification.

A rejected workflow receipt may include failure: {reason, requiredDistanceMeters?}. Reasons are OUTSIDE_ALLOWED_AREA, LOCATION_INACCURATE, LOCATION_STALE, LOCATION_REQUIRED, NOT_READY or ACTION_CHANGED. Distance is bounded to 1–10000 metres. ELA renders safe instructions instead of provider exception text. Definite rejection permits a new operation with fresh input; ambiguous delivery remains PENDING and recovers the original operationId. Never retry a rejected GPS sample automatically as the rider moves.

Timers contain id, label, startAt, deadlineAt, paused and optional resolvedAt, with ISO 8601 timestamps. ELA displays source deadlines using server time and monotonic elapsed time, including paused and overdue states. Rider details show current deadlines as bounded progress bars and omit resolved timers; admin history retains resolved states. ELA does not calculate your penalties. Contacts contain id, role (PICKUP, CUSTOMER or SUPPORT), name, phone and allowed stages. Scope each contact to its own item or stop. ELA removes contacts after expiry, cancellation, reassignment or completion and excludes them from public offers and rider history.Optional contact recipientId and deliveryStopId are opaque identities scoped to the workflow. ELA groups matching recipients at the same destination in its existing customer card and retains their order associations. Different destinations or conflicting contact details remain separate; names or phone numbers alone never establish grouping. SLA targets remain associated with each order.Partner super admins can set optional public logoUrl using PATCH /api/v1/partner/company-profile (null clears it). Use a public HTTPS PNG, JPEG or WebP URL without credentials, query or fragment. The offer originatingPartner and trip externalFulfillment.partner carry only this validated artwork URL, never organization metadata. ELA uses a compact rounded image beside the partner name and falls back to initials if unavailable.

Assigned riders and authorized ELA administrators see the same partner items, timers and pickup milestones. Admins need orders:read within their order scope; submitting an eligible action also requires orders:operate-on-behalf and records ADMIN attribution. Location confirmation remains rider-only. Admin history retains operational milestones and resolved timers while hiding terminal PINs and stage-restricted contacts. ELA polls and reconciles durably after missed events and restarts; a click remains pending until the signed source receipt confirms it.

Verify vendor collection and customer delivery

The assigned rider sees the source pickup code; your vendor enters it in your vendor workflow. After assignment, publish READY then RELEASED to POST /partner-api/fulfillments/{id}/pickups/{sourceStopId}/release with generation, riderId, reference and milestone. RELEASED requires readiness and rider arrival. Each active pickup needs its own release. ELA cannot self-authorize collection. For a grouped delivery, publish CANCELLED through the same endpoint to remove an uncollected pickup. The remaining pickup keeps its driver and accepted delivery price; the snapshot marks the removed pickup cancelled without recording a handoff. Cancelling a released/completed pickup, the last active pickup, or a single-pickup delivery is refused; use whole-delivery cancellation when appropriate. Sources retain their normal customer/vendor cancellation and refund rules and retry this milestone with the same idempotency key after an uncertain response.

The rider records customer arrival and enters the customer code in ELA. The source verifies the current owner/generation and applies failure/lockout rules. ELA commits delivery only after signed authorization. Customer codes are absent from offers, snapshots, webhooks and persisted ELA operations. Source-managed notifications suppress ELA customer delivery messages and live activities while retaining rider, internal and security communications.

Cancel and reconcile billing

POST /partner-api/fulfillments/{id}/cancel with generation and reason. The result state is CONFIRMED, PENDING or REJECTED with a stable reference. Only CONFIRMED has effectiveAt and final feeAmountKobo, adjustmentAmountKobo and refundAmountKobo. Poll the snapshot while pending; retain ownership on refusal or uncertainty. The saved policy determines before-pickup fees, capped at the quote. Cancellation after any pickup is refused.

An unaccepted offer holds prepaid/credit capacity without an invoice line. Assignment converts that hold to one invoice line at the ELA quote. Withdrawal releases the hold; allowed accepted cancellation reduces the line by quote minus fee. Paid-invoice overpayments remain invoice credit; this operation pays no cash refund. Match billing.invoice.id/reference and amountKobo to your payable. Clear that payable when billing.settledAmountKobo equals amountKobo: this is payment allocated to the delivery line, even when the rolling invoice remains open for other orders. Do not also pay a withdrawable partner wallet for the same delivery. Your customer delivery charge stays independent.

Events, tracking and recovery

Subscribe to fulfillment.received, fulfillment.assigned, fulfillment.rejected, fulfillment.pickup_ready, fulfillment.pickup_arrived, fulfillment.pickup_released, fulfillment.pickup_completed, fulfillment.pickup_cancelled, fulfillment.status_changed, fulfillment.cancelled and fulfillment.delivered. The existing X-ELA-Signature webhook protocol applies. data.fulfillment contains source identity, generation, monotonically increasing revision and invoice reference. Deduplicate by webhook ID, order by generation/revision, and reconcile using GET /partner-api/fulfillments/{id}.

GET /partner-api/fulfillments/{id}/tracking is available in RIDER_ACCEPTED and RELEASE_PENDING while the same driver remains assigned. An unresolved release retains live tracking until removal is confirmed. Retired generations have no live access. Correct 400 payloads and 401/403 credentials or enablement. Check workspace on 404 and reconcile state on 409. For 410, obtain a new quote if no receipt exists. Obey Retry-After on 429 when present. Retry 503 and lost responses with the same identity and backoff. Durable ELA reconciliation retries pending source operations and unpublished events.