### Category Available Condition Slugs Example (Laptops) Source: https://docs.api.onbuy.com/?version=latest This example displays the 'available_condition_slugs' for the 'Laptops' category, which requires a more detailed refurbished grading system. ```json "category_id": 8345, "name": "Laptops", ... "available_condition_slugs": [ "new", "diamond", "platinum", "gold", "silver", "bronze" ] ``` -------------------------------- ### Variant Mapping Example Source: https://docs.api.onbuy.com/?version=latest This example shows how a variant name like 'Sizes' is recognized and mapped to the 'Size' attribute for creating product variants. ```json "variant_1": { "name": "Sizes" } ``` -------------------------------- ### Category Available Condition Slugs Example (Digital Cameras) Source: https://docs.api.onbuy.com/?version=latest This example shows the 'available_condition_slugs' for the 'Digital Cameras' category, which only permits 'new' or 'refurbished' conditions. ```json "category_id": 3251, "name": "Digital Cameras", ... "available_condition_slugs": [ "new", "refurbished" ] ``` -------------------------------- ### Example Payload Snippet for 'new' Listing Source: https://docs.api.onbuy.com/?version=latest This snippet demonstrates the structure of a payload when listing an item as 'new'. Ensure your SKU, price, and stock values are correctly formatted. ```json "listings": { "new": { "sku": "SKU1", "price": 299.99, "stock": 1 ... ``` -------------------------------- ### Example Payload Snippet for 'refurbished' Listing Source: https://docs.api.onbuy.com/?version=latest This snippet illustrates the payload structure for listing an item as 'refurbished'. Similar to 'new' listings, verify SKU, price, and stock. ```json "listings": { "refurbished": { "sku": "SKU2", "price": 199.99, "stock": 2 ... ``` -------------------------------- ### Create Product Listing Source: https://docs.api.onbuy.com/?version=latest Use this method to add a new listing to an existing product on OnBuy. First, search for the product using `GET /v2/products`. If the product exists, you can then use this method. ```APIDOC ## POST /v2/products/{{onbuy_product_code}}/listings ### Description Adds a new listing to an existing product. ### Method POST ### Endpoint /v2/products/{{onbuy_product_code}}/listings ### Parameters #### Path Parameters - **onbuy_product_code** (string) - Required - The unique OnBuy product code (OPC) of the existing product. ``` -------------------------------- ### Search Products Source: https://docs.api.onbuy.com/ The `GET /v2/products` endpoint searches the product catalogue. The search scope (Live or Test) depends on the API keys used for authentication. ```APIDOC ## Search Products ### Description This endpoint searches the product catalogue. The results returned are dependent on the environment (Live or Test) associated with the API keys used for authentication. ### Method GET ### Endpoint `/v2/products` ### Behavior - When using Test API keys, the search will only include products within the Test environment. - To search across both Live and Test environments, use Live API keys. ``` -------------------------------- ### Variant Mapping Failure Example Source: https://docs.api.onbuy.com/?version=latest This example illustrates a potential variant mapping failure where 'Shirt Size' may not be recognized as a standard field, leading to the product being created as a single item. ```json "variant_1": { "name": "Shirt Size" } ``` -------------------------------- ### Example of permitted_write_levels property Source: https://docs.api.onbuy.com/?version=latest This JSON structure indicates the write access levels granted for a request. 'true' signifies allowed access, while 'false' indicates denied access. ```json "permitted_write_levels": { "global_product": true, "local_product": true, } ``` -------------------------------- ### Example Variant Name Mapping Source: https://docs.api.onbuy.com/ Illustrates how variant names are mapped to standardized fields. Ensure variant names closely align with standard fields for successful matching. ```json { "variant_1": { "name": "Sizes" } } ``` ```json { "variant_1": { "name": "Shirt Size" } } ``` -------------------------------- ### API Request Methods Source: https://docs.api.onbuy.com/?version=latest The OnBuy API supports standard HTTP request methods: GET for fetching, POST for adding, PUT for updating, and DELETE for removing resources. Each request, except requestToken, requires an access_token in the Authorization header. ```APIDOC ## API Request Methods - **GET**: Used for fetching items. - **POST**: Used for adding items. - **PUT**: Used for updating items. - **DELETE**: Used for removing items. All requests (except `requestToken`) require an `Authorization` header with a valid `access_token`. ``` -------------------------------- ### Creating Test Products Source: https://docs.api.onbuy.com/?version=latest Instructions on how to create test products via the API using Test API keys. ```APIDOC ## Creating Test Products ### Description Test products can be created via the API using Test API keys. They follow the same JSON format as live products, but SKUs and barcodes cannot be reused between live and test environments. ### Steps 1. Enable the OnBuy API via the OnBuy API Integration page within the SCP. 2. Use your Test API keys for authentication. 3. Create a Product using the `POST /v2/products` endpoint with the access token generated by the Test API keys. ### Note When using the `GET /v2/products` Search endpoint, the search scope (Live or Test) depends on the API keys used for authentication. ``` -------------------------------- ### Create Product Source: https://docs.api.onbuy.com/ Test products can be created via the API using Test API keys. The JSON format is the same as live products. SKUs and barcodes must be unique across both Live and Test environments. ```APIDOC ## Create Product ### Description This endpoint allows for the creation of test products via the API. It requires authentication using Test API keys and follows the standard product JSON format. ### Method POST ### Endpoint `/v2/products` ### Authentication Requires authentication using Test API keys. ### Notes - Test products share the same database as live products. SKUs and barcodes used in one environment cannot be reused in the other. - Ensure API is enabled via the OnBuy API Integration page in the SCP. ``` -------------------------------- ### Create New Product Source: https://docs.api.onbuy.com/ If a product does not exist on OnBuy, use this method to add a new product to the system. Products are submitted as a JSON string and processed in a queue. ```APIDOC ## POST /v2/products ### Description Adds a new product to the OnBuy system. Recommended to upload in batches of up to 1,000 products per request. ### Method POST ### Endpoint /v2/products ### Parameters #### Request Body - **products** (array) - Required - An array of product objects to be created. - Each product object should contain details such as: - **title** (string) - Required - The title of the product. - **description** (string) - Required - The full description of the product. - **brand** (string) - Required - The brand of the product. - **manufacturer** (string) - Required - The manufacturer of the product. - **gtin** (string) - Required - The Global Trade Item Number. - **images** (array) - Optional - An array of image URLs for the product. ### Request Example ```json { "products": [ { "title": "Example Product", "description": "This is a detailed description of the example product.", "brand": "ExampleBrand", "manufacturer": "ExampleManufacturer", "gtin": "1234567890123", "images": [ "http://example.com/image1.jpg", "http://example.com/image2.jpg" ] } ] } ``` ### Response #### Success Response (200) - **queue_id** (string) - The ID of the queue for processing the product creation. #### Error Response (400) - **error** (object) - Contains details about validation errors. - **message** (string) - A description of the error. - **details** (array) - Specific details about the validation failures. ``` -------------------------------- ### Check Product Existence Source: https://docs.api.onbuy.com/ Before creating a new product, it's recommended to check if it already exists using the search function. This helps avoid duplicate product entries. ```APIDOC ## GET /v2/products ### Description Searches for existing products on OnBuy.com. ### Method GET ### Endpoint /v2/products ### Parameters #### Query Parameters - **search** (string) - Optional - The search query to find products. ### Response #### Success Response (200) - **products** (array) - A list of products matching the search criteria. - **MetaData** (object) - Contains pagination information like limit, offset, and total_rows. ``` -------------------------------- ### Create New Product Source: https://docs.api.onbuy.com/?version=latest Use this method to add a new product to OnBuy if it does not already exist. Products should be submitted as a JSON string, with recommendations for batching up to 1,000 products per request. ```APIDOC ## POST /v2/products ### Description Adds a new product to the OnBuy system if it does not already exist. Recommended to upload in batches of up to 1,000 products per POST request. ### Method POST ### Endpoint /v2/products ### Parameters #### Request Body - **product_data** (JSON string) - Required - The product details to be created. ``` -------------------------------- ### Setting Product Price for German Site Source: https://docs.api.onbuy.com/?version=latest This JSON payload demonstrates how to set a product price for a specific site, using site ID 2002 for Germany, which implies the price is in EUR. ```json { "site_id": 2002, "listings": [ { "sku": "examplesku", "price": 19.99 } ] } ``` -------------------------------- ### Creating Test Orders Source: https://docs.api.onbuy.com/?version=latest Guidance on creating test orders through the API. ```APIDOC ## Creating Test Orders ### Description Test orders can be created via the OnBuy API Integration page within the SCP. This process requires using a Test SKU that already exists in your Test Account inventory. ### Prerequisites - Unverified seller accounts cannot create test orders. - Integration partners requiring a test account should contact OnBuy support for assistance with verification steps. ### Process 1. Navigate to the OnBuy API Integration page within the SCP. 2. Select "Create Test Order". 3. Fill in the required fields. 4. Submit the order. ``` -------------------------------- ### Check Product Creation Status Source: https://docs.api.onbuy.com/?version=latest Use the queues methods to check the status of product creation requests. Multiple queue IDs can be checked simultaneously. The status can be 'pending', 'Success', or 'failed'. ```APIDOC ## GET /v2/queues ### Description Retrieves the status of product creation requests. Allows checking multiple queue IDs at once. ### Method GET ### Endpoint /v2/queues ### Parameters #### Query Parameters - **queue_ids** (string) - Required - A comma-separated list of queue IDs to check. ``` -------------------------------- ### Add Listing to Existing Product Source: https://docs.api.onbuy.com/ If a product already exists on OnBuy, you can add a new listing to it using this method. This allows you to specify your own purchasing options for an existing product. ```APIDOC ## POST /v2/products/{{onbuy_product_code}}/listings ### Description Adds a new listing to an existing product on OnBuy.com. ### Method POST ### Endpoint /v2/products/{{onbuy_product_code}}/listings ### Parameters #### Path Parameters - **onbuy_product_code** (string) - Required - The unique OnBuy product code for the existing product. #### Request Body - **listing_data** (object) - Required - Contains the details for the new listing. - **price** (number) - Required - The price of the product listing. - **stock** (integer) - Required - The available stock for the listing. - **sku** (string) - Required - The Stock Keeping Unit for the listing. ``` -------------------------------- ### Check Product Creation Status Source: https://docs.api.onbuy.com/ Monitor the status of product creation requests using the queue ID returned after submitting products. This allows you to track progress and identify any failures. ```APIDOC ## GET /v2/queues ### Description Retrieves the status of product creation queues. ### Method GET ### Endpoint /v2/queues ### Parameters #### Query Parameters - **queue_ids** (string) - Optional - A comma-separated list of queue IDs to check. ### Response #### Success Response (200) - **queues** (array) - An array of queue status objects. - Each object contains: - **queue_id** (string) - The ID of the queue. - **status** (string) - The current status (e.g., 'pending', 'success', 'failed'). - **error_message** (string) - Returned if the status is 'failed', detailing the error. - **opc** (string) - Returned if the status is 'success', the OnBuy Product Code (OPC) of the created product. ``` -------------------------------- ### Create Test Order Source: https://docs.api.onbuy.com/ Test orders can be created via the API. This requires a Test SKU that exists in your Test Account inventory. Unverified seller accounts cannot create test orders. ```APIDOC ## Create Test Order ### Description Allows for the creation of test orders through the API. This process requires a pre-existing Test SKU in your inventory and is only available for verified seller accounts. ### Prerequisites - A Test SKU must exist in your Test Account inventory. - Seller account must be verified. ### Access Initiated via the 'Create Test Order' option on the OnBuy API Integration page within the SCP. ``` -------------------------------- ### Partner Integrations Source: https://docs.api.onbuy.com/?version=latest Information for technology businesses interested in integrating with OnBuy. ```APIDOC ## Partner Integrations ### Description Technology businesses offering solutions like order fulfillment or inventory management can apply to have their integration added to the Seller Control Panel (SCP). ### Benefits - Upon approval, a unique `Provider-Token` will be provided for use in the header of each API call. - This ensures sellers using the integration have the correct setup enabled in the SCP. ### Header Format `Provider-Token`: `XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX` ### Error Handling If a seller uses API keys for a different integration but includes your partner header, an error will be returned: "the integration specified in the header doesn't match the integration defined in the API token." ``` -------------------------------- ### International Sites Source: https://docs.api.onbuy.com/?version=latest Details on configuring API access for international OnBuy sites. ```APIDOC ## International Sites ### Description To expand into new international markets, API requests must include the relevant Site ID for the target region. Cross-country API requests are not currently supported. ### Site IDs Site IDs are unique identifiers for each regional OnBuy site. Available Site IDs can be found on the OnBuy API Integration page within the Seller Control Panel. ### Available Site IDs | Site ID | Country | |---------|------------------| | 2000 | OnBuy UK | | 2001 | OnBuy France | | 2002 | OnBuy Germany | | 2003 | OnBuy Czech Republic | | 2004 | OnBuy Netherlands| | 2007 | OnBuy Austria | | 2008 | OnBuy Belgium | | 2011 | OnBuy Denmark | | 2013 | OnBuy Spain | | 2014 | OnBuy Finland | | 2015 | OnBuy Greece | | 2017 | OnBuy Hungary | | 2019 | OnBuy Ireland | | 2020 | OnBuy Italy | | 2026 | OnBuy Norway | | 2027 | OnBuy Poland | | 2028 | OnBuy Portugal | | 2029 | OnBuy Romania | | 2030 | OnBuy Sweden | | 2031 | OnBuy Switzerland| | 2033 | OnBuy Slovakia | ``` -------------------------------- ### Partner Integration Header Source: https://docs.api.onbuy.com/ Technology partners can include a 'Provider-Token' in the header of API calls to identify their integration. This helps ensure sellers use the correct integration. ```APIDOC ## Partner Integration Header ### Description Integrations can be identified by including a `Provider-Token` in the request header. This token is provided by OnBuy and ensures that sellers are using the correct integration. ### Header Format `Provider-Token`: `XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX` ### Error Handling If a seller attempts to use API keys for a different integration but includes a valid `Provider-Token`, an error will be returned indicating a mismatch between the header and the API token's defined integration. ``` -------------------------------- ### API Usage Limits Source: https://docs.api.onbuy.com/ API usage is controlled by hourly and daily limits that vary by request method and environment (Live/Test). Exceeding these limits will result in a 429 Too Many Requests error. ```APIDOC ## API Usage Limits ### Description Rate limits are applied to API requests to ensure platform stability. Limits differ based on the HTTP method and whether the request is made to the Live or Test environment. ### Limits | Method | Environment | Hourly Limit | Daily Limit | |-------------|-------------|--------------|-------------| | GET | Live | 600 | 12,000 | | POST | Live | 240 | 4,800 | | PUT | Live | 240 | 4,800 | | DELETE | Live | 240 | 4,800 | | GET | Test | 600 | 12,000 | | POST | Test | 240 | 4,800 | | PUT | Test | 240 | 4,800 | | DELETE | Test | 240 | 4,800 | ### Error Handling If usage limits are exceeded, the API will return a `429 Too Many Requests` error. No further requests can be made until the usage window resets. ``` -------------------------------- ### API Usage Limits Source: https://docs.api.onbuy.com/?version=latest API usage is controlled to maintain platform stability, with limits that vary by request method and environment. Exceeding these limits will result in a 429 Too Many Requests error. ```APIDOC ## API Usage Limits ### Description Rate limits for API requests, categorized by HTTP method and environment (Live/Test). ### Limits | Method | Environment | Hourly Limit | Daily Limit | |-------------|-------------|--------------|-------------| | GET | Live | 600 | 12,000 | | POST | Live | 240 | 4,800 | | PUT | Live | 240 | 4,800 | | DELETE | Live | 240 | 4,800 | | GET | Test | 600 | 12,000 | | POST | Test | 240 | 4,800 | | PUT | Test | 240 | 4,800 | | DELETE | Test | 240 | 4,800 | ### Error Handling - **429 Too Many Requests**: Returned when usage limits are exceeded. No further requests can be made until the usage window resets. ``` -------------------------------- ### Site IDs Source: https://docs.api.onbuy.com/ Site IDs are unique identifiers for each regional OnBuy marketplace. API requests for international sites must include the relevant Site ID. ```APIDOC ## Site IDs ### Description Site IDs are unique numerical identifiers for each regional OnBuy marketplace. When making API requests to international sites, the corresponding Site ID must be included. ### Usage - API requests targeting a specific region must include its Site ID. - Cross-country API requests are not supported. ### Retrieval Available Site IDs can be found on the OnBuy API Integration page within the Seller Control Panel, or by using the Sites endpoint. ### Available Site IDs | Site ID | Country | |---------|------------------| | 2000 | OnBuy UK | | 2001 | OnBuy France | | 2002 | OnBuy Germany | | 2003 | OnBuy Czech Republic | | 2004 | OnBuy Netherlands| | 2007 | OnBuy Austria | | 2008 | OnBuy Belgium | | 2011 | OnBuy Denmark | | 2013 | OnBuy Spain | | 2014 | OnBuy Finland | | 2015 | OnBuy Greece | | 2017 | OnBuy Hungary | | 2019 | OnBuy Ireland | | 2020 | OnBuy Italy | | 2026 | OnBuy Norway | | 2027 | OnBuy Poland | | 2028 | OnBuy Portugal | | 2029 | OnBuy Romania | | 2030 | OnBuy Sweden | | 2031 | OnBuy Switzerland| | 2033 | OnBuy Slovakia | ``` -------------------------------- ### API Response Codes Source: https://docs.api.onbuy.com/?version=latest The API uses standard HTTP response codes to indicate the success or failure of a request. Codes in the 2xx range signify success, while 4xx and 5xx codes indicate client or server errors, respectively. ```APIDOC ## API Response Codes | Code | Message / Error | |---|---| | 200 | OK Success | | 400 | Bad Request - Invalid request mostly due to wrong data. | | 401 | Unauthorised - Missing Secret or Consumer Key, Authentication Failed, Bad Token. | | 403 | Forbidden - Account does not have permission to the accessed method. | | 404 | Not Found - The requested resource was not found. | | 429 | Too Many Requests - Usage limit has been exceeded. | | 500 | Internal Server Error - Internal error. Please contact us. | Note: Unless otherwise specified, all dates are in UTC. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.