### Install Shoptet API SDK via Composer Source: https://api.docs.shoptet.com/shoptet-api/openapi Use this command to install the SDK using Composer. Composer handles dependencies automatically. ```bash composer require shoptet/api-sdk-php ``` -------------------------------- ### Obtain OAuth Access Token via Addon Installation Source: https://api.docs.shoptet.com/shoptet-api/openapi This code shows how to obtain and store a new OAuth token during an addon installation callback. It requires setting the partner domain URL and providing necessary OAuth parameters. ```php // Set partner domain URL for obtaining fresh public API token \Shoptet\Api\Sdk\Php\Sdk::setPartnerDomainUrl('https://partner-eshop.myshoptet.com'); $requestData = new \Shoptet\Api\Sdk\Php\Endpoint\OAuth\CreateOauthAccessToken\CreateOauthAccessTokenRequestData([ 'client_id' => 'some-client-id', 'client_secret' => 'some-client-secret', 'redirect_uri' => 'https://partner-redirect-domain.com/after/authorize', 'code' => 'fdqmcvw0b89p3xv31j7w....', // use code from request ]); $authorizationFacade = \Shoptet\Api\Sdk\Php\Sdk::createAuthorizationFacade(); // obtain and store new OAuth token $authorizationFacade->addonInstallationCallback('oauth-token-for-target-eshop', $requestData); ``` -------------------------------- ### Order Insertion Request Example Source: https://api.docs.shoptet.com/shoptet-api/openapi A JSON request body example for inserting a new order into Shoptet. This includes customer details, payment and shipping information, and line items. ```json { "data": { "email": "foo@bar.cz", "externalCode": "123", "paymentMethodGuid": "6f2c8e36-3faf-11e2-a723-705ab6a2ba75", "shippingGuid": "8921cdc1-051b-11e5-a8d3-ac162d8a2454", "billingAddress": { "fullName": "Jan Novák", "street": "Rovná", "city": "Rovina", "zip": "12300" }, "currency": { "code": "CZK" }, "items": [ { "itemType": "product", "code": "32/ZEL", "vatRate": "21.00", "itemPriceWithVat": "121.00" }, { "itemType": "billing", "name": "Platba převodem", "vatRate": "21.00", "itemPriceWithVat": "0" }, { "itemType": "shipping", "name": "PPL", "vatRate": "21.00", "itemPriceWithVat": "59.00" } ] } } ``` -------------------------------- ### Shoptet API - Success Response Example Source: https://api.docs.shoptet.com/shoptet-api/openapi Example of a successful JSON response from the Shoptet API. ```APIDOC ## Response Format (Success) ### Description This is the standard format for a successful JSON response from the Shoptet API. ### Response Body Example ```json { "data": { "contactInformation": { "eshopName": "www.domena-eshopu.cz", "url": "https:\/\/www.domena-eshopu.cz\/", "companyId": "28935675" } }, "errors": null, "metadata": { "requestId": "019c8c34-64f3-7328-af43-bf1e34fa39d7" } } ``` ### Response Fields - **data** (object | null) - Contains the requested data or null if not present. - **errors** (array | null) - Contains error details if an error occurred, otherwise null. - **metadata** (object) - Contains metadata about the request, such as `requestId`. ``` -------------------------------- ### GET /api/products/warranties Source: https://api.docs.shoptet.com/shoptet-api/openapi Returns a list of product warranties. ```APIDOC ## GET /api/products/warranties ### Description Returns list of product warranties. ### Method GET ### Endpoint /api/products/warranties ``` -------------------------------- ### GET /api/products/{guid}/relatedProducts Source: https://api.docs.shoptet.com/shoptet-api/openapi Returns a list of related products for a given product, ordered by priority. If reciprocal linking is enabled, it also includes products that list the current product as related. ```APIDOC ## GET /api/products/{guid}/relatedProducts ### Description Returns a list of related products for a given product, ordered by priority. If reciprocal linking is enabled, it also includes products that list the current product as related. ### Method GET ### Endpoint /api/products/{guid}/relatedProducts ### Parameters #### Path Parameters - **guid** (string) - Required - The unique identifier of the product. #### Query Parameters - **priority** (integer) - Optional - The priority to order the related products by. ### Response #### Success Response (200) - **relatedProducts** (array) - A list of related products. - **guid** (string) - The unique identifier of the related product. - **priority** (integer) - The priority of the related product. #### Response Example { "relatedProducts": [ { "guid": "related_product_guid_1", "priority": 1 }, { "guid": "related_product_guid_2", "priority": 2 } ] } ``` -------------------------------- ### GET /api/products/surcharge-parameters/{code} Source: https://api.docs.shoptet.com/shoptet-api/openapi Detail of surcharge parameter. ```APIDOC ## GET /api/products/surcharge-parameters/{code} ### Description Detail of surcharge parameter. ### Method GET ### Endpoint /api/products/surcharge-parameters/{code} #### Path Parameters - **code** (string) - Required - The code of the surcharge parameter. ``` -------------------------------- ### GET /api/products/availabilities Source: https://api.docs.shoptet.com/shoptet-api/openapi Returns the list of product availabilities within the e-shop and default availabilities ids. ```APIDOC ## GET /api/products/availabilities ### Description Returns the list of product availabilities within the e-shop and default availabilities ids. ### Method GET ### Endpoint /api/products/availabilities ``` -------------------------------- ### Shoptet API - Error Response Example Source: https://api.docs.shoptet.com/shoptet-api/openapi Example of a JSON response from the Shoptet API when an error occurs. ```APIDOC ## Response Format (Error) ### Description This is the standard format for an error JSON response from the Shoptet API. ### Response Body Example ```json { "data": null, "errors": [ { "errorCode": "missing-access-token", "message": "Missing access token. Please add `Shoptet-Access-Token` header to your request.", "instance": "unknown" } ], "metadata": { "requestId": "019c8c34-64f3-7328-af43-bf1e34fa39d7" } } ``` ### Response Fields - **data** (object | null) - Contains the requested data or null if not present. - **errors** (array) - Contains error details when an error occurs. - **errorCode** (string) - The code identifying the type of error. - **message** (string) - A human-readable description of the error. - **instance** (string) - Information about the specific instance related to the error. - **metadata** (object) - Contains metadata about the request, such as `requestId`. ``` -------------------------------- ### GET /api/products/surcharge-parameters Source: https://api.docs.shoptet.com/shoptet-api/openapi Returns the list of available surcharge parameters with their available values within the e-shop. ```APIDOC ## GET /api/products/surcharge-parameters ### Description Returns the list of available surcharge parameters with their available values within the e-shop. ### Method GET ### Endpoint /api/products/surcharge-parameters ``` -------------------------------- ### List of products Source: https://api.docs.shoptet.com/shoptet-api/openapi Returns a list of products with basic information and GUIDs. Supports paging and can include main product image information if requested. Allows filtering by specific product codes or GUIDs (max 50, comma-separated). ```APIDOC ## GET /api/products ### Description Returns the list of products with basic info and GUID. Supports Paging. Information about the main product image can be included if `include=images` parameter is used. ### Method GET ### Endpoint /api/products ### Parameters #### Query Parameters - **include** (string) - Optional - Specifies additional information to include in the response, e.g., `images`. - **productCodes** (string) - Optional - Comma-separated list of product codes to filter by (max 50). If used, other filters are not applied. - **productGuids** (string) - Optional - Comma-separated list of product GUIDs to filter by (max 50). If used, other filters are not applied. ### Response #### Success Response (200) - **products** (array) - List of product objects, each containing basic info and GUID. - **paging** (object) - Information about pagination. #### Response Example { "products": [ { "guid": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "name": "Example Product", "price": { "currency": "EUR", "value": 100.00 }, "imageUrl": "https://example.com/image.jpg" } ], "paging": { "limit": 50, "offset": 0, "total": 100 } } ``` -------------------------------- ### POST /api/products/{guid}/related-files Source: https://api.docs.shoptet.com/shoptet-api/openapi Links a related file from temporary storage to a specific product. ```APIDOC ## POST /api/products/{guid}/related-files ### Description Links a related file from temporary storage to a specific product. ### Method POST ### Endpoint /api/products/{guid}/related-files ### Parameters #### Path Parameters - **guid** (string) - Required - The unique identifier of the product to which the file will be linked. #### Request Body - **fileGuid** (string) - Required - The unique identifier of the file in temporary storage to link. ### Request Example { "fileGuid": "temporary_file_guid" } ### Response #### Success Response (200) - **message** (string) - A success message indicating the file was linked. #### Response Example { "message": "File linked successfully to product." } ``` -------------------------------- ### Creation of customer account Source: https://api.docs.shoptet.com/shoptet-api/openapi Creates a new customer account for a given customer GUID. ```APIDOC ## POST /api/customers/{guid}/accounts ### Description Creates a new customer account for the specified customer. ### Method POST ### Endpoint /api/customers/{guid}/accounts ### Parameters #### Path Parameters - **guid** (string) - Required - The unique identifier of the customer. #### Request Body - **[Schema for customer account creation]** (object) - Required - The details of the customer account to be created. ``` -------------------------------- ### GET /api/xy-discounts Source: https://api.docs.shoptet.com/shoptet-api/openapi Retrieves a list of all X+Y discounts configured in the e-shop. ```APIDOC ## GET /api/xy-discounts ### Description Retrieves a list of all X+Y discounts configured in the e-shop. ### Method GET ### Endpoint /api/xy-discounts ``` -------------------------------- ### GET /api/products/units Source: https://api.docs.shoptet.com/shoptet-api/openapi Retrieves a list of all product units available in the e-shop. ```APIDOC ## GET /api/products/units ### Description Retrieves a list of all product units available in the e-shop. ### Method GET ### Endpoint /api/products/units ``` -------------------------------- ### GET /api/volume-discounts Source: https://api.docs.shoptet.com/shoptet-api/openapi Retrieves a list of all volume discounts currently configured in the e-shop. ```APIDOC ## GET /api/volume-discounts ### Description Retrieves a list of all volume discounts currently configured in the e-shop. ### Method GET ### Endpoint /api/volume-discounts ``` -------------------------------- ### GET /api/xy-discounts/settings Source: https://api.docs.shoptet.com/shoptet-api/openapi Retrieves the current settings for X+Y discounts. This includes general settings and potentially category targeting configurations. ```APIDOC ## GET /api/xy-discounts/settings ### Description Retrieves the current settings for X+Y discounts. This includes general settings and potentially category targeting configurations. ### Method GET ### Endpoint /api/xy-discounts/settings ``` -------------------------------- ### Include Composer Autoloader Source: https://api.docs.shoptet.com/shoptet-api/openapi After installing with Composer, include the autoloader to make the SDK classes available in your project. ```php require_once 'vendor/autoload.php'; ``` -------------------------------- ### GET /api/proof-payments/snapshot Source: https://api.docs.shoptet.com/shoptet-api/openapi Retrieves a snapshot of all proof payments with detailed information, returned in JSONlines format and compressed with GZIP. ```APIDOC ## GET /api/proof-payments/snapshot ### Description Using this endpoint, you can get a list of all proof payments with detailed info of each proof payment (like in Proof payment Detail endpoint). Response will be in jsonlines format with each proof payment taking one line of output file. One proof payment in response has the same format as proof payment detail response. See Proof payment snapshot schema for more details. Result file is compressed using GZIP. ### Method GET ### Endpoint /api/proof-payments/snapshot ``` -------------------------------- ### Call for Private API Access Source: https://api.docs.shoptet.com/shoptet-api/openapi Example cURL command for accessing the Shoptet private API. Requires the 'Shoptet-Private-API-Token' header. ```bash curl --include \ -H 'Shoptet-Private-API-Token: 123456-a-123-XXXXXXXXXXXXXXXXXXXXXXXXX' \ -H 'Content-Type: application/json' \ 'https://api.myshoptet.com/api/eshop' ``` -------------------------------- ### GET /api/template-include Source: https://api.docs.shoptet.com/shoptet-api/openapi Lists currently defined HTML codes for the addon in all possible locations. Each addon can only view its own codes. ```APIDOC ## GET /api/template-include ### Description This endpoint lists currently defined HTML codes for this addon, in all possible locations. Each addon sees only “its own” codes; it cannot see other codes of other addons, not even from the same developer. Also, it does not see the code inserted within the administration. ### Method GET ### Endpoint /api/template-include ### Parameters #### Query Parameters - **location** (string) - Optional - Specifies the location to filter the codes (e.g., common-header, common-footer, order-confirmed). ### Response #### Success Response (200) - **codes** (object) - An object containing HTML codes keyed by location. - **common-header** (string) - The HTML code for the common header. - **common-footer** (string) - The HTML code for the common footer. - **order-confirmed** (string) - The HTML code for the order confirmed page. #### Response Example ```json { "codes": { "common-header": "", "common-footer": "", "order-confirmed": "
Thank you for your order!
" } } ``` ``` -------------------------------- ### Get List of Products Source: https://api.docs.shoptet.com/shoptet-api/openapi Retrieves a paginated list of products. The response includes methods to fetch the next page of results. ```APIDOC ## Get List of Products ### Description This endpoint retrieves a paginated list of products. The SDK provides functionality to easily navigate through the pages of results. ### Method GET ### Endpoint /products ### Parameters N/A ### Request Example ```php \Shoptet\Api\Sdk\Php\Sdk::setPartnerDomainUrl('https://partner-eshop.myshoptet.com'); \Shoptet\Api\Sdk\Php\Sdk::authorizeRequest('token-for-target-eshop'); $listOfProductResponse = \Shoptet\Api\Sdk\Php\Sdk::getListOfProducts(); //... Process response try { $listOfProductResponseNextPage = $listOfProductResponse->getNextPage(); } catch (OutOfRangeException $e) { //Next page is out of range - Last page already reached } ``` ### Response #### Success Response (200) - **products** (array) - A list of products. - **pagination** (object) - Pagination details, including a method to get the next page. ``` -------------------------------- ### Manual SDK Installation Source: https://api.docs.shoptet.com/shoptet-api/openapi If not using Composer, include the SDK's initialization file manually. Ensure all dependencies are met. ```php require_once '/path/to/api-sdk-php/init.php'; ``` -------------------------------- ### GET /api/sales-channels/{guid} Source: https://api.docs.shoptet.com/shoptet-api/openapi Retrieves detailed information about a specific sales channel using its GUID. Requires the Sales Channel module. ```APIDOC ## GET /api/sales-channels/{guid} ### Description Information about the detail of the sales channels. Module Sales Channel is required. ### Method GET ### Endpoint /api/sales-channels/{guid} #### Path Parameters - **guid** (string) - Description: The GUID of the sales channel. ``` -------------------------------- ### Authorization Setup Source: https://api.docs.shoptet.com/shoptet-api/openapi Demonstrates how to set the partner domain URL and authorize requests using a token. It also includes logic for handling expired or missing tokens by creating a fresh public API token. ```APIDOC ## Authorization Setup ### Description This section details the process of authorizing API requests. It involves setting the partner domain URL and using an access token. The code examples show how to handle token expiration or absence by obtaining a new token. ### Method PHP SDK methods ### Endpoint N/A (SDK methods) ### Parameters N/A ### Request Example ```php // Set partner domain URL \Shoptet\Api\Sdk\Php\Sdk::setPartnerDomainUrl('https://partner-eshop.myshoptet.com'); try { // Authorize request with a token \Shoptet\Api\Sdk\Php\Sdk::authorizeRequest('token-for-target-eshop'); } catch (TokenHasExpiredException | TokenNotFoundException) { // If token has expired or not found, create fresh public API token \Shoptet\Api\Sdk\Php\Sdk::createFreshPublicApiToken('token-for-target-eshop', 'oauth-token-for-target-eshop'); // Try to authorize request again with fresh public API token \Shoptet\Api\Sdk\Php\Sdk::authorizeRequest('token-for-target-eshop'); } ``` ### Response N/A (SDK method execution) ``` -------------------------------- ### GET /api/discussions-posts Source: https://api.docs.shoptet.com/shoptet-api/openapi Retrieves a list of discussion posts. Supports filtering by product GUID, article ID, page ID, customer GUID, author's email, and creation date. The 'discussion' module must be active. ```APIDOC ## GET /api/discussions-posts ### Description Lists discussion posts with filtering capabilities. ### Method GET ### Endpoint /api/discussions-posts ### Parameters #### Query Parameters - **productGuid** (string) - Optional - Filter by product GUID. - **articleId** (integer) - Optional - Filter by article ID. - **pageId** (integer) - Optional - Filter by page ID. - **customerGuid** (string) - Optional - Filter by customer GUID. - **authorEmail** (string) - Optional - Filter by author's email. - **creationDate** (string) - Optional - Filter by creation date (format may vary, e.g., YYYY-MM-DD). ### Response #### Success Response (200) - **discussions** (array) - A list of discussion post objects. - **id** (integer) - The unique identifier of the discussion post. - **productId** (integer) - The ID of the product the discussion belongs to. - **articleId** (integer) - The ID of the article the discussion belongs to. - **pageId** (integer) - The ID of the page the discussion belongs to. - **customerGuid** (string) - The GUID of the customer who posted. - **authorEmail** (string) - The email of the author. - **createdAt** (string) - The date and time of creation. - **content** (string) - The content of the discussion post. - **approved** (boolean) - Indicates if the post is approved. - **authorName** (string) - The name of the author. - **authorUrl** (string) - The URL of the author. - **authorAvatarUrl** (string) - The URL of the author's avatar. - **parentDiscussionId** (integer) - The ID of the parent discussion post, if it's a reply. - **product** (object) - Details about the associated product. - **article** (object) - Details about the associated article. - **page** (object) - Details about the associated page. - **customer** (object) - Details about the associated customer. ``` -------------------------------- ### GET /api/shipping-request/{shippingRequestCode}/{shippingGuid} Source: https://api.docs.shoptet.com/shoptet-api/openapi Retrieves the details of a cart associated with a specific shipping request, identified by its code and GUID. ```APIDOC ## GET /api/shipping-request/{shippingRequestCode}/{shippingGuid} ### Description Endpoint returns details of cart for shipping request. ### Method GET ### Endpoint /api/shipping-request/{shippingRequestCode}/{shippingGuid} ### Parameters #### Path Parameters - **shippingRequestCode** (string) - Required - The code of the shipping request. - **shippingGuid** (string) - Required - The GUID of the shipping request. ### Response #### Success Response (200) - **cartDetails** (object) - Description of the cart details. ``` -------------------------------- ### POST /api/products/availabilities Source: https://api.docs.shoptet.com/shoptet-api/openapi Creates a new product availability. ```APIDOC ## POST /api/products/availabilities ### Description Creates a new product availability. ### Method POST ### Endpoint /api/products/availabilities ``` -------------------------------- ### Shoptet API - Example Call for Addons Source: https://api.docs.shoptet.com/shoptet-api/openapi This snippet demonstrates how to make a request to the Shoptet API for addons using an access token. ```APIDOC ## GET /api/eshop ### Description This endpoint is used to retrieve information related to addons for the eshop. ### Method GET ### Endpoint /api/eshop ### Parameters #### Headers - **Shoptet-Access-Token** (string) - Required - The access token for authenticating with the Shoptet API. - **Content-Type** (string) - Required - Specifies the content type of the request, typically application/json. ### Request Example ```http GET /api/eshop HTTP/2 Host: api.myshoptet.com Shoptet-Access-Token: 123456-a-123-XXXXXXXXXXXXXXXXXXXXXXXXX Content-Type: application/json ``` ``` -------------------------------- ### Deletion of customer account Source: https://api.docs.shoptet.com/shoptet-api/openapi Deletes a specific customer account using its GUID and the parent customer's GUID. ```APIDOC ## DELETE /api/customers/{guid}/accounts/{accountGuid} ### Description Deletes a specific customer account. ### Method DELETE ### Endpoint /api/customers/{guid}/accounts/{accountGuid} ### Parameters #### Path Parameters - **guid** (string) - Required - The unique identifier of the customer. - **accountGuid** (string) - Required - The unique identifier of the customer account. ``` -------------------------------- ### Run Unit Tests Source: https://api.docs.shoptet.com/shoptet-api/openapi Execute the unit tests for the SDK using the provided composer command. ```bash composer test:unit ``` -------------------------------- ### Update of customer account Source: https://api.docs.shoptet.com/shoptet-api/openapi Updates an existing customer account identified by its GUID and the parent customer's GUID. ```APIDOC ## PATCH /api/customers/{guid}/accounts/{accountGuid} ### Description Updates an existing customer account. ### Method PATCH ### Endpoint /api/customers/{guid}/accounts/{accountGuid} ### Parameters #### Path Parameters - **guid** (string) - Required - The unique identifier of the customer. - **accountGuid** (string) - Required - The unique identifier of the customer account. #### Request Body - **[Schema for customer account update]** (object) - Required - The fields to update for the customer account. ``` -------------------------------- ### Detail of customer account Source: https://api.docs.shoptet.com/shoptet-api/openapi Retrieves the details of a specific customer account using its GUID and the parent customer's GUID. ```APIDOC ## GET /api/customers/{guid}/accounts/{accountGuid} ### Description Retrieves the detailed information for a specific customer account. ### Method GET ### Endpoint /api/customers/{guid}/accounts/{accountGuid} ### Parameters #### Path Parameters - **guid** (string) - Required - The unique identifier of the customer. - **accountGuid** (string) - Required - The unique identifier of the customer account. ``` -------------------------------- ### Obtaining OAuth Access Token Source: https://api.docs.shoptet.com/shoptet-api/openapi Illustrates how to obtain a new OAuth access token, typically during an addon installation callback, by providing client credentials and a code. ```APIDOC ## Obtaining OAuth Access Token ### Description This section describes how to obtain a new OAuth access token, which is necessary for certain operations. It is often used in the context of an addon installation callback. ### Method PHP SDK methods ### Endpoint N/A (SDK methods) ### Parameters N/A ### Request Example ```php // Set partner domain URL \Shoptet\Api\Sdk\Php\Sdk::setPartnerDomainUrl('https://partner-eshop.myshoptet.com'); $requestData = new \Shoptet\Api\Sdk\Php\Endpoint\OAuth\CreateOauthAccessToken\CreateOauthAccessTokenRequestData([ 'client_id' => 'some-client-id', 'client_secret' => 'some-client-secret', 'redirect_uri' => 'https://partner-redirect-domain.com/after/authorize', 'code' => 'fdqmcvw0b89p3xv31j7w....', // use code from request ]); $authorizationFacade = \Shoptet\Api\Sdk\Php\Sdk::createAuthorizationFacade(); // obtain and store new OAuth token $authorizationFacade->addonInstallationCallback('oauth-token-for-target-eshop', $requestData); ``` ### Response N/A (SDK method execution) ``` -------------------------------- ### Deletion of customer delivery address Source: https://api.docs.shoptet.com/shoptet-api/openapi Deletes a specific customer delivery address using its GUID and the parent customer's GUID. ```APIDOC ## DELETE /api/customers/{guid}/delivery-addresses/{addressGuid} ### Description Deletes a specific customer delivery address. ### Method DELETE ### Endpoint /api/customers/{guid}/delivery-addresses/{addressGuid} ### Parameters #### Path Parameters - **guid** (string) - Required - The unique identifier of the customer. - **addressGuid** (string) - Required - The unique identifier of the delivery address. ``` -------------------------------- ### Call for Addons API Source: https://api.docs.shoptet.com/shoptet-api/openapi Example cURL command to call the Shoptet API for addons. Ensure the 'Shoptet-Access-Token' header is correctly set. ```bash curl --include \ -H 'Shoptet-Access-Token: 123456-a-123-XXXXXXXXXXXXXXXXXXXXXXXXX' \ -H 'Content-Type: application/json' \ 'https://api.myshoptet.com/api/eshop' ``` -------------------------------- ### Update of customer delivery address Source: https://api.docs.shoptet.com/shoptet-api/openapi Updates an existing customer delivery address identified by its GUID and the parent customer's GUID. ```APIDOC ## PATCH /api/customers/{guid}/delivery-addresses/{addressGuid} ### Description Updates an existing customer delivery address. ### Method PATCH ### Endpoint /api/customers/{guid}/delivery-addresses/{addressGuid} ### Parameters #### Path Parameters - **guid** (string) - Required - The unique identifier of the customer. - **addressGuid** (string) - Required - The unique identifier of the delivery address. #### Request Body - **[Schema for delivery address update]** (object) - Required - The fields to update for the delivery address. ``` -------------------------------- ### GET /v1/payments/{id} Source: https://api.docs.shoptet.com/shoptet-pay-api/openapi-public Retrieves the details of a specific payment by its ID. Use this to get comprehensive information about a single payment transaction. ```APIDOC ## GET /v1/payments/{id} ### Description Retrieves the details of a specific payment by its ID. Use this to get comprehensive information about a single payment transaction. ### Method GET ### Endpoint /v1/payments/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the payment. ### Response #### Success Response (200 OK) - **id** (string) - The unique identifier of the payment. - **status** (string) - The current status of the payment. - **amount** (number) - The amount of the payment. - **currency** (string) - The currency of the payment. - **createdAt** (string) - The timestamp when the payment was initiated. #### Response Example { "id": "p_12345abcde", "status": "completed", "amount": 25.00, "currency": "CZK", "createdAt": "2023-10-27T12:00:00Z" } ``` -------------------------------- ### Creation of customer Source: https://api.docs.shoptet.com/shoptet-api/openapi Creates a new customer in the e-shop. ```APIDOC ## POST /api/customers ### Description Creation of customer. ### Method POST ### Endpoint /api/customers ``` -------------------------------- ### Detail of customer delivery address Source: https://api.docs.shoptet.com/shoptet-api/openapi Retrieves the details of a specific customer delivery address using its GUID and the parent customer's GUID. ```APIDOC ## GET /api/customers/{guid}/delivery-addresses/{addressGuid} ### Description Retrieves the detailed information for a specific customer delivery address. ### Method GET ### Endpoint /api/customers/{guid}/delivery-addresses/{addressGuid} ### Parameters #### Path Parameters - **guid** (string) - Required - The unique identifier of the customer. - **addressGuid** (string) - Required - The unique identifier of the delivery address. ``` -------------------------------- ### List of all quantity discounts (snapshot) Source: https://api.docs.shoptet.com/shoptet-api/openapi Retrieves a list of all quantity discounts with detailed information about each article asynchronously. The response is in jsonlines format, compressed with GZIP, and each discount has the same format as in the detail endpoint. ```APIDOC ## GET /api/quantity-discounts/snapshot ### Description Retrieves a list of all quantity discounts with detailed information about each article asynchronously. The response is in jsonlines format, compressed with GZIP, and each discount has the same format as in the detail endpoint. ### Method GET ### Endpoint /api/quantity-discounts/snapshot ``` -------------------------------- ### Call Endpoint with Request Body Source: https://api.docs.shoptet.com/shoptet-api/openapi Demonstrates how to set up authorization and then call an API endpoint, such as `createBrand`, with a request body. The response body can be accessed using `getBody()`. ```php \Shoptet\Api\Sdk\Php\Sdk::setPartnerDomainUrl('https://partner-eshop.myshoptet.com'); \Shoptet\Api\Sdk\Php\Sdk::authorizeRequest('token-for-target-eshop'); $createdBrandResponse = \Shoptet\Api\Sdk\Php\Sdk::createBrand([ 'data' => [ 'name' => 'Brand name', 'description' => 'Brand description', 'indexName' => 'brand-name', ] ]); $createdBrandResponse->getBody(); //... ``` -------------------------------- ### Create Pricelist Source: https://api.docs.shoptet.com/shoptet-api/openapi Creates a new price list in the Shoptet e-shop. ```APIDOC ## POST /api/pricelists ### Description Creates a new price list. ### Method POST ### Endpoint /api/pricelists ### Parameters #### Request Body - **name** (string) - Required - Name of the price list. - **currency** (object) - Required - Currency object for the price list. - **code** (string) - Required - ISO 4217 currency code (e.g., "EUR", "USD"). - **active** (boolean) - Optional - Whether the price list is active. Defaults to true. ### Request Example ```json { "name": "Wholesale Prices", "currency": { "code": "EUR" }, "active": true } ``` ### Response #### Success Response (201) - **id** (string) - The ID of the newly created price list. - **name** (string) - The name of the created price list. - **currency** (object) - The currency object of the created price list. - **active** (boolean) - The active status of the created price list. #### Response Example ```json { "id": "new-price-list-id", "name": "Wholesale Prices", "currency": { "code": "EUR" }, "active": true } ``` ``` -------------------------------- ### DELETE /api/discount-coupons/templates/{guid} Source: https://api.docs.shoptet.com/shoptet-api/openapi Deletes a discount coupon template identified by its GUID. Returns 200 on success. Returns 404 if the template does not exist. Returns 409 if the template is in use. ```APIDOC ## DELETE /api/discount-coupons/templates/{guid} ### Description Deletes discount coupon template as per entered guid. ### Method DELETE ### Endpoint /api/discount-coupons/templates/{guid} ### Parameters #### Path Parameters - **guid** (string) - Required - The unique identifier of the discount coupon template to delete. ### Response #### Success Response (200) Returns a success status code if the template is deleted. #### Error Response - **404 Not Found**: If the discount coupon template does not exist. - **409 Conflict**: If the discount coupon template cannot be deleted because it is used as a template of a discount coupon. ``` -------------------------------- ### Product Image Fields Example Source: https://api.docs.shoptet.com/shoptet-api/openapi Illustrates the structure of image-related fields returned by the product detail endpoint, including name, description, SEO name, and CDN name. ```json "name": "106.png", "description": "shamrock 2115611 640", "seoName": "106_shamrock-2115611-640.png", "cdnName": "106_shamrock-2115611-640.png?5b2a41f5" ``` -------------------------------- ### Update of brand Source: https://api.docs.shoptet.com/shoptet-api/openapi Updates an existing brand identified by its code. Note: The `code` field is deprecated; use `indexName` instead. `code` accepts both GUID and index name styles, while `indexName` is deprecated in favor of GUID style. ```APIDOC ## PATCH /api/brands/{code} ### Description Updates an existing brand. Note: The `code` field is deprecated; use `indexName` instead. Parameter `code` accepts both GUID string style and index name string style, while the index name string style is deprecated in favor of the GUID style. ### Method PATCH ### Endpoint /api/brands/{code} ``` -------------------------------- ### List of all discount coupons (snapshot) Source: https://api.docs.shoptet.com/shoptet-api/openapi Retrieves a list of all discount coupons with detailed information asynchronously. The response is in jsonlines format, compressed with GZIP. ```APIDOC ## GET /api/discount-coupons/snapshot ### Description Using this endpoint, you can get list of all discount coupons with detailed info of each discount coupon asynchronously. See how [Asynchronous requests](https://developers.shoptet.com/asynchronous-requests/) work on our developer's portal. Response will be in jsonlines format with each discount coupon taking one line of output file. One discount coupon in response has the same format as one discount coupon item form list response. See Discount coupon snapshot schema for more details. Result file is compressed using GZIP. ### Method GET ### Endpoint /api/discount-coupons/snapshot ``` -------------------------------- ### List of all price list details (Snapshot) Source: https://api.docs.shoptet.com/shoptet-api/openapi Asynchronously retrieves a list of all price list details, including information on each price. The response is in JSON Lines format and compressed with GZIP. ```APIDOC ## GET /api/pricelists/{id}/snapshot ### Description Using this endpoint, you can get a list of all price list details with information on each price (like in Price list Detail endpoint) asynchronously. See how Asynchronous requests work on our developer’s portal. Response will be in jsonlines format with each price list taking one line of output file. One price list in response has the same format as price list detail response. See Price list snapshot schema for more details. Result file is compressed using GZIP. ### Method GET ### Endpoint /api/pricelists/{id}/snapshot ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the price list for which to get the snapshot. ### Request Example None ### Response #### Success Response (200) - **Gzipped JSON Lines file** - Each line represents a price list detail, formatted similarly to the Price list Detail endpoint response. The entire file is compressed using GZIP. #### Response Example (content of one line in JSON Lines format before compression) ```json { "id": "string", "name": "string", "currency": { "code": "string" }, "active": true, "products": [ { "variantId": "string", "code": "string", "price": { "amount": 0.0, "currency": { "code": "string" } }, "priceWithVat": { "amount": 0.0, "currency": { "code": "string" } }, "priceWithoutVat": { "amount": 0.0, "currency": { "code": "string" } }, "orderableAmount": { "min": 0, "max": 0 }, "discounts": [ { "amount": 0.0, "type": "percentage" } ] } ] } ``` ``` -------------------------------- ### List of products reviews Source: https://api.docs.shoptet.com/shoptet-api/openapi Returns a list of reviews for products in the e-shop. ```APIDOC ## GET /api/reviews/products ### Description Returns list of product's reviews. ### Method GET ### Endpoint /api/reviews/products ``` -------------------------------- ### POST /api/products/surcharge-parameters Source: https://api.docs.shoptet.com/shoptet-api/openapi Creation of surcharge parameter. ```APIDOC ## POST /api/products/surcharge-parameters ### Description Creation of surcharge parameter. ### Method POST ### Endpoint /api/products/surcharge-parameters ``` -------------------------------- ### Deletion of customer Source: https://api.docs.shoptet.com/shoptet-api/openapi Deletes a customer from the e-shop using their GUID. ```APIDOC ## DELETE /api/customers/{guid} ### Description Deletion of customer. ### Method DELETE ### Endpoint /api/customers/{guid} #### Path Parameters - **guid** (string) - Required - The unique identifier of the customer to delete. ``` -------------------------------- ### GET /api/products/snapshot Source: https://api.docs.shoptet.com/shoptet-api/openapi Retrieves a list of all products with detailed information asynchronously. The response format is jsonlines, with each line representing a product. Various sections of product data can be included using the 'include' parameter. ```APIDOC ## GET /api/products/snapshot ### Description Retrieves a list of all products with detailed information asynchronously. The response format is jsonlines, with each line representing a product. Various sections of product data can be included using the 'include' parameter. ### Method GET ### Endpoint /api/products/snapshot ### Parameters #### Query Parameters - **include** (string) - Optional - Specifies which sections of product data to include in the response. Possible values include: images, variantParameters, allCategories, flags, descriptiveParameters, measureUnit, surchargeParameters, setItems, filteringParameters, recyclingFee, consumptionTax, warranty, sortVariants, gifts, alternativeProducts, relatedProducts, relatedVideos, relatedFiles, perStockAmounts, perPricelistPrices. - **productCodes** (string) - Optional - Comma-separated list of specific product codes to retrieve. Accepts a maximum of 50 codes. If used, other filters are not applied. - **productGuids** (string) - Optional - Comma-separated list of specific product GUIDs to retrieve. Accepts a maximum of 50 GUIDs. If used, other filters are not applied. ### Response #### Success Response (200) - The response is in jsonlines format, with each line containing detailed product information similar to the Product Detail endpoint. The structure of each product line can be further detailed by the 'include' parameter. #### Response Example { "example": "{\"id\": \"123\", \"guid\": \"abc-123\", ... }\n{\"id\": \"456\", \"guid\": \"def-456\", ... }" } ``` -------------------------------- ### GET /api/suppliers Source: https://api.docs.shoptet.com/shoptet-api/openapi Returns the list of suppliers. Supports Paging. ```APIDOC ## GET /api/suppliers ### Description Returns the list of suppliers. Supports Paging. ### Method GET ### Endpoint /api/suppliers ``` -------------------------------- ### GET /api/proof-payments Source: https://api.docs.shoptet.com/shoptet-api/openapi Retrieves a paginated list of all proof of payments. ```APIDOC ## GET /api/proof-payments ### Description The list of proof payments supports Paging. ### Method GET ### Endpoint /api/proof-payments ``` -------------------------------- ### GET /api/sales-channels Source: https://api.docs.shoptet.com/shoptet-api/openapi Provides a list of all sales channels available in the system. ```APIDOC ## GET /api/sales-channels ### Description Provides a list of all sales channels. ### Method GET ### Endpoint /api/sales-channels ``` -------------------------------- ### POST /api/products/surcharge-parameters/{code} Source: https://api.docs.shoptet.com/shoptet-api/openapi Creation of surcharge parameter value. ```APIDOC ## POST /api/products/surcharge-parameters/{code} ### Description Creation of surcharge parameter value. ### Method POST ### Endpoint /api/products/surcharge-parameters/{code} #### Path Parameters - **code** (string) - Required - The code of the surcharge parameter. ``` -------------------------------- ### GET /api/products/filtering-parameters/{code} Source: https://api.docs.shoptet.com/shoptet-api/openapi Retrieves the details of a specific filtering parameter. ```APIDOC ## GET /api/products/filtering-parameters/{code} ### Description Retrieves the details of a specific filtering parameter. ### Method GET ### Endpoint /api/products/filtering-parameters/{code} ### Parameters #### Path Parameters - **code** (string) - Required - The code of the filtering parameter to retrieve. ### Response #### Success Response (200) - **filteringParameter** (object) - The details of the filtering parameter. - **code** (string) - The unique code of the filtering parameter. - **name** (string) - The name of the filtering parameter. ``` -------------------------------- ### GET /api/proof-payments/{code}/pdf Source: https://api.docs.shoptet.com/shoptet-api/openapi Downloads the proof of payment as a PDF file. Response is application/octet-stream. Only one-by-one download is allowed per e-shop; parallel requests result in a 423 Locked error. ```APIDOC ## GET /api/proof-payments/{code}/pdf ### Description You can request the proof of payment as PDF file, response will be as application/octet-stream. You can download pdf documents only one-by-one for every e-shop. Parallel requests end with 423 Locked error. ### Method GET ### Endpoint /api/proof-payments/{code}/pdf ### Parameters #### Path Parameters - **code** (string) - Required - The identifier for the proof of payment. ``` -------------------------------- ### Product category update Source: https://api.docs.shoptet.com/shoptet-api/openapi Updates an existing product category identified by its GUID. ```APIDOC ## PATCH /api/categories/{categoryGuid} ### Description Updates existing category. ### Method PATCH ### Endpoint /api/categories/{categoryGuid} #### Path Parameters - **categoryGuid** (string) - Required - The unique identifier of the category to update. ``` -------------------------------- ### List of product alternative products Source: https://api.docs.shoptet.com/shoptet-api/openapi Returns a list of alternative products related to a specific product, ordered by priority. If reciprocal pairing is enabled, it also includes products that list the current product as an alternative. ```APIDOC ## GET /api/products/{guid}/alternativeProducts ### Description Returns a list of alternative products related to the product defined by GUID. The list is ordered by the priority parameter. If the 'Pair reciprocally' option is enabled, the list will be enriched with items that have the called product in their own alternative table. ### Method GET ### Endpoint /api/products/{guid}/alternativeProducts ``` -------------------------------- ### Product copy Source: https://api.docs.shoptet.com/shoptet-api/openapi Copies a product identified by its GUID. The new product will have the same attributes as the original. Many settings can be copied, but some require active modules. Users can specify which parameters to copy by setting them to true or false. ```APIDOC ## POST /api/products/{guid}/copy ### Description This endpoint allows you to copy a product identified by a GUID. The new product will have the same attributes as the original product. Many settings can be copied from the original product, but some settings require an active module. ### Method POST ### Endpoint /api/products/{guid}/copy ### Parameters #### Path Parameters - **guid** (string) - Required - The GUID of the product to copy. #### Request Body - **copyParameters** (object) - Optional - An object specifying which parameters to copy. If not provided, all parameters are copied by default. Parameters not included will be set to false. - **parameterName** (boolean) - Optional - Set to `true` to copy the parameter, `false` to exclude it. ### Request Example ```json { "copyParameters": { "images": true, "variants": true, "seo": false } } ``` ### Response #### Success Response (200) - **guid** (string) - The GUID of the newly copied product. - **id** (integer) - The ID of the newly copied product. #### Response Example { "guid": "copied-product-guid", "id": 67890 } ``` -------------------------------- ### Update of customer Source: https://api.docs.shoptet.com/shoptet-api/openapi Updates an existing customer's information using their GUID. ```APIDOC ## PATCH /api/customers/{guid} ### Description Update of customer. ### Method PATCH ### Endpoint /api/customers/{guid} #### Path Parameters - **guid** (string) - Required - The unique identifier of the customer to update. ``` -------------------------------- ### Customer detail Source: https://api.docs.shoptet.com/shoptet-api/openapi Retrieves additional information about a specific customer using their GUID. ```APIDOC ## GET /api/customers/{guid} ### Description Additional information about one customer. ### Method GET ### Endpoint /api/customers/{guid} #### Path Parameters - **guid** (string) - Required - The unique identifier of the customer. ``` -------------------------------- ### GET /api/products/recycling-fee-categories Source: https://api.docs.shoptet.com/shoptet-api/openapi Returns the list of recycling fee categories within the e-shop. ```APIDOC ## GET /api/products/recycling-fee-categories ### Description Returns the list of recycling fee categories within the e-shop. ### Method GET ### Endpoint /api/products/recycling-fee-categories ```