Store jobs
A store job is what a store button of the app does on one product and one store: publish puts the product on the store, sync sends its current state again, unpublish hides it there (the app calls it Disconnect), republish shows a hidden product again (Reconnect). resend_issue sends again a change a store did not take (from GET /v1/store-issues). A store can take longer to answer than a call may wait, so the call answers 202 with one job a store at once, and B7R does the work after it.
- Starting jobs needs
stores:publish; reading them needsstores:read, whichstores:publishgoes with. - One product and one store hold one open job at a time, from the app or the API. The same action again answers the job already open (you join it). Another action is refused for that store with
store_job_openuntil the open one ends. - A
publishof a product already on that store, shown or hidden, isdonewith nothing changed. To show a hidden one, userepublish. - A person in the app is never queued behind a key: pressing a store button while your job only waits takes its place, and your job ends
failedwithsuperseded_by_app. - A job is tried up to 4 times: the first, then after 1, 5 and 15 minutes, while the cause can pass (the store or the integration did not answer, the photos of a new product are still being drawn). A cause a retry cannot change ends it at once.
- Each try checks again that the key is still valid and holds
stores:publish, and that the product and the store are yours. A key revoked while its jobs wait sends nothing. - Follow a job without asking: with updates on, each job ends with one
product.store_changedcarrying itsjob_id: a publish, unpublish or republish with where the product now stands on the store (published,hiddenorremoved, even when it was there already), a sync or a resend withsynced, and a job that fails withfailedand itsreason. A sync that re-creates a product the store deleted also sendsremovedandpublished. The update needs a key holdingstores:read. - By default your account runs at most 2 jobs at once and holds at most 50 open jobs;
GET /v1/me?include=limitsshows your values. Starting jobs is also limited per minute (store_actions_per_minute) and per day (store_jobs_per_day, from midnight Riyadh time). When several accounts wait, the account with the fewest jobs running goes first.
Start store jobs
Name one action, one product and 1 to 20 stores, or resend_issue and one issue_id. Send an Idempotency-Key: the same key and body answer the same jobs again.
Before any job is made, the product and every store must be yours (else 404 not_found), the product not taken down (422 design_rejected with design_taken_down) and, except for unpublish, not archived (409 product_not_editable).
Each store is then its own job, and a store refused does not undo the others. This example names three stores: the second is busy with another action, so the answer is 202 with two jobs and that store in refused, with the job that holds it (job_id is null when the store is busy with an action in the app). Every store you name is in jobs or in refused. A store or a product removed while the call ran is in refused with not_found. Only a call that got no job at all answers an error: 404 not_found, 409 store_job_open, or 429 rate_limited with the error queue_full when your account holds its most open jobs. A call that would pass your daily number of jobs starts none: 429 rate_limited with the error daily_limit.
Headers
Bearer b7r_live_.... A key with the stores:publish area. X-B7R-Key works too; send one, never both.
A new value per operation (up to 255 letters, digits, ., _, : or -; a UUID works), the same value on its retries. See Safe retries.
application/json, when the request has a body.
ar for Arabic error titles; anything else gives English. Codes never change.
Body
publish: put the product on the stores. sync: send its current state again. unpublish: hide it on the stores (the app's Disconnect). republish: show a hidden product again (the app's Reconnect). resend_issue: send again a change a store did not take. One of publish, sync, unpublish, republish, resend_issue.
A pair action: the product, from GET /v1/products.
A pair action: 1 to 20 stores, from GET /v1/stores; one job each. 1 to 20 items.
resend_issue: the issue, from GET /v1/store-issues.
Answer
One a store: a new job, or the open job of the same action, which this call joins.
Child fields
One of publish, sync, unpublish, republish, resend_issue.
queued: waiting for its turn or its next try. running: at the store now. done and failed are final. One of queued, running, done, failed.
Why it failed, or why its last try did not finish (while queued); null when done.
Tries made so far; at most 4. At least 0.
When a queued job is tried next; null once it runs or ends.
Child fields
store_job_open: another action runs on this product and store now. queue_full: the account holds its most open store jobs. not_found: the store or the product went while the call ran. One of store_job_open, queue_full, not_found.
The job of the other action that holds the pair; null for queue_full and not_found.
Errors
| HTTP | Code | Retry |
|---|---|---|
| 400 | invalid_request | No |
| 400 | idempotency_key_required | No |
| 401 | unauthorized | No |
| 403 | area_forbidden | No |
| 403 | account_inactive | No |
| 403 | connection_disabled | No |
| 403 | https_required | No |
| 404 | not_found | No |
| 409 | idempotency_mismatch | No |
| 409 | idempotency_in_flight | Yes |
| 409 | product_not_editable | No |
| 409 | store_job_open | No |
| 413 | request_too_large | No |
| 415 | unsupported_media_type | No |
| 422 | design_rejected | No |
| 429 | rate_limited | Yes |
| 500 | internal_error | Yes |
| 502 | upstream_unavailable | Yes |
| 503 | api_unavailable | Yes |
| 503 | request_expired | Yes |
| 503 | service_unavailable | Yes |
| 503 | try_again_later | Yes |
| 504 | upstream_timeout | Yes |
curl -X POST https://api.b7r.app/v1/store-jobs \
-H "Authorization: Bearer $B7R_API_KEY" \
-H "Idempotency-Key: $(uuidgen 2>/dev/null || node -e 'console.log(crypto.randomUUID())')" \
-H "Content-Type: application/json" \
-d '{
"action": "publish",
"product_id": "7f3c2a10-5b9e-4d6a-8c21-3e4f5a6b7c8d",
"store_ids": [
"1a2b3c4d-1111-4a5b-8c6d-7e8f9a0b1c2d",
"1a2b3c4d-2222-4a5b-8c6d-7e8f9a0b1c2d",
"1a2b3c4d-3333-4a5b-8c6d-7e8f9a0b1c2d"
]
}'const res = await fetch("https://api.b7r.app/v1/store-jobs", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.B7R_API_KEY}`,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
"action": "publish",
"product_id": "7f3c2a10-5b9e-4d6a-8c21-3e4f5a6b7c8d",
"store_ids": [
"1a2b3c4d-1111-4a5b-8c6d-7e8f9a0b1c2d",
"1a2b3c4d-2222-4a5b-8c6d-7e8f9a0b1c2d",
"1a2b3c4d-3333-4a5b-8c6d-7e8f9a0b1c2d"
]
}),
});
const data = await res.json();import os, requests, uuid
res = requests.post(
"https://api.b7r.app/v1/store-jobs",
headers={
"Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"action": "publish",
"product_id": "7f3c2a10-5b9e-4d6a-8c21-3e4f5a6b7c8d",
"store_ids": [
"1a2b3c4d-1111-4a5b-8c6d-7e8f9a0b1c2d",
"1a2b3c4d-2222-4a5b-8c6d-7e8f9a0b1c2d",
"1a2b3c4d-3333-4a5b-8c6d-7e8f9a0b1c2d"
]
},
timeout=30,
)
data = res.json(){
"jobs": [
{
"id": "b1c2d3e4-0001-4f5a-8b6c-7d8e9f0a1b2c",
"action": "publish",
"status": "queued",
"reason": null,
"product_id": "7f3c2a10-5b9e-4d6a-8c21-3e4f5a6b7c8d",
"store_id": "1a2b3c4d-1111-4a5b-8c6d-7e8f9a0b1c2d",
"issue_id": null,
"attempts": 0,
"next_attempt_at": "2026-11-26T09:00:00.000Z",
"created_at": "2026-11-26T09:00:00.000Z",
"updated_at": "2026-11-26T09:00:00.000Z",
"finished_at": null
},
{
"id": "b1c2d3e4-0002-4f5a-8b6c-7d8e9f0a1b2c",
"action": "publish",
"status": "queued",
"reason": null,
"product_id": "7f3c2a10-5b9e-4d6a-8c21-3e4f5a6b7c8d",
"store_id": "1a2b3c4d-3333-4a5b-8c6d-7e8f9a0b1c2d",
"issue_id": null,
"attempts": 0,
"next_attempt_at": "2026-11-26T09:00:00.000Z",
"created_at": "2026-11-26T09:00:00.000Z",
"updated_at": "2026-11-26T09:00:00.000Z",
"finished_at": null
}
],
"refused": [
{
"store_id": "1a2b3c4d-2222-4a5b-8c6d-7e8f9a0b1c2d",
"code": "store_job_open",
"job_id": "b1c2d3e4-0009-4f5a-8b6c-7d8e9f0a1b2c"
}
]
}Read a store job
status is queued, running, done or failed; done and failed are final. A queued job shows when it is tried next, and the reason of its last try when one did not finish.
Another account’s job answers 404 not_found, exactly like a job that does not exist.
Headers
Bearer b7r_live_.... A key with the stores:read area. X-B7R-Key works too; send one, never both.
ar for Arabic error titles; anything else gives English. Codes never change.
Path
Answer
One of publish, sync, unpublish, republish, resend_issue.
queued: waiting for its turn or its next try. running: at the store now. done and failed are final. One of queued, running, done, failed.
Why it failed, or why its last try did not finish (while queued); null when done.
Tries made so far; at most 4. At least 0.
When a queued job is tried next; null once it runs or ends.
Errors
| HTTP | Code | Retry |
|---|---|---|
| 400 | invalid_request | No |
| 401 | unauthorized | No |
| 403 | area_forbidden | No |
| 403 | account_inactive | No |
| 403 | connection_disabled | No |
| 403 | https_required | No |
| 404 | not_found | No |
| 429 | rate_limited | Yes |
| 500 | internal_error | Yes |
| 502 | upstream_unavailable | Yes |
| 503 | api_unavailable | Yes |
| 503 | request_expired | Yes |
| 503 | service_unavailable | Yes |
| 504 | upstream_timeout | Yes |
curl https://api.b7r.app/v1/store-jobs/b1c2d3e4-0001-4f5a-8b6c-7d8e9f0a1b2c \
-H "Authorization: Bearer $B7R_API_KEY"const res = await fetch("https://api.b7r.app/v1/store-jobs/b1c2d3e4-0001-4f5a-8b6c-7d8e9f0a1b2c", {
headers: {
Authorization: `Bearer ${process.env.B7R_API_KEY}`,
},
});
const data = await res.json();import os, requests
res = requests.get(
"https://api.b7r.app/v1/store-jobs/b1c2d3e4-0001-4f5a-8b6c-7d8e9f0a1b2c",
headers={
"Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
},
timeout=30,
)
data = res.json(){
"id": "b1c2d3e4-0001-4f5a-8b6c-7d8e9f0a1b2c",
"action": "publish",
"status": "done",
"reason": null,
"product_id": "7f3c2a10-5b9e-4d6a-8c21-3e4f5a6b7c8d",
"store_id": "1a2b3c4d-1111-4a5b-8c6d-7e8f9a0b1c2d",
"issue_id": null,
"attempts": 1,
"next_attempt_at": null,
"created_at": "2026-11-26T09:00:00.000Z",
"updated_at": "2026-11-26T09:00:07.214Z",
"finished_at": "2026-11-26T09:00:07.214Z"
}List store jobs
Newest first. Filter by product_id, store_id or status. Page with cursor until next_cursor is null. A finished job stays listed for the days of your request log.
Headers
Bearer b7r_live_.... A key with the stores:read area. X-B7R-Key works too; send one, never both.
ar for Arabic error titles; anything else gives English. Codes never change.
Query
1 to 256.
One of queued, running, done, failed.
Answer
Child fields
One of publish, sync, unpublish, republish, resend_issue.
queued: waiting for its turn or its next try. running: at the store now. done and failed are final. One of queued, running, done, failed.
Why it failed, or why its last try did not finish (while queued); null when done.
Tries made so far; at most 4. At least 0.
When a queued job is tried next; null once it runs or ends.
Errors
| HTTP | Code | Retry |
|---|---|---|
| 400 | invalid_request | No |
| 401 | unauthorized | No |
| 403 | area_forbidden | No |
| 403 | account_inactive | No |
| 403 | connection_disabled | No |
| 403 | https_required | No |
| 429 | rate_limited | Yes |
| 500 | internal_error | Yes |
| 502 | upstream_unavailable | Yes |
| 503 | api_unavailable | Yes |
| 503 | request_expired | Yes |
| 503 | service_unavailable | Yes |
| 504 | upstream_timeout | Yes |
curl "https://api.b7r.app/v1/store-jobs?product_id=7f3c2a10-5b9e-4d6a-8c21-3e4f5a6b7c8d&status=failed" \
-H "Authorization: Bearer $B7R_API_KEY"const res = await fetch("https://api.b7r.app/v1/store-jobs?product_id=7f3c2a10-5b9e-4d6a-8c21-3e4f5a6b7c8d&status=failed", {
headers: {
Authorization: `Bearer ${process.env.B7R_API_KEY}`,
},
});
const data = await res.json();import os, requests
res = requests.get(
"https://api.b7r.app/v1/store-jobs?product_id=7f3c2a10-5b9e-4d6a-8c21-3e4f5a6b7c8d&status=failed",
headers={
"Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
},
timeout=30,
)
data = res.json(){
"data": [
{
"id": "b1c2d3e4-0002-4f5a-8b6c-7d8e9f0a1b2c",
"action": "publish",
"status": "failed",
"reason": "subscription_inactive",
"product_id": "7f3c2a10-5b9e-4d6a-8c21-3e4f5a6b7c8d",
"store_id": "1a2b3c4d-3333-4a5b-8c6d-7e8f9a0b1c2d",
"issue_id": null,
"attempts": 1,
"next_attempt_at": null,
"created_at": "2026-11-26T09:00:00.000Z",
"updated_at": "2026-11-26T09:00:05.880Z",
"finished_at": "2026-11-26T09:00:05.880Z"
}
],
"next_cursor": null
}Why a job failed
reason | What happened |
|---|---|
not_found | The product, the store or the issue is not yours, or is gone. A disconnect, in the app or with POST /v1/stores/{id}/disconnect, does not end the store’s waiting jobs at once: each fails when it comes to run, a product job with not_found. |
taken_down | The design was taken down; it is never published or changed on a store. |
not_published | A sync of a product that is not on that store: publish it first. |
not_unpublished | A republish of a product that is not hidden on that store. |
platform_paused | B7R paused that store platform's integration for a while. |
subscription_inactive | The store's subscription to the B7R app lapsed. An unpublish still runs. |
store_rejected | The store refused the product or the change. |
store_disconnected | The store holds no valid connection to B7R: reconnect it in the app. |
sku_taken | A SKU of the product belongs to another product on that store. |
admin_only | Only B7R sends this change (the shipping company of an order). |
store_unavailable | The store or the integration did not answer, on the last try. |
no_photos_yet | The product's photos were still being drawn, on the last try. |
unlinked | The store had deleted the product and it could not be made again, on the last try. Publish it. |
superseded_by_app | Someone pressed a store button in the app for this product and store while the job waited. |
interrupted | The job stopped while it ran and was out of tries. |
attempts_exhausted | The job waited past its last try. |
integration_off | The Custom API was off when the job came to run. |
key_revoked, key_expired, area_missing | The key that started the job is revoked, expired or no longer holds stores:publish. |
account_inactive, connection_disabled | The account or its Custom API connection was off when the job came to run. |
lease_lost, internal_error | Something failed on B7R’s side, on the last try. Start the job again. |
To send a change a store did not take, start resend_issue with its issue_id: { "action": "resend_issue", "issue_id": "9e8d7c6b-5a4f-4e3d-9c2b-1a0f9e8d7c6b" }. A resolved issue, and the shipping company change of an order (B7R's alone), answer 400 invalid_request at /body/issue_id. A product's issue is not sent again once the product is taken down (422 design_rejected, design_taken_down) or archived (404 not_found), except the hide of a product hidden on that store, which always goes.
