{
  "info": {
    "name": "Youbega Public API",
    "description": "Requests from https://api.youbega.com/docs. Set the collection variable apiKey to your API key (Settings > Integration > API on youbega.com). Do not add a Content-Type header to the product requests: Postman sets multipart/form-data with the boundary itself.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "X-Api-Key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{apiKey}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.youbega.com"
    },
    {
      "key": "apiKey",
      "value": ""
    },
    {
      "key": "productId",
      "value": ""
    },
    {
      "key": "locationId",
      "value": ""
    },
    {
      "key": "shippingMethodId",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Products",
      "item": [
        {
          "name": "GET /products",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/products?page=1&pageSize=100",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "products"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "1"
                },
                {
                  "key": "pageSize",
                  "value": "100"
                }
              ]
            },
            "description": "page starts at 1, pageSize 1 to 100."
          }
        },
        {
          "name": "POST /products",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "Name",
                  "value": "Steel bathroom shelf",
                  "type": "text"
                },
                {
                  "key": "Description",
                  "value": "<p>Wall shelf made of stainless steel, 60 cm.</p>",
                  "type": "text"
                },
                {
                  "key": "PriceTypeId",
                  "value": "2",
                  "type": "text",
                  "description": "1 no price, 2 fixed price, 3 free, 4 price range, 5 for negotiation"
                },
                {
                  "key": "BasePrice",
                  "value": "19.99",
                  "type": "text",
                  "description": "Dot as decimal separator. A comma is read as a thousands separator."
                },
                {
                  "key": "CurrencyId",
                  "value": "2",
                  "type": "text",
                  "description": "1 EUR, 2 PLN, 3 USD, 4 GBP; default: the currency of your account"
                },
                {
                  "key": "Quantity",
                  "value": "5",
                  "type": "text"
                },
                {
                  "key": "PersonalPickup",
                  "value": "true",
                  "type": "text"
                },
                {
                  "key": "ItemCondition",
                  "value": "New",
                  "type": "text",
                  "description": "New, LikeNew or Used"
                },
                {
                  "key": "CategoriesIds[0]",
                  "value": "3",
                  "type": "text",
                  "description": "Category path from GET /products/categories, top level first (3 = house_and_garden)"
                },
                {
                  "key": "CategoriesIds[1]",
                  "value": "24",
                  "type": "text",
                  "description": "24 = h_bathroom under house_and_garden"
                },
                {
                  "key": "CountryCodes[0]",
                  "value": "PL",
                  "type": "text"
                },
                {
                  "key": "LocationsIds[0]",
                  "value": "{{locationId}}",
                  "type": "text",
                  "description": "Enable after POST /locations or after setting the variable locationId",
                  "disabled": true
                },
                {
                  "key": "ShippingMethodsIds[0]",
                  "value": "{{shippingMethodId}}",
                  "type": "text",
                  "description": "Enable after POST /shippingMethods or after setting the variable shippingMethodId",
                  "disabled": true
                },
                {
                  "key": "Tags[0]",
                  "value": "bathroom",
                  "type": "text"
                },
                {
                  "key": "PaymentCapabilities[0]",
                  "value": "BankTransfer",
                  "type": "text",
                  "description": "Cash, Card or BankTransfer"
                },
                {
                  "key": "Parameters[0].Name",
                  "value": "Color",
                  "type": "text"
                },
                {
                  "key": "Parameters[0].Value",
                  "value": "Silver",
                  "type": "text"
                },
                {
                  "key": "Parameters[1].Name",
                  "value": "Material",
                  "type": "text"
                },
                {
                  "key": "Parameters[1].Value",
                  "value": "Steel",
                  "type": "text"
                },
                {
                  "key": "ManufacturerInfo",
                  "value": "Example Manufacturer Sp. z o.o., ul. Przykładowa 1, 00-001 Warszawa",
                  "type": "text"
                },
                {
                  "key": "ResponsiblePersonInfo",
                  "value": "Example Importer GmbH, Musterstraße 1, 10115 Berlin",
                  "type": "text"
                },
                {
                  "key": "AdvertisementFiles",
                  "type": "file",
                  "src": [],
                  "description": "Select a JPEG, PNG, WebP, GIF or BMP photo. Add one row per photo with the same key; the first one is the main photo."
                },
                {
                  "key": "GpsrFiles",
                  "type": "file",
                  "src": [],
                  "description": "Optional GPSR document (image or PDF).",
                  "disabled": true
                },
                {
                  "key": "VideoFiles",
                  "type": "file",
                  "src": [],
                  "description": "Optional MP4 video with H.264, up to 8 MB. Up to 2; add one row per video with the same key.",
                  "disabled": true
                },
                {
                  "key": "VideoPosterFiles",
                  "type": "file",
                  "src": [],
                  "description": "Optional poster (JPG, PNG or WEBP, up to 25 megapixels) for the video in the same position. Without it the first usable photo is used.",
                  "disabled": true
                },
                {
                  "key": "YoutubeVideoIds[0]",
                  "type": "text",
                  "value": "dQw4w9WgXcQ",
                  "description": "Optional YouTube video id (11 characters), not a link. Up to 2.",
                  "disabled": true
                }
              ]
            },
            "url": {
              "raw": "{{baseUrl}}/products",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "products"
              ]
            },
            "description": "Creates a product. Select a photo in the AdvertisementFiles row first. Returns 201 with the id, which is stored in the variable productId."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code === 200 || pm.response.code === 201) {",
                  "    pm.collectionVariables.set('productId', pm.response.json().id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "PUT /products - price and stock",
          "request": {
            "method": "PUT",
            "header": [],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "Id",
                  "value": "{{productId}}",
                  "type": "text",
                  "description": "Set automatically by POST /products, or copy an id from GET /products"
                },
                {
                  "key": "Name",
                  "value": "Steel bathroom shelf",
                  "type": "text"
                },
                {
                  "key": "PriceTypeId",
                  "value": "2",
                  "type": "text"
                },
                {
                  "key": "BasePrice",
                  "value": "17.49",
                  "type": "text"
                },
                {
                  "key": "Quantity",
                  "value": "8",
                  "type": "text",
                  "description": "Not sent = set to 0"
                },
                {
                  "key": "PersonalPickup",
                  "value": "true",
                  "type": "text",
                  "description": "Not sent = set to false"
                },
                {
                  "key": "CountryCodes[0]",
                  "value": "PL",
                  "type": "text",
                  "description": "Not sent = only the countries of the locations remain"
                }
              ]
            },
            "url": {
              "raw": "{{baseUrl}}/products",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "products"
              ]
            },
            "description": "Updates price and stock of {{productId}}. Every field that is not listed is kept: description, category, locations, shipping methods, tags, parameters, GPSR data, photos."
          }
        },
        {
          "name": "PUT /products - replace photos",
          "request": {
            "method": "PUT",
            "header": [],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "Id",
                  "value": "{{productId}}",
                  "type": "text",
                  "description": "Set automatically by POST /products, or copy an id from GET /products"
                },
                {
                  "key": "Name",
                  "value": "Steel bathroom shelf",
                  "type": "text"
                },
                {
                  "key": "PriceTypeId",
                  "value": "2",
                  "type": "text"
                },
                {
                  "key": "BasePrice",
                  "value": "17.49",
                  "type": "text"
                },
                {
                  "key": "Quantity",
                  "value": "8",
                  "type": "text",
                  "description": "Not sent = set to 0"
                },
                {
                  "key": "PersonalPickup",
                  "value": "true",
                  "type": "text",
                  "description": "Not sent = set to false"
                },
                {
                  "key": "CountryCodes[0]",
                  "value": "PL",
                  "type": "text",
                  "description": "Not sent = only the countries of the locations remain"
                },
                {
                  "key": "AdvertisementFiles",
                  "type": "file",
                  "src": [],
                  "description": "Main photo. The files replace all photos; videos stay."
                },
                {
                  "key": "AdvertisementFiles",
                  "type": "file",
                  "src": [],
                  "description": "Second photo."
                }
              ]
            },
            "url": {
              "raw": "{{baseUrl}}/products",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "products"
              ]
            },
            "description": "Replaces the whole gallery of {{productId}} with the selected photos, in this order."
          }
        },
        {
          "name": "PUT /products - add videos",
          "request": {
            "method": "PUT",
            "header": [],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "Id",
                  "value": "{{productId}}",
                  "type": "text",
                  "description": "Set automatically by POST /products, or copy an id from GET /products"
                },
                {
                  "key": "Name",
                  "value": "Steel bathroom shelf",
                  "type": "text"
                },
                {
                  "key": "PriceTypeId",
                  "value": "2",
                  "type": "text"
                },
                {
                  "key": "BasePrice",
                  "value": "17.49",
                  "type": "text"
                },
                {
                  "key": "Quantity",
                  "value": "8",
                  "type": "text",
                  "description": "Not sent = set to 0"
                },
                {
                  "key": "PersonalPickup",
                  "value": "true",
                  "type": "text",
                  "description": "Not sent = set to false"
                },
                {
                  "key": "CountryCodes[0]",
                  "value": "PL",
                  "type": "text",
                  "description": "Not sent = only the countries of the locations remain"
                },
                {
                  "key": "VideoFiles",
                  "type": "file",
                  "src": [],
                  "description": "MP4 video with H.264, up to 8 MB. Up to 2; add one row per video with the same key."
                },
                {
                  "key": "VideoPosterFiles",
                  "type": "file",
                  "src": [],
                  "description": "Poster (JPG, PNG or WEBP, up to 25 megapixels) for the video in the same position."
                },
                {
                  "key": "YoutubeVideoIds[0]",
                  "type": "text",
                  "value": "dQw4w9WgXcQ",
                  "description": "YouTube video id (11 characters), not a link."
                }
              ]
            },
            "url": {
              "raw": "{{baseUrl}}/products",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "products"
              ]
            },
            "description": "Replaces all videos of the product with one uploaded MP4 and one YouTube video. The photos stay."
          }
        },
        {
          "name": "GET /products/categories",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/products/categories",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "products",
                "categories"
              ]
            },
            "description": "Category tree. Category ids are unique only within their level: send the whole path in CategoriesIds."
          }
        }
      ]
    },
    {
      "name": "Locations",
      "item": [
        {
          "name": "GET /locations",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/locations",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "locations"
              ]
            }
          }
        },
        {
          "name": "POST /locations",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"countryCode\": \"PL\",\n  \"postalCode\": \"00-110\",\n  \"city\": \"Warszawa\",\n  \"streetName\": \"Plac Defilad\",\n  \"streetNumber\": \"1\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/locations",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "locations"
              ]
            },
            "description": "Creates a location (or returns the existing one for the same place). The id is stored in the variable locationId."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code === 200 || pm.response.code === 201) {",
                  "    pm.collectionVariables.set('locationId', pm.response.json().id);",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Shipping methods",
      "item": [
        {
          "name": "GET /shippingMethods",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/shippingMethods",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "shippingMethods"
              ]
            }
          }
        },
        {
          "name": "POST /shippingMethods",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Courier\",\n  \"description\": \"Delivery to the door in 1-2 working days\",\n  \"price\": 12.5,\n  \"countryCode\": \"PL\",\n  \"currencyId\": 2\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/shippingMethods",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "shippingMethods"
              ]
            },
            "description": "Creates a new shipping method on every call. The response is the id as a JSON string; it is stored in the variable shippingMethodId."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code === 200 || pm.response.code === 201) {",
                  "    pm.collectionVariables.set('shippingMethodId', pm.response.json());",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Orders",
      "item": [
        {
          "name": "GET /orders",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/orders?page=0&pageSize=20&startDate=2026-01-01T00:00:00Z",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "0"
                },
                {
                  "key": "pageSize",
                  "value": "20"
                },
                {
                  "key": "startDate",
                  "value": "2026-01-01T00:00:00Z"
                }
              ]
            },
            "description": "page starts at 0. Orders are sorted by their last change, newest first."
          }
        }
      ]
    }
  ]
}
