{
 "openapi": "3.0.3",
 "info": {
  "title": "Ikonka ordersAPI",
  "version": "0.9.0",
  "description": "B2B ordering API of Ikonka. One request places a complete order: the API checks it the same way the online shop does and returns either the order number or **all** reasons for refusal at once.\n\n**Authentication** - HTTP Basic with the e-mail and password of your B2B account in the Ikonka online shop. Every B2B account has API access - there is nothing to request or enable.\n\n**Testing** - send an order with `\"checkOnly\": true`: a full check, nothing is saved. Use it as often as you like.\n\n**Retries** - one `externalId` is one order. If a request times out or the connection drops, send the same order again **with the same `externalId`**; it will not be created twice.\n\n**Errors** - every refusal has a fixed `code` and a `message` **in Polish**. Base your error handling on `code`; `message` is for display. Codes are listed under the `Error` schema.\n\n**Compatibility** - new fields and codes may be added; ignore fields you do not know.\n"
 },
 "servers": [
  {
   "url": "https://orders-api.ikonka.eu"
  }
 ],
 "security": [
  {
   "basicAuth": []
  }
 ],
 "tags": [
  {
   "name": "Orders",
   "description": "Placing and checking orders."
  },
  {
   "name": "Catalog",
   "description": "What can be chosen in an order."
  },
  {
   "name": "Service"
  }
 ],
 "paths": {
  "/v1/orders": {
   "post": {
    "tags": [
     "Orders"
    ],
    "summary": "Place an order (or check it with checkOnly)",
    "description": "The order goes through all the steps of the online shop at once. The response is the order number or all reasons for refusal. With `\"checkOnly\": true` - the same check, nothing is saved.\n\nWe do not wait for the order to reach the warehouse system - `201` means the order exists at Ikonka.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Order"
       },
       "example": {
        "externalId": "ZAM-2026-0001",
        "lines": [
         {
          "code": "KX9644",
          "quantity": 12
         },
         {
          "code": "KX3127",
          "quantity": 6
         }
        ],
        "shippingMethod": "dpd_courier",
        "paymentMethod": "bank_transfer",
        "comments": "Zamówienie tygodniowe - sklep Poznań",
        "checkOnly": true
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Order placed.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PlacedOrder"
        },
        "example": {
         "orderNumber": "1023456",
         "externalId": "ZAM-2026-0001",
         "status": "new"
        }
       }
      }
     },
     "200": {
      "description": "Result of `checkOnly`, or the order with this `externalId` already exists (`\"repeated\": true`).",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "$ref": "#/components/schemas/CheckResult"
          },
          {
           "$ref": "#/components/schemas/PlacedOrder"
          }
         ]
        }
       }
      }
     },
     "202": {
      "description": "Order is being processed - the order number is not known yet. Send the same order again with the same `externalId` in a few minutes.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PendingOrder"
        }
       }
      }
     },
     "400": {
      "description": "Invalid request: not JSON, wrong field type, field outside the contract or missing `externalId`. Nothing was saved.",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "$ref": "#/components/schemas/CheckResult"
          },
          {
           "$ref": "#/components/schemas/ErrorResponse"
          }
         ]
        }
       }
      }
     },
     "409": {
      "description": "An order with this `externalId` is being processed - wait for the first request.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorResponse"
        },
        "example": {
         "valid": false,
         "errors": [
          {
           "code": "ORDER_IN_PROGRESS",
           "message": "Zamówienie o tym numerze jest właśnie przetwarzane."
          }
         ]
        }
       }
      }
     },
     "413": {
      "description": "The request exceeds the size limit (32 MB).",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorResponse"
        },
        "example": {
         "valid": false,
         "errors": [
          {
           "code": "BODY_TOO_LARGE",
           "message": "Żądanie za duże."
          }
         ]
        }
       }
      }
     },
     "422": {
      "description": "Order refused - all reasons in `errors`. Nothing was saved; correct it and send again with the same `externalId`.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CheckResult"
        }
       }
      }
     },
     "502": {
      "description": "The order was not accepted - contact Ikonka with the `externalId`.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorResponse"
        },
        "example": {
         "valid": false,
         "errors": [
          {
           "code": "ORDER_REJECTED",
           "message": "Zamówienie nie zostało przyjęte."
          }
         ]
        }
       }
      }
     },
     "401": {
      "description": "Wrong e-mail or password.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorResponse"
        },
        "example": {
         "valid": false,
         "errors": [
          {
           "code": "UNAUTHORIZED",
           "message": "Nieprawidłowy e-mail lub hasło."
          }
         ]
        }
       }
      }
     },
     "403": {
      "description": "The account has no API access.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorResponse"
        },
        "example": {
         "valid": false,
         "errors": [
          {
           "code": "ACCOUNT_API_ACCESS_MISSING",
           "message": "Konto nie ma dostępu do API."
          }
         ]
        }
       }
      }
     },
     "429": {
      "description": "Login temporarily locked after failed attempts.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorResponse"
        },
        "example": {
         "valid": false,
         "errors": [
          {
           "code": "LOGIN_LOCKED",
           "message": "Logowanie zablokowane - spróbuj za 15 min."
          }
         ]
        }
       }
      }
     },
     "503": {
      "description": "Service temporarily unavailable - retry later.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorResponse"
        },
        "example": {
         "valid": false,
         "errors": [
          {
           "code": "SERVICE_UNAVAILABLE",
           "message": "Usługa jest chwilowo niedostępna - spróbuj ponownie za chwilę."
          }
         ]
        }
       }
      }
     },
     "500": {
      "description": "Unexpected error. Do not resend the order with a new `externalId`.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorResponse"
        },
        "example": {
         "valid": false,
         "errors": [
          {
           "code": "INTERNAL_ERROR",
           "message": "Wystąpił nieoczekiwany błąd."
          }
         ]
        }
       }
      }
     }
    }
   }
  },
  "/v1/catalog": {
   "get": {
    "tags": [
     "Catalog"
    ],
    "summary": "Shipping and payment methods for your account and country",
    "description": "Lists all aliases, including unavailable ones with `reason`. Weight and order value limits depend on the order - `checkOnly` checks them.",
    "parameters": [
     {
      "name": "country",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "example": "DEU",
      "description": "Delivery country, ISO 3166-1 alpha-3. Default: the country of the account's delivery address."
     },
     {
      "name": "dropshipping",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "1"
       ]
      },
      "description": "`1` - methods for dropshipping."
     }
    ],
    "responses": {
     "200": {
      "description": "The catalog.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Catalog"
        }
       }
      }
     },
     "401": {
      "description": "Wrong e-mail or password.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorResponse"
        },
        "example": {
         "valid": false,
         "errors": [
          {
           "code": "UNAUTHORIZED",
           "message": "Nieprawidłowy e-mail lub hasło."
          }
         ]
        }
       }
      }
     },
     "403": {
      "description": "The account has no API access.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorResponse"
        },
        "example": {
         "valid": false,
         "errors": [
          {
           "code": "ACCOUNT_API_ACCESS_MISSING",
           "message": "Konto nie ma dostępu do API."
          }
         ]
        }
       }
      }
     },
     "429": {
      "description": "Login temporarily locked after failed attempts.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorResponse"
        },
        "example": {
         "valid": false,
         "errors": [
          {
           "code": "LOGIN_LOCKED",
           "message": "Logowanie zablokowane - spróbuj za 15 min."
          }
         ]
        }
       }
      }
     },
     "503": {
      "description": "Service temporarily unavailable - retry later.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorResponse"
        },
        "example": {
         "valid": false,
         "errors": [
          {
           "code": "SERVICE_UNAVAILABLE",
           "message": "Usługa jest chwilowo niedostępna - spróbuj ponownie za chwilę."
          }
         ]
        }
       }
      }
     },
     "500": {
      "description": "Unexpected error. Do not resend the order with a new `externalId`.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorResponse"
        },
        "example": {
         "valid": false,
         "errors": [
          {
           "code": "INTERNAL_ERROR",
           "message": "Wystąpił nieoczekiwany błąd."
          }
         ]
        }
       }
      }
     }
    }
   }
  },
  "/health": {
   "get": {
    "tags": [
     "Service"
    ],
    "summary": "Is the service up",
    "security": [],
    "responses": {
     "200": {
      "description": "The service responds.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "state": {
           "type": "string",
           "enum": [
            "alive"
           ]
          }
         }
        },
        "example": {
         "state": "alive"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "basicAuth": {
    "type": "http",
    "scheme": "basic",
    "description": "E-mail and password of your B2B account in the online shop."
   }
  },
  "schemas": {
   "Order": {
    "type": "object",
    "required": [
     "externalId",
     "lines",
     "shippingMethod",
     "paymentMethod"
    ],
    "additionalProperties": false,
    "description": "Fields outside this list are refused with `UNKNOWN_FIELD`. Prices, shipping costs and payment terms follow from the account's trade terms - they are not sent.",
    "properties": {
     "externalId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9._-]{1,64}$",
      "example": "ZAM-2026-0001",
      "description": "Your order number. One `externalId` is one order - resending it returns the existing order instead of creating a second one. Not needed with `checkOnly`. Do not use identifiers that differ only in letter case."
     },
     "lines": {
      "type": "array",
      "minItems": 1,
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/OrderLine"
      },
      "description": "Order lines. Each product code may appear only once."
     },
     "shippingMethod": {
      "type": "string",
      "enum": [
       "dpd_courier",
       "gls_courier",
       "inpost_courier",
       "inpost_locker",
       "own_courier_parcels",
       "own_dpd",
       "own_gls",
       "own_inpost",
       "own_other",
       "own_ups",
       "pallet_pickup",
       "pallet_raben",
       "personal_pickup"
      ],
      "example": "dpd_courier",
      "description": "Shipping method alias. Availability for your account and country: `GET /v1/catalog`.\n\n| Alias | Method | Notes |\n|---|---|---|\n| `personal_pickup` | Odbiór osobisty |  |\n| `own_dpd` | Odbiór własny DPD (Allegro SMART!) | Own transport - label in the order (`labelRequired` in the catalog). |\n| `own_gls` | Odbiór własny GLS (Allegro SMART!) | Online shop only - refused via API. |\n| `own_inpost` | Odbiór własny Inpost (Allegro SMART!) | Own transport - label in the order (`labelRequired` in the catalog). |\n| `own_ups` | Odbiór własny Orlen Paczka/UPS/Kolporter (Allegro) / Allegro One Kurier | Own transport - label in the order (`labelRequired` in the catalog). |\n| `own_other` | Odbiór własny INNY (dropshipping) | Own transport - label in the order (`labelRequired` in the catalog). |\n| `own_courier_parcels` | Odbiór własny kurier - paczki | Labels are sent by e-mail to your account manager. |\n| `pallet_pickup` | Odbiór Palet | Labels are sent by e-mail to your account manager. |\n| `inpost_locker` | InPost Paczkomaty 24/7 | The method for the delivery country is chosen automatically. Requires `pickupPoint`. |\n| `dpd_courier` | DPD kurier | The method for the delivery country is chosen automatically. |\n| `gls_courier` | GLS kurier | The method for the delivery country is chosen automatically. |\n| `inpost_courier` | InPost kurier | The method for the delivery country is chosen automatically. |\n| `pallet_raben` | Paleta RABEN PL | The method for the delivery country is chosen automatically. |"
     },
     "paymentMethod": {
      "type": "string",
      "enum": [
       "bank_transfer",
       "bank_transfer_dropshipping",
       "cash_on_delivery",
       "cash_on_delivery_dropshipping"
      ],
      "example": "bank_transfer",
      "description": "Payment method alias.\n\n| Alias | Payment | Notes |\n|---|---|---|\n| `bank_transfer` | Przelew |  |\n| `bank_transfer_dropshipping` | Przelew (dropshipping) |  |\n| `cash_on_delivery` | Za pobraniem | Online shop only - refused via API. |\n| `cash_on_delivery_dropshipping` | Za pobraniem (dropshipping) | Online shop only - refused via API. |"
     },
     "pickupPoint": {
      "type": "string",
      "example": "ADM01A",
      "description": "Pickup point code - required for `inpost_locker`."
     },
     "currency": {
      "type": "string",
      "example": "EUR",
      "description": "Order currency, ISO 4217. Default: the account's currency. If a currency is enforced for the account, a different one is refused with `CURRENCY_FORCED`."
     },
     "recipient": {
      "$ref": "#/components/schemas/Recipient"
     },
     "dropshipping": {
      "type": "boolean",
      "description": "Ship directly to your end customer. Requires `recipient` and dropshipping enabled for the account. Methods for this mode: `GET /v1/catalog?dropshipping=1`."
     },
     "labels": {
      "type": "array",
      "maxItems": 1,
      "items": {
       "$ref": "#/components/schemas/Label"
      },
      "description": "Shipping label for own transport - only for methods with `labelRequired` in the catalog."
     },
     "comments": {
      "type": "string",
      "maxLength": 1000,
      "description": "Order comments. Plain text, no HTML."
     },
     "checkOnly": {
      "type": "boolean",
      "description": "`true` - full check, nothing is saved."
     }
    }
   },
   "OrderLine": {
    "type": "object",
    "required": [
     "code",
     "quantity"
    ],
    "additionalProperties": false,
    "properties": {
     "code": {
      "type": "string",
      "example": "KX9644",
      "description": "Product code as in the Ikonka offer."
     },
     "quantity": {
      "type": "integer",
      "minimum": 1,
      "maximum": 9999,
      "example": 12,
      "description": "Quantity in pieces."
     }
    }
   },
   "Recipient": {
    "type": "object",
    "additionalProperties": false,
    "description": "Delivery address different from the account address. Required: `company` or `firstName` + `lastName`, and `street`, `streetNumber1`, `postcode`, `city`, `country`. The invoice always goes to the account details. Texts longer than allowed are refused with `TEXT_TOO_LONG`.",
    "properties": {
     "firstName": {
      "type": "string"
     },
     "lastName": {
      "type": "string"
     },
     "company": {
      "type": "string"
     },
     "street": {
      "type": "string"
     },
     "streetNumber1": {
      "type": "string",
      "description": "Building number."
     },
     "streetNumber2": {
      "type": "string",
      "description": "Flat number."
     },
     "postcode": {
      "type": "string"
     },
     "city": {
      "type": "string"
     },
     "country": {
      "type": "string",
      "example": "POL",
      "description": "ISO 3166-1 alpha-3: `POL`, `DEU`, `CZE`..."
     },
     "email": {
      "type": "string",
      "format": "email"
     },
     "phone": {
      "type": "string",
      "description": "Recommended for courier shipments."
     }
    }
   },
   "Label": {
    "type": "object",
    "required": [
     "trackingNumber",
     "pdfBase64"
    ],
    "additionalProperties": false,
    "properties": {
     "trackingNumber": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$",
      "description": "Tracking number from the label. Must not be used in another order."
     },
     "pdfBase64": {
      "type": "string",
      "format": "byte",
      "description": "PDF file in base64: one A6 page, up to 5 MB before encoding."
     }
    }
   },
   "PlacedOrder": {
    "type": "object",
    "required": [
     "orderNumber",
     "externalId",
     "status"
    ],
    "properties": {
     "orderNumber": {
      "type": "string",
      "example": "1023456",
      "description": "Order number at Ikonka."
     },
     "externalId": {
      "type": "string",
      "example": "ZAM-2026-0001"
     },
     "status": {
      "$ref": "#/components/schemas/OrderStatus"
     },
     "repeated": {
      "type": "boolean",
      "description": "`true` - the order with this `externalId` already existed; nothing new was created."
     }
    }
   },
   "OrderStatus": {
    "type": "string",
    "example": "new",
    "description": "Order status. Values may be added - treat unknown ones as `unknown`.\n\n- `awaiting_payment` - Oczekuje na płatność\n- `cancelled` - Anulowane\n- `new` - Nowe - oczekuje na weryfikację\n- `new_fast_payment` - Nowe - szybka płatność\n- `new_temporary` - Nowe - tymczasowe\n- `unknown` - other status"
   },
   "PendingOrder": {
    "type": "object",
    "properties": {
     "externalId": {
      "type": "string",
      "example": "ZAM-2026-0001"
     },
     "status": {
      "type": "string",
      "enum": [
       "pending"
      ]
     },
     "message": {
      "type": "string",
      "example": "Zamówienie jest przetwarzane. Wyślij je ponownie z tym samym externalId za kilka minut, żeby otrzymać numer zamówienia."
     }
    }
   },
   "CheckResult": {
    "type": "object",
    "required": [
     "valid",
     "errors"
    ],
    "description": "Result of the check. `steps`: 1 - products, 2 - shipping, 3 - payment, 4 - address. The step that stopped the order has `\"valid\": false` and its own `errors`.",
    "properties": {
     "valid": {
      "type": "boolean"
     },
     "errors": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Error"
      }
     },
     "steps": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/CheckStep"
      }
     },
     "checkedOnly": {
      "type": "boolean",
      "description": "`true` - this was `checkOnly`, nothing saved."
     }
    }
   },
   "CheckStep": {
    "type": "object",
    "properties": {
     "step": {
      "type": "integer",
      "enum": [
       1,
       2,
       3,
       4
      ]
     },
     "valid": {
      "type": "boolean"
     },
     "errors": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Error"
      }
     },
     "options": {
      "type": "object",
      "additionalProperties": true,
      "description": "What the step determined. Step 1: `netValue`, `currency`. Step 2: `available`, `shippingMethodId`, `shippingMethodName`, `shippingCostNet`, `shippingCostGross`, `packages`. Step 3: `available`, `statusAfterPlacing`. In step 2 `available` lists the shipping methods that accept this order (products, weight, order value, country, account, payment method) - change `shippingMethod` to any of them. A method that needs a pickup point or a label is listed only when the request contains it. The list is alphabetical, not by cost - `checkOnly` with a given method returns its cost. In step 3 `available` lists all payment aliases supported in orders."
     }
    }
   },
   "Error": {
    "type": "object",
    "required": [
     "code",
     "message"
    ],
    "properties": {
     "code": {
      "type": "string",
      "example": "PRODUCT_NOT_FOUND",
      "description": "Fixed code - base your error handling on it. Codes may be added; treat unknown ones as a general refusal.\n\n| Code | Meaning |\n|---|---|\n| **Request and account** | |\n| `BODY_INVALID` | The body is not valid JSON. |\n| `BODY_TOO_LARGE` | The request exceeds the size limit. |\n| `SCHEMA_INVALID` | A field has the wrong type. |\n| `UNKNOWN_FIELD` | A field outside the contract (e.g. `price`). |\n| `NOT_FOUND` | Unknown path. |\n| `METHOD_NOT_ALLOWED` | Unsupported HTTP method. |\n| `EXTERNAL_ID_REQUIRED` | `externalId` is missing. |\n| `EXTERNAL_ID_INVALID` | `externalId` contains characters that are not allowed. |\n| `UNAUTHORIZED` | Wrong e-mail or password. |\n| `ACCOUNT_API_ACCESS_MISSING` | The account has no API access. |\n| `ACCOUNT_INACTIVE` | The account cannot place orders. |\n| `ACCOUNT_NOT_ALLOWED` | The account cannot place orders. |\n| `ACCOUNT_ADDRESS_MISSING` | The account has no delivery or invoice address. |\n| `LOGIN_LOCKED` | Login temporarily locked after failed attempts. |\n| `LOGIN_PAUSED` | Login temporarily paused - retry later. |\n| **Lines and products** | |\n| `LINES_REQUIRED` | The order has no lines. |\n| `LINES_TOO_MANY` | More than 200 lines. |\n| `LINE_CODE_REQUIRED` | A line without a product code. |\n| `LINE_DUPLICATE` | A product code repeats - sum the quantities. |\n| `LINE_QUANTITY_INVALID` | Quantity is not an integer greater than 0. |\n| `LINE_QUANTITY_TOO_LARGE` | More than 9999 pcs per line. |\n| `PRODUCT_NOT_FOUND` | Unknown product code. |\n| `PRODUCT_NOT_AVAILABLE` | The product is not in the offer. |\n| `PRODUCT_NOT_SELLABLE` | The product is temporarily not for sale. |\n| `OUT_OF_STOCK` | Not enough stock. |\n| `QUANTITY_NOT_MULTIPLE` | Quantity is not a multiple of the package. |\n| `QUANTITY_BELOW_MINIMUM` | Quantity below the product minimum. |\n| `QUANTITY_ABOVE_MAXIMUM` | Quantity above the product maximum. |\n| `CART_BELOW_MINIMUM` | Order value below the minimum. |\n| `CURRENCY_UNKNOWN` | Unknown currency. |\n| `CURRENCY_FORCED` | A different currency applies to this order. |\n| **Shipping and labels** | |\n| `SHIPPING_METHOD_REQUIRED` | No shipping method chosen. |\n| `SHIPPING_METHOD_NOT_ALLOWED` | Unknown or unavailable alias. |\n| `SHIPPING_METHOD_UNAVAILABLE` | The method is temporarily unavailable. |\n| `SHIPPING_METHOD_WEBSITE_ONLY` | The method is available only in the online shop. |\n| `SHIPPING_METHOD_NOT_IN_COUNTRY` | The method does not ship to the delivery country. |\n| `SHIPPING_METHOD_EXCLUDED_FOR_ACCOUNT` | The method is disabled for the account. |\n| `SHIPPING_METHOD_EXCLUDED_BY_PRODUCT` | A product cannot be shipped with this method. |\n| `SHIPPING_METHOD_WEIGHT_LIMIT` | The method's weight limit is exceeded. |\n| `SHIPPING_METHOD_CART_VALUE_LIMIT` | Order value outside the method's range. |\n| `SHIPPING_METHOD_DROPSHIPPING_MISMATCH` | The method does not match the dropshipping mode. |\n| `SHIPPING_METHOD_AMBIGUOUS` | The method for the delivery country cannot be determined. |\n| `PICKUP_POINT_REQUIRED` | Pickup point code is missing. |\n| `PICKUP_POINT_UNKNOWN` | The pickup point does not exist or is inactive. |\n| `PICKUP_POINT_NOT_ALLOWED` | The method does not use pickup points. |\n| `LABEL_REQUIRED` | The method requires a label. |\n| `LABEL_NOT_ALLOWED` | The method does not accept a label. |\n| `LABEL_TOO_MANY` | More than 1 label. |\n| `LABEL_INVALID` | The label is not a valid base64-encoded PDF. |\n| `LABEL_TOO_LARGE` | The label exceeds 5 MB. |\n| `LABEL_FILE_TYPE_NOT_ALLOWED` | File type not allowed. |\n| `LABEL_FORMAT_NOT_ALLOWED` | The label is not a single A6 page. |\n| `LABEL_REFERENCE_INVALID` | Invalid `trackingNumber`. |\n| `LABEL_TRACKING_NUMBER_TAKEN` | The tracking number is already used. |\n| `OWN_TRANSPORT_ONE_PACKAGE` | Own transport: one package per order. |\n| **Payment** | |\n| `PAYMENT_METHOD_REQUIRED` | No payment method chosen. |\n| `PAYMENT_METHOD_NOT_ALLOWED` | Unknown or unavailable alias. |\n| `PAYMENT_METHOD_UNAVAILABLE` | The payment method is temporarily unavailable. |\n| `PAYMENT_METHOD_WEBSITE_ONLY` | Available only in the online shop (e.g. cash on delivery). |\n| `SHIPPING_PAYMENT_PAIR_NOT_ALLOWED` | The payment method is not available with this shipping method. |\n| `PAYMENT_METHOD_DROPSHIPPING_MISMATCH` | The payment method does not match the dropshipping mode. |\n| `PAYMENT_METHOD_NOT_IN_COUNTRY` | Not available for the country. |\n| `PAYMENT_METHOD_NOT_IN_CURRENCY` | Not available for the currency. |\n| `PAYMENT_METHOD_EXCLUDED_FOR_ACCOUNT` | Disabled for the account. |\n| `PAYMENT_METHOD_EXCLUDED_BY_PRODUCT` | A product excludes this payment method. |\n| **Address and text** | |\n| `RECIPIENT_INVALID` | `recipient` is not an object. |\n| `RECIPIENT_INCOMPLETE` | The delivery address is incomplete. |\n| `RECIPIENT_COUNTRY_UNKNOWN` | Unknown country (ISO 3166-1 alpha-3). |\n| `RECIPIENT_EMAIL_INVALID` | Invalid recipient e-mail. |\n| `DROPSHIPPING_NOT_ALLOWED` | The account has no dropshipping. |\n| `DROPSHIPPING_RECIPIENT_REQUIRED` | Dropshipping without a recipient address. |\n| `COMMENT_TOO_LONG` | The text is too long. |\n| `TEXT_TOO_LONG` | The text is too long. |\n| `TEXT_CONTROL_CHARACTERS` | Control character in a single-line field. |\n| `TEXT_UNSUPPORTED_CHARACTERS` | Unsupported character (e.g. emoji). |\n| `TEXT_NOT_ALLOWED` | HTML tag or script in the text. |\n| **Processing** | |\n| `ORDER_IN_PROGRESS` | An order with this `externalId` is being processed. |\n| `ORDER_REJECTED` | The order was not accepted. |\n| `SERVICE_UNAVAILABLE` | Service temporarily unavailable - retry later with the same `externalId`. |\n| `INTERNAL_ERROR` | Unexpected error. |"
     },
     "message": {
      "type": "string",
      "description": "Message in Polish, for display."
     },
     "field": {
      "type": "string",
      "example": "lines[0]",
      "description": "Field of your request the error refers to."
     },
     "step": {
      "type": "integer",
      "enum": [
       1,
       2,
       3,
       4
      ]
     },
     "hint": {
      "type": "string",
      "example": "najbliższe: 6 albo 12"
     }
    }
   },
   "ErrorResponse": {
    "type": "object",
    "required": [
     "errors"
    ],
    "properties": {
     "valid": {
      "type": "boolean",
      "enum": [
       false
      ]
     },
     "errors": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "Catalog": {
    "type": "object",
    "properties": {
     "country": {
      "type": "string",
      "example": "DEU",
      "description": "Delivery country the list applies to."
     },
     "countrySource": {
      "type": "string",
      "example": "account",
      "description": "`query` - from the `country` parameter, `account` - from the account's delivery address, `default` - shop default."
     },
     "countryChecked": {
      "type": "boolean"
     },
     "dropshipping": {
      "type": "boolean"
     },
     "dropshippingAllowed": {
      "type": "boolean",
      "nullable": true,
      "description": "Whether the account has dropshipping."
     },
     "shipping": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/CatalogEntry"
      }
     },
     "payment": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/CatalogEntry"
      }
     }
    }
   },
   "CatalogEntry": {
    "type": "object",
    "required": [
     "alias",
     "name",
     "available"
    ],
    "properties": {
     "alias": {
      "type": "string",
      "description": "Value for `shippingMethod` / `paymentMethod`."
     },
     "name": {
      "type": "string"
     },
     "available": {
      "type": "boolean"
     },
     "reason": {
      "type": "string",
      "description": "Why it is not available."
     },
     "method": {
      "type": "object",
      "description": "The shipping method that applies in this country.",
      "properties": {
       "id": {
        "type": "integer"
       },
       "name": {
        "type": "string"
       }
      }
     },
     "labelRequired": {
      "type": "boolean",
      "description": "The order must contain a label."
     },
     "excludedForAccount": {
      "type": "boolean",
      "description": "Disabled for the account - your account manager can change it."
     },
     "availableOnWebsite": {
      "type": "boolean",
      "description": "Available only in the online shop."
     },
     "info": {
      "type": "string"
     },
     "description": {
      "type": "string"
     }
    }
   }
  }
 }
}