Common Workflows
These workflows cover the most common integration scenarios.
Flow 1 — New user, assign kit for the first time
Section titled “Flow 1 — New user, assign kit for the first time”Use this flow when a user has just been imported and you need to assign their product kit.
-
Import the user
Create or update the user record via the import endpoint.
POST /api/import/usersapi-key: <key>Content-Type: application/json{"users": [{"email": "john.doe@example.com","uber_id": 12345,"first_name": "John","last_name": "Doe","partner_name": "Adecco","agency_id": "P-12345","active": 1}]} -
Resolve the internal user ID
The import response already includes the
id(seeresults.users[].id) — keep it for later calls. If you didn’t capture it, look it up by email instead.GET /api/users/find-by-email?email=john.doe@example.comapi-key: <key>Response:
{ "success": true, "user_id": 84 } -
Fetch the available products (can run in parallel with step 2)
Get the full product list so you know which
product_idvalues to use.GET /api/productsapi-key: <key>Response:
[{ "id": 2, "product_name": "Rain Pants" },{ "id": 7, "product_name": "Rain Jacket" },{ "id": 14, "product_name": "Phone Holder" }] -
Add products to the user’s kit
Call the store endpoint once per product. Repeat for each item you want to assign.
POST /api/users/84/kitapi-key: <key>Content-Type: application/json{ "product_id": 7, "quantity": 1, "mandatory": true }POST /api/users/84/kitapi-key: <key>Content-Type: application/json{ "product_id": 14, "quantity": 1, "mandatory": false }
Flow 2 — Existing user, review and update kit
Section titled “Flow 2 — Existing user, review and update kit”Use this flow when a user already exists and you need to review or change their assigned products.
-
Resolve the internal user ID
GET /api/users/find-by-email?email=john.doe@example.comapi-key: <key>Response:
{ "success": true, "user_id": 84 } -
Get the current kit
Retrieve what the user currently has assigned.
GET /api/users/84/kitapi-key: <key>Response:
{"success": true,"kit": [{ "user_id": 84, "product_id": 7, "quantity": 1, "mandatory": true, "product": { "id": 7, "product_name": "Rain Jacket" } },{ "user_id": 84, "product_id": 14, "quantity": 1, "mandatory": false, "product": { "id": 14, "product_name": "Phone Holder" } }]} -
Update or remove products as needed
Send a POST with the same
product_idto changequantityormandatory. The endpoint upserts, so no separate update call is needed.POST /api/users/84/kitapi-key: <key>Content-Type: application/json{ "product_id": 14, "quantity": 2, "mandatory": true }Send a DELETE with the
product_idyou want to remove.DELETE /api/users/84/kit/14api-key: <key>
Flow 3 — Deactivate a user
Section titled “Flow 3 — Deactivate a user”Use this flow when a user leaves or should no longer have access. Sending active: 0 via the import endpoint deactivates the account.
-
Resolve the internal user ID
The import endpoint matches on the internal
id(Boolanga ID), notuber_id. If you didn’t keep theidfrom the original import response, look it up by email,uber_id, oragency_id— see Flow 4, step 1 for the lookup options. -
Send an import request with
active: 0Include the resolved
id. Onlyactiveneeds to change — include the other required fields to pass validation.POST /api/import/usersapi-key: <key>Content-Type: application/json{"users": [{"id": 84,"email": "john.doe@example.com","uber_id": 12345,"first_name": "John","last_name": "Doe","partner_name": "Adecco","active": 0}]}Expected response:
{"success": true,"results": {"created": 0,"updated": 1,"failed": []}}
Flow 4 — Update an existing user’s details
Section titled “Flow 4 — Update an existing user’s details”Use this flow when you need to change a user’s data (name, partner, agency_id, etc.) but only have their email, uber_id, or agency_id, not their internal id.
-
Resolve the internal user ID
GET /api/users/find-by-email?email=john.doe@example.comapi-key: <key>Response:
{ "success": true, "user_id": 84, "uber_id": "12345", "agency_id": null }GET /api/users?uber_id=12345api-key: <key>Response:
{"data": [{ "id": 84, "uber_id": "12345", "agency_id": null, "email": "john.doe@example.com", "partner_name": "Adecco" }]}GET /api/users?agency_id=P-12345api-key: <key>Response:
{"data": [{ "id": 84, "uber_id": "12345", "agency_id": "P-12345", "email": "john.doe@example.com", "partner_name": "Adecco" }]} -
Send an import request with the resolved
idInclude
idplus every required field, even the ones that aren’t changing — the request is validated as a full record, not a partial patch.POST /api/import/usersapi-key: <key>Content-Type: application/json{"users": [{"id": 84,"email": "john.doe@example.com","uber_id": 12345,"first_name": "John","last_name": "Doe-Smith","partner_name": "Randstad","agency_id": "P-12345","active": 1}]}Expected response:
{"success": true,"results": {"created": 0,"updated": 1,"failed": []}}
Flow 5 — Handle partial import failures
Section titled “Flow 5 — Handle partial import failures”Use this flow when a bulk import request comes back with results.failed entries — some users saved, others didn’t.
-
Send the bulk import
POST /api/import/usersapi-key: <key>Content-Type: application/json{"users": [{ "email": "john.doe@example.com", "uber_id": 12345, "first_name": "John", "last_name": "Doe", "partner_name": "Adecco", "active": 1 },{ "email": "jane.doe@example.com", "uber_id": 12345, "first_name": "Jane", "last_name": "Doe", "partner_name": "Adecco", "active": 1 },{ "email": "sam.roe@example.com", "uber_id": 99999, "first_name": "Sam", "last_name": "Roe", "partner_name": "Unknown Partner", "active": 1 }]} -
Read the response — successful and failed records are independent
Every record in the batch is processed on its own; one failure doesn’t roll back the others.
{"success": true,"results": {"created": 1,"updated": 0,"failed": [{"index": 1,"id": null,"uber_id": 12345,"email": "jane.doe@example.com","error": "uber_id already belongs to a different user."},{"index": 2,"id": null,"uber_id": 99999,"email": "sam.roe@example.com","error": "Partner not found: \"Unknown Partner\"."}],"users": [{ "index": 0, "id": 84, "uber_id": "12345", "email": "john.doe@example.com", "action": "created" }]}} -
Fix and resubmit only the failed records
Match each
failedentry back to your source data byindex(position in the original request), fix the underlying issue, then resend just those records in a new request — there’s no need to resend the ones that already succeeded.| Error | Fix | |-------|-----| |
Partner not found: "..."| Correctpartner_nameto match a partner that exists | |User not found for id: "..."| Drop theidif the user shouldn’t exist yet, or correct it | |Email already belongs to a different user.| Resolve the conflictingemail, or add the correctidif you meant to update that user | |uber_id already belongs to a different user.| Resolve the conflictinguber_id, or add the correctidif you meant to update that user | |agency_id already belongs to a different user.| Resolve the conflictingagency_id, or add the correctidif you meant to update that user |
Flow 6 — Sync your local user list with the eShop
Section titled “Flow 6 — Sync your local user list with the eShop”Use this flow to keep your own system in sync with every user known to the eShop (anyone with an uber_id and/or agency_id), for example in a nightly job.
-
Page through the full user list
Request pages in order, following
next_page_url(or incrementingpage) until it comes backnull.GET /api/users?limit=200&page=1api-key: <key>GET /api/users?limit=200&page=2api-key: <key> -
Upsert each user into your own system
For every entry in
data, store the internalid(Boolanga ID) alongsideuber_id,agency_id, andemail— you’ll needidfor any future update via the import endpoint (see Flow 4).
Flow 7 — Review exchange orders
Section titled “Flow 7 — Review exchange orders”Use this flow to review (approve or deny) pendig exchange orders.
-
Page through the full exchange orders list
Request pages in order, following
next_page_url(or incrementingpage) until it comes backnull.GET /api/v1/exchanges/orders?exchange_status=pending&limit=200&page=1api-key: <key>GET /api/v1/exchanges/orders?exchange_status=pending&limit=200&page=2api-key: <key> -
Approve or deny the exchange order
Call the review endpoint once per exchange order. Repeat for each exchange you want to review.
POST /api/v1/exchanges/reviewapi-key: <key>Content-Type: application/json{ "order_id": 7, "status": "denied" }POST /api/v1/exchanges/reviewapi-key: <key>Content-Type: application/json{ "order_id": 8, "status": "approved" }