{"templateId":"api_docs","sharedDataIds":{"apiDocsStore":"api-docs-openapi.yaml","sidebar":"sidebar-sidebars.yaml"},"props":{"definitionId":"openapi.yaml","settings":{"baseUrlPath":"/openapi"},"disableAutoScroll":true,"seo":{"title":"ChicksGold Seller API"},"dynamicMarkdocComponents":[],"metadata":{"type":"openapi","title":"ChicksGold Seller API","version":"1.0.0","description":"# Overview\n\nThe ChicksGold API lets you manage your **Currency** offers from your own systems. With it you can:\n\n- read your seller account and the current price update cooldown;\n- list your offers and read one offer;\n- pause and activate offers;\n- update prices, one offer at a time or in batches of up to 100.\n\nAccess is granted by ChicksGold to approved sellers only.\nRequests without a valid key are rejected.\n\n# Authentication\n\nSend your API key in the `x-api-key` header on every request. Your API key is provided to you by ChicksGold when your access is enabled.\n\n```\nx-api-key: <your API key>\n```\n\n- Keep your key secret. Never put it in a browser, a mobile app or public code. If it is exposed, contact ChicksGold Support so it can be replaced.\n- **Production and staging keys are different and not interchangeable.** A key only works on the environment it was issued for.\n- A missing or invalid key returns `401 INVALID_API_KEY`. A key that is valid but not registered for your account, or that has been disabled, returns `403 API_KEY_NOT_REGISTERED` or `403 API_KEY_DISABLED`.\n\n# Environments\n\n| Environment | Base URL |\n|---|---|\n| Production | `https://api.chicksgold.com/v1` |\n| Staging | `https://staging-api.chicksgold.com/v1` |\n\nBoth environments require an API key issued by ChicksGold, and the keys are different. Staging is for testing your integration\nbefore you go live. It is **not** open access and not a public sandbox: it is available only to approved sellers. Staging is\nseparate from production.\n\n# Prices and units\n\nEach offer is sold per **unit** of the game currency (`unit`, for example `M` for millions). `price` is in USD per 1 `unit`, a\nJSON number with at most 5 decimal places. `quantity` and `minimum` are expressed in `unit`. For example, 376 `M` at a price of\n0.26650 is 376 × 0.26650 = 100.20 USD. Stock and minimum order are managed on the ChicksGold website; the API does not change them.\n\n# Rate limits\n\nWhen you exceed a limit you get `429`. Read the `Retry-After` header (seconds), wait that long and retry with backoff. Do not retry in a tight loop.\n\n| Code | Status | Meaning |\n|---|---|---|\n| `RATE_LIMITED` | 429 | You are sending requests too fast. Slow down and retry after `Retry-After`. |\n| `QUOTA_EXCEEDED` | 429 | You used the daily request quota for your key. |\n| `PRICE_UPDATE_COOLDOWN` | 429 | A business rule, not a rate limit: this offer's price was changed too recently. See **Price update cooldown**. |\n\n# Price update cooldown\n\nThe price of each offer can be changed at most once per cooldown window. The window is **15 minutes** for now and might\nbe shorten in the future. Do not hard-code it: read `priceCooldownSeconds` from `GET /me` and `priceUpdatableAt` from each offer.\n\n- A price change inside the window is rejected with `429 PRICE_UPDATE_COOLDOWN`. The response carries `Retry-After` (seconds until the price can change again) and `details.priceUpdatableAt`.\n- In a batch, an offer inside its window is reported as `cooldown` for that item and the rest of the batch still succeeds.\n- Sending the price the offer already has succeeds with `changed: false` and does **not** start a new window.\n- The cooldown is per offer: changing one offer's price does not delay another offer.\n\n# Pagination\n\n`GET /offers` returns offers newest first, in pages. Use `limit` (1 to 100, default 50) to set the page size.\nA page has `data`, `hasMore` and `nextAfter`. While `hasMore` is `true`, call the endpoint again with `after` set to the previous\npage's `nextAfter`, keeping the same filters. On the last page `hasMore` is `false` and `nextAfter` is `null`.\n\n# Errors\n\nEvery error uses the same envelope:\n\n```json\n{\n  \"error\": {\n    \"code\": \"OFFER_NOT_FOUND\",\n    \"message\": \"Offer not found.\",\n    \"requestId\": \"3f0c2a8e-6d7b-4b1e-9b0a-2e1f4c5d6a7b\",\n    \"details\": {}\n  }\n}\n```\n\n- `code` is stable and machine-readable: branch on it, not on `message`, which may change.\n- `message` is a human-readable explanation.\n- `requestId` identifies the request and is also returned in the `x-request-id` header. **Include it when you contact ChicksGold Support.**\n- `details` is optional and depends on the code.\n\n| Status | Code | When |\n|---|---|---|\n| 400 | `VALIDATION_FAILED` | The request is malformed, has unknown fields or invalid values. `details.errors` lists each problem. |\n| 400, 413, 415 | `BAD_REQUEST` | The request was rejected before it was processed. |\n| 401 | `INVALID_API_KEY` | The `x-api-key` header is missing or the key is invalid. |\n| 403 | `API_KEY_NOT_REGISTERED` | The key is valid but is not registered for a seller account. |\n| 403 | `API_KEY_DISABLED` | The key has been disabled. |\n| 403 | `SELLER_API_DISABLED` | API access is not enabled for your account. |\n| 403 | `SELLER_RESTRICTED` | Activating a paused offer while your seller account is restricted. Contact support and quote the `Ref` in the message. |\n| 403 | `FORBIDDEN` | The request could not be authorized. Contact support with the `requestId`. |\n| 404 | `NOT_FOUND` | The path or method does not exist. |\n| 404 | `OFFER_NOT_FOUND` | The offer does not exist or is not yours. |\n| 409 | `OFFER_OUT_OF_STOCK` | The offer cannot be activated because it has no stock. |\n| 409 | `OFFER_NOT_ACTIVATABLE` | The offer's status (`unavailable`) cannot be changed through the API. |\n| 413 | `BATCH_TOO_LARGE` | A batch has more than 100 items. |\n| 413 | `PAYLOAD_TOO_LARGE` | The request body is larger than 1 MiB. |\n| 429 | `RATE_LIMITED` | Too many requests per second. |\n| 429 | `QUOTA_EXCEEDED` | The daily quota was used. |\n| 429 | `PRICE_UPDATE_COOLDOWN` | The offer's price was changed too recently. |\n| 500 | `INTERNAL_ERROR` | Unexpected error. |\n| 502 and other 5xx | `UPSTREAM_ERROR` | A temporary problem on our side. **Retry with exponential backoff.** |\n\nA `5xx` response is temporary: wait, then retry with backoff (for example 1 s, 2 s, 4 s, up to a few attempts). Retries are safe by design:\nsending the price an offer already has returns `changed: false`, and pause and activate can be repeated safely. If the problem\ncontinues, contact support with the `requestId`.\n","summary":"Manage your currency offers and prices from your own systems."},"compilationErrors":[],"markdown":{"partials":{},"variables":{"rbac":{"teams":["anonymous"]},"user":{},"remoteAddr":{"hostname":"docs.chicksgold.com","port":4000,"ipAddress":"216.73.216.199"},"lang":"default_locale","env":{"PUBLIC_REDOCLY_BRANCH_NAME":"main"}}},"pagePropGetterError":{"message":"","name":""}},"slug":"/openapi","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}