Member API
Last updated: November 24, 2026
1. Overview
The Member API lets you read your own TheBuyerForce account from a script, a spreadsheet or a server: your reservations, packages, balance history and statements, support tickets, notifications and the deals you can see. It also does two things you can do on the website: submit tracking numbers, and lower or cancel a reservation.
To create a key, your member account must be active, opened at least 60 days ago, and have accepted the latest Terms of Service and the API Terms. Staff accounts can't use the API. While an account is suspended its keys can read but can't make changes. Submitting tracking numbers also needs the latest Terms of Service accepted. Once we publish an updated version of the Terms of Service, that version counts as the latest, even before it takes effect.
Every request goes to this base URL:
https://www.thebuyerforce.com/api/v1Use the address with www. The address without it redirects here, and many HTTP clients drop the Authorization header when a redirect changes the host, so your request would arrive without its key.
Version 1 has no webhooks or event stream: to see what changed, ask again, within the limits in Limits and cost. The API can't move money: payouts, bank accounts, payout coupons and answers to offers stay on the website.
There is no API for creating reservations or adding spots, and there won't be. Automated reservation of deals is never allowed, including through the API.
A tool may use the API to tell you about a deal, but you must make the reservation yourself on the website. If a tool fills in or prepares any part of a new reservation or of added spots for you, that counts as automated reservation, even if you click the last button yourself.
2. Authentication
Create a key in Developer Tools. Each time you create one, we email a code to your sign-in address to confirm it's you. The key is shown once: keep it somewhere safe. Keys start with tbf_live_.
Send the key in the Authorization header of every request, and nowhere else:
Authorization: Bearer <your key>- A key in the URL is refused with 400
api_key_in_url. URLs end up in logs and browser history, so revoke that key and create a new one. - A request from a web page or a browser extension can be refused with 403
browser_origin_refused. Call the API from a script or a server. - Don't embed your key in a web page, a browser extension or code that other people can read, and keep it out of shared spreadsheets.
- Where Developer Tools offers it, you can limit a key to a list of IP addresses. It's optional, and we suggest it for a key that can make changes (orders:write or reservations:write).
How long a key works
- When you create a key you choose how long it works: 30, 90, 180 and 365 days (90 unless you choose otherwise).
- A key that isn't used for 60 days stops working and is revoked. A key that has expired or been revoked can't be brought back: create a new one.
- All your keys are revoked when your password changes, when you use Sign out other devices in Settings → Sessions, when we sign your account out on every device, when we turn off API access for your account, and when your account is banned or closed. Logging out, or ending a single session with End Session in Settings → Sessions, doesn't revoke your keys.
- You can have at most 3 keys that work at a time.
One key per tool
Give each key a label that names what uses it, and use a separate key for each tool, so you can revoke one without stopping the others. You may give a key to a third-party tool you choose. Requests made with your key are your requests, and you are responsible for the tool you choose and what it does with your key and your data. How data you get through the API may be used is set out in the API Terms.
3. Scopes
A key can do only what its scopes allow, apart from GET /me, which any key can use to read basic details of your account and of the key itself. You choose the scopes when you create the key, and they can't be changed afterwards: for more access, create a new key. A request a key's scopes don't allow is refused with 403 insufficient_scope, and costs nothing.
| Scope | What it allows | Ticked when you create a key | Makes changes |
|---|---|---|---|
orders:read | Read your reservations, your packages with their delivery status, and the lines of each package. | Yes | No |
deals:read | Read the deals you can see on the website, including the spots left. Read only: deals are never reserved through the API. | No | No |
tickets:read | Read your support tickets and their messages, including any offer on a ticket. | No | No |
notifications:read | Read your notifications and how many are unread. Notices in the account, payouts and referrals categories are never included. Notices in the credits, holds and balance categories are included only when the key also has money:read. Other notices can still show an amount, such as an accepted offer or a lost-package settlement. | No | No |
money:read | Read your balance history month by month, and your monthly statements. Anyone with this key can see your balance history and statements. | No | No |
orders:write | Submit tracking numbers, and check a list of them without submitting it. Anyone with this key can submit tracking numbers in your name. | No | Yes |
reservations:write | Lower the spots on a reservation, or cancel it. There is no way to make a reservation or add spots. Anyone with this key can reduce or cancel your reservations. Spots you give up may be taken by others. | No | Yes |
4. Limits and cost
Each account has 30 units a minute and 1,000 units a UTC day. They are shared by all the account's keys and every endpoint, deals included: no endpoint has an allowance of its own. More keys don't add units.
The windows are fixed: the minute window starts again on each minute, and the day window at 00:00 UTC. So across the moment a window starts again, up to twice its units can be used in a short time.
| Endpoint | Cost |
|---|---|
GET /me | 1 unit |
GET /openapi.json | Free, no key needed |
GET /reservations | 1 unit |
GET /reservations/{id} | 1 unit |
POST /reservations/{id}/reduce | 1 unit |
POST /reservations/{id}/cancel | 1 unit |
GET /orders | 5 units |
GET /orders/lines | 1 unit per 100 order_ids, at least 1 (1–3) |
GET /balance/entries | 5 units |
GET /statements | 1 unit |
GET /statements/{month} | 2 units |
GET /tickets | 1 unit |
GET /tickets/{id} | 1 unit |
GET /notifications | 1 unit |
GET /notifications/unread-count | 1 unit |
GET /deals | 1 unit |
GET /deals/{id} | 1 unit |
POST /orders/batch | 10 units plus 1 per 40 orders (10–20) |
POST /orders/validate | 1 unit plus 1 per 40 orders (1–11) |
Every answer to a request whose key was accepted has three headers: X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (seconds), for whichever window is closer to running out. When the units run out the answer is 429 rate_limited with a Retry-After header: wait that many seconds. A request refused before its key is accepted (a 401, a 403 for the key or the account, a 409 for new API Terms, or a 400 for a key in the URL) costs nothing and has none of these headers.
Submitting tracking numbers
Submitting tracking numbers has limits of its own, besides the units:
- At most 400 rows a request.
- At most 1,000 tracking numbers new to your account in any 24 hours, on the website and the API together. 400 of them are kept for the website, so the API can submit up to 600. When the part kept for the website is as large as your account's whole limit, every API submission of new numbers is refused.
- At most 5 API submissions a minute and 30 an hour.
These are the defaults: one account's limits can differ, and a 429's limit and api_limit fields say what yours are. A number that is already on someone else's account counts toward the limit and isn't given back, even when another member added it while your request was being handled.
Three 429 answers are about submitting, apart from running out of units:
too_many_submissions: Too many API submissions in a short time. Wait the seconds Retry-After gives, then try again.daily_quota: This account has reached its limit of new tracking numbers for the last 24 hours. Send fewer, or try again when more opens up.api_daily_quota: The API has used its share of this account's new tracking numbers for the last 24 hours. The website can still add more.
The limits are per account, and your account's limits can differ from the ones on this page. Using several keys or several accounts to get around a limit isn't allowed under the API Terms. The limits, and what a request costs, can change as the API Terms set out.
5. Requests and responses
Answers
Every answer is JSON, in one of these shapes:
- One thing:
{ "data": { … }, "request_id": "…" }. - A list:
{ "data": [ … ], "next_cursor": "…" or null, "request_id": "…" }. An empty list is a 200 with[]. - A page with a heading (
GET /balance/entries):{ "data": { …, "entries": [ … ] }, "next_cursor": …, "request_id": "…" }. Heredatais the month, with its totals, and its entries are indata.entries;next_cursoris besidedata, as on a list. - A feed (
GET /notifications):{ "data": [ … ], "next_cursor": "…" or null, "has_more": true or false, "request_id": "…" }. - One answer isn't JSON:
GET /statements/{month}?format=csvis the statement CSV itself (text/csv; charset=utf-8,Content-Disposition: attachment), the same bytes as the website's download. Its request id is only in theX-Request-Idheader. Its errors are JSON, as everywhere. - One answer is JSON in none of these shapes:
GET /openapi.jsonis the API description itself, with nodataaround it and norequest_idin it.
An error is { "error": "…", "code": "…", "request_id": "…" }, sometimes with more fields (param names the parameter at fault). Check code, not the words in error, which can change. Every answer has an X-Request-Id header; include it if you email support about a request.
Pages
On a list or a page, next_cursor is null on the last page. For the next page, send it back as cursor with the same other parameters; only limit may change from page to page. A cursor belongs to its endpoint, its parameters and your account: with other parameters, start again from the first page. After maintenance a cursor can stop working: that is a 400 invalid_cursor, and you start again from the first page. On GET /balance/entries, if the month's statement comes out while you are paging, the next page is a 409 cursor_stale: start the month again from its first page.
A feed is different: once you have caught up, next_cursor still has a value. Keep it and send it as after next time to read only what is new; has_more says whether there is another page now. It is null only when you sent no after and there was nothing to read: poll again without after.
Requests
A request body is JSON (the examples send Content-Type: application/json). Only POST …/cancel may be sent without a body, or with {}. A query parameter an endpoint doesn't take is a 400 invalid_parameter naming it in param. An id in the path that isn't a UUID is a 400 invalid_parameter with param id (on /statements/{month}, a month that isn't YYYY-MM names month). A body that isn't JSON in the shape an endpoint takes is a 400 invalid_body. On POST /orders/batch, rows with a problem are a 400 invalid_rows listing them (POST /orders/validate answers them as invalid_format rows in its 200), and more than 400 rows is a 400 too_many_rows on either (see Submitting tracking numbers). On POST …/reduce, a quantity that is missing or isn't a whole number of at least 1 is a 400 invalid_parameter naming quantity. An id that is well formed but isn't yours, or doesn't exist, is a 404 not_found (a statement: statement_not_found); the two read the same.
Fields
- Times are ISO 8601 in UTC. A field for a day ends in
_pt_dateand is the Pacific date,YYYY-MM-DD. - Amounts are decimal strings, such as
"12.50", with acurrencybeside them. - Fields hold values, not wording ready to show: lay out dates and amounts yourself. The exception is text written for people to read: an entry's
titleanddetail(the same words as the statement CSV, which may include dates), a notification'stitleandbody, and a ticket'ssubject,last_message_previewand messagebody. Don't parse them: use the structured fields beside them for times and amounts. - The ids of your records (reservations, packages, tickets, deals and so on) are UUIDs.
request_idis a string with no fixed format, andkey_idis the 12 characters aftertbf_live_at the start of your key. - Every field is always there; one with no value is null. The exceptions: the fields an
expand=adds (deliveryonGET /orders,fulfillmentsonGET /reservations) are there only when asked for, andGET /reservations/{id}always hasfulfillments; and a row ofPOST /orders/batchorPOST /orders/validatehas the fields of its result only (see Submitting tracking numbers). - Lists of values (statuses, kinds, categories) can grow. Treat a value you don't know as "other".
Some answers differ from what the website shows, on purpose: /reservations also lists a reservation on a deal you can no longer see (its deal is null), so it can count more active reservations than the website does. A package's credited_amount is its total; its lines (GET /orders/lines) can add up to something else after a partial return or a reversal.
6. Errors
Every error the API sends is below. Words in angle brackets, such as <scope> or <n>, are filled in with the value in the answer.
| Status | Code | Message |
|---|---|---|
| 400 | api_key_in_url | Send your key in the Authorization header, not in the URL. A key that was in a URL can end up in logs, so revoke it in Developer Tools and create a new one. |
| 400 | invalid_body | The request body isn't valid JSON in the shape this endpoint expects. See this endpoint in the API documentation. |
| 400 | invalid_cursor | This cursor isn't valid for this request. Send the next_cursor from the previous page as it is, with the same filters, or start again without a cursor. |
| 400 | invalid_parameter | A query parameter is missing, repeated, empty or not valid for this endpoint. The param field names it; check it against this endpoint in the API documentation. |
| 400 | invalid_rows | Some rows can't be submitted, so nothing was saved. Fix the rows listed in rows and send the whole list again. |
| 400 | too_many_rows | This request has more rows than one request takes. Send the list in smaller parts; see this endpoint in the API documentation for the limit. |
| 401 | invalid_api_key | This API key isn't valid. Check that you copied all of it, or create a new one in Developer Tools. |
| 401 | key_expired | This key has expired. Keys also stop working after 60 days without use. Create a new one in Developer Tools. |
| 401 | key_revoked | This key was revoked: in Developer Tools, by us, or once it expired or went 60 days unused. A password change, Sign out other devices in Settings, our sign-out on every device, or a ban revokes all of an account's keys; logging out or ending one session doesn't. Create a new one in Developer Tools. |
| 401 | missing_api_key | Send your API key as Authorization: Bearer <key>. |
| 403 | account_banned | This account has been closed, so you can't sign in. For your remaining balance or packages still on the way, email support@thebuyerforce.com. |
| 403 | account_not_eligible | This account can't use the API. Only active member accounts can. Questions? Email support@thebuyerforce.com. |
| 403 | account_suspended | Your account is suspended, so this isn't available right now. You can still sign in and see your orders, payments and support tickets. Questions? Email support@thebuyerforce.com. |
| 403 | api_access_disabled | API access is turned off for this account, so its keys don't work. Questions? Email support@thebuyerforce.com. |
| 403 | browser_origin_refused | The API can't be called from a web page or browser extension. Call it from a server or script, and don't embed your key in a web page, a browser extension or code that other people can read. |
| 403 | insufficient_scope | This key doesn't have the <scope> access this request needs. Create a key with that access in Developer Tools. |
| 403 | ip_not_allowed | This key only works from the IP addresses set for it. This request came from <ip>. |
| 404 | not_found | Not found. |
| 404 | statement_not_found | There's no statement for this month, or no such version. Statements are issued after a month ends. |
| 405 | method_not_allowed | This endpoint doesn't accept <METHOD>. |
| 409 | api_terms_acceptance_required | Accept the current API Terms in Developer Tools, then try again. |
| 409 | below_fulfilled | A reservation can't go below the spots already fulfilled. |
| 409 | change_window_closed | A reservation can be changed only in the 24 hours after it was made. |
| 409 | cursor_stale | This month's statement was issued while you were paging. Start again from the first page. |
| 409 | deal_expired | This deal has expired, so its reservations can't be changed. |
| 409 | newest_spots_first | Lower or cancel your newest reservation on this plan first. |
| 409 | quantity_increase_not_allowed | The API can only lower or cancel a reservation. Spots can't be added through the API. |
| 400, 403 or 409 | reservation_change_refused | This reservation can't be changed. The message says why. |
| 409 | reservation_not_active | This reservation is no longer active, so it can't be changed. |
| 409 | terms_acceptance_required | Please accept the Terms of Service to continue. |
| 413 | payload_too_large | The request body is larger than this endpoint accepts. Send a smaller body; see this endpoint in the API documentation for the limit. |
| 429 | api_daily_quota | The API has used its share of this account's new tracking numbers for the last 24 hours. The website can still add more. |
| 429 | daily_quota | This account has reached its limit of new tracking numbers for the last 24 hours. Send fewer, or try again when more opens up. |
| 429 | rate_limited | Too many requests for this account. Wait <n> seconds, then try again. |
| 429 | too_many_submissions | Too many API submissions in a short time. Wait the seconds Retry-After gives, then try again. |
| 500 | internal_error | Something went wrong on our side. If this request makes a change, check whether it went through before you try again. If it keeps happening, email support@thebuyerforce.com with the request_id. |
| 500 | statement_inconsistent | This statement can't be sent right now. Contact support. |
| 503 | reservation_change_unconfirmed | We couldn't confirm whether this change went through. Check the reservation with GET /api/v1/reservations/{id} before you try again. |
| 503 | reservation_lookup_failed | We couldn't check your reservations just now, so nothing was changed. Please try again in a minute. |
| 503 | temporarily_unavailable | We couldn't complete this just now, and nothing was changed. Try again in a minute. |
When to try again
- 429
rate_limited: wait the seconds inRetry-After. A wait of more than a minute means the day's units are used up: they come back at 00:00 UTC. - 429
too_many_submissions,daily_quotaandapi_daily_quota:Retry-Afteris when a submission like this one can go through again. When there is none, waiting won't help: send fewer rows (with an API share of 0, submit on the website). - 503: wait the seconds in
Retry-Afterif it is there; otherwise try again after 2, 4, 8, 16 and 32 seconds. For a large account, a balance history, a statement or the lines of many packages can now and then take too long: ask for the lines of fewer packages at a time, and onGET /ordersuse a smallerlimit. - A change that got a 500 or a 503
reservation_change_unconfirmedmay have gone through: read the reservation first, then decide. - 409
api_terms_acceptance_required: accept the new API Terms in Developer Tools. 409terms_acceptance_required: accept the new Terms of Service on the website. - A suspended account can read but not make changes (403
account_suspended). Checking a list with POST /orders/validate isn't a change.
7. Endpoints
account
Your account and the key making the request, and this document.
GET /me
Your account, your Terms acceptance and this key
Who this key belongs to and where the account stands: active or suspended, the latest Terms of Service version we have published (it can take effect later) and whether you have accepted it, the API Terms version, this key and the units left. A good first call to check a key works. Takes no query parameters.
No query parameters.
Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | object | Your account and this key. |
data.member_id | string (uuid) | Your member id. Every key you create answers with the same one. |
data.account | object | Your account's standing. |
data.account.status | string | active, or suspended: a suspended account can still read, and a request that makes a change is refused (403 account_suspended). Values: active, suspended. |
data.account.read_only | boolean | true while the account is suspended: its keys can read but can't make changes, so a request that would make one is refused (403 account_suspended). Checking a list with POST /orders/validate still works, since it changes nothing. |
data.terms | object | The Terms of Service. |
data.terms.current_version | string (date) | The version members are asked to accept now. It can be published before the date it takes effect. |
data.terms.effective_pt_date | string (date) | The date current_version takes effect, in Pacific time. It can be after today. |
data.terms.accepted_current | boolean | Whether you have accepted current_version. |
data.terms.accepted_version | string or null | The version you accepted most recently, or null when there is none on record. |
data.api_terms_version | string (date) | The API Terms version keys work under now. When it changes, requests are answered 409 api_terms_acceptance_required until you accept it in Developer Tools. |
data.key | object | The key that made this request. |
data.key.id | string (uuid) | The key's id. |
data.key.key_id | string | The 12 characters after tbf_live_ at the start of the key. Developer Tools lists keys by it; it isn't secret. |
data.key.label | string | The name you gave the key. |
data.key.scopes | array of string | The access the key has. Values: orders:read, deals:read, tickets:read, notifications:read, money:read, orders:write, reservations:write. |
data.key.expires_at | string (date-time) | When the key stops working. A key also stops working after 60 days without use, or when it is revoked. |
data.key.ip_allowlist_set | boolean | Whether the key only works from IP addresses you set for it. |
data.rate | object | The units left after this request. Each request costs units, counted per minute and per UTC day, and all your keys share them. |
data.rate.minute | object | This minute (UTC). A new one starts on the minute. |
data.rate.minute.limit | integer | The units this window allows. |
data.rate.minute.remaining | integer | The units left in this window after this request. |
data.rate.minute.reset_seconds | integer | Seconds until this window starts again. |
data.rate.day | object | This UTC day. A new one starts at 00:00 UTC. |
data.rate.day.limit | integer | The units this window allows. |
data.rate.day.remaining | integer | The units left in this window after this request. |
data.rate.day.reset_seconds | integer | Seconds until this window starts again. |
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": {
"member_id": "00000000-0000-4000-8000-000000000909",
"account": {
"status": "active",
"read_only": false
},
"terms": {
"current_version": "2026-12-01",
"effective_pt_date": "2026-12-01",
"accepted_current": true,
"accepted_version": "2026-12-01"
},
"api_terms_version": "2026-12-01",
"key": {
"id": "00000000-0000-4000-8000-000000000910",
"key_id": "ab12cd34ef56",
"label": "Sheets sync",
"scopes": [
"orders:read"
],
"expires_at": "2027-02-13T18:04:05.123Z",
"ip_allowlist_set": false
},
"rate": {
"minute": {
"limit": 30,
"remaining": 29,
"reset_seconds": 31
},
"day": {
"limit": 1000,
"remaining": 990,
"reset_seconds": 40231
}
}
},
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter is unknown, repeated, empty or not valid, or a parameter in the path is not valid (invalid_parameter, with param naming it), a cursor is not valid (invalid_cursor), the key was sent in the URL (api_key_in_url), or, for an endpoint that takes a body, the body is not JSON in the shape it takes (invalid_body) or has more rows than it takes (too_many_rows); a field of the body with a value that is not valid can instead be invalid_parameter naming it, where the endpoint's description says so. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 409 | The API Terms changed. Accept the current version in Developer Tools, then send the request again. |
| 429 | This account has used its units for this minute or this UTC day. Wait Retry-After seconds, then try again. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-H "Authorization: Bearer $TBF_API_KEY" \
"https://www.thebuyerforce.com/api/v1/me"GET /openapi.json
This document
This OpenAPI 3.1 document, listing the endpoints open now. Download it to import into your own tools. It needs no key and costs nothing. Takes no query parameters.
No query parameters.
Answer fields (200)
| Field | Type | Description |
|---|---|---|
openapi | string | The OpenAPI version. Value: 3.1.0. |
info | object | What this API is. |
info.title | string | The API's name. |
info.version | string (date) | The date this document last changed. |
info.description | string | What the API is for and how to call it. |
info.termsOfService | string | The API Terms that apply to every request. |
info.contact | object | Where to write with questions. |
info.contact.email | string | The support email address. |
servers | array of object | Where to send requests. |
servers[].url | string | The base URL; every path is relative to it. |
security | array | How requests are authorized: an API key as a bearer token. |
tags | array of object · not always there | The groups the endpoints are listed in, in order. |
tags[].name | string | The group's name, as each endpoint's tags give it. |
tags[].description | string | What the group is for. |
paths | any | The endpoints open now, by path and method. |
components | any | The schemas, answers and key scheme the paths refer to. |
x-tbf-scopes | array of object · not always there | The scopes open now, in the order the key form lists them. |
x-tbf-scopes[].scope | string | The scope, as a key lists it. |
x-tbf-scopes[].summary | string | What it lets a key do. |
x-tbf-scopes[].default_checked | boolean | Whether the key form ticks it when it opens. |
x-tbf-scopes[].write | boolean | Whether it lets a key make changes. |
x-tbf-rate-limits | object · not always there | The units each account has, shared by all its keys and every endpoint. |
x-tbf-rate-limits.units_per_minute | integer | The units allowed in one minute. |
x-tbf-rate-limits.units_per_day | integer | The units allowed in one UTC day. |
x-tbf-rate-limits.window | string | Fixed windows: each starts again whole, so up to twice the units can be used across the moment one ends. Value: fixed. |
x-tbf-rate-limits.minute_starts | string | When each minute window starts. |
x-tbf-rate-limits.day_starts | string | When each day window starts. |
x-tbf-tracking-limits | object · not always there | The limits on submitting tracking numbers, as set by default; listed while submitting is open. |
x-tbf-tracking-limits.rows_per_request | integer | The most rows one request can send. |
x-tbf-tracking-limits.new_numbers_per_24h | integer | The most numbers new to the account it can submit in any 24 hours, on the website and the API together. |
x-tbf-tracking-limits.kept_for_website | integer | How many of those are kept for the website: the API can use the rest. |
x-tbf-tracking-limits.api_submissions_per_minute | integer | The most submissions through the API in a minute. |
x-tbf-tracking-limits.api_submissions_per_hour | integer | The most submissions through the API in an hour. |
x-tbf-tracking-limits.defaults | boolean | These are the defaults; one account's limits can differ, as a 429's limit and api_limit say. Value: true. |
Example answer
{
"openapi": "3.1.0",
"info": {
"title": "TheBuyerForce Member API",
"version": "2026-11-24",
"description": "Read your own reservations, packages, money, tickets, notifications and the deals you can see, submit tracking numbers, and lower or cancel your reservations, from a script or a server, with an API key you create in Developer Tools. Send the key as Authorization: Bearer <key>; requests from a web page or a browser extension can be refused. Every answer is JSON with a request_id, except the statement CSV (its request id is in the X-Request-Id header) and this document itself; every answer has an X-Request-Id header. A method an endpoint does not accept is answered 405 with an Allow header.",
"termsOfService": "https://www.thebuyerforce.com/terms/api",
"contact": {
"email": "support@thebuyerforce.com"
}
},
"servers": [
{
"url": "https://www.thebuyerforce.com/api/v1"
}
],
"security": [
{
"bearer": []
}
],
"tags": [
{
"name": "account",
"description": "Your account and the key making the request, and this document."
}
],
"paths": {
"/me": {
"get": {
"operationId": "getMe",
"summary": "Your account, your Terms acceptance and this key"
}
}
},
"components": {
"securitySchemes": {
"bearer": {
"type": "http",
"scheme": "bearer"
}
}
},
"x-tbf-scopes": [
{
"scope": "orders:read",
"summary": "Read your reservations, your packages with their delivery status, and the lines of each package.",
"default_checked": true,
"write": false
}
],
"x-tbf-rate-limits": {
"units_per_minute": 30,
"units_per_day": 1000,
"window": "fixed",
"minute_starts": "on the minute (UTC)",
"day_starts": "00:00 UTC"
}
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: it has a query parameter, and this endpoint takes none (invalid_parameter, with param naming it), or a key was sent in the URL (api_key_in_url). Send the request with no query string. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused). Download it from a script or a server instead. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
curl -sS \
"https://www.thebuyerforce.com/api/v1/openapi.json"reservations
Your reservations: list them, read one, lower the spots on one or cancel it. There is no way to make a reservation or add spots.
GET /reservations
Your reservations
Your reservations, newest first by when you reserved, a page at a time. status=active (the default) lists the ones still open: status active, and a delivery deadline that has not passed or is not set. status=all lists every reservation with the status it has now, so one whose delivery deadline has passed reads expired. A reservation on a deal you can no longer see is listed too, with deal null, so this can count more active reservations than the website shows. expand=fulfillments adds the packages credited to each one. group_by=deal answers one entry per deal instead, adding up all your active reservations on one page.
| Parameter | In | Description | Example |
|---|---|---|---|
status | query | active (the default): reservations still open, with status active and a delivery deadline that has not passed or is not set. all: every reservation. | all |
expand | query | fulfillments: add each reservation's fulfillments, the packages credited to it. limit is then at most 100. | fulfillments |
group_by | query | deal: one entry per deal, adding up your active reservations on it, all on one page (next_cursor is null). Send it alone or with status=active: with status=all, expand, cursor or limit it is a 400 naming group_by. | deal |
limit | query | How many reservations a page holds: a whole number from 1 to 500, or to 100 with expand=fulfillments. 100 when left out. A number outside that is a 400, never cut down to fit. | 100 |
cursor | query | The next_cursor of the page before, as it came. Send the same status and expand with it; only limit may change from page to page. A cursor that doesn't fit the request is a 400 invalid_cursor: start again without one. | v1.c2FtcGxlLWN1cnNvcg.c2FtcGxlLXNpZ25hdHVyZQ |
Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | array of one of the shapes below | Reservations, or with group_by=deal one group per deal. [] when there are none. |
| One shape: Reservation | ||
data[].id | string (uuid) | The reservation's id. |
data[].deal_id | string (uuid) | The id of the deal it is on, also when deal is null. |
data[].deal | object or null | The deal, or null when you can no longer see it (a paused deal, say). The reservation is listed either way. |
data[].deal.id | string (uuid) | The deal's id. |
data[].deal.title | string | The deal's title. |
data[].status | string | Where the reservation stands now: active (still open), expired (its delivery deadline has passed, or it was closed as expired), cancelled, or completed. Values: active, expired, cancelled, completed. |
data[].quantity | integer | The units you reserved. |
data[].fulfilled | integer | The units credited to it so far. |
data[].remaining | integer | quantity less fulfilled, never below 0. |
data[].plan | object | The payout plan locked in when you reserved. |
data[].plan.label | string or null | The plan's name, or null when none is on record. |
data[].plan.hold_days | integer or null | The days money credited under this plan is held before it can be paid out, or null when none is on record. |
data[].plan.unit_payout | string or null | What each unit pays when it is credited, as locked in when you reserved, or null when none is on record. Never the deal's price today. |
data[].plan.currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data[].reserved_at | string (date-time) or null | When you reserved, or null when it is not on record. |
data[].modify_deadline | string (date-time) or null | While status is active: until when you can change or cancel the reservation, 24 hours after reserved_at or the deal's expiry, whichever comes first. It is given even once it has passed, so compare it with the time yourself. A change is still checked when you make it. null for any other status, or when reserved_at is not on record. |
data[].delivery_deadline | string (date-time) or null | The delivery deadline: once it passes, the reservation reads expired. null when it has none. |
data[].fulfillments | array of object · not always there | Only with expand=fulfillments, and always on GET /reservations/{id}: the packages credited to this reservation, [] when there are none. |
data[].fulfillments[].order_id | string (uuid) or null | The package's id, as GET /orders gives it, or null when the credit isn't tied to one. |
data[].fulfillments[].tracking_number | string or null | The package's tracking number, or null when it isn't known. |
data[].fulfillments[].upc | string or null | The UPC credited, or null. |
data[].fulfillments[].quantity | integer | The units credited. |
data[].fulfillments[].unit_payout | string | What each unit paid. |
data[].fulfillments[].credited_amount | string | The amount credited. |
data[].fulfillments[].currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data[].fulfillments[].status | string | credited (the money is in your balance), reversed (the credit was taken back), or received (not credited yet). Values: credited, reversed, received. |
data[].fulfillments[].origin | string | How it was credited: warehouse_match (the warehouse received the package and matched it to this reservation), ticket_offer (an offer on a support ticket), or lost_package (a settlement for a package the carrier delivered and the warehouse never received). Values: warehouse_match, ticket_offer, lost_package. |
data[].fulfillments[].credited_at | string (date-time) or null | When it was credited, or null while it is received. |
data[].fulfillments[].received_at | string (date-time) or null | When the warehouse received the package, or null when it isn't a package you can see: a lost_package settlement (never received), or a ticket_offer on a receipt not matched to one of your packages (its tracking_number is null too). |
| One shape: ReservationGroup | ||
data[].deal_id | string (uuid) | The deal's id. |
data[].deal | object or null | The deal, or null when you can no longer see it (a paused deal, say). The reservation is listed either way. |
data[].deal.id | string (uuid) | The deal's id. |
data[].deal.title | string | The deal's title. |
data[].reservation_ids | array of string (uuid) | The reservations in the group, newest first. Read one with GET /reservations/{id}. |
data[].quantity | integer | The units reserved, added up. |
data[].fulfilled | integer | The units credited, added up. |
data[].remaining | integer | The remaining units, added up. |
data[].next_delivery_deadline | string (date-time) or null | The group's earliest delivery deadline, or null when none of them has one. |
| Every answer | ||
next_cursor | string or null | Send it as cursor to get the next page; null on the last page. Always null with group_by=deal. |
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": [
{
"id": "00000000-0000-4000-8000-000000000906",
"deal_id": "00000000-0000-4000-8000-000000000905",
"deal": {
"id": "00000000-0000-4000-8000-000000000905",
"title": "Sample tablet, 64 GB"
},
"status": "active",
"quantity": 4,
"fulfilled": 1,
"remaining": 3,
"plan": {
"label": "Standard",
"hold_days": 14,
"unit_payout": "120.00",
"currency": "USD"
},
"reserved_at": "2026-11-15T17:30:12.345Z",
"modify_deadline": "2026-11-16T17:30:12.345Z",
"delivery_deadline": "2026-11-28T08:00:00.000Z"
}
],
"next_cursor": "v1.c2FtcGxlLWN1cnNvcg.c2FtcGxlLXNpZ25hdHVyZQ",
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter is unknown, repeated, empty or not valid, or a parameter in the path is not valid (invalid_parameter, with param naming it), a cursor is not valid (invalid_cursor), the key was sent in the URL (api_key_in_url), or, for an endpoint that takes a body, the body is not JSON in the shape it takes (invalid_body) or has more rows than it takes (too_many_rows); a field of the body with a value that is not valid can instead be invalid_parameter naming it, where the endpoint's description says so. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 409 | The API Terms changed. Accept the current version in Developer Tools, then send the request again. |
| 429 | This account has used its units for this minute or this UTC day. Wait Retry-After seconds, then try again. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-H "Authorization: Bearer $TBF_API_KEY" \
"https://www.thebuyerforce.com/api/v1/reservations"GET /reservations/{id}
One of your reservations
One reservation by its id, whatever its status, always with its fulfillments: the same entry status=all&expand=fulfillments lists for it. An id that is not a UUID is a 400 invalid_parameter naming id. A UUID that is not one of your reservations is a 404 not_found, the same answer whether it does not exist or is not yours. Takes no query parameters.
| Parameter | In | Description | Example |
|---|---|---|---|
id · required | path | The reservation's id: a UUID, in either case. | 00000000-0000-4000-8000-000000000906 |
Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | object | The reservation, with its fulfillments. |
data.id | string (uuid) | The reservation's id. |
data.deal_id | string (uuid) | The id of the deal it is on, also when deal is null. |
data.deal | object or null | The deal, or null when you can no longer see it (a paused deal, say). The reservation is listed either way. |
data.deal.id | string (uuid) | The deal's id. |
data.deal.title | string | The deal's title. |
data.status | string | Where the reservation stands now: active (still open), expired (its delivery deadline has passed, or it was closed as expired), cancelled, or completed. Values: active, expired, cancelled, completed. |
data.quantity | integer | The units you reserved. |
data.fulfilled | integer | The units credited to it so far. |
data.remaining | integer | quantity less fulfilled, never below 0. |
data.plan | object | The payout plan locked in when you reserved. |
data.plan.label | string or null | The plan's name, or null when none is on record. |
data.plan.hold_days | integer or null | The days money credited under this plan is held before it can be paid out, or null when none is on record. |
data.plan.unit_payout | string or null | What each unit pays when it is credited, as locked in when you reserved, or null when none is on record. Never the deal's price today. |
data.plan.currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data.reserved_at | string (date-time) or null | When you reserved, or null when it is not on record. |
data.modify_deadline | string (date-time) or null | While status is active: until when you can change or cancel the reservation, 24 hours after reserved_at or the deal's expiry, whichever comes first. It is given even once it has passed, so compare it with the time yourself. A change is still checked when you make it. null for any other status, or when reserved_at is not on record. |
data.delivery_deadline | string (date-time) or null | The delivery deadline: once it passes, the reservation reads expired. null when it has none. |
data.fulfillments | array of object | Only with expand=fulfillments, and always on GET /reservations/{id}: the packages credited to this reservation, [] when there are none. |
data.fulfillments[].order_id | string (uuid) or null | The package's id, as GET /orders gives it, or null when the credit isn't tied to one. |
data.fulfillments[].tracking_number | string or null | The package's tracking number, or null when it isn't known. |
data.fulfillments[].upc | string or null | The UPC credited, or null. |
data.fulfillments[].quantity | integer | The units credited. |
data.fulfillments[].unit_payout | string | What each unit paid. |
data.fulfillments[].credited_amount | string | The amount credited. |
data.fulfillments[].currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data.fulfillments[].status | string | credited (the money is in your balance), reversed (the credit was taken back), or received (not credited yet). Values: credited, reversed, received. |
data.fulfillments[].origin | string | How it was credited: warehouse_match (the warehouse received the package and matched it to this reservation), ticket_offer (an offer on a support ticket), or lost_package (a settlement for a package the carrier delivered and the warehouse never received). Values: warehouse_match, ticket_offer, lost_package. |
data.fulfillments[].credited_at | string (date-time) or null | When it was credited, or null while it is received. |
data.fulfillments[].received_at | string (date-time) or null | When the warehouse received the package, or null when it isn't a package you can see: a lost_package settlement (never received), or a ticket_offer on a receipt not matched to one of your packages (its tracking_number is null too). |
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": {
"id": "00000000-0000-4000-8000-000000000906",
"deal_id": "00000000-0000-4000-8000-000000000905",
"deal": {
"id": "00000000-0000-4000-8000-000000000905",
"title": "Sample tablet, 64 GB"
},
"status": "active",
"quantity": 4,
"fulfilled": 1,
"remaining": 3,
"plan": {
"label": "Standard",
"hold_days": 14,
"unit_payout": "120.00",
"currency": "USD"
},
"reserved_at": "2026-11-15T17:30:12.345Z",
"modify_deadline": "2026-11-16T17:30:12.345Z",
"delivery_deadline": "2026-11-28T08:00:00.000Z",
"fulfillments": [
{
"order_id": "00000000-0000-4000-8000-000000000902",
"tracking_number": "9400000000000000000001",
"upc": "012345678905",
"quantity": 1,
"unit_payout": "120.00",
"credited_amount": "120.00",
"currency": "USD",
"status": "credited",
"origin": "warehouse_match",
"credited_at": "2026-11-15T21:04:05.123Z",
"received_at": "2026-11-15T19:40:00.000Z"
}
]
},
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter is unknown, repeated, empty or not valid, or a parameter in the path is not valid (invalid_parameter, with param naming it), a cursor is not valid (invalid_cursor), the key was sent in the URL (api_key_in_url), or, for an endpoint that takes a body, the body is not JSON in the shape it takes (invalid_body) or has more rows than it takes (too_many_rows); a field of the body with a value that is not valid can instead be invalid_parameter naming it, where the endpoint's description says so. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 404 | Nothing of yours has this id: it does not exist, or it is not yours. The two answers are the same (not_found). An id that is not a UUID is a 400 instead. |
| 409 | The API Terms changed. Accept the current version in Developer Tools, then send the request again. |
| 429 | This account has used its units for this minute or this UTC day. Wait Retry-After seconds, then try again. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-H "Authorization: Bearer $TBF_API_KEY" \
"https://www.thebuyerforce.com/api/v1/reservations/00000000-0000-4000-8000-000000000906"POST /reservations/{id}/reduce
Lower one of your reservations
Lower one of your reservations to quantity spots: quantity is the number it keeps, at least 1, not the number taken off. Sending the same quantity again is safe while the reservation can still be changed: the answer is 200 with previous_quantity equal to quantity, and nothing changes. Once its 24 hours are over the same request is a 409 change_window_closed, so do not count on a 200 when you retry. A body that is not a JSON object, or has a key besides quantity, is a 400 invalid_body; a quantity that is missing, or is not a whole number of at least 1, is a 400 invalid_parameter naming quantity. To give the reservation up instead, use POST /reservations/{id}/cancel. Lowering a reservation never counts toward your limit of new reservations. The website's rules apply. A reservation can be changed only in the 24 hours after it was made, and not once its deal has expired (409 change_window_closed, 409 deal_expired). On one payment plan, lower or cancel your newest reservation first: an older one can change only once every newer one on that plan is down to what has been fulfilled (409 newest_spots_first). A reservation never goes below the units already fulfilled (409 below_fulfilled). The API can never add spots or make a reservation: a quantity above what the reservation holds is a 409 quantity_increase_not_allowed, and new reservations are made on the website. A reservation that is no longer held (cancelled or completed, or closed as expired) is a 409 reservation_not_active; one that is not yours, or does not exist, is a 404 not_found. One that GET /reservations lists as expired only because its delivery deadline has passed is still held, and the rules above apply to it: once its 24 hours are over it is a 409 change_window_closed (or deal_expired), not reservation_not_active. Any other refusal is reservation_change_refused with the reason in error, as a 400, 403 or 409. A 503 reservation_lookup_failed changed nothing: wait Retry-After seconds and send it again. After a 503 reservation_change_unconfirmed, a 500 or a timeout, the change may or may not have gone through: read the reservation with GET /reservations/{id} (orders:read) before you send it again. A change sends the same notifications as one made on the website, as your notification settings say. Needs a key with reservations:write; you need orders:read to list your reservations and their ids. Costs 1 unit.
| Parameter | In | Description | Example |
|---|---|---|---|
id · required | path | The reservation's id, as GET /reservations lists it: a UUID, in either case. | 00000000-0000-4000-8000-000000000906 |
Request body
| Field | Type | Description |
|---|---|---|
quantity | integer | The spots the reservation keeps after the change: at least 1, and at most what it holds now. |
{
"quantity": 2
}Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | object | The reservation as it is now. |
data.id | string (uuid) | The reservation's id. |
data.deal_id | string (uuid) or null | The id of the deal it is on. |
data.status | string | Where the reservation stands after the change, as GET /reservations says it: cancelled after a cancel; active after a reduce, or expired when its delivery deadline has passed. Values: active, expired, cancelled. |
data.quantity | integer | The units it holds now: what you asked for, or 0 after a cancel. |
data.fulfilled | integer | The units credited to it so far. |
data.previous_quantity | integer or null | The units it held before this request, or null when that could not be read. Equal to quantity when a reduce asked for what it already held. |
data.reserved_at | string (date-time) or null | When you reserved, or null when it is not on record. |
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": {
"id": "00000000-0000-4000-8000-000000000906",
"deal_id": "00000000-0000-4000-8000-000000000905",
"status": "active",
"quantity": 2,
"fulfilled": 1,
"previous_quantity": 4,
"reserved_at": "2026-11-15T17:30:12.345Z"
},
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter is unknown, repeated, empty or not valid, or a parameter in the path is not valid (invalid_parameter, with param naming it), a cursor is not valid (invalid_cursor), the key was sent in the URL (api_key_in_url), or, for an endpoint that takes a body, the body is not JSON in the shape it takes (invalid_body) or has more rows than it takes (too_many_rows); a field of the body with a value that is not valid can instead be invalid_parameter naming it, where the endpoint's description says so. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 404 | Nothing of yours has this id: it does not exist, or it is not yours. The two answers are the same (not_found). An id that is not a UUID is a 400 instead. |
| 409 | Either the API Terms changed (api_terms_acceptance_required: accept them in Developer Tools), or the reservation could not be changed (ReservationConflict: the code says why, and nothing was changed). |
| 413 | The request body is larger than this endpoint takes (payload_too_large). Send less in one request. |
| 429 | This account has used its units for this minute or this UTC day. Wait Retry-After seconds, then try again. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-X POST \
-H "Authorization: Bearer $TBF_API_KEY" \
-H "Content-Type: application/json" \
-d '{"quantity":2}' \
"https://www.thebuyerforce.com/api/v1/reservations/00000000-0000-4000-8000-000000000906/reduce"POST /reservations/{id}/cancel
Cancel one of your reservations
Cancel one of your reservations. Send no body, or {}. A cancel cannot be undone, and the spots go back to the deal for anyone to reserve. A cancel is not repeatable: sending it again answers 409 reservation_not_active. Each cancel counts toward your 24-hour limit on making new reservations on the website (see Changing reservations in the API documentation); the cancel itself is never refused for that limit. The website's rules apply. A reservation can be changed only in the 24 hours after it was made, and not once its deal has expired (409 change_window_closed, 409 deal_expired). On one payment plan, lower or cancel your newest reservation first: an older one can change only once every newer one on that plan is down to what has been fulfilled (409 newest_spots_first). A reservation never goes below the units already fulfilled (409 below_fulfilled). The API can never add spots or make a reservation: a quantity above what the reservation holds is a 409 quantity_increase_not_allowed, and new reservations are made on the website. A reservation that is no longer held (cancelled or completed, or closed as expired) is a 409 reservation_not_active; one that is not yours, or does not exist, is a 404 not_found. One that GET /reservations lists as expired only because its delivery deadline has passed is still held, and the rules above apply to it: once its 24 hours are over it is a 409 change_window_closed (or deal_expired), not reservation_not_active. Any other refusal is reservation_change_refused with the reason in error, as a 400, 403 or 409. A 503 reservation_lookup_failed changed nothing: wait Retry-After seconds and send it again. After a 503 reservation_change_unconfirmed, a 500 or a timeout, the change may or may not have gone through: read the reservation with GET /reservations/{id} (orders:read) before you send it again. A change sends the same notifications as one made on the website, as your notification settings say. Needs a key with reservations:write; you need orders:read to list your reservations and their ids. Costs 1 unit.
| Parameter | In | Description | Example |
|---|---|---|---|
id · required | path | The reservation's id, as GET /reservations lists it: a UUID, in either case. | 00000000-0000-4000-8000-000000000906 |
Request body (optional)
No fields.
{}Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | object | The reservation as it is now. |
data.id | string (uuid) | The reservation's id. |
data.deal_id | string (uuid) or null | The id of the deal it is on. |
data.status | string | Where the reservation stands after the change, as GET /reservations says it: cancelled after a cancel; active after a reduce, or expired when its delivery deadline has passed. Values: active, expired, cancelled. |
data.quantity | integer | The units it holds now: what you asked for, or 0 after a cancel. |
data.fulfilled | integer | The units credited to it so far. |
data.previous_quantity | integer or null | The units it held before this request, or null when that could not be read. Equal to quantity when a reduce asked for what it already held. |
data.reserved_at | string (date-time) or null | When you reserved, or null when it is not on record. |
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": {
"id": "00000000-0000-4000-8000-000000000906",
"deal_id": "00000000-0000-4000-8000-000000000905",
"status": "cancelled",
"quantity": 0,
"fulfilled": 0,
"previous_quantity": 4,
"reserved_at": "2026-11-15T17:30:12.345Z"
},
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter is unknown, repeated, empty or not valid, or a parameter in the path is not valid (invalid_parameter, with param naming it), a cursor is not valid (invalid_cursor), the key was sent in the URL (api_key_in_url), or, for an endpoint that takes a body, the body is not JSON in the shape it takes (invalid_body) or has more rows than it takes (too_many_rows); a field of the body with a value that is not valid can instead be invalid_parameter naming it, where the endpoint's description says so. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 404 | Nothing of yours has this id: it does not exist, or it is not yours. The two answers are the same (not_found). An id that is not a UUID is a 400 instead. |
| 409 | Either the API Terms changed (api_terms_acceptance_required: accept them in Developer Tools), or the reservation could not be changed (ReservationConflict: the code says why, and nothing was changed). |
| 413 | The request body is larger than this endpoint takes (payload_too_large). Send less in one request. |
| 429 | This account has used its units for this minute or this UTC day. Wait Retry-After seconds, then try again. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-X POST \
-H "Authorization: Bearer $TBF_API_KEY" \
"https://www.thebuyerforce.com/api/v1/reservations/00000000-0000-4000-8000-000000000906/cancel"packages
Your packages, with their delivery status, and the lines of each package.
GET /orders
Your packages
Your packages, one entry per tracking number you submitted, newest submission first, a page at a time: what the warehouse received, what was credited and when that money can be paid out. Filter by status and by when you submitted them. expand=delivery adds what the carrier says about each package still pending. A package submitted while you page through does not show up in that pass: start again from the first page to see it.
| Parameter | In | Description | Example |
|---|---|---|---|
status | query | Only packages in these statuses, separated by commas (status=pending,approved), each once. all, on its own, is the same as leaving status out. | pending,approved |
submitted_from | query | Only packages submitted at or after this time: a date and time with a time zone, such as 2026-11-01T07:00:00Z or 2026-11-01T00:00:00-07:00 (send a + in the time zone as %2B), with up to 9 decimals; decimals past the millisecond are cut. A date alone is a 400. | 2026-11-01T07:00:00Z |
submitted_to | query | Only packages submitted before this time, written as submitted_from (decimals past the millisecond are cut). With both, submitted_from must be earlier, or the answer is a 400 naming submitted_to. | 2026-12-01T08:00:00Z |
limit | query | How many packages a page holds: a whole number from 1 to 1000, 100 when left out. A number outside that is a 400, never cut down to fit. | 1000 |
expand | query | delivery: add each package's delivery, what the carrier says about it. Only packages still pending have one; it is null for the rest. | delivery |
cursor | query | The next_cursor of the page before, as it came. Send the same status, submitted_from, submitted_to and expand with it; only limit may change from page to page. A cursor that doesn't fit the request is a 400 invalid_cursor: start again without one. | v1.c2FtcGxlLWN1cnNvcg.c2FtcGxlLXNpZ25hdHVyZQ |
Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | array of object | Packages. [] when there are none. |
data[].id | string (uuid) | The package's id. |
data[].tracking_number | string | The tracking number as it is stored on the package, which can differ from what was sent: a number added now is stored upper case, without spaces, and without the wrapper some carriers print around the number (a USPS label's 420 and ZIP code); an older package keeps the form it was stored in then. To match a package with your own records, use its id. |
data[].status | string | pending (submitted, not received yet), under_review (on hold, not credited yet), approved (received and matched, not credited yet), credited, settled_lost (delivered by the carrier, never received by the warehouse, and credited as a lost package), returned (sent back; one returned in part keeps what was credited), rejected or failed. Values: pending, under_review, approved, credited, rejected, returned, failed, settled_lost. |
data[].quantity | integer | The units on the package: the number you submitted until it is credited, then the number credited. qty_received is what the warehouse counted. |
data[].submitted_at | string (date-time) or null | When you submitted it, or null when it is not on record. |
data[].received_at | string (date-time) or null | When the warehouse first received units on this tracking number, or null before then. |
data[].qty_received | integer | The units the warehouse received on this tracking number, 0 before any. |
data[].upcs | array of string | The UPCs received on it, each once ([] when the units received carry none). Before anything is received, the UPC you submitted, if it was one. [] when none is known. |
data[].credited_amount | string or null | What the package was credited, when its status is credited, settled_lost or returned and an amount was credited. null otherwise. |
data[].currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data[].available_at | string (date-time) or null | When the last of the money credited for it can be paid out, or null when nothing was credited. |
data[].payout_state | string | none (available_at is null), holding (available_at is still ahead) or available (it has come). One credit still held makes it holding. Values: none, holding, available. |
data[].delivery | object or null · not always there | Only with expand=delivery: what the carrier says about it, for a package still pending. null for any other status, and when the carrier has told us nothing to go on. |
data[].delivery.verdict | string | in_transit (on its way), queued (delivered, and the warehouse is within its usual time to receive it), overdue (delivered longer ago than the warehouse usually takes), stalled (the carrier has not moved it for some days), or amazon_account (Amazon shows this package only to the buyer: look it up in your Amazon account). Values: in_transit, queued, overdue, stalled, amazon_account. |
data[].delivery.delivered_pt_date | string (date) or null | queued or overdue: the Pacific date the carrier delivered it. null otherwise. |
data[].delivery.days_since_delivered | integer or null | queued or overdue: whole Pacific days since delivery, 0 on the day itself. stalled: days since the carrier last moved it. null otherwise. |
data[].delivery.last_checked_at | string (date-time) or null | When we last asked the carrier, or null. |
data[].delivery.delivery_location | string or null | queued or overdue: where the carrier says it left the package. null otherwise. |
data[].delivery.stall_category | string or null | stalled only: label_only (the carrier has a label but never got the package) or undeliverable (the carrier says it cannot deliver it), both for you to take up with the retailer; near_warehouse (it stopped at or near the warehouse) or in_network (it stopped on the way), which nearly always move again by themselves. null otherwise. Values: label_only, undeliverable, near_warehouse, in_network. |
data[].delivery.same_delivery | string or null | queued or overdue, once another package from the same carrier delivery has been received: scanning (the warehouse is still receiving that delivery) or stopped (it seems done). null otherwise, which does not mean nothing was received. Values: scanning, stopped. |
data[].delivery.guarantee | object or null | queued or overdue: the Guarantee, when it covers this package. null otherwise. |
data[].delivery.guarantee.cap_amount | string | The most it pays for this package. |
data[].delivery.guarantee.currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data[].delivery.guarantee.missing_pt_date | string (date) | The Pacific date 14 days after delivery: from this day, a package the warehouse still has not received counts as missing. |
data[].delivery.guarantee.claim_by_pt_date | string (date) | The Pacific date 90 days after delivery: the last day to make a claim. The whole day counts, until 23:59 Pacific time. |
data[].delivery.guarantee.stage | string | before_day_14 (missing_pt_date is still ahead) or from_day_14 (it has come). Values: before_day_14, from_day_14. |
data[].delivery.fedex_new_castle | boolean | true when the one reason this package has no Guarantee is that FedEx delivered it to the New Castle, DE warehouse (Terms of Service Section 6.3(f)(3)). false otherwise. |
next_cursor | string or null | Send it as cursor to get the next page; null on the last page. |
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": [
{
"id": "00000000-0000-4000-8000-000000000912",
"tracking_number": "1Z999AA10123456793",
"status": "pending",
"quantity": 2,
"submitted_at": "2026-11-12T16:20:00.000Z",
"received_at": null,
"qty_received": 0,
"upcs": [
"012345678905"
],
"credited_amount": null,
"currency": "USD",
"available_at": null,
"payout_state": "none",
"delivery": {
"verdict": "queued",
"delivered_pt_date": "2026-11-14",
"days_since_delivered": 1,
"last_checked_at": "2026-11-15T18:00:00.000Z",
"delivery_location": "Dock",
"stall_category": null,
"same_delivery": "scanning",
"guarantee": null,
"fedex_new_castle": false
}
},
{
"id": "00000000-0000-4000-8000-000000000902",
"tracking_number": "9400000000000000000001",
"status": "credited",
"quantity": 1,
"submitted_at": "2026-11-10T15:00:00.000Z",
"received_at": "2026-11-15T19:40:00.000Z",
"qty_received": 1,
"upcs": [
"012345678905"
],
"credited_amount": "120.00",
"currency": "USD",
"available_at": "2026-11-29T21:04:05.123Z",
"payout_state": "holding",
"delivery": null
}
],
"next_cursor": "v1.c2FtcGxlLWN1cnNvcg.c2FtcGxlLXNpZ25hdHVyZQ",
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter is unknown, repeated, empty or not valid, or a parameter in the path is not valid (invalid_parameter, with param naming it), a cursor is not valid (invalid_cursor), the key was sent in the URL (api_key_in_url), or, for an endpoint that takes a body, the body is not JSON in the shape it takes (invalid_body) or has more rows than it takes (too_many_rows); a field of the body with a value that is not valid can instead be invalid_parameter naming it, where the endpoint's description says so. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 409 | The API Terms changed. Accept the current version in Developer Tools, then send the request again. |
| 429 | This account has used its units for this minute or this UTC day. Wait Retry-After seconds, then try again. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-H "Authorization: Bearer $TBF_API_KEY" \
"https://www.thebuyerforce.com/api/v1/orders"GET /orders/lines
The lines of your packages
The packages you name by id (the ids GET /orders gives), each split into lines as the CSV export on your orders page splits it: by UPC, then one line per payout plan or offer, each with its amount. A package not received yet, or received and not credited, is one line. Send up to 300 ids in one request; each is answered once, in the order you sent them, and every id is answered in this one answer (next_cursor is always null). The cost is one unit for each 100 ids sent, rounded up, and at least one. An id that is not one of your packages is answered not_found, whether it does not exist or is not yours. A 503 means nothing was answered: send the request again, with fewer ids if it keeps happening.
| Parameter | In | Description | Example |
|---|---|---|---|
order_ids · required | query | The packages' ids, separated by commas (order_ids=<id>,<id>): from 1 to 300 UUIDs, in either case. An id sent twice is answered once. More ids than that, an empty entry, or anything that is not a UUID is a 400 naming order_ids; so is any other query parameter (there is no cursor or limit). | 00000000-0000-4000-8000-000000000902,00000000-0000-4000-8000-000000000913 |
Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | array of object | One result for each id you sent, in the order you sent them. |
data[].order_id | string (uuid) | An id you sent, in lower case. |
data[].result | string | ok (its lines are here); not_found (no package of yours has this id: it does not exist, or it is not yours, and the two read the same); or unsupported_tracking (its tracking number has characters this endpoint cannot look up: lines is [], so export that package from the orders page instead). Values: ok, not_found, unsupported_tracking. |
data[].tracking_number | string or null | The tracking number as it is stored on the package, which can differ from the number submitted for it: a number added now is stored upper case, without spaces, and without the wrapper some carriers print around the number (a USPS label's 420 and ZIP code); an older package keeps the form it was stored in then. To match a package with your own records, use order_id. null for not_found. |
data[].status | string or null | The package's status, as GET /orders gives it. null for not_found. Values: pending, under_review, approved, credited, rejected, returned, failed, settled_lost. |
data[].credited_amount | string or null | What the package was credited, the same value GET /orders gives for it: only when its status is credited, settled_lost or returned. null otherwise. |
data[].lines_total | string or null | Its lines' line_amount added up: the package's Σ Line Amount in the orders page's CSV export. null when no line has an amount. For a credited or settled_lost package it is normally credited_amount; after a return in part, or a credit taken back, the two can differ. For what the package was credited, read credited_amount. |
data[].currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data[].lines | array of object | The lines, by UPC and then by plan or offer. [] for not_found and unsupported_tracking. A package not received yet, or received and not credited, has one line with its status. |
data[].lines[].upc | string or null | The UPC of this line, or null when none was recorded for it. |
data[].lines[].product | string or null | The product's name as your orders page shows it, or null when it has none yet. |
data[].lines[].line_status | string | The line's status: the package's, except that on a package returned in part a line whose credit stands reads credited. Values: pending, under_review, approved, credited, rejected, returned, failed, settled_lost. |
data[].lines[].qty_received | integer or null | The units of this UPC the warehouse received on the package, or null when not known. When one UPC came in at two warehouses, the count of one of them, the same on both of its lines. |
data[].lines[].line_type | string or null | plan (credited under a payout plan), offer (a support ticket offer you accepted), offer_pending (an offer not answered yet: shown, not credited), or null on a line with nothing credited yet. Values: plan, offer, offer_pending. |
data[].lines[].plan_label | string or null | The payout plan's name (Offer for an offer without one), or null. |
data[].lines[].hold_days | integer or null | The days the money of this line is held before it can be paid out, or null on a line with nothing credited yet. |
data[].lines[].payout_state | string | pending (an offer not answered yet), holding (still held), available (it can be paid out), or none (nothing to pay out yet, or the package's status is not one that pays out). Values: none, pending, holding, available. |
data[].lines[].available_at | string (date-time) or null | When the money of this line unlocks: the same instant as Unlocks At in the orders page's CSV export. While some of it is still held, the soonest time money of this line still held can be paid out; once none is, when the last of it could. So it is the time of a holding or available line, and it can also be set while payout_state is none (the package's status is not one that pays out). null when the line has no such time: an offer not answered yet, a line with nothing credited yet, or none on record. Not the package's available_at on GET /orders, which is always the last of the whole package. |
data[].lines[].unit_payout | string or null | What each unit of this line pays, to the cent, or null when not known. |
data[].lines[].quantity | integer or null | The line's units: those credited, or a pending offer's. null when not known. |
data[].lines[].line_amount | string or null | The line's amount, to the cent: its Line Amount in the orders page's CSV export. null for a pending offer, and when nothing is known. |
data[].lines[].currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data[].lines[].offer_status | string or null | The offer on this UPC, the same on each of its lines: accepted, pending (not answered yet), return_requested, other, or null when there is none. Values: accepted, pending, return_requested, other. |
next_cursor | string or null | Always null: every id is answered at once. |
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": [
{
"order_id": "00000000-0000-4000-8000-000000000902",
"result": "ok",
"tracking_number": "9400000000000000000001",
"status": "credited",
"credited_amount": "120.00",
"lines_total": "120.00",
"currency": "USD",
"lines": [
{
"upc": "012345678905",
"product": "Sample tablet, 64 GB",
"line_status": "credited",
"qty_received": 1,
"line_type": "plan",
"plan_label": "Standard",
"hold_days": 14,
"payout_state": "holding",
"available_at": "2026-11-29T21:04:05.123Z",
"unit_payout": "120.00",
"quantity": 1,
"line_amount": "120.00",
"currency": "USD",
"offer_status": null
}
]
},
{
"order_id": "00000000-0000-4000-8000-000000000913",
"result": "not_found",
"tracking_number": null,
"status": null,
"credited_amount": null,
"lines_total": null,
"currency": "USD",
"lines": []
}
],
"next_cursor": null,
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter is unknown, repeated, empty or not valid, or a parameter in the path is not valid (invalid_parameter, with param naming it), a cursor is not valid (invalid_cursor), the key was sent in the URL (api_key_in_url), or, for an endpoint that takes a body, the body is not JSON in the shape it takes (invalid_body) or has more rows than it takes (too_many_rows); a field of the body with a value that is not valid can instead be invalid_parameter naming it, where the endpoint's description says so. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 409 | The API Terms changed. Accept the current version in Developer Tools, then send the request again. |
| 429 | This account has used its units for this minute or this UTC day. Wait Retry-After seconds, then try again. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-H "Authorization: Bearer $TBF_API_KEY" \
"https://www.thebuyerforce.com/api/v1/orders/lines?order_ids=00000000-0000-4000-8000-000000000902%2C00000000-0000-4000-8000-000000000913"money
Your balance history, month by month, and your monthly statements.
GET /balance/entries
A month of your balance entries
Every entry that moved your balance in one Pacific month, oldest first, with the month's totals; on the first page, today's balance, available, holding and pending payouts too. For a month whose statement is out (state issued) the entries are its lines, final. The current month (open) and a month that has ended without its statement yet (preparing) are as they stand now: a credit can still land in the middle of the list, so to reconcile a month read it again from the first page, and treat the issued statement as the final word. Pages are built from the whole month each time: the default limit of 500 takes most months in one page. Send the same month and kind with each cursor (sent or left out, as on the first page); only cursor and limit may change. To change kind, start again from the first page. If the month's statement is issued between two of your pages, the next one answers 409 cursor_stale: start again from the first page. A busy account's month can now and then take too long to read: the answer is then a 503, never part of a month. Wait a little and try again. For an issued month whose statement doesn't add up to its header, the answer is a 500 statement_inconsistent: asking again won't change it, so contact support.
| Parameter | In | Description | Example |
|---|---|---|---|
month | query | The Pacific month, written YYYY-MM, such as 2026-11. The current Pacific month when left out. A month after the current one is a 400; one before your first month answers state none, with no entries. | 2026-10 |
kind | query | Only entries of these kinds, separated by commas (kind=credit,fee), each once: credit (credits and bonuses), fee, adjustment, payout (payouts and payouts returned). Every kind when left out. totals and entry_count are the whole month's either way. | credit,fee |
limit | query | How many entries a page holds: a whole number from 1 to 1000, 500 when left out. A number outside that is a 400, never cut down to fit. | 500 |
cursor | query | The next_cursor of the page before, as it came. Send the same month and kind with it; only limit may change from page to page. A cursor that doesn't fit the request is a 400 invalid_cursor: start again without one. | v1.c2FtcGxlLWN1cnNvcg.c2FtcGxlLXNpZ25hdHVyZQ |
Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | object | The month: its totals and a page of its entries. |
data.month | string | The Pacific month, YYYY-MM. |
data.state | string | issued (its statement is out: these are the statement's lines, final), open (the current month, as it stands now), preparing (the month has ended and its statement is not out yet: the entries as they stand), or none (before your first month: no entries). Values: issued, open, preparing, none. |
data.generated_at | string (date-time) | When this answer was put together. |
data.currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data.statement | object or null | When state is issued, the statement: its id, its number as the statement shows it, its version and when it was issued. null otherwise. |
data.statement.id | string (uuid) | The statement's id. |
data.statement.number | string | Its number, as the statement and its CSV print it. |
data.statement.version | integer | Its version: 1, or more once it has been revised. |
data.statement.issued_at | string (date-time) | When this version was issued. |
data.opening | string or null | When state is issued, the statement's opening balance; null otherwise. |
data.closing | string or null | When state is issued, the statement's closing balance; null otherwise. |
data.totals | object | The month's totals by type. |
data.totals.credits | string | The credits added up. |
data.totals.bonuses | string | The bonuses added up. |
data.totals.fees | string | The fees added up (negative). |
data.totals.adjustments | string | The adjustments added up. |
data.totals.payouts | string | The payouts added up (negative). |
data.totals.payouts_returned | string | The payouts the bank sent back, added up. |
data.totals.currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data.entry_count | integer | How many entries the whole month has, whatever kind= asks for. |
data.summary | object or null | Today's figures, on the first page only (no cursor); null on the pages after it. |
data.summary.balance | string | Your balance now. |
data.summary.available | string | What you can request as a payout now: after holds and payouts in progress. |
data.summary.holding | string | Credits still on hold. |
data.summary.pending_payouts | string | Payouts requested and not completed yet: balance less holding less available. |
data.summary.currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data.entries | array of object | This page of entries, oldest first. [] when there are none (or none of the kinds asked for). |
data.entries[].entry_key | string | This entry's key: the same before and after its month's statement is issued, so you can use it to tell entries apart. It is not a UUID and its format can change: don't parse it. To link an entry to a package, a credit or a payout, use order_id, payment_id or payout_id. |
data.entries[].line_no | integer or null | Its line on the month's statement, 1 to line_count, once the statement is issued. null before then. |
data.entries[].occurred_at | string (date-time) | When it moved your balance. Entries are in order in the list: several can share one millisecond, so keep the list order (and line_no), not this time. |
data.entries[].occurred_pt_date | string (date) | The Pacific date it moved your balance: the Date column of the statement CSV. |
data.entries[].time_known | boolean | false when only the date is known (a statement correction): then use occurred_pt_date and leave the time aside. |
data.entries[].kind | string | The group kind= filters on: credit (credits and bonuses), fee, adjustment, or payout (payouts and payouts returned by the bank). Values: credit, fee, adjustment, payout. |
data.entries[].type | string | What it is, one for each Type the statement CSV shows: credit, bonus, fee, adjustment, payout, or payout_returned (a payout the bank sent back). Values: credit, bonus, fee, adjustment, payout, payout_returned. |
data.entries[].amount | string | What it added to your balance (negative for what it took away). |
data.entries[].currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data.entries[].title | string | What it is, in words, as the website and the statement show it. |
data.entries[].detail | string or null | A line more, as the website shows it (the last four characters of a package's tracking number, say), or null. |
data.entries[].order_id | string (uuid) or null | For a credit, the package it was for, as GET /orders gives its id; null for every other type, and for a credit with no package. |
data.entries[].payment_id | string (uuid) or null | The credit, bonus, fee or adjustment behind it, the adjustment that recorded a payout the bank sent back included; null for a payout, for a payout returned without such an adjustment, and for a statement correction. It stays the same once the statement is issued. |
data.entries[].payout_id | string (uuid) or null | The payout behind it (a payout, or a payout returned by the bank); null otherwise. One exception: when an adjustment recorded the return (payment_id is then set), payout_id names the payout only until the month's statement is issued, and is null on the issued line. To keep such a return linked, use payment_id. |
next_cursor | string or null | Send it as cursor to get the next page; null on the last page. |
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": {
"month": "2026-11",
"state": "open",
"generated_at": "2026-11-16T20:15:02.123Z",
"currency": "USD",
"statement": null,
"opening": null,
"closing": null,
"totals": {
"credits": "1130.01",
"bonuses": "0.00",
"fees": "-0.01",
"adjustments": "0.00",
"payouts": "-1000.00",
"payouts_returned": "0.00",
"currency": "USD"
},
"entry_count": 42,
"summary": {
"balance": "250.00",
"available": "130.00",
"holding": "120.00",
"pending_payouts": "0.00",
"currency": "USD"
},
"entries": [
{
"entry_key": "payment:00000000-0000-4000-8000-000000000901",
"line_no": null,
"occurred_at": "2026-11-15T21:04:05.123Z",
"occurred_pt_date": "2026-11-15",
"time_known": true,
"kind": "credit",
"type": "credit",
"amount": "120.00",
"currency": "USD",
"title": "Package checked in",
"detail": "Tracking ••0001",
"order_id": "00000000-0000-4000-8000-000000000902",
"payment_id": "00000000-0000-4000-8000-000000000901",
"payout_id": null
}
]
},
"next_cursor": "v1.c2FtcGxlLWN1cnNvcg.c2FtcGxlLXNpZ25hdHVyZQ",
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter is unknown, repeated, empty or not valid, or a parameter in the path is not valid (invalid_parameter, with param naming it), a cursor is not valid (invalid_cursor), the key was sent in the URL (api_key_in_url), or, for an endpoint that takes a body, the body is not JSON in the shape it takes (invalid_body) or has more rows than it takes (too_many_rows); a field of the body with a value that is not valid can instead be invalid_parameter naming it, where the endpoint's description says so. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 409 | Either the API Terms changed (api_terms_acceptance_required: accept them in Developer Tools, then send the request again), or this month's statement was issued while you were paging (cursor_stale: start again from the first page). |
| 429 | This account has used its units for this minute or this UTC day. Wait Retry-After seconds, then try again. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-H "Authorization: Bearer $TBF_API_KEY" \
"https://www.thebuyerforce.com/api/v1/balance/entries"GET /statements
Your monthly statements
Every month with a statement issued, newest month first, with its current version and every version. A statement is issued after its month ends. All on one page: next_cursor is always null. No statements yet is data []. Takes no query parameters.
No query parameters.
Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | array of object | One entry per month with a statement, newest first. [] when there are none. |
data[].month | string | The Pacific month, YYYY-MM. |
data[].number | string | The current version's number, as the statement and its CSV print it. |
data[].version | integer | The current version. |
data[].issued_at | string (date-time) | When the current version was issued. |
data[].line_count | integer | How many lines the current version has. |
data[].revised | boolean | true when the month has more than one version. |
data[].versions | array of object | Every version, oldest first. |
data[].versions[].version | integer | The version: 1, then 2 and on for each revision. |
data[].versions[].issued_at | string (date-time) | When it was issued. |
data[].versions[].line_count | integer | How many lines it has. |
next_cursor | string or null | Always null: every statement is on one page. |
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": [
{
"month": "2026-10",
"number": "S-2026-10-00000000",
"version": 1,
"issued_at": "2026-11-01T11:00:04.123Z",
"line_count": 1,
"revised": false,
"versions": [
{
"version": 1,
"issued_at": "2026-11-01T11:00:04.123Z",
"line_count": 1
}
]
},
{
"month": "2026-09",
"number": "S-2026-09-5e6f7a8b",
"version": 2,
"issued_at": "2026-10-03T18:00:00.500Z",
"line_count": 118,
"revised": true,
"versions": [
{
"version": 1,
"issued_at": "2026-10-01T11:00:04.123Z",
"line_count": 117
},
{
"version": 2,
"issued_at": "2026-10-03T18:00:00.500Z",
"line_count": 118
}
]
}
],
"next_cursor": null,
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter is unknown, repeated, empty or not valid, or a parameter in the path is not valid (invalid_parameter, with param naming it), a cursor is not valid (invalid_cursor), the key was sent in the URL (api_key_in_url), or, for an endpoint that takes a body, the body is not JSON in the shape it takes (invalid_body) or has more rows than it takes (too_many_rows); a field of the body with a value that is not valid can instead be invalid_parameter naming it, where the endpoint's description says so. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 409 | The API Terms changed. Accept the current version in Developer Tools, then send the request again. |
| 429 | This account has used its units for this minute or this UTC day. Wait Retry-After seconds, then try again. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-H "Authorization: Bearer $TBF_API_KEY" \
"https://www.thebuyerforce.com/api/v1/statements"GET /statements/{month}
One monthly statement, as JSON or CSV
One month's statement: its current version, or the version you ask for. format=json (the default) answers its header and every line; format=csv answers the very file the website downloads, byte for byte, with no JSON around it: the request id is then only in the X-Request-Id header, and the file comes with Content-Disposition: attachment and its file name. A month with no statement (the current month, one that has ended without its statement yet, one before your first month) or a version it does not have is a 404 statement_not_found. A statement whose lines don't add up to its header is a 500 statement_inconsistent: asking again won't change it, so contact support. A busy account can now and then get a 503: wait a little and try again.
| Parameter | In | Description | Example |
|---|---|---|---|
month · required | path | The Pacific month, written YYYY-MM. Anything else is a 400 invalid_parameter naming month. | 2026-10 |
version | query | Which version: a whole number from 1 to 999999. The month's current version when left out. | 1 |
format | query | json (the default): the statement as JSON. csv: the statement CSV, as the website downloads it. | csv |
Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | object | The statement. |
data.month | string | The Pacific month, YYYY-MM. |
data.number | string | This version's number, as the statement and its CSV print it. |
data.version | integer | The version answered. |
data.current_version | integer | The month's current version: the same as version unless you asked for an older one. |
data.issued_at | string (date-time) | When this version was issued. |
data.revision | object or null | For a version that replaced an earlier one: why, and when the one it replaced was issued. null for a first version. |
data.revision.reason | string or null | The reason given with the revision, as the website shows it, or null. |
data.revision.replaces_issued_at | string (date-time) or null | When the version it replaced was issued. |
data.opening | string | The opening balance: the previous statement's closing balance. |
data.closing | string | The closing balance: opening plus every line. |
data.totals | object | The month's totals by type. |
data.totals.credits | string | The credits added up. |
data.totals.bonuses | string | The bonuses added up. |
data.totals.fees | string | The fees added up (negative). |
data.totals.adjustments | string | The adjustments added up. |
data.totals.payouts | string | The payouts added up (negative). |
data.totals.payouts_returned | string | The payouts the bank sent back, added up. |
data.totals.currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data.line_count | integer | How many lines it has. |
data.currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data.versions | array of object | Every version of the month's statement, oldest first. |
data.versions[].version | integer | The version: 1, then 2 and on for each revision. |
data.versions[].issued_at | string (date-time) | When it was issued. |
data.versions[].line_count | integer | How many lines it has. |
data.lines | array of object | Every line, by line_no: the same entries GET /balance/entries answers for an issued month, the same rows the CSV has. |
data.lines[].entry_key | string | This entry's key: the same before and after its month's statement is issued, so you can use it to tell entries apart. It is not a UUID and its format can change: don't parse it. To link an entry to a package, a credit or a payout, use order_id, payment_id or payout_id. |
data.lines[].line_no | integer or null | Its line on the month's statement, 1 to line_count, once the statement is issued. null before then. |
data.lines[].occurred_at | string (date-time) | When it moved your balance. Entries are in order in the list: several can share one millisecond, so keep the list order (and line_no), not this time. |
data.lines[].occurred_pt_date | string (date) | The Pacific date it moved your balance: the Date column of the statement CSV. |
data.lines[].time_known | boolean | false when only the date is known (a statement correction): then use occurred_pt_date and leave the time aside. |
data.lines[].kind | string | The group kind= filters on: credit (credits and bonuses), fee, adjustment, or payout (payouts and payouts returned by the bank). Values: credit, fee, adjustment, payout. |
data.lines[].type | string | What it is, one for each Type the statement CSV shows: credit, bonus, fee, adjustment, payout, or payout_returned (a payout the bank sent back). Values: credit, bonus, fee, adjustment, payout, payout_returned. |
data.lines[].amount | string | What it added to your balance (negative for what it took away). |
data.lines[].currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data.lines[].title | string | What it is, in words, as the website and the statement show it. |
data.lines[].detail | string or null | A line more, as the website shows it (the last four characters of a package's tracking number, say), or null. |
data.lines[].order_id | string (uuid) or null | For a credit, the package it was for, as GET /orders gives its id; null for every other type, and for a credit with no package. |
data.lines[].payment_id | string (uuid) or null | The credit, bonus, fee or adjustment behind it, the adjustment that recorded a payout the bank sent back included; null for a payout, for a payout returned without such an adjustment, and for a statement correction. It stays the same once the statement is issued. |
data.lines[].payout_id | string (uuid) or null | The payout behind it (a payout, or a payout returned by the bank); null otherwise. One exception: when an adjustment recorded the return (payment_id is then set), payout_id names the payout only until the month's statement is issued, and is null on the issued line. To keep such a return linked, use payment_id. |
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": {
"month": "2026-10",
"number": "S-2026-10-00000000",
"version": 1,
"current_version": 1,
"issued_at": "2026-11-01T11:00:04.123Z",
"revision": null,
"opening": "0.00",
"closing": "120.00",
"totals": {
"credits": "120.00",
"bonuses": "0.00",
"fees": "0.00",
"adjustments": "0.00",
"payouts": "0.00",
"payouts_returned": "0.00",
"currency": "USD"
},
"line_count": 1,
"currency": "USD",
"versions": [
{
"version": 1,
"issued_at": "2026-11-01T11:00:04.123Z",
"line_count": 1
}
],
"lines": [
{
"entry_key": "payment:00000000-0000-4000-8000-000000000919",
"line_no": 1,
"occurred_at": "2026-10-20T18:04:05.123Z",
"occurred_pt_date": "2026-10-20",
"time_known": true,
"kind": "credit",
"type": "credit",
"amount": "120.00",
"currency": "USD",
"title": "Package checked in",
"detail": "Tracking ••4039",
"order_id": "00000000-0000-4000-8000-000000000918",
"payment_id": "00000000-0000-4000-8000-000000000919",
"payout_id": null
}
]
},
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter is unknown, repeated, empty or not valid, or a parameter in the path is not valid (invalid_parameter, with param naming it), a cursor is not valid (invalid_cursor), the key was sent in the URL (api_key_in_url), or, for an endpoint that takes a body, the body is not JSON in the shape it takes (invalid_body) or has more rows than it takes (too_many_rows); a field of the body with a value that is not valid can instead be invalid_parameter naming it, where the endpoint's description says so. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 404 | No statement for this month, or no such version (statement_not_found). Statements are issued after a month ends. |
| 409 | The API Terms changed. Accept the current version in Developer Tools, then send the request again. |
| 429 | This account has used its units for this minute or this UTC day. Wait Retry-After seconds, then try again. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-H "Authorization: Bearer $TBF_API_KEY" \
"https://www.thebuyerforce.com/api/v1/statements/2026-10"curl -sS \
-H "Authorization: Bearer $TBF_API_KEY" \
-o statement.csv \
"https://www.thebuyerforce.com/api/v1/statements/2026-10?format=csv"tickets
Your support tickets and their messages.
GET /tickets
Your support tickets
Your support tickets, newest first by when they were opened, a page at a time: archived=false (the default) lists the ones still open, archived=true the resolved and closed ones. The order is by when a ticket was opened, not by its latest message, so it stays put while you page through. For the ones with news, sort by last_message_at yourself, or look at unread_count. Reading tickets or notifications through the API doesn't mark anything as read.
| Parameter | In | Description | Example |
|---|---|---|---|
archived | query | false (the default): tickets still open. true: resolved and closed tickets. | true |
limit | query | How many tickets a page holds: a whole number from 1 to 100, 50 when left out. A number outside that is a 400, never cut down to fit. | 50 |
cursor | query | The next_cursor of the page before, as it came. Send the same archived with it; only limit may change from page to page. A cursor that doesn't fit the request is a 400 invalid_cursor: start again without one. | v1.c2FtcGxlLWN1cnNvcg.c2FtcGxlLXNpZ25hdHVyZQ |
Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | array of object | Tickets. [] when there are none. |
data[].id | string (uuid) | The ticket's id. Read the whole ticket with GET /tickets/{id}. |
data[].ticket_number | string | The ticket's number, as the website shows it. |
data[].subject | string | The ticket's subject. |
data[].kind | string | exception: opened for a package the warehouse received with a problem (tracking_number and upc say which); support: a ticket you opened. Values: exception, support. |
data[].status | string | open, in_progress, waiting_user (waiting on you), waiting_admin (waiting on our support team), resolved or closed. Treat a value not listed here as other. |
data[].priority | string or null | low, normal, high or urgent; null on an older ticket that has none. Treat a value not listed here as other. |
data[].tracking_number | string or null | An exception ticket's tracking number; null on a support ticket. |
data[].upc | string or null | An exception ticket's UPC; null when there is none. |
data[].last_message_preview | string or null | The latest message as the website lists it (a notice without its "SYSTEM:" prefix, **bold** as plain text), at most 500 characters; null when there is none. An exception ticket's opening message comes without its Notes paragraph, as in the thread. |
data[].last_message_at | string (date-time) or null | When the latest message was sent, or null. |
data[].unread_count | integer | Our replies you haven't opened on the website yet. Reading tickets or notifications through the API doesn't mark anything as read. It goes back to 0 once you open the ticket on the website. |
data[].created_at | string (date-time) | When the ticket was opened. The list is ordered by it, newest first. |
next_cursor | string or null | Send it as cursor to get the next page; null on the last page. |
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": [
{
"id": "00000000-0000-4000-8000-000000000907",
"ticket_number": "TKT-20261114-0007",
"subject": "Inbound exception",
"kind": "exception",
"status": "waiting_user",
"priority": "normal",
"tracking_number": "9400000000000000000003",
"upc": "012345678905",
"last_message_preview": "An offer with 2 payout options has been made for your inbound item(s) (2 units). Choose the terms that suit you, or request a return.",
"last_message_at": "2026-11-15T18:20:00.000Z",
"unread_count": 1,
"created_at": "2026-11-14T16:05:00.000Z"
}
],
"next_cursor": null,
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter is unknown, repeated, empty or not valid, or a parameter in the path is not valid (invalid_parameter, with param naming it), a cursor is not valid (invalid_cursor), the key was sent in the URL (api_key_in_url), or, for an endpoint that takes a body, the body is not JSON in the shape it takes (invalid_body) or has more rows than it takes (too_many_rows); a field of the body with a value that is not valid can instead be invalid_parameter naming it, where the endpoint's description says so. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 409 | The API Terms changed. Accept the current version in Developer Tools, then send the request again. |
| 429 | This account has used its units for this minute or this UTC day. Wait Retry-After seconds, then try again. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-H "Authorization: Bearer $TBF_API_KEY" \
"https://www.thebuyerforce.com/api/v1/tickets"GET /tickets/{id}
One of your support tickets
One ticket by its id, with its messages, oldest first, and its offer. A message says whether you, our support team or the platform wrote it, never who. Files sent with a message are described, not linked: open them on the website. An id that is not a UUID is a 400 invalid_parameter naming id. A UUID that is not one of your tickets is a 404 not_found, the same answer whether it does not exist or is not yours. Takes no query parameters. Reading tickets or notifications through the API doesn't mark anything as read.
| Parameter | In | Description | Example |
|---|---|---|---|
id · required | path | The ticket's id: a UUID, in either case. | 00000000-0000-4000-8000-000000000907 |
Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | object | The ticket with its messages. |
data.ticket | object | The ticket. |
data.ticket.id | string (uuid) | The ticket's id. |
data.ticket.ticket_number | string | The ticket's number, as the website shows it. |
data.ticket.subject | string | The ticket's subject. |
data.ticket.kind | string | exception: opened for a package the warehouse received with a problem (tracking_number and upc say which); support: a ticket you opened. Values: exception, support. |
data.ticket.status | string | open, in_progress, waiting_user (waiting on you), waiting_admin (waiting on our support team), resolved or closed. Treat a value not listed here as other. |
data.ticket.priority | string or null | low, normal, high or urgent; null on an older ticket that has none. Treat a value not listed here as other. |
data.ticket.created_at | string (date-time) | When the ticket was opened. |
data.ticket.updated_at | string (date-time) or null | When the ticket last changed, or null when it is not on record. |
data.ticket.closed_at | string (date-time) or null | When it was resolved or closed, or null. |
data.ticket.last_message_at | string (date-time) or null | When the latest message was sent, or null. |
data.ticket.unread_count | integer | Our replies you haven't opened on the website yet. Reading tickets or notifications through the API doesn't mark anything as read. It goes back to 0 once you open the ticket on the website. |
data.ticket.exception | object or null | On an exception ticket: the package the warehouse received with a problem, when you can see it. null on a support ticket. |
data.ticket.exception.tracking_number | string or null | The package's tracking number, or null. |
data.ticket.exception.upc | string or null | The UPC the warehouse received, or null. |
data.ticket.exception.quantity | integer or null | The units involved, or null. |
data.ticket.exception.status | string or null | The problem's status, as stored (open or resolved), or null. |
data.messages | array of object | Its messages, oldest first. [] when there are none. |
data.messages[].id | string (uuid) | The message's id. |
data.messages[].from | string | member: you wrote it; support: our support team did; system: a notice the platform wrote (an offer made, a return processed). Values: member, support, system. |
data.messages[].body | string | The text as sent, **bold** markers included; a system notice without its "SYSTEM:" prefix. Empty when the message is only a file. An exception ticket's opening message (the one that lists the tracking number, UPC, quantity and status) comes without its Notes paragraph: the API doesn't answer the notes recorded on an exception, though the website shows them in this message. |
data.messages[].created_at | string (date-time) | When it was sent. |
data.messages[].attachment | object or null | The file sent with it, or null. |
data.messages[].attachment.name | string | The file's name, at most 255 characters. |
data.messages[].attachment.size | integer | Its size in bytes. |
data.messages[].attachment.content_type | string | Its type, such as image/png or application/pdf. Open the file on the website's ticket page. |
data.offer | object or null | Its offer, while one is open or after you answered it; null when there is none. |
data.offer.id | string (uuid) | The offer's id. |
data.offer.type | string | return_only: the item goes back to you; offer_with_return_choice: an offer to buy it, or a return if you choose. Values: return_only, offer_with_return_choice. |
data.offer.status | string | pending (waiting for your answer on the website), accepted (you accepted it), or return_requested (you chose a return). Values: pending, accepted, return_requested. |
data.offer.quantity | integer | The units the offer is for. |
data.offer.unit_payout | string or null | What each unit pays; null for return_only. When the offer has plans, plans and chosen_plan say what you are paid, and this is only the price the offer was made with. |
data.offer.total_payout | string or null | unit_payout times quantity; null for return_only. With plans, as unit_payout. |
data.offer.currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data.offer.plans | array of object or null | The payout options to choose from, or null when the offer has a single price. |
data.offer.plans[].label | string or null | The option's name, or null. |
data.offer.plans[].hold_days | integer | The days money credited under this option is held before it can be paid out. |
data.offer.plans[].unit_payout | string | What each unit pays under this option. |
data.offer.plans[].currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data.offer.chosen_plan | object or null | The option you chose, or null when none has been chosen. |
data.offer.chosen_plan.label | string or null | The option's name, or null. |
data.offer.chosen_plan.hold_days | integer or null | Its hold in days, or null when not on record. |
data.offer.response | string or null | What you answered: accept_offer or request_return; null before you answer. Values: accept_offer, request_return. |
data.offer.response_confirmed_at | string (date-time) or null | When you confirmed your answer, or null. |
data.offer.credited_at | string (date-time) or null | When the offer was credited to your balance, or null. |
data.offer.return_fee_charged_at | string (date-time) or null | When the return fee was charged, or null. |
data.offer.created_at | string (date-time) | When the offer was made. |
data.offer.updated_at | string (date-time) or null | When it last changed, or null when it is not on record. |
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": {
"ticket": {
"id": "00000000-0000-4000-8000-000000000907",
"ticket_number": "TKT-20261114-0007",
"subject": "Inbound exception",
"kind": "exception",
"status": "waiting_user",
"priority": "normal",
"created_at": "2026-11-14T16:05:00.000Z",
"updated_at": "2026-11-15T18:20:00.000Z",
"closed_at": null,
"last_message_at": "2026-11-15T18:20:00.000Z",
"unread_count": 1,
"exception": {
"tracking_number": "9400000000000000000003",
"upc": "012345678905",
"quantity": 2,
"status": "open"
}
},
"messages": [
{
"id": "00000000-0000-4000-8000-000000000921",
"from": "member",
"body": "The box arrived open. Photo attached.",
"created_at": "2026-11-14T16:30:00.000Z",
"attachment": {
"name": "box.jpg",
"size": 482113,
"content_type": "image/jpeg"
}
},
{
"id": "00000000-0000-4000-8000-000000000914",
"from": "system",
"body": "An offer with 2 payout options has been made for your inbound item(s) (2 units). Choose the terms that suit you, or request a return.",
"created_at": "2026-11-15T18:20:00.000Z",
"attachment": null
}
],
"offer": {
"id": "00000000-0000-4000-8000-000000000915",
"type": "offer_with_return_choice",
"status": "pending",
"quantity": 2,
"unit_payout": "12.00",
"total_payout": "24.00",
"currency": "USD",
"plans": [
{
"label": "Standard",
"hold_days": 14,
"unit_payout": "12.00",
"currency": "USD"
},
{
"label": "Rush",
"hold_days": 0,
"unit_payout": "11.50",
"currency": "USD"
}
],
"chosen_plan": null,
"response": null,
"response_confirmed_at": null,
"credited_at": null,
"return_fee_charged_at": null,
"created_at": "2026-11-15T18:20:00.000Z",
"updated_at": "2026-11-15T18:20:00.000Z"
}
},
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter is unknown, repeated, empty or not valid, or a parameter in the path is not valid (invalid_parameter, with param naming it), a cursor is not valid (invalid_cursor), the key was sent in the URL (api_key_in_url), or, for an endpoint that takes a body, the body is not JSON in the shape it takes (invalid_body) or has more rows than it takes (too_many_rows); a field of the body with a value that is not valid can instead be invalid_parameter naming it, where the endpoint's description says so. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 404 | Nothing of yours has this id: it does not exist, or it is not yours. The two answers are the same (not_found). An id that is not a UUID is a 400 instead. |
| 409 | The API Terms changed. Accept the current version in Developer Tools, then send the request again. |
| 429 | This account has used its units for this minute or this UTC day. Wait Retry-After seconds, then try again. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-H "Authorization: Bearer $TBF_API_KEY" \
"https://www.thebuyerforce.com/api/v1/tickets/00000000-0000-4000-8000-000000000907"notifications
Your notifications, and how many are unread.
GET /notifications
Your notifications, as a feed
Your notifications, oldest first, from just after the position you send as after (from the first without it), at most limit at a time. Account, payout and referral notices are never included. Notices of package credits, released holds and balance adjustments are included only for a key that also has money:read; other notices can still show an amount, such as an accepted offer or a lost-package settlement. Keep the last next_cursor and send it as after to read on: unlike a list, next_cursor is never null once you have a position, an empty page hands back the after you sent, and has_more says whether more is already waiting. A notification shows up here about 5 seconds after it is sent. It reflects what was there when you read it: a notification you read on the website later is not sent again. Reading tickets or notifications through the API doesn't mark anything as read. Each call uses 1 unit of the same daily allowance as every other endpoint, so leave room for your other calls between polls (see Limits in the API documentation, #limits). Polling the GET /notifications feed is enough to learn of new notifications; you don't need to poll the unread count as well.
| Parameter | In | Description | Example |
|---|---|---|---|
after | query | The next_cursor of the page before, as it came: the position to read on from. Leave it out to start from your first notification. One that doesn't fit is a 400 invalid_cursor: start again without one. | v1.c2FtcGxlLWN1cnNvcg.c2FtcGxlLXNpZ25hdHVyZQ |
limit | query | How many notifications a page holds: a whole number from 1 to 50, 50 when left out. A number outside that is a 400, never cut down to fit. | 50 |
Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | array of object | Notifications, oldest first. [] when nothing new is there. |
data[].id | string (uuid) | The notification's id. |
data[].type | string | What it is about, such as deal_published or order_credited. New types can appear. |
data[].category | string | The type's group, as the website's notification settings name them. Values: deals, reservations, orders, credits, holds, balance, tickets, announcements. |
data[].title | string | The title, as the website shows it. |
data[].body | string or null | The text under the title, or null. |
data[].link | string or null | A path on the website it points to, such as /deals/<id>, or null. |
data[].created_at | string (date-time) | When it was sent. |
data[].read_at | string (date-time) or null | When you read it on the website, or null. |
data[].resolved_reason | string or null | Why it no longer counts as unread although you may not have read it, such as deal_closed or aged_out; null while it still counts. New reasons can appear: treat any value as over. |
data[].unread | boolean | true when read_at and resolved_reason are both null: what the unread count counts. |
next_cursor | string or null | Send it as after to read on. The position after this page, kept when the page is empty (the after you sent); null only when you sent no after and there is nothing yet. |
has_more | boolean | true when more notifications are already waiting after this page: read on now. |
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": [
{
"id": "00000000-0000-4000-8000-000000000908",
"type": "deal_published",
"category": "deals",
"title": "New deal: Sample tablet, 64 GB",
"body": "Best Buy · Retail $109.99 · 2 payout plans",
"link": "/deals/00000000-0000-4000-8000-000000000905",
"created_at": "2026-11-15T17:00:00.123Z",
"read_at": null,
"resolved_reason": null,
"unread": true
}
],
"next_cursor": "v1.c2FtcGxlLWN1cnNvcg.c2FtcGxlLXNpZ25hdHVyZQ",
"has_more": false,
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter is unknown, repeated, empty or not valid, or a parameter in the path is not valid (invalid_parameter, with param naming it), a cursor is not valid (invalid_cursor), the key was sent in the URL (api_key_in_url), or, for an endpoint that takes a body, the body is not JSON in the shape it takes (invalid_body) or has more rows than it takes (too_many_rows); a field of the body with a value that is not valid can instead be invalid_parameter naming it, where the endpoint's description says so. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 409 | The API Terms changed. Accept the current version in Developer Tools, then send the request again. |
| 429 | This account has used its units for this minute or this UTC day. Wait Retry-After seconds, then try again. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-H "Authorization: Bearer $TBF_API_KEY" \
"https://www.thebuyerforce.com/api/v1/notifications"GET /notifications/unread-count
How many of your notifications are unread
How many of the notifications this key can read are unread: not read on the website, and still current. Account, payout and referral notices are never counted. Without money:read, notices of package credits, released holds and balance adjustments aren't counted either, so this can be lower than the number the website shows. Takes no query parameters. Reading tickets or notifications through the API doesn't mark anything as read. Each call uses 1 unit of the same daily allowance as every other endpoint, so leave room for your other calls between polls (see Limits in the API documentation, #limits). Polling the GET /notifications feed is enough to learn of new notifications; you don't need to poll the unread count as well.
No query parameters.
Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | object | The count. |
data.count | integer | How many. |
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": {
"count": 3
},
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter is unknown, repeated, empty or not valid, or a parameter in the path is not valid (invalid_parameter, with param naming it), a cursor is not valid (invalid_cursor), the key was sent in the URL (api_key_in_url), or, for an endpoint that takes a body, the body is not JSON in the shape it takes (invalid_body) or has more rows than it takes (too_many_rows); a field of the body with a value that is not valid can instead be invalid_parameter naming it, where the endpoint's description says so. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 409 | The API Terms changed. Accept the current version in Developer Tools, then send the request again. |
| 429 | This account has used its units for this minute or this UTC day. Wait Retry-After seconds, then try again. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-H "Authorization: Bearer $TBF_API_KEY" \
"https://www.thebuyerforce.com/api/v1/notifications/unread-count"deals
The deals you can see on the website, read only.
GET /deals
The deals you can see, with their spots left
The deals you can see on the website's Deals page right now, each with its spots left (remaining_spots), newest first by created_at, then by id, a page at a time. Read only: reserving happens on the website, and the API never reserves. Which deals: the same as the website, including deals offered only to chosen members when you are one of them. A deal leaves the list 14 days after its end date. As on the website, a deal with no end date is not listed, though GET /deals/{id} answers it, and so is a deal you reserved after it leaves the list. Where this differs from the website's page: the order is by created_at alone, not deals you can still reserve first; the list holds up to the newest 1000 deals (the page loads its newest 200); retailer is an exact match on one of a deal's retailer names, ignoring case, where the website's filter also matches part of a name, so read retailers[].name from the list first; search looks in the title and description only, not in badges, retailer names or the UPC: to find a deal by any of those, filter the deals you read. There is no lookup by UPC. No profit is given, and nothing of your own reservations: GET /reservations?group_by=deal (orders:read) has those. remaining_spots is never below 0. Each call uses 1 unit of the same daily allowance as every other endpoint; see Limits and cost in the API documentation (#limits).
| Parameter | In | Description | Example |
|---|---|---|---|
retailer | query | Only the deals one of whose retailers has this name, ignoring case and spaces around it: 1 to 100 characters. Part of a name finds nothing. | Best Buy |
search | query | Only the deals whose title or description has this text, ignoring case: 1 to 200 characters, not only spaces or control characters. | tablet |
limit | query | How many deals a page holds: a whole number from 1 to 200, 100 when left out. A number outside that is a 400, never cut down to fit. | 100 |
cursor | query | The next_cursor of the page before, as it came. Send the same retailer and search with it; only limit may change from page to page. A cursor that doesn't fit the request is a 400 invalid_cursor: start again without one. | v1.c2FtcGxlLWN1cnNvcg.c2FtcGxlLXNpZ25hdHVyZQ |
Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | array of object | Deals. [] when there are none. |
data[].id | string (uuid) | The deal's id. Read it alone with GET /deals/{id}. |
data[].title | string | The deal's title. |
data[].description | string or null | The deal's description, or null. |
data[].retailers | array of object | The retailers that sell it, each with its product page when there is one; [] when none are named. |
data[].retailers[].name | string | The retailer's name, as the website shows it. retailer= on GET /deals matches it exactly, ignoring case. |
data[].retailers[].url | string or null | The product's page at that retailer, or null. |
data[].image_url | string or null | The deal's picture, or null when it has none. |
data[].currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data[].retail_price | string | What you pay for each unit at the retailer. |
data[].payout_price | string | What each unit pays you. When the deal has payout options, the highest option's unit_payout. |
data[].payout_plans | array of object or null | The payout options to choose from when you reserve, or null when the deal has a single price (payout_price). |
data[].payout_plans[].label | string or null | The option's name, or null. |
data[].payout_plans[].hold_days | integer | The days money credited under this option is held before it can be paid out. |
data[].payout_plans[].unit_payout | string | What each unit pays under this option. |
data[].payout_plans[].currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data[].status | string | active or limited. Deals in any other state are never sent. Values: active, limited. |
data[].distribution_mode | string | public: open to every member. targeted_self_reserve and targeted_preassigned: offered to chosen members, you among them. Values: public, targeted_self_reserve, targeted_preassigned. |
data[].expires_at | string (date-time) or null | When the deal closes, or null when it has no end date. |
data[].expired | boolean | true once expires_at has passed; false when it has no end date. |
data[].total_spots | integer | All the spots the deal has. |
data[].reserved_spots | integer | The spots members have reserved so far. |
data[].remaining_spots | integer | The spots left: total_spots less reserved_spots, never below 0. The count the website shows. |
data[].max_per_member | integer | The most units one member may reserve on the deal (4 when the deal sets none). |
data[].difficulty | string or null | easy, medium or hard, or null. Values: easy, medium, hard. |
data[].priority | string or null | low, medium, high or urgent, or null. Values: low, medium, high, urgent. |
data[].badges | array of object | The labels on the deal, at most 3, in the order the website shows them; [] when it has none. |
data[].badges[].kind | string | What sort of label it is: restocks, in_store, promo_code or custom today. More kinds can be added: for a kind you don't know, show its label. |
data[].badges[].label | string | The label as the website shows it. |
data[].badges[].note | string or null | What it means for you, as the website words it; null for a custom label without one. |
data[].badges[].code | string or null | The promo code to use at the retailer on a promo_code label; null on every other kind. |
data[].upc | string or null | The deal's own UPC, as the website's list shows it, or null. There is no lookup by UPC: to find one, filter the deals you read. |
data[].requirements | string or null | The deal's requirements, or null when it states none. |
data[].instructions | string or null | The deal's instructions as written (one step a line), or null when it has none. |
data[].warehouse_assignment | string or null | any: any of our warehouses; specific: only the ones in warehouse_codes; null when not set, which the website treats as any. Values: any, specific. |
data[].warehouse_codes | array of string | The codes of the warehouses assigned to the deal, such as OR11085; [] when none are. |
data[].ship_to_states | array of string | The states (two-letter codes) of the warehouses you can ship this deal's units to, as the website's Ship To filter reads them: every open warehouse's when warehouse_assignment is any or null, else the assigned ones'. |
data[].created_at | string (date-time) or null | When the deal was created, or null when that is not on record. The list is ordered by it, newest first. |
next_cursor | string or null | Send it as cursor to get the next page; null on the last page. |
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": [
{
"id": "00000000-0000-4000-8000-000000000905",
"title": "Sample tablet, 64 GB",
"description": "Ships in 3-5 days. Limit 2 per order at the retailer.",
"retailers": [
{
"name": "Best Buy",
"url": "https://www.bestbuy.com/site/sample-tablet"
}
],
"image_url": "https://www.thebuyerforce.com/sample-tablet.jpg",
"currency": "USD",
"retail_price": "109.99",
"payout_price": "120.00",
"payout_plans": [
{
"label": "Standard",
"hold_days": 14,
"unit_payout": "120.00",
"currency": "USD"
},
{
"label": "Rush",
"hold_days": 0,
"unit_payout": "115.00",
"currency": "USD"
}
],
"status": "active",
"distribution_mode": "public",
"expires_at": "2026-11-22T08:00:00.000Z",
"expired": false,
"total_spots": 40,
"reserved_spots": 33,
"remaining_spots": 7,
"max_per_member": 6,
"difficulty": "easy",
"priority": "high",
"badges": [
{
"kind": "promo_code",
"label": "Code SAVE20",
"note": "Use code SAVE20 at checkout.",
"code": "SAVE20"
}
],
"upc": "012345678905",
"requirements": null,
"instructions": "Order from the retailer\nShip to the warehouse on your reservation",
"warehouse_assignment": "specific",
"warehouse_codes": [
"OR11085"
],
"ship_to_states": [
"OR"
],
"created_at": "2026-11-15T17:00:00.123Z"
}
],
"next_cursor": "v1.c2FtcGxlLWN1cnNvcg.c2FtcGxlLXNpZ25hdHVyZQ",
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter is unknown, repeated, empty or not valid, or a parameter in the path is not valid (invalid_parameter, with param naming it), a cursor is not valid (invalid_cursor), the key was sent in the URL (api_key_in_url), or, for an endpoint that takes a body, the body is not JSON in the shape it takes (invalid_body) or has more rows than it takes (too_many_rows); a field of the body with a value that is not valid can instead be invalid_parameter naming it, where the endpoint's description says so. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 409 | The API Terms changed. Accept the current version in Developer Tools, then send the request again. |
| 429 | This account has used its units for this minute or this UTC day. Wait Retry-After seconds, then try again. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-H "Authorization: Bearer $TBF_API_KEY" \
"https://www.thebuyerforce.com/api/v1/deals"GET /deals/{id}
One deal you can see
One deal by its id, with its spots left, when you can see it: the deals whose page opens for you on the website. That is more than the list: a deal you reserved stays readable after it leaves the list, and a deal with no end date is answered though the list leaves it out. A deal no longer open (ended by us, or still a draft) and a deal offered only to other members are a 404, even if you reserved it. An id that is not a UUID is a 400 invalid_parameter naming id (the website shows its not-found page instead). A UUID that is not a deal you can see is a 404 not_found, the same answer whether it does not exist or is not for you. Takes no query parameters. Read only: reserving happens on the website, and the API never reserves. Each call uses 1 unit of the same daily allowance as every other endpoint; see Limits and cost in the API documentation (#limits).
| Parameter | In | Description | Example |
|---|---|---|---|
id · required | path | The deal's id: a UUID, in either case. | 00000000-0000-4000-8000-000000000905 |
Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | object | The deal. |
data.id | string (uuid) | The deal's id. Read it alone with GET /deals/{id}. |
data.title | string | The deal's title. |
data.description | string or null | The deal's description, or null. |
data.retailers | array of object | The retailers that sell it, each with its product page when there is one; [] when none are named. |
data.retailers[].name | string | The retailer's name, as the website shows it. retailer= on GET /deals matches it exactly, ignoring case. |
data.retailers[].url | string or null | The product's page at that retailer, or null. |
data.image_url | string or null | The deal's picture, or null when it has none. |
data.currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data.retail_price | string | What you pay for each unit at the retailer. |
data.payout_price | string | What each unit pays you. When the deal has payout options, the highest option's unit_payout. |
data.payout_plans | array of object or null | The payout options to choose from when you reserve, or null when the deal has a single price (payout_price). |
data.payout_plans[].label | string or null | The option's name, or null. |
data.payout_plans[].hold_days | integer | The days money credited under this option is held before it can be paid out. |
data.payout_plans[].unit_payout | string | What each unit pays under this option. |
data.payout_plans[].currency | string | The currency of the amounts on this object. Always USD. Value: USD. |
data.status | string | active or limited. Deals in any other state are never sent. Values: active, limited. |
data.distribution_mode | string | public: open to every member. targeted_self_reserve and targeted_preassigned: offered to chosen members, you among them. Values: public, targeted_self_reserve, targeted_preassigned. |
data.expires_at | string (date-time) or null | When the deal closes, or null when it has no end date. |
data.expired | boolean | true once expires_at has passed; false when it has no end date. |
data.total_spots | integer | All the spots the deal has. |
data.reserved_spots | integer | The spots members have reserved so far. |
data.remaining_spots | integer | The spots left: total_spots less reserved_spots, never below 0. The count the website shows. |
data.max_per_member | integer | The most units one member may reserve on the deal (4 when the deal sets none). |
data.difficulty | string or null | easy, medium or hard, or null. Values: easy, medium, hard. |
data.priority | string or null | low, medium, high or urgent, or null. Values: low, medium, high, urgent. |
data.badges | array of object | The labels on the deal, at most 3, in the order the website shows them; [] when it has none. |
data.badges[].kind | string | What sort of label it is: restocks, in_store, promo_code or custom today. More kinds can be added: for a kind you don't know, show its label. |
data.badges[].label | string | The label as the website shows it. |
data.badges[].note | string or null | What it means for you, as the website words it; null for a custom label without one. |
data.badges[].code | string or null | The promo code to use at the retailer on a promo_code label; null on every other kind. |
data.upc | string or null | The deal's own UPC, as the website's list shows it, or null. There is no lookup by UPC: to find one, filter the deals you read. |
data.requirements | string or null | The deal's requirements, or null when it states none. |
data.instructions | string or null | The deal's instructions as written (one step a line), or null when it has none. |
data.warehouse_assignment | string or null | any: any of our warehouses; specific: only the ones in warehouse_codes; null when not set, which the website treats as any. Values: any, specific. |
data.warehouse_codes | array of string | The codes of the warehouses assigned to the deal, such as OR11085; [] when none are. |
data.ship_to_states | array of string | The states (two-letter codes) of the warehouses you can ship this deal's units to, as the website's Ship To filter reads them: every open warehouse's when warehouse_assignment is any or null, else the assigned ones'. |
data.created_at | string (date-time) or null | When the deal was created, or null when that is not on record. The list is ordered by it, newest first. |
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": {
"id": "00000000-0000-4000-8000-000000000905",
"title": "Sample tablet, 64 GB",
"description": "Ships in 3-5 days. Limit 2 per order at the retailer.",
"retailers": [
{
"name": "Best Buy",
"url": "https://www.bestbuy.com/site/sample-tablet"
}
],
"image_url": "https://www.thebuyerforce.com/sample-tablet.jpg",
"currency": "USD",
"retail_price": "109.99",
"payout_price": "120.00",
"payout_plans": [
{
"label": "Standard",
"hold_days": 14,
"unit_payout": "120.00",
"currency": "USD"
},
{
"label": "Rush",
"hold_days": 0,
"unit_payout": "115.00",
"currency": "USD"
}
],
"status": "active",
"distribution_mode": "public",
"expires_at": "2026-11-22T08:00:00.000Z",
"expired": false,
"total_spots": 40,
"reserved_spots": 33,
"remaining_spots": 7,
"max_per_member": 6,
"difficulty": "easy",
"priority": "high",
"badges": [
{
"kind": "promo_code",
"label": "Code SAVE20",
"note": "Use code SAVE20 at checkout.",
"code": "SAVE20"
}
],
"upc": "012345678905",
"requirements": null,
"instructions": "Order from the retailer\nShip to the warehouse on your reservation",
"warehouse_assignment": "specific",
"warehouse_codes": [
"OR11085"
],
"ship_to_states": [
"OR"
],
"created_at": "2026-11-15T17:00:00.123Z"
},
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter is unknown, repeated, empty or not valid, or a parameter in the path is not valid (invalid_parameter, with param naming it), a cursor is not valid (invalid_cursor), the key was sent in the URL (api_key_in_url), or, for an endpoint that takes a body, the body is not JSON in the shape it takes (invalid_body) or has more rows than it takes (too_many_rows); a field of the body with a value that is not valid can instead be invalid_parameter naming it, where the endpoint's description says so. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 404 | Nothing of yours has this id: it does not exist, or it is not yours. The two answers are the same (not_found). An id that is not a UUID is a 400 instead. |
| 409 | The API Terms changed. Accept the current version in Developer Tools, then send the request again. |
| 429 | This account has used its units for this minute or this UTC day. Wait Retry-After seconds, then try again. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-H "Authorization: Bearer $TBF_API_KEY" \
"https://www.thebuyerforce.com/api/v1/deals/00000000-0000-4000-8000-000000000905"tracking
Submitting tracking numbers, and checking a list of them before you do.
POST /orders/batch
Submit tracking numbers
Submit up to 400 tracking numbers in one request, each with an optional quantity and note, as on the website's bulk page. Every row you send is answered, by its index and in order, with one result: created (a new package on your orders); already_yours (already on your orders: nothing changes); already_yours_quantity_differs (already on your orders, and the row gave a quantity the package doesn't have: nothing changes, change it on the website); duplicate_in_request (the same number as an earlier row of this request: only the earlier row is used); unavailable (This tracking number can't be added to your account. It still counts toward your 24-hour limit of new tracking numbers.). created and unavailable rows count toward your 24-hour limit of new tracking numbers; already_yours rows never do. If any row can't be submitted, nothing is saved: the answer is 400 invalid_rows, listing those rows. Check a list first with POST /orders/validate. Sending the same list again is safe: numbers already on your orders come back as already_yours and don't count toward the limit. Rows that came back unavailable count again each time they are sent, so leave them out when you retry. A 503 means no package was added, and the list can be sent again as it is (its unavailable rows count again). A request can take tens of seconds (numbers the warehouse has already received are credited during it): set a timeout of 60 seconds or more, and after a timeout send the list again. New packages are passed on to the warehouse by a scheduled job within a few minutes, not at once. The API may use your account's 24-hour limit of new tracking numbers less 400, which is kept for the website (by default 600 of 1000). Deleting a package on the website doesn't give its count back. At most 5 submissions a minute and 30 an hour (429 too_many_submissions); past the 24-hour limit, 429 daily_quota or api_daily_quota. Without the latest Terms of Service accepted on the website, including an update we have published that hasn't taken effect yet, the answer is 409 terms_acceptance_required. The cost is 10 units plus one for each 40 rows sent, rounded up; a longer or larger request costs as 400 rows. A key with orders:write can add to your orders: if Developer Tools lets you set an IP allowlist on it, we suggest you do.
No query parameters.
Request body
| Field | Type | Description |
|---|---|---|
orders | array of object | From 1 to 400 rows, in your order. A row may have tracking_number, quantity and note, and no other key. |
orders[].tracking_number | string | The tracking number exactly as printed on the label: letters, digits and dashes (spaces are dropped). A row with two numbers, a count beside the number, or a word that isn't part of it is refused, as on the website. |
orders[].quantity | integer or null · not always there | How many items the package holds, a whole number from 1 to 999. 1 when left out or null. |
orders[].note | string or null · not always there | A delivery code or note, as in the Note box on the website's bulk page: at most 100 characters once the spaces at either end are trimmed. None when left out, null or blank. |
{
"orders": [
{
"tracking_number": "1Z999AA10123456784",
"quantity": 2,
"note": "gate code 1234"
},
{
"tracking_number": "TBA301234567890"
},
{
"tracking_number": "tba301234567890"
},
{
"tracking_number": "9400111899223344556677"
}
]
}Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | object | What happened to each row. |
data.results | array of one of the shapes below | One result for each row you sent, by index, in order. |
| One shape: OrderBatchCreated | ||
data.results[].index | integer | The row: its place in the orders you sent, from 0. |
data.results[].result | string | Always created. Value: created. |
data.results[].tracking_number | string | The row's tracking number as it is stored: upper case, without spaces, and without the wrapper some carriers print around the number (a USPS label's 420 and ZIP code). |
data.results[].order_id | string (uuid) | The package's id, as GET /orders gives it. |
data.results[].quantity | integer | The quantity sent (1 when the row gave none). |
| One shape: OrderBatchAlreadyYours | ||
data.results[].index | integer | The row: its place in the orders you sent, from 0. |
data.results[].result | string | Always already_yours. Value: already_yours. |
data.results[].tracking_number | string | The row's tracking number in the form numbers are stored in now: upper case, without spaces, and without the wrapper some carriers print around the number (a USPS label's 420 and ZIP code). It is read from the row, not from your package: an older package can show its number in another form in GET /orders, so match the two by order_id. |
data.results[].order_id | string (uuid) | The package's id, as GET /orders gives it. |
| One shape: OrderBatchQuantityDiffers | ||
data.results[].index | integer | The row: its place in the orders you sent, from 0. |
data.results[].result | string | Always already_yours_quantity_differs. Value: already_yours_quantity_differs. |
data.results[].tracking_number | string | The row's tracking number in the form numbers are stored in now: upper case, without spaces, and without the wrapper some carriers print around the number (a USPS label's 420 and ZIP code). It is read from the row, not from your package: an older package can show its number in another form in GET /orders, so match the two by order_id. |
data.results[].order_id | string (uuid) | The package's id, as GET /orders gives it. |
data.results[].quantity | integer | The package's quantity now. |
data.results[].submitted_quantity | integer | The quantity the row gave. |
| One shape: OrderBatchDuplicate | ||
data.results[].index | integer | The row: its place in the orders you sent, from 0. |
data.results[].result | string | Always duplicate_in_request. Value: duplicate_in_request. |
data.results[].duplicate_of | integer | The index of the earlier row. |
| One shape: OrderBatchUnavailable | ||
data.results[].index | integer | The row: its place in the orders you sent, from 0. |
data.results[].result | string | Always unavailable. Value: unavailable. |
| Every answer | ||
data.counts | object | How many rows got each result. They add up to the rows you sent. |
data.counts.created | integer | Rows answered created. |
data.counts.already_yours | integer | Rows answered already_yours. |
data.counts.already_yours_quantity_differs | integer | Rows answered already_yours_quantity_differs. |
data.counts.duplicate_in_request | integer | Rows answered duplicate_in_request. |
data.counts.unavailable | integer | Rows answered unavailable. |
data.quota | object | Your limit of new tracking numbers after this request: new numbers and unavailable ones count, numbers already yours do not. |
data.quota.api_limit | integer or null | How many the API may add in the window: the account's limit less what is kept for the website (600 of 1000 by default). null when not known. |
data.quota.account_limit | integer or null | How many the account may add in the window, through the website and the API together. null when not known. |
data.quota.remaining | integer or null | How many more the API can add now: the smaller of what is left of api_limit and of account_limit. null when not known. |
data.quota.window_hours | integer | The window, in hours: always the last 24. Value: 24. |
data.forecast | object | Telling the warehouse about the new packages. |
data.forecast.queued | integer | Rows that will be passed on to the warehouse within a few minutes, by a scheduled job. |
data.forecast.held | integer | Rows held back for now, passed on once released. Usually 0. |
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": {
"results": [
{
"index": 0,
"result": "created",
"tracking_number": "1Z999AA10123456784",
"order_id": "00000000-0000-4000-8000-000000000916",
"quantity": 2
},
{
"index": 1,
"result": "already_yours",
"tracking_number": "TBA301234567890",
"order_id": "00000000-0000-4000-8000-000000000917"
},
{
"index": 2,
"result": "duplicate_in_request",
"duplicate_of": 1
},
{
"index": 3,
"result": "unavailable"
}
],
"counts": {
"created": 1,
"already_yours": 1,
"already_yours_quantity_differs": 0,
"duplicate_in_request": 1,
"unavailable": 1
},
"quota": {
"api_limit": 600,
"account_limit": 1000,
"remaining": 598,
"window_hours": 24
},
"forecast": {
"queued": 1,
"held": 0
}
},
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter or the key in the URL; a body that is not JSON in the shape above, or with more rows than allowed; or rows that can't be submitted (invalid_rows, listing each with what to fix). Nothing was saved. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 409 | Either the API Terms changed (api_terms_acceptance_required: accept them in Developer Tools), or the latest Terms of Service are not accepted (terms_acceptance_required: accept them on the website). Then send the list again. |
| 413 | The request body is larger than this endpoint takes (payload_too_large). Send less in one request. |
| 429 | Too many requests: the units of this minute or UTC day ran out (rate_limited), too many submissions in a short time (too_many_submissions), or the 24-hour limit of new tracking numbers is reached: the account's (daily_quota) or the API's share of it (api_daily_quota; the website can still add more). Nothing was saved. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-X POST \
-H "Authorization: Bearer $TBF_API_KEY" \
-H "Content-Type: application/json" \
-d '{"orders":[{"tracking_number":"1Z999AA10123456784","quantity":2,"note":"gate code 1234"},{"tracking_number":"TBA301234567890"},{"tracking_number":"tba301234567890"},{"tracking_number":"9400111899223344556677"}]}' \
"https://www.thebuyerforce.com/api/v1/orders/batch"POST /orders/validate
Check a list of tracking numbers without submitting it
Read a list as POST /orders/batch would, row by row, and submit nothing. A row with a problem is answered invalid_format here, with what to fix, instead of turning the whole answer into a 400. It reads nothing of your account and is the same for everyone, so a row that is valid here can still come back unavailable from the batch. It never counts toward your limit of new tracking numbers, and works with a suspended account. The body, its limits and its 400s and 413 are the batch's. The cost is 1 unit plus one for each 40 rows sent, rounded up.
No query parameters.
Request body
| Field | Type | Description |
|---|---|---|
orders | array of object | From 1 to 400 rows, in your order. A row may have tracking_number, quantity and note, and no other key. |
orders[].tracking_number | string | The tracking number exactly as printed on the label: letters, digits and dashes (spaces are dropped). A row with two numbers, a count beside the number, or a word that isn't part of it is refused, as on the website. |
orders[].quantity | integer or null · not always there | How many items the package holds, a whole number from 1 to 999. 1 when left out or null. |
orders[].note | string or null · not always there | A delivery code or note, as in the Note box on the website's bulk page: at most 100 characters once the spaces at either end are trimmed. None when left out, null or blank. |
{
"orders": [
{
"tracking_number": "1Z999AA10123456784",
"quantity": 2,
"note": "gate code 1234"
},
{
"tracking_number": "TBA301234567890"
},
{
"tracking_number": "tba301234567890"
},
{
"tracking_number": "9400111899223344556677"
}
]
}Answer fields (200)
| Field | Type | Description |
|---|---|---|
data | object | Whether the list is valid, and the problems in it. |
data.valid | boolean | true when no row has a problem: the batch would take the list (repeats are fine, the batch answers them). |
data.counts | object | How many rows got each result. They add up to the rows you sent. |
data.counts.valid | integer | Rows answered valid. |
data.counts.duplicate_in_request | integer | Rows answered duplicate_in_request. |
data.counts.invalid_format | integer | Rows answered invalid_format. |
data.rows | array of one of the shapes below | One result for each row you sent, by index, in order. |
| One shape: OrderBatchValidRow | ||
data.rows[].index | integer | The row: its place in the orders you sent, from 0. |
data.rows[].result | string | Always valid. Value: valid. |
data.rows[].tracking_number | string | The row's tracking number as it would be stored: upper case, without spaces, and without the wrapper some carriers print around the number (a USPS label's 420 and ZIP code). |
| One shape: OrderBatchDuplicate | ||
data.rows[].index | integer | The row: its place in the orders you sent, from 0. |
data.rows[].result | string | Always duplicate_in_request. Value: duplicate_in_request. |
data.rows[].duplicate_of | integer | The index of the earlier row. |
| One shape: OrderBatchInvalidRow | ||
data.rows[].index | integer | The row: its place in the orders you sent, from 0. |
data.rows[].result | string | Always invalid_format. Value: invalid_format. |
data.rows[].field | string | What the problem is about: the row itself (not an object, or a key other than the three), or one of its fields. Values: row, tracking_number, quantity, note. |
data.rows[].reason | string | What is wrong, in plain English. The wording can change: check field, not this. |
| Every answer | ||
request_id | string | This request's id, also sent as the X-Request-Id header. Include it if you email support about a request. |
Example answer
{
"data": {
"valid": true,
"counts": {
"valid": 3,
"duplicate_in_request": 1,
"invalid_format": 0
},
"rows": [
{
"index": 0,
"result": "valid",
"tracking_number": "1Z999AA10123456784"
},
{
"index": 1,
"result": "valid",
"tracking_number": "TBA301234567890"
},
{
"index": 2,
"result": "duplicate_in_request",
"duplicate_of": 1
},
{
"index": 3,
"result": "valid",
"tracking_number": "9400111899223344556677"
}
]
},
"request_id": "00000000-0000-4000-8000-000000000904"
}Other answers
| Status | When |
|---|---|
| 400 | The request is not valid: a query parameter is unknown, repeated, empty or not valid, or a parameter in the path is not valid (invalid_parameter, with param naming it), a cursor is not valid (invalid_cursor), the key was sent in the URL (api_key_in_url), or, for an endpoint that takes a body, the body is not JSON in the shape it takes (invalid_body) or has more rows than it takes (too_many_rows); a field of the body with a value that is not valid can instead be invalid_parameter naming it, where the endpoint's description says so. |
| 401 | No usable key: none was sent (missing_api_key), it is not valid (invalid_api_key), it has expired (key_expired) or it no longer works (key_revoked). Create a new key in Developer Tools. |
| 403 | The request is not allowed: it came from a web page or browser extension (browser_origin_refused), the key lacks the access it needs (insufficient_scope), it came from an IP address the key does not allow (ip_not_allowed), it makes a change and the account is suspended (account_suspended), the account is closed (account_banned) or cannot use the API (account_not_eligible), or API access is turned off for the account (api_access_disabled). |
| 409 | The API Terms changed. Accept the current version in Developer Tools, then send the request again. |
| 413 | The request body is larger than this endpoint takes (payload_too_large). Send less in one request. |
| 429 | This account has used its units for this minute or this UTC day. Wait Retry-After seconds, then try again. |
| 500 | Something went wrong on our side. If it keeps happening, email support with the request_id. |
| 503 | The request could not be completed just now, and nothing was changed: try again in a minute, after Retry-After seconds when it is sent. One exception: after reservation_change_unconfirmed a change may have gone through, so check before you send it again. |
curl -sS \
-X POST \
-H "Authorization: Bearer $TBF_API_KEY" \
-H "Content-Type: application/json" \
-d '{"orders":[{"tracking_number":"1Z999AA10123456784","quantity":2,"note":"gate code 1234"},{"tracking_number":"TBA301234567890"},{"tracking_number":"tba301234567890"},{"tracking_number":"9400111899223344556677"}]}' \
"https://www.thebuyerforce.com/api/v1/orders/validate"8. Submitting tracking numbers
POST /orders/batch submits up to 400 tracking numbers at once, as the website's bulk page does. Each row of POST /orders/batch or POST /orders/validate is answered, by its index in the list, with one of these results:
| Result | What it means |
|---|---|
created | A new package on your orders. It counts toward your 24-hour limit of new tracking numbers.Fields besides index and result: tracking_number, order_id and quantity.Returned by: POST /orders/batch. |
already_yours | Already on your orders, and nothing changed. It doesn't count toward the limit. Also the answer when the row gave no quantity and the package's differs.Fields besides index and result: tracking_number and order_id.Returned by: POST /orders/batch. |
already_yours_quantity_differs | Already on your orders, and the row gave a quantity the package doesn't have. Nothing changed (change it on the website). It doesn't count toward the limit.Fields besides index and result: tracking_number, order_id, quantity and submitted_quantity.Returned by: POST /orders/batch. |
duplicate_in_request | The same tracking number as an earlier row of this request, maybe written another way (case, spaces, a carrier's wrapper). Only the earlier row is used, with its quantity and note.Fields besides index and result: duplicate_of.Returned by: POST /orders/batch and POST /orders/validate. |
unavailable | This tracking number can't be added to your account. It still counts toward your 24-hour limit of new tracking numbers.Fields besides index and result: none.Returned by: POST /orders/batch. |
valid | A row the batch would submit.Fields besides index and result: tracking_number.Returned by: POST /orders/validate. |
invalid_format | A row that can't be submitted, with what to fix.Fields besides index and result: field and reason.Returned by: POST /orders/validate and 400 invalid_rows. |
- If any row has a problem, nothing is saved: the answer is 400
invalid_rows, listing those rows. Check a list first withPOST /orders/validate, which saves nothing. - Sending the same list again is safe: numbers already on your orders come back as already_yours and don't count toward the limit. Rows that came back unavailable count again each time they are sent, so leave them out when you retry.
- What counts toward your 24-hour limit: every created row and every unavailable row, including a number that was new when your request started and that someone else added before it finished. Rows already yours never count. An unavailable row doesn't say whose the number is.
- There is no Idempotency-Key header: submitting a number is idempotent by itself.
- To change a quantity or delete a package, use the website. Deleting a package doesn't give its count back.
- Without the latest Terms of Service accepted, including an update we have published that hasn't taken effect yet, the answer is 409
terms_acceptance_required: accept them on the website. - New packages are passed on to the warehouse by a scheduled job within a few minutes, not at once.
9. Changing reservations
POST /reservations/{id}/reduce lowers a reservation and POST /reservations/{id}/cancel cancels it, by the website's rules. You find the ids with GET /reservations, which needs orders:read.
quantityis how many spots the reservation keeps afterwards, at least 1. Sending the same quantity again is safe.- The newest spots go first: an older reservation can't be lowered or cancelled while a newer one of yours on the same deal and payout plan still has spots that haven't been fulfilled (409
newest_spots_first). - A reservation can be changed only in the 24 hours after it was made (409
change_window_closed), and only before its deal expires (409deal_expired). - If your other reservations on the deal can't be read just then, nothing changes: 503
reservation_lookup_failed, withRetry-After. - Cancel takes no body (or
{}). A cancel can't be undone, and sending it again gets 409reservation_not_active. Spots you give up may be reserved by someone else at once. - There is no waiting time after a cancel. Each cancel counts toward the website's limit of 40 new reservations in 24 hours (that limit only, not the per-minute or per-hour ones). A cancel itself is never refused for it: when the limit is reached, only new reservations on the website wait. Lowering a reservation doesn't count.
- There is no way to make a reservation or add spots through the API.
10. Moving off direct database reads
Apart from this API, scripts may not read our database directly or call the website's pages and endpoints. This includes scripts that sign in with your password. Use the API instead.
| What you read | Read it with |
|---|---|
| Credits, payouts and your balance | GET /balance/entries (money:read)GET /statements (money:read) |
| Reservations | GET /reservations (orders:read) |
| The packages counted toward a reservation | GET /reservations?expand=fulfillments (orders:read) |
| Packages | GET /orders (orders:read) |
| What was received for each UPC | GET /orders/lines (orders:read) |
| Items not credited, or with a problem | GET /orders/lines (orders:read): offer_status and the countsGET /tickets/{id} (tickets:read): its exception part |
GET /orders/lines takes up to 300 package ids a request and costs 1 unit for each 100. Ask only for packages that are new or changed since you last looked: the Apps Script example below shows how.
11. Examples
Three examples to start from. Each reads your key from a place only you control, never from the code. Download the whole API description to use with your own tools: Download openapi.json (OpenAPI 3.1). It can't be fetched from another website's page: download it and import the file.
You may copy and adapt the examples on this page and the API description (/api/v1/openapi.json) to build tools that use the API.
Export your packages and their lines, reservations, this month's balance history, the latest statement and tickets to CSV files (Python)
"""Export to CSV files in this folder: your packages and their lines, your reservations,
this month's balance entries, your latest statement and your tickets.
Not exported: notifications, deals and earlier months (for an earlier month, pass
month=YYYY-MM to /balance/entries, or save that month's statement from /statements).
Needs Python 3.9 or later and requests. Run it with your key in the environment, never in this file:
TBF_API_KEY='<your key>' python export.py
Sections the key has no scope for are skipped. Each request costs units: see Limits and cost.
"""
import csv, json, os, sys, time
import requests
# www, always: the bare domain redirects, and a redirect to another host drops the key.
BASE_URL = "https://www.thebuyerforce.com/api/v1"
KEY = os.environ["TBF_API_KEY"]
LINES_PER_CALL = 100 # package ids per /orders/lines request
class ApiError(Exception):
def __init__(self, status, body):
self.code = body.get("code")
super().__init__(f"{status} {self.code}: {body.get('error')} (request_id {body.get('request_id')})")
def error_body(r):
"""An error answer's JSON; an answer that isn't JSON (a gateway's error page) as its first 200 characters."""
try:
body = r.json()
except ValueError:
body = None
return body if isinstance(body, dict) else {"error": " ".join(r.text.split())[:200]}
def call(method, path, params=None, body=None, raw=False):
"""One request. Waits and tries again after a 429, and after a 503 or no answer at all (at most
5 times: this script only reads, so asking again is safe); raises ApiError for any other error.
raw=True returns the answer's bytes as they are (the statement CSV)."""
retries = 0
while True:
try:
r = requests.request(method, BASE_URL + path, params=params, json=body, timeout=30,
allow_redirects=False, headers={"Authorization": "Bearer " + KEY})
except (requests.ConnectionError, requests.Timeout) as e:
if retries == 5:
sys.exit(f"No answer for {path} after 5 retries: {e}")
time.sleep(2 ** (retries + 1)) # 2, 4, 8, 16, 32 seconds
retries += 1
continue
if r.is_redirect:
sys.exit(f"Redirected to {r.headers.get('Location')}: check BASE_URL.")
if r.status_code == 200:
return r.content if raw else r.json()
wait = int(r.headers.get("Retry-After", "0"))
if r.status_code == 429 and wait > 60:
# The day's units are used up until 00:00 UTC: stop rather than wait for hours.
sys.exit(f"429 {error_body(r).get('code')}: try again in {wait} seconds.")
if r.status_code == 429:
time.sleep(wait or 1)
elif r.status_code == 503 and retries < 5:
time.sleep(wait or 2 ** (retries + 1)) # 2, 4, 8, 16, 32 seconds
retries += 1
else:
raise ApiError(r.status_code, error_body(r))
def pages(path, params, items=lambda data: data, first=None):
"""Every row of a list, page by page until next_cursor is null. items picks a page's rows
out of its data (for /balance/entries, data["entries"]); first gets the first page's data.
Not for /notifications, whose next_cursor is never null."""
params = dict(params)
while True:
body = call("GET", path, params)
if first is not None and not first:
first.update(body["data"])
yield from items(body["data"])
if body["next_cursor"] is None:
return
params["cursor"] = body["next_cursor"]
def write_csv(name, rows):
"""Dicts to a CSV file; lists and objects go in as JSON. utf-8-sig: UTF-8 that Excel opens as such."""
columns = []
for row in rows:
columns += [k for k in row if k not in columns]
with open(name, "w", newline="", encoding="utf-8-sig") as f:
out = csv.DictWriter(f, columns)
out.writeheader()
out.writerows({k: json.dumps(v) if isinstance(v, (dict, list)) else v for k, v in row.items()} for row in rows)
print(f"{name}: {len(rows)} rows")
def export_orders():
# The largest page /orders allows: fewer pages, fewer units.
orders = list(pages("/orders", {"expand": "delivery", "limit": 1000}))
write_csv("orders.csv", orders)
ids = [order["id"] for order in orders]
lines = []
for start in range(0, len(ids), LINES_PER_CALL):
batch = ",".join(ids[start:start + LINES_PER_CALL])
for result in pages("/orders/lines", {"order_ids": batch}):
lines += [dict(line, order_id=result["order_id"]) for line in result["lines"]]
write_csv("order_lines.csv", lines)
def export_reservations():
reservations = list(pages("/reservations", {"status": "all", "expand": "fulfillments"}))
packages = []
for reservation in reservations:
packages += [dict(p, reservation_id=reservation["id"]) for p in reservation.pop("fulfillments")]
write_csv("reservations.csv", reservations)
write_csv("reservation_packages.csv", packages)
def export_money():
for attempt in (1, 2):
head = {}
try:
# No month: this Pacific month, as the first page's data says.
entries = list(pages("/balance/entries", {}, items=lambda d: d["entries"], first=head))
break
except ApiError as e:
# The month's statement came out while paging: start again from page 1, once.
if e.code != "cursor_stale" or attempt == 2:
raise
month = head["month"]
print(f"{month} ({head['state']}): opening {head['opening']}, closing {head['closing']}, totals {head['totals']}")
write_csv(f"balance_{month}.csv", entries)
statements = list(pages("/statements", {})) # newest first
if statements:
latest = statements[0]["month"]
data = call("GET", f"/statements/{latest}", {"format": "csv"}, raw=True)
with open(f"statement_{latest}.csv", "wb") as f: # the same bytes as the website's download
f.write(data)
print(f"statement_{latest}.csv saved")
def export_tickets():
# Packages that weren't credited, or had a problem, come with a ticket.
tickets = []
for archived in ("false", "true"):
tickets += [dict(t, archived=archived) for t in pages("/tickets", {"archived": archived})]
write_csv("tickets.csv", tickets)
SECTIONS = [
("orders and lines", "orders:read", export_orders),
("reservations", "orders:read", export_reservations),
("balance and statements", "money:read", export_money),
("tickets", "tickets:read", export_tickets),
]
def main():
scopes = call("GET", "/me")["data"]["key"]["scopes"]
for name, scope, export in SECTIONS:
if scope in scopes:
export()
else:
print(f"Skipping {name}: this key doesn't have {scope}.")
if __name__ == "__main__":
try:
main()
except ApiError as e:
sys.exit(str(e))
Keep your packages, their lines and your reservations in a Google Sheet (Apps Script)
// Keep your TheBuyerForce packages, their lines and your reservations in this spreadsheet.
// Setup: Extensions > Apps Script, paste this file, save, reload the spreadsheet, then
// TheBuyerForce > Set API key (a key with orders:read) and TheBuyerForce > Sync now.
// Use it only in a spreadsheet you alone can edit: anyone who can edit the script can read your key.
//
// Cost: each run uses about (pages of /orders x the cost of a page)
// + (new or changed packages / 40, rounded up) + (pages of /reservations) units.
// Times the runs a day, that has to fit in your daily units, which every tool on your
// account shares: see Limits and cost before syncing more often. A daily trigger is a
// good start (Triggers > Add trigger > syncNow > Time-driven > Day timer).
//
// Lines are fetched only for packages new or changed in /orders since the last run.
// A change in a line alone shows up when its package next changes; to fetch every
// line again, delete the hidden _tbf_sync sheet.
//
// The orders, reservations, order_lines and _tbf_sync sheets are rewritten by every run:
// keep your own columns and formulas on another sheet.
var BASE_URL = "https://www.thebuyerforce.com/api/v1";
var IDS_PER_CALL = 40; // package ids per /orders/lines request, so the URL stays short enough
var RUN_LIMIT_MS = 5 * 60 * 1000; // stop well before Apps Script's 6-minute limit
var ORDER_COLUMNS = ["id", "tracking_number", "status", "quantity", "qty_received", "upcs", "submitted_at",
"received_at", "credited_amount", "available_at", "payout_state"];
var RESERVATION_COLUMNS = ["id", "deal_id", "status", "quantity", "fulfilled", "remaining", "reserved_at",
"delivery_deadline"];
var LINE_COLUMNS = ["upc", "product", "line_status", "quantity", "qty_received", "unit_payout", "line_amount",
"payout_state", "available_at", "offer_status"];
var started = 0;
function onOpen() {
SpreadsheetApp.getUi().createMenu("TheBuyerForce")
.addItem("Set API key", "setApiKey").addItem("Sync now", "syncNow").addToUi();
}
function setApiKey() {
var ui = SpreadsheetApp.getUi();
var answer = ui.prompt("TheBuyerForce API key",
"Paste a key with orders:read. It is kept in your user properties, never in a cell.", ui.ButtonSet.OK_CANCEL);
if (answer.getSelectedButton() === ui.Button.OK) {
PropertiesService.getUserProperties().setProperty("TBF_API_KEY", answer.getResponseText().trim());
}
}
// Ends a run early. Nothing is lost: the next run picks up what this one didn't finish.
function Stop(message) { this.message = message; }
function syncNow() {
started = Date.now();
try {
sync();
} catch (e) {
if (!(e instanceof Stop)) throw e;
Logger.log("Stopped early: " + e.message);
}
}
function sync() {
// 1. Every page of both lists; their sheets are rewritten only once both are complete.
var orders = allPages(function (cursor) { return apiGet("/orders", { limit: 1000, cursor: cursor }); });
var reservations = allPages(function (cursor) { return apiGet("/reservations", { status: "active", cursor: cursor }); });
writeSheet("orders", ORDER_COLUMNS, orders.map(function (o) { return pick(o, ORDER_COLUMNS); }));
writeSheet("reservations", ["deal"].concat(RESERVATION_COLUMNS), reservations.map(function (r) {
return [r.deal ? r.deal.title : ""].concat(pick(r, RESERVATION_COLUMNS));
}));
// 2. The packages new or changed since the last run, by their mark. One no longer
// listed was deleted on the website: its lines and mark go.
var marks = {};
readRows("_tbf_sync", 2).forEach(function (row) { marks[row[0]] = row[1]; });
var listed = {};
var changed = [];
orders.forEach(function (order) {
listed[order.id] = true;
if (marks[order.id] !== markOf(order)) changed.push(order);
});
var lines = readRows("order_lines", 1 + LINE_COLUMNS.length).filter(function (row) { return listed[row[0]]; });
Object.keys(marks).forEach(function (id) { if (!listed[id]) delete marks[id]; });
saveLines(lines, marks);
// 3. Lines for those packages only. A group's marks move once its lines are saved,
// so a package whose lines weren't fetched is fetched on the next run.
for (var i = 0; i < changed.length; i += IDS_PER_CALL) {
var group = changed.slice(i, i + IDS_PER_CALL);
var ids = group.map(function (order) { return order.id; });
var page = apiGet("/orders/lines", { order_ids: ids.join(",") });
lines = lines.filter(function (row) { return ids.indexOf(row[0]) < 0; });
page.data.forEach(function (result) {
result.lines.forEach(function (line) { lines.push([result.order_id].concat(pick(line, LINE_COLUMNS))); });
});
group.forEach(function (order) { marks[order.id] = markOf(order); });
saveLines(lines, marks);
}
Logger.log("Synced " + orders.length + " packages (" + changed.length + " new or changed) and " +
reservations.length + " reservations.");
}
function allPages(getPage) {
var rows = [];
var cursor = null;
do {
var page = getPage(cursor);
rows = rows.concat(page.data);
cursor = page.next_cursor;
} while (cursor);
return rows;
}
function apiGet(path, params) {
var key = PropertiesService.getUserProperties().getProperty("TBF_API_KEY");
if (!key) throw new Error("No API key yet: use TheBuyerForce > Set API key.");
var query = Object.keys(params).filter(function (name) { return params[name] != null; })
.map(function (name) { return name + "=" + encodeURIComponent(params[name]); }).join("&");
for (var retries = 0; ; retries++) {
if (Date.now() - started > RUN_LIMIT_MS) throw new Stop("this run is out of time. Run Sync now again to carry on.");
var response = UrlFetchApp.fetch(BASE_URL + path + (query ? "?" + query : ""), {
headers: { Authorization: "Bearer " + key },
muteHttpExceptions: true,
followRedirects: false,
});
var status = response.getResponseCode();
if (status === 200) return JSON.parse(response.getContentText());
if (status >= 300 && status < 400) throw new Error("Redirected: check BASE_URL.");
var body = {};
try { body = JSON.parse(response.getContentText()); } catch (e) {}
if ((status === 429 || status === 503) && retries < 5) {
// Retry-After when the answer has one, else 2, 4, 8, 16, 32 seconds. A wait longer than
// this run has left (once the day's units are used up, until 00:00 UTC) ends the run.
var wait = Number(headerValue(response, "Retry-After")) || Math.pow(2, retries + 1);
if (wait * 1000 > RUN_LIMIT_MS - (Date.now() - started)) {
throw new Stop(status + " " + body.code + ": try again in " + wait + " seconds.");
}
Utilities.sleep(wait * 1000);
continue;
}
throw new Error(status + " " + body.code + ": " + body.error + " (request_id " + body.request_id + ")");
}
}
// A response header, whatever the case of its name.
function headerValue(response, name) {
var headers = response.getAllHeaders();
for (var h in headers) if (h.toLowerCase() === name.toLowerCase()) return headers[h];
return null;
}
// A package's mark: everything /orders says about it except delivery.
function markOf(order) {
var copy = {};
Object.keys(order).forEach(function (field) { if (field !== "delivery") copy[field] = order[field]; });
return JSON.stringify(copy);
}
function pick(object, columns) {
return columns.map(function (column) {
var value = object[column];
return value === null || value === undefined ? "" : Array.isArray(value) ? value.join(" ") : value;
});
}
function saveLines(lines, marks) {
writeSheet("order_lines", ["order_id"].concat(LINE_COLUMNS), lines);
writeSheet("_tbf_sync", ["order_id", "mark"], Object.keys(marks).map(function (id) { return [id, marks[id]]; }), true);
}
function writeSheet(name, header, rows, hidden) {
var book = SpreadsheetApp.getActiveSpreadsheet();
var sheet = book.getSheetByName(name);
if (!sheet) {
sheet = book.insertSheet(name);
if (hidden) sheet.hideSheet();
}
var values = [header].concat(rows);
sheet.clearContents();
// Plain text, so long tracking numbers and times stay exactly as the API wrote them.
sheet.getRange(1, 1, values.length, header.length).setNumberFormat("@").setValues(values);
}
// The rows under the header, each cut or padded to width columns, so a column added
// by hand can't make the rows too wide to write back.
function readRows(name, width) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(name);
if (!sheet || sheet.getLastRow() < 2) return [];
return sheet.getDataRange().getValues().slice(1).map(function (row) {
row = row.slice(0, width);
while (row.length < width) row.push("");
return row;
});
}
Submit tracking numbers from a CSV file (Python)
"""Submit the tracking numbers in tracking.csv (columns tracking_number and quantity).
Needs a key with orders:write in TBF_API_KEY. Nothing is retried: read the output, then decide.
"""
import csv, os, sys
import requests
BASE_URL = "https://www.thebuyerforce.com/api/v1"
KEY = os.environ["TBF_API_KEY"]
def call(method, path, body):
try: # a batch can take tens of seconds: wait at least 60 for the answer
r = requests.request(method, BASE_URL + path, json=body, timeout=90,
allow_redirects=False, headers={"Authorization": "Bearer " + KEY})
except (requests.ConnectionError, requests.Timeout):
sys.exit("No answer: the connection failed or timed out. Sending the same list again is safe.")
if r.is_redirect:
sys.exit("Redirected: check BASE_URL.")
if r.status_code != 200: # a 429 too: wait, then run this again yourself
try:
e = r.json()
except ValueError:
e = None
if not isinstance(e, dict): # not an error answer: a gateway's page, as good as no answer
sys.exit(f"{r.status_code}: {' '.join(r.text.split())[:200]}. Sending the same list again is safe.")
sys.exit(f"{r.status_code} {e.get('code')}: {e.get('error')} (request_id {e.get('request_id')})")
return r.json()["data"]
def quantity(text):
text = (text or "").strip()
return int(text) if text.isdigit() else (text or None) # anything else: validate says what's wrong
# utf-8-sig reads Excel's "CSV UTF-8" too; a character it can't read (in a column this doesn't use) is replaced.
with open("tracking.csv", newline="", encoding="utf-8-sig", errors="replace") as f:
reader = csv.DictReader(f)
if "tracking_number" not in (reader.fieldnames or []):
sys.exit(f"tracking.csv has no tracking_number column. Its columns: {', '.join(reader.fieldnames or [])}")
rows = [{"tracking_number": row["tracking_number"], "quantity": quantity(row.get("quantity"))} for row in reader]
check = call("POST", "/orders/validate", body={"orders": rows})
for row in check["rows"]:
if row["result"] == "invalid_format":
print(f"Row {row['index']}: {row['field']}: {row['reason']}")
if not check["valid"]:
sys.exit("Nothing was submitted. Fix those rows, then run this again.")
answer = call("POST", "/orders/batch", body={"orders": rows})
for row in answer["results"]:
print(row["index"], row.get("tracking_number", ""), row["result"])
unavailable = [row["index"] for row in answer["results"] if row["result"] == "unavailable"]
if unavailable:
print("Unavailable rows:", unavailable)
print("They count toward your limit again each time they are sent: don't send them again as they are.")
12. Changes and support
New endpoints, new fields, new values in a list of values (such as a new status) and changes to text written for people to read (such as an error message) can come at any time, without notice: write your code so they don't break it.
A change that would break code that follows this page, such as removing an endpoint or a field or changing what a field means, comes as a new version (/api/v2), or on version 1 with at least 90 days' notice, as set out in the API Terms, which also say when we may act at once (security, abuse or legal reasons). The notice comes in the app and by email.
The 90 days don't cover corrections that make the API do what this page says; changes to the limits or to what a request costs (see Limits and cost); changes to rules that also apply on the website, which apply to the API at the same time; or stopping the API altogether, which has a notice period of its own in the API Terms.
The API comes with no promise of availability, and all or part of it can be paused without notice, as the API Terms set out. They, with our Terms of Service, apply to every request.
Questions: support@thebuyerforce.com. Include the request id.
What changed
- 2026-11-24: First version of the Member API documentation.