### PHP Example for Signing Requests Source: https://sellerapi.kaufland.com/?page=rest-api Demonstrates how to use the `signRequest` function in PHP with example values to generate a Shop-Signature. ```PHP ``` -------------------------------- ### Python Example for Signing Requests Source: https://sellerapi.kaufland.com/?page=rest-api Demonstrates how to use the `sign_request` function in Python with example values to generate a Shop-Signature. ```Python #!/usr/bin/python import hmac import hashlib import time def sign_request(method, uri, body, timestamp, secret_key): plain_text = "\n".join([method, uri, body, str(timestamp)]) digest_maker = hmac.new(secret_key.encode(), None, hashlib.sha256) digest_maker.update(plain_text.encode()) return digest_maker.hexdigest() method = "POST" uri = "https://sellerapi.kaufland.com/v2/units/" body = "" timestamp = 1411055926 # time.time() secret_key = "a7d0cb1da1ddbc86c96ee5fedd341b7d8ebfbb2f5c83cfe0909f4e57f05dd403" print(sign_request(method, uri, body, timestamp, secret_key)) # da0b65f51c0716c1d3fa658b7eaf710583630a762a98c9af8e9b392bd9df2e2a ``` -------------------------------- ### Example Subscription Response Source: https://sellerapi.kaufland.com/?page=push-notifications This is an example of the JSON response body when retrieving current subscriptions. ```JSON [ { "id_subscription": 37, "callback_url": "https://example.com/hm_notifications.php", "fallback_email": "webmaster@example.com", "event_name": "order_new", "is_active": true "storefront": "de" } ] ``` -------------------------------- ### Shared Set Search Response Example Source: https://sellerapi.kaufland.com/?page=product-data Example JSON response when searching for shared set values. It includes labels and their corresponding values. ```JSON { "data": [ { "label": "Braun", "value": "Braun" }, { "label": "Bunt", "value": "Bunt" }, { "label": "Schwarz", "value": "Schwarz" }, { "label": "Rot", "value": "Rot" }, { "label": "Orange", "value": "Orange" }, { "label": "Weiß", "value": "Weiß" }, { "label": "Hellbraun", "value": "Hellbraun" }, { "label": "Hellblau", "value": "Hellblau" }, { "label": "Silber", "value": "Silber" }, { "label": "Rosa", "value": "Rosa" }, { "label": "Blau", "value": "Blau" }, { "label": "Grau", "value": "Grau" }, { "label": "Beige", "value": "Beige" }, { "label": "Dunkelbraun", "value": "Dunkelbraun" }, { "label": "Hellgrau", "value": "Hellgrau" }, { "label": "Dunkelgrau", "value": "Dunkelgrau" }, { "label": "Grün", "value": "Grün" }, { "label": "Bronze", "value": "Bronze" }, { "label": "dunkelgrün", "value": "dunkelgrün" }, { "label": "Gold", "value": "Gold" }, { "label": "Pink", "value": "Pink" }, { "label": "Gelb", "value": "Gelb" }, { "label": "Violett", "value": "Violett" } ], "pagination": { "offset": 0, "limit": 30, "total": 23 } } ``` -------------------------------- ### Get Product with Units Source: https://sellerapi.kaufland.com/?page=product-data Retrieve a product's data along with all associated units (offers). ```HTTP GET https://sellerapi.kaufland.com/products/{id_product}?embedded=units ``` -------------------------------- ### Example Variant Suggestions CSV Data Source: https://sellerapi.kaufland.com/?page=variant-suggestions-files This is an example of a partial variant suggestions data file in the CSV format expected by the Kaufland marketplace. Note the use of quotes for attributes containing commas. ```csv ean;parent_ean;variant_attributes;action 8945085546346;4124102788893;colour; 4124102788893;4124102788893;colour; 6484759040462;4124102788893;colour; 2493874020064;4124102788893;colour;encourage 1252445707071;4124102788893;colour;discourage 6633663891438;8514476545826;"height,colour";encourage 8514476545826;8514476545826;"height,colour";encourage 8911039691234;6867350126126;"weight,length";encourage 9066532731364;6867350126126;;discourage 6867350126126;6867350126126;; discourage 5202543304099;6867350126126;; 7862397008909;6867350126126;; ;;; ``` -------------------------------- ### Example Notification Request Headers Source: https://sellerapi.kaufland.com/?page=push-notifications These are the headers included in a push notification request from the Kaufland marketplace. ```http Shop-Timestamp 1432815691 Shop-Signature c57523ff08413a7eaf88447ba2405c0632fbefecff7b3426d94fd1c4b7482caa ``` -------------------------------- ### Shared Set Values CSV Format Example Source: https://sellerapi.kaufland.com/?page=product-data Example of the CSV format for downloaded shared set values. It contains LABEL and VALUE columns. ```CSV LABEL;VALUE Schwarz;Schwarz Grau;Grau Weiß;Weiß Braun;Braun Beige;Beige Rot;Rot Grün;Grün Gelb;Gelb Orange;Orange Blau;Blau Türkis;Türkis Rosa;Rosa Violett;Violett Silber;Silber Gold;Gold Bronze;Bronze Transparent;Transparent Pink;Pink Bunt;Bunt Kupfer;Kupfer Taupe;Taupe milchig;milchig Hellgrau;Hellgrau Dunkelgrau;Dunkelgrau Hellblau;Hellblau Dunkelblau;Dunkelblau Ocker;Ocker Hellbraun;Hellbraun Lila;Lila dunkelgrün;dunkelgrün bordeaux;bordeaux Dunkelbraun;Dunkelbraun Naturbelassen;Naturbelassen Hellgelb;Hellgelb Dunkelgelb;Dunkelgelb Hellrot;Hellrot Dunkelrot;Dunkelrot Hellorange;Hellorange Dunkelorange;Dunkelorange Hellrosa;Hellrosa Dunkelrosa;Dunkelrosa Hellviolett;Hellviolett Dunkelviolett;Dunkelviolett Limette;Limette Cyan;Cyan Magenta;Magenta Kastanienbraun;Kastanienbraun Olive;Olive Blaugrün;Blaugrün Marine;Marine Fuchsia;Fuchsia Himmelblau;Himmelblau Aqua;Aqua Koralle;Koralle Petrol;Petrol Königsblau;Königsblau ``` -------------------------------- ### Subscription Listing Enabled for All Storefronts Source: https://sellerapi.kaufland.com/?page=releaselog The GET /subscriptions endpoint is now enabled for all storefronts, allowing listing of subscriptions across all shops. ```text GET /subscriptions * Listing subscriptions is enabled now for all storefronts: ``` -------------------------------- ### Get Product by ID Source: https://sellerapi.kaufland.com/?page=product-data Retrieve a specific product's data using its unique ID. ```HTTP GET https://sellerapi.kaufland.com/products/{id_product} ``` -------------------------------- ### Example Inventory Command File Line (DELETE by EAN) Source: https://sellerapi.kaufland.com/?page=inventory-files-csv Use this command to delete all product listings associated with a specific EAN. ```csv DELETE;5060004769643 ``` -------------------------------- ### Deleting a Unit (DELETE) Source: https://sellerapi.kaufland.com/?page=code-examples This example demonstrates how to delete an existing unit using a DELETE request. It requires the unit ID obtained from the creation response. ```APIDOC ## DELETE /units/{id_unit}/ ### Description Deletes an existing unit identified by its ID. ### Method DELETE ### Endpoint https://sellerapi.kaufland.com/v2/units/{id_unit}/ ### Parameters #### Path Parameters - **id_unit** (string) - Required - The ID of the unit to delete. #### Query Parameters - **storefront** (string) - Required - The storefront from which to delete the unit (e.g., 'de'). ### Response #### Success Response (204) - No content is returned upon successful deletion. #### Response Example ``` HTTP Response Code: 204 ``` ``` -------------------------------- ### MARK_UNIT_CANCELLED Command Example Source: https://sellerapi.kaufland.com/?page=order-files Cancels an order unit and provides a reason for cancellation. Use this to manage order fulfillment issues and inform customers. ```csv MARK_UNIT_CANCELLED;56896348978;NoInventory ``` -------------------------------- ### GET /order-units Source: https://sellerapi.kaufland.com/?page=orders Retrieves a list of order units. It is recommended to use the `status` query parameter to filter the results. For example, to get all order units that need to be sent to customers, use `status=need_to_be_sent`. ```APIDOC ## GET /order-units ### Description Retrieves a list of order units. You can filter by status, such as `need_to_be_sent`. ### Method GET ### Endpoint /order-units ### Query Parameters - **status** (string) - Optional - The status of the order units to retrieve (e.g., `need_to_be_sent`). ### Response #### Success Response (200) Returns an array of order units. - **data** (array) - An array of order unit objects. - **id_order_unit** (integer) - The unique identifier for the order unit. - **id_order** (string) - The identifier for the order. - **ts_created_iso** (string) - The creation timestamp in ISO 8601 format. - **ts_updated_iso** (string) - The last updated timestamp in ISO 8601 format. - **is_marketplace_deemed_supplier** (boolean) - Indicates if the marketplace is deemed the supplier. - **status** (string) - The current status of the order unit. - **cancel_reason** (null) - The reason for cancellation, if applicable. - **price** (integer) - The price of the order unit. - **id_offer** (string) - The identifier for the offer. - **revenue_gross** (integer) - The gross revenue for the order unit. - **revenue_net** (integer) - The net revenue for the order unit. - **vat** (integer) - The VAT percentage. - **note** (string) - A personal note for the order unit. - **unit_condition** (string) - The condition of the unit (e.g., 'new'). - **storefront** (string) - The storefront identifier (e.g., 'de'). - **delivery_time_min** (integer) - The minimum delivery time in days. - **delivery_time_max** (integer) - The maximum delivery time in days. - **delivery_time_expires_iso** (string) - The expiration timestamp for delivery time in ISO 8601 format. - **shipping_rate** (integer) - The shipping rate. - **buyer** (object) - Information about the buyer. - **id_buyer** (integer) - The buyer's unique identifier. - **email** (string) - The buyer's email address. - **billing_address** (object) - The billing address details. - **first_name** (string) - **last_name** (string) - **company_name** (string) - **street** (string) - **house_number** (string) - **postcode** (string) - **city** (string) - **additional_field** (string) - **phone** (string) - **country** (string) - **shipping_address** (object) - The shipping address details. - **first_name** (string) - **last_name** (string) - **company_name** (string) - **street** (string) - **house_number** (string) - **postcode** (string) - **city** (string) - **additional_field** (string) - **phone** (string) - **country** (string) - **product** (object) - Information about the product. - **id_product** (integer) - **title** (string) - **eans** (object) - An object containing EANs. - **id_category** (integer) - **main_picture** (string) - URL to the main product picture. - **manufacturer** (string) - **url** (string) - URL to the product page. - **real_mgb_article_number** (string) - **age_rating** (integer) - **is_valid** (boolean) - **dangerous_goods_li_shipping** (null) - **danger_label_9A** (null) - **discounts** (array) - An array of discount objects. - **discount_value** (integer) - **usage_type** (string) - **pagination** (object) - Pagination details. - **offset** (integer) - **limit** (integer) - **total** (integer) ### Request Example ```json { "status": "need_to_be_sent" } ``` ### Response Example ```json { "data": [ { "id_order_unit": 314567828995811, "id_order": "MBXGYR", "ts_created_iso": "2013-12-01T22:37:27Z", "ts_updated_iso": "2013-12-01T22:37:28Z", "is_marketplace_deemed_supplier": false, "status": "need_to_be_sent", "cancel_reason": null, "price": 4615, "id_offer": "286419401", "revenue_gross": 3928, "revenue_net": 3301, "vat": 19, "note": "Your personal note for this unit - it is displayed to the customer on the product page.", "unit_condition": "new", "storefront": "de", "delivery_time_min": 1, "delivery_time_max": 3, "delivery_time_expires_iso": "2013-12-01T22:37:27Z", "shipping_rate": 0, "buyer": { "id_buyer": 24972423, "email": "john.doe@example.de" }, "billing_address": { "first_name": "John", "last_name": "Doe", "company_name": "", "street": "Bonnerstraße", "house_number": "73", "postcode": "53117", "city": "Bonn", "additional_field": "1. OG", "phone": "02289001", "country": "DE" }, "shipping_address": { "first_name": "John", "last_name": "Doe", "company_name": "", "street": "Bonnerstraße", "house_number": "73", "postcode": "53117", "city": "Bonn", "additional_field": "1. OG", "phone": "02289001", "country": "DE" }, "product": { "id_product": 4294967296, "title": "Such an awesome title for an product", "eans": { 0: "4024144772148" }, "id_category": 45181, "main_picture": "https://media.kaufland.de/images/items/original/a5b07911e5859c2fc6c7a2852d2da33f.jpg", "manufacturer": "DuckProducer", "url": "https://www.kaufland.de/product/58097801/", "real_mgb_article_number": "", "age_rating": 0, "is_valid": true, "dangerous_goods_li_shipping": null, "danger_label_9A": null }, "discounts": [ { "discount_value": 500, "usage_type": "voucher" } ] }, { "id_order_unit": 314567828995812, "id_order": "MBXGYX", "ts_created_iso": "2013-12-01T22:37:27Z", "ts_updated_iso": "2013-12-01T22:37:28Z", "is_marketplace_deemed_supplier": false, "status": "need_to_be_sent", "cancel_reason": null, "price": 5615, "id_offer": "386419401", "revenue_gross": 4928, "revenue_net": 4301, "vat": 19, "note": "Your personal note for this unit - it is displayed to the customer on the product page.", "unit_condition": "new", "storefront": "de", "delivery_time_min": 1, "delivery_time_max": 3, "delivery_time_expires_iso": "2013-12-01T22:37:27Z", "shipping_rate": 0, "buyer": { "id_buyer": 24972424, "email": "jane.doe@example.de" }, "billing_address": { "first_name": "Jane", "last_name": "Doe", "company_name": "", "street": "Bonnerstraße", "house_number": "73", "postcode": "53117", "city": "Bonn", "additional_field": "1. OG", "phone": "02289001", "country": "DE" }, "shipping_address": { "first_name": "Jane", "last_name": "Doe", "company_name": "", "street": "Bonnerstraße", "house_number": "73", "postcode": "53117", "city": "Bonn", "additional_field": "1. OG", "phone": "02289001", "country": "DE" }, "product": { "id_product": 4294967296, "title": "Such an awesome title for an product", "eans": { 0: "4024144772148" }, "id_category": 45181, "main_picture": "https://media.kaufland.de/images/items/original/a5b07911e5859c2fc6c7a2852d2da33f.jpg", "manufacturer": "DuckProducer", "url": "https://www.kaufland.de/product/58097801/", "real_mgb_article_number": "", "age_rating": 0, "is_valid": true, "dangerous_goods_li_shipping": null, "danger_label_9A": null }, "discounts": [] } ], "pagination": { "offset": 0, "limit": 0, "total": 0 } } ``` ``` -------------------------------- ### Product Endpoints Include Fulfillment Type Source: https://sellerapi.kaufland.com/?page=releaselog New `fulfillment_type` parameter added to embedded units for GET /products/search, GET /products/ean/{ean}, and GET /products/{id_product} when units are embedded. ```text GET /products/search * Added an extra parameter for the following endpoints: * When they are requested with embedded units the response now includes `fulfillment_type` for the unit ``` ```text GET /products/ean/{ean} * Added an extra parameter for the following endpoints: * When they are requested with embedded units the response now includes `fulfillment_type` for the unit ``` ```text GET /products/{id_product} * Added an extra parameter for the following endpoints: * When they are requested with embedded units the response now includes `fulfillment_type` for the unit ``` -------------------------------- ### Example Inventory Command File (FLUSH and UPSERT) Source: https://sellerapi.kaufland.com/?page=inventory-files-csv This sequence first deletes all existing inventory and then re-adds products. It's useful for a complete reset and update of your inventory. ```csv FLUSH; UPSERT;5060004769643;100;4999;EUR;;4390218756;1235;67;;;;;2;standard_rate;99 UPSERT;4011905437873;200;5999;EUR;;;1235;10;;;;;4;unspecified ``` -------------------------------- ### Adding a Unit (POST) Source: https://sellerapi.kaufland.com/?page=code-examples This example demonstrates how to add a new unit (offer) to a product using a POST request. It includes details on request parameters, headers, and expected success response. ```APIDOC ## POST /units/ ### Description Adds a new unit (offer) to a product. Requires a listing price greater than zero. ### Method POST ### Endpoint https://sellerapi.kaufland.com/v2/units/ ### Parameters #### Query Parameters - **storefront** (string) - Required - The storefront to create the unit on (e.g., 'de'). #### Request Body - **ean** (string) - Required - The EAN of the product. - **condition** (string) - Required - The condition of the unit (e.g., 'NEW'). - **listing_price** (integer) - Required - The listing price in cents (must be greater than zero). - **minimum_price** (integer) - Optional - The minimum price in cents. - **amount** (integer) - Required - The available quantity of the unit. - **note** (string) - Optional - A note for the unit. - **id_shipping_group** (integer) - Required - The ID of the shipping group. - **id_warehouse** (integer) - Required - The ID of the warehouse. - **id_product** (integer) - Required - The ID of the product. - **id_offer** (string) - Optional - A custom identifier for the offer. - **handling_time** (integer) - Optional - The handling time in days. ### Request Example ```json { "ean": "9780470527580", "condition": "NEW", "listing_price": 4550, "minimum_price": 3990, "amount": 9, "note": "My example note", "id_shipping_group": 1, "id_warehouse": 1, "id_product": 1, "id_offer": "My own unit identifier", "handling_time": 1 } ``` ### Response #### Success Response (201) - **Location** (string) - The URL to the newly created unit. #### Response Example ``` HTTP Response Code: 201 ``` ``` -------------------------------- ### Example Inventory Command File Line (DELETE with Offer ID) Source: https://sellerapi.kaufland.com/?page=inventory-files-csv Use this command to delete a specific product listing by providing both the EAN and the offer ID. ```csv DELETE;5060004769643;4390218756 ``` -------------------------------- ### Example Inventory Command File Line (UPSERT) Source: https://sellerapi.kaufland.com/?page=inventory-files-csv Use this command to list or update product inventory. It includes details like EAN, condition, price, offer ID, and handling time. ```csv UPSERT;5060004769643;100;4999;EUR;;4390218756;1235;67;;;;3425;2;standard_rate;99 ``` -------------------------------- ### Add a Unit (POST Request) Source: https://sellerapi.kaufland.com/?page=code-examples Use this PHP script to add a new unit (offer) to a product. Ensure the listing price is greater than zero. This example demonstrates a POST request with necessary authentication headers. ```php "9780470527580", "condition" => "NEW", "listing_price" => 4550, "minimum_price" => 3990, "amount" => 9, "note" => "My example note", "id_shipping_group" => 1, "id_warehouse" => 1, "id_product" => 1, "id_offer" => "My own unit identifier", "handling_time" => 1 ]; $jsonData = json_encode($data); // We're adding a new unit $uri = $baseUrl . '/units/'; // Need to specify the storefront the unit will be created on $params = [ 'storefront' => 'de', ]; //The query parameters must be URL-encoded, but the "=" and "&" signs should not be encoded $uri .= '?' . http_build_query($params); // Current Unix timestamp in seconds $timestamp = time(); // Define all the mandatory headers $headers = [ 'Content-Type: application/json', 'Accept: application/json', 'Shop-Client-Key: ' . $clientKey, 'Shop-Timestamp: ' . $timestamp, 'Shop-Signature: ' . signRequest('POST', $uri, $jsonData, $timestamp, $secretKey), 'User-Agent: test', ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $uri); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLINFO_HEADER_OUT, 1); $response = curl_exec($ch); list($header, $body) = explode("\r\n\r\n", $response, 2); print("$header\n\n"); $responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); print("HTTP Response Code: $responseCode\n"); curl_close($ch); ``` -------------------------------- ### Example Modify Subscription Request Body Source: https://sellerapi.kaufland.com/?page=push-notifications This is an example of the JSON request body for modifying a subscription. The `is_active` flag controls whether the subscription is enabled or disabled. ```JSON { "callback_url": "https://example.com/hm_notifications.php", "fallback_email": "webmaster@example.com", "event_name": "order_new", "is_active": false, "storefront": "de" } ``` -------------------------------- ### API Error Response Example Source: https://sellerapi.kaufland.com/?page=inventory This JSON object shows an example of an error response from the API. The `message` property provides details about the error encountered during the request. ```json { "message": "Can not decode body" } ``` -------------------------------- ### Collection Pagination Example Source: https://sellerapi.kaufland.com/?page=rest-api Demonstrates how to use 'limit' and 'offset' query parameters to paginate through collections of data. The 'pagination' object in the response provides details about the current page, limit, and total number of items. ```APIDOC ## GET /categories ### Description Retrieves a collection of categories. Supports pagination to manage large result sets. ### Method GET ### Endpoint /categories ### Query Parameters - **limit** (integer) - Optional - The maximum number of items to return per page. Default and maximum values are endpoint dependent. - **offset** (integer) - Optional - The number of items to skip from the beginning of the result set. Defaults to 0. ### Response #### Success Response (200) - **data** (array) - A collection of category objects. - **pagination** (object) - Information about the pagination state. - **offset** (integer) - The current offset. - **limit** (integer) - The current limit. - **total** (integer) - The total number of items available. ### Response Example ```json { "data": [ { "id_category": 39231, "name": "laptops-und-zubehoer", "id_parent_category": 39161, "title_singular": "Laptop & Zubehör", "title_plural": "Laptops & Zubehör", "level": 4, "url": "https://www.kaufland.de/laptops-und-zubehoer/", "shipping_category": "D", "variable_fee": "5.90", "fixed_fee": 0, "vat": "19.00" } ], "pagination": { "offset": 0, "limit": 1, "total": 100 } } ``` ``` -------------------------------- ### Initialize a Return for Order Units Source: https://sellerapi.kaufland.com/?page=returns Use this endpoint to initialize a return for one or more order units from a single order. Ensure the 'note' field meets the length requirements and select an appropriate 'reason' from the allowed values. ```bash POST https://sellerapi.kaufland.com/v2/returns ``` -------------------------------- ### GET Request to Retrieve Order Units by Status Source: https://sellerapi.kaufland.com/?page=orders Use this GET request to fetch order units that require shipment. The `status` query parameter is crucial for filtering. ```http GET https://sellerapi.kaufland.com/v2/order-units?status=need_to_be_sent ``` -------------------------------- ### Identify KSS Eligible Order Units via API Source: https://sellerapi.kaufland.com/?page=kss Include the `kss_delivery` field in requests to `GET /order-units/{id_order_unit}` and `GET /orders/{id_order}` to determine if an order unit is eligible for KSS. The response will include the `kss_eligible` boolean field. ```HTTP GET /order-units/{id_order_unit}?include=kss_delivery GET /orders/{id_order}?include=kss_delivery ``` -------------------------------- ### Get All Reports Source: https://sellerapi.kaufland.com/?page=reports Retrieves a list of all available reports, including their status. ```APIDOC ## GET /reports ### Description Retrieves a list of all available reports and their current generation status. Reports with a status of 'done' are ready for download. ### Method GET ### Endpoint /reports ### Parameters #### Query Parameters None ### Request Example ```json { "example": "GET /reports" } ``` ### Response #### Success Response (200) - **id_report** (string) - The unique identifier for the report. - **status** (string) - The current status of the report (e.g., 'queued', 'done'). #### Response Example ```json { "example": [ { "id_report": "report_123", "status": "done" }, { "id_report": "report_456", "status": "queued" } ] } ``` ``` -------------------------------- ### GET /product-data/{ean} Endpoint Source: https://sellerapi.kaufland.com/?page=releaselog This endpoint is used for retrieving product data by EAN. ```http GET /product-data/{ean} ``` -------------------------------- ### Collection Pagination Example Source: https://sellerapi.kaufland.com/?page=rest-api This JSON snippet demonstrates the 'pagination' object included in collection responses. It provides details on the 'offset', 'limit', and 'total' number of items available. ```json { "data": [ { "id_category": 39231, "name": "laptops-und-zubehoer", "id_parent_category": 39161, "title_singular": "Laptop & Zubehör", "title_plural": "Laptops & Zubehör", "level": 4, "url": "https://www.kaufland.de/laptops-und-zubehoer/", "shipping_category": "D", "variable_fee": "5.90", "fixed_fee": 0, "vat": "19.00" }, { "id_category": 46051, "name": "laptops", "id_parent_category": 39231, "title_singular": "Laptop", "title_plural": "Laptops", "level": 5, "url": "https://www.kaufland.de/laptops/", "shipping_category": "D", "variable_fee": "5.90", "fixed_fee": 0, "vat": "19.00" } ], "pagination": { "offset": 5, "limit": 25, "total": 5530 } } ``` -------------------------------- ### Opening a ticket (POST) Source: https://sellerapi.kaufland.com/?page=code-examples This PHP script demonstrates how to open a new ticket on an order unit using a POST request to the Kaufland Seller API. ```APIDOC ## Opening a ticket (POST) ### Description This endpoint allows you to open a new ticket associated with a specific order unit. You can provide a reason and a message for the ticket. ### Method POST ### Endpoint /v2/tickets ### Parameters #### Request Body - **id_order_unit** (array) - Required - An array containing the ID(s) of the order unit(s) for which to open a ticket. - **reason** (string) - Required - The reason for opening the ticket (e.g., "product_not_as_described"). - **message** (string) - Required - A message detailing the issue. ### Request Example ```json { "id_order_unit": [ 1234567890 ], "reason": "product_not_as_described", "message": "Some message here" } ``` ### Response #### Success Response (201 Created) - **Location** (string) - The URL of the newly created ticket, including its ID. #### Response Example ``` Location: /v2/tickets/2498572 ``` ``` -------------------------------- ### Get Report Metadata Source: https://sellerapi.kaufland.com/?page=reports Retrieves detailed metadata for a specific report using its ID. ```APIDOC ## GET /reports/{id_report} ### Description Retrieves the full metadata for a single report using its unique identifier. ### Method GET ### Endpoint /reports/{id_report} ### Parameters #### Path Parameters - **id_report** (string) - Required - The unique identifier of the report. ### Request Example ```json { "example": "GET /reports/report_123" } ``` ### Response #### Success Response (200) - **url** (string) - The URL from which the report file can be downloaded. #### Response Example ```json { "example": { "url": "https://example.com/reports/download/report_123.csv" } } ``` ``` -------------------------------- ### Retrieve All Open Returns Source: https://sellerapi.kaufland.com/?page=returns This GET request retrieves all open returns across all customers by filtering on multiple status values. Remember to handle pagination for comprehensive results. ```bash GET https://sellerapi.kaufland.com/v2/returns?status=return_requested&status=label_generated&status=package_sent&status=package_received ``` -------------------------------- ### GET /attributes/{id_attribute}/shared-set Endpoint Source: https://sellerapi.kaufland.com/?page=releaselog A new endpoint for fetching shared sets of attributes. ```http GET /attributes/{id_attribute}/shared-set ``` -------------------------------- ### Example Product Data CSV Content Source: https://sellerapi.kaufland.com/?page=product-data-files This snippet shows the expected CSV format for product data, including semicolon separators and UTF-8 encoding. Note the handling of multiple values for attributes like 'picture'. ```csv ean;locale;title;colour;picture;picture;picture.url;picture.alt_text 4019111448324;de-DE;Siena Garden Gartenbank Kadina II;Weiß;http://example.com/sggk2_1.jpg;;http://example.com/sggk2_2.jpg;alt text 4039568600076;de-DE;Inko Stapelbank Duke Bronze;Bronze;http://example.com/isdb_1.jpg;;http://example.com/isdb_2.jpg; 4039568600113;de-DE;Inko Stapelbank Nexus Weiss;Weiß;http://example.com/isnw_1.jpg;http://example.com/isnw_2.jpg;http://example.com/isnw_3.jpg;alt text 4039568600021;de-DE;Inko Stapelbank Nexus Bronze;Bronze;http://example.com/isnb_1.jpg;;http://example.com/isnb_2.jpg; ``` -------------------------------- ### FAQ Section JSON Example Source: https://sellerapi.kaufland.com/?page=product-data-rich-content-faq This JSON structure represents a single FAQ block. It includes the block type, question, answer, and an optional separator. Use this for creating expandable question/answer pairs in product rich content. ```json { "type": "faq", "data": { "question": "1. Question number one", "answer": "There are many variations of passages of Lorem Ipsum available, but the majority have been altered in some form, by injected humour or randomised content." }, "separator": true } ``` -------------------------------- ### Upload Product Offer using PHP and cURL Source: https://sellerapi.kaufland.com/?page=getting-started This PHP script uses cURL to send a POST request to the Kaufland Marketplace API to create a new product offer. It includes a `signRequest` function for authentication and requires API keys for authorization. The script outputs the HTTP response code and headers. ```php "9780470527580", "condition" => "new", "listing_price" => 4550, "minimum_price" => 3990, "amount" => 9, "delivery_time_min": 3, "delivery_time_max": 8, "location" => "DE" ]; $jsonData = json_encode($data); // We're adding a new unit $uri = $baseUrl . '/units/'; // Current Unix timestamp in seconds $timestamp = time(); // Name of your partner solution $userAgent = 'test' // Define all the mandatory headers $headers = [ 'Accept: application/json', 'Shop-Client-Key: ' . $clientKey, 'Shop-Timestamp: ' . $timestamp, 'Shop-Signature: ' . signRequest('POST', $uri, $jsonData, $timestamp, $secretKey), 'User-Agent: ' . $userAgent, ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $uri); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLINFO_HEADER_OUT, 1); $response = curl_exec($ch); list($header, $body) = explode("\r\n\r\n", $response, 2); print("$header\n\n"); $responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); print("HTTP Response Code: $responseCode\n"); ``` -------------------------------- ### Get Product Data Status Source: https://sellerapi.kaufland.com/?page=product-data Retrieves the status of product data updates for a given product EAN. ```APIDOC ## GET /product-data/status/{ean} ### Description Retrieves the status of product data updates for a specific product identified by its EAN. ### Method GET ### Endpoint /product-data/status/{ean} ### Parameters #### Path Parameters - **ean** (string) - Required - The EAN of the product whose status is to be retrieved. ### Response #### Success Response (200) - **update_status** (string) - The current status of the product data update (e.g., PENDING, IN_PROGRESS, SUCCESS, FAIL). - **update_fail_reason** (string) - If the `update_status` is FAIL, this field contains the reason for the failure. #### Response Example ```json { "update_status": "SUCCESS", "update_fail_reason": null } ``` ``` -------------------------------- ### Get Category Info by ID Source: https://sellerapi.kaufland.com/?page=product-data Retrieve detailed information for a specific category using its ID and storefront. ```HTTP GET https://sellerapi.kaufland.com/categories/50551?storefront=de ``` -------------------------------- ### Example Full Return Information Response Source: https://sellerapi.kaufland.com/?page=returns This JSON structure represents a detailed response when retrieving full information about a return, including return units and buyer data. ```json { "data": { "id_return": 3800, "ts_created_iso": "2016-05-07T23:10:36Z", "ts_updated_iso": "2016-05-09T11:17:02Z", "storefront": "de" "tracking_provider": "DHL", "tracking_code": "00340434161221754211", "status": "label_generated", "return_units": { "[ { "id_return_unit": 4134, "id_return": 3800, "id_order_unit": 2312312451, "ts_created_iso": "2016-05-07T22:00:14Z", "status": "need_to_be_returned", "note": "Sadly not the right size.", "reason": "wrong_size", "storefront": "de" } ] }, "buyer": { "id_buyer": 3124124, "email": "john.doe@example.de" } } } ``` -------------------------------- ### Push Notification Subscription Response Source: https://sellerapi.kaufland.com/?page=push-notifications This is an example of a successful response body when subscribing to a push notification event. ```json { "data": { "id_subscription": 11011, "callback_url": "https://example.com/hm_notifications.php", "fallback_email": "test@kaufland.de", "event_name": "order_new", "is_active": true, "storefront": "de" } } ``` -------------------------------- ### Get Category Info Source: https://sellerapi.kaufland.com/?page=product-data Retrieves all available information for a specific category using its ID. Requires specifying a storefront. ```APIDOC ## GET /categories/{id_category}/ ### Description Retrieves all available information for a specific category using its ID. Requires specifying a storefront. ### Method GET ### Endpoint /categories/{id_category}/ ### Parameters #### Path Parameters - **id_category** (string) - Required - The unique identifier of the category. #### Query Parameters - **storefront** (string) - Required - Specifies the country storefront (e.g., 'de'). ```