{
  "openapi": "3.0.1",
  "info": {
    "title": "Voucherify API - Products",
    "version": "v2018-08-01",
    "description": "Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details.",
    "contact": {
      "name": "Voucherify Team",
      "url": "https://www.voucherify.io/contact-support",
      "email": "support@voucherify.io"
    },
    "termsOfService": "https://www.voucherify.io/legal/subscription-agreement",
    "license": {
      "name": "MIT",
      "url": "https://github.com/voucherifyio/voucherify-js-sdk/blob/main/LICENSE"
    }
  },
  "servers": [
    {
      "url": "https://{cluster}.voucherify.io",
      "description": "Base URL",
      "variables": {
        "cluster": {
          "default": "api",
          "enum": [
            "api",
            "us1.api",
            "as1.api",
            "download",
            "us1.download",
            "as1.download"
          ]
        }
      }
    }
  ],
  "paths": {
    "/v1/products": {
      "get": {
        "operationId": "list-products",
        "tags": [
          "Products"
        ],
        "summary": "List Products",
        "description": "Retrieve a list of products.",
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/order"
          },
          {
            "$ref": "#/components/parameters/start_date"
          },
          {
            "$ref": "#/components/parameters/end_date"
          }
        ],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "products"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a dictionary with product objects. The products are returned sorted by creation date by default, with the most recent products appearing last, unless you specify another sequence using the `order` query parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsListResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "object": "list",
                      "data_ref": "products",
                      "products": [
                        {
                          "id": "prod_f1r5Tpr0DuC7",
                          "source_id": "test_prod_id_1",
                          "name": "Apple iPhone 8",
                          "price": null,
                          "attributes": [
                            "color",
                            "memory"
                          ],
                          "metadata": {
                            "test": true,
                            "vendor": "Cortland"
                          },
                          "image_url": null,
                          "created_at": "2021-12-03T06:33:46.101Z",
                          "updated_at": null,
                          "object": "product",
                          "skus": {
                            "data": [
                              {
                                "id": "sku_0a417bd1d9952f9d6f",
                                "source_id": "test_iphone_8_silver_256gb",
                                "product_id": "prod_f1r5Tpr0DuC7",
                                "sku": "iPhone 8 Silver 256GB",
                                "price": null,
                                "currency": null,
                                "attributes": {
                                  "color": "silver",
                                  "memory": "256"
                                },
                                "image_url": null,
                                "metadata": {},
                                "created_at": "2021-12-03T06:33:46.599097+00:00",
                                "updated_at": null,
                                "object": "sku"
                              },
                              {
                                "id": "sku_0a417bd1d9952f9d6e",
                                "source_id": "test_iphone_8_silver_64gb",
                                "product_id": "prod_f1r5Tpr0DuC7",
                                "sku": "iPhone 8 Silver 64GB",
                                "price": null,
                                "currency": null,
                                "attributes": {
                                  "color": "silver",
                                  "memory": "64"
                                },
                                "image_url": null,
                                "metadata": {},
                                "created_at": "2021-12-03T06:33:46.598595+00:00",
                                "updated_at": null,
                                "object": "sku"
                              }
                            ],
                            "total": 2
                          }
                        },
                        {
                          "id": "prod_0ac67e1bb8072eec48",
                          "source_id": "test_volleyball",
                          "name": "VolleyBall",
                          "price": 1100,
                          "attributes": [],
                          "metadata": {
                            "color": [
                              "white"
                            ],
                            "label": true,
                            "origin": "PL"
                          },
                          "image_url": null,
                          "created_at": "2022-03-16T14:01:45.459Z",
                          "updated_at": "2022-04-26T12:51:35.500Z",
                          "object": "product",
                          "skus": {
                            "data": [
                              {
                                "id": "sku_0ac768973f5c4ea0d0",
                                "source_id": "test_volleyball_pl",
                                "product_id": "prod_0ac67e1bb8072eec48",
                                "sku": "PL",
                                "price": 500,
                                "currency": "USD",
                                "attributes": {},
                                "image_url": null,
                                "metadata": {
                                  "color": [
                                    "red"
                                  ]
                                },
                                "created_at": "2022-03-17T07:06:13.629918+00:00",
                                "updated_at": null,
                                "object": "sku"
                              },
                              {
                                "id": "sku_0ac7689713072e1df6",
                                "source_id": "test_volleyball_us",
                                "product_id": "prod_0ac67e1bb8072eec48",
                                "sku": "US",
                                "price": 1500,
                                "currency": "USD",
                                "attributes": {},
                                "image_url": null,
                                "metadata": {
                                  "color": [
                                    "yellow"
                                  ]
                                },
                                "created_at": "2022-03-17T07:06:13.452532+00:00",
                                "updated_at": null,
                                "object": "sku"
                              }
                            ],
                            "total": 2
                          }
                        }
                      ],
                      "total": 2
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "create-product",
        "tags": [
          "Products"
        ],
        "summary": "Create Product",
        "description": "Creates a product object.\n\n\n\n<Note>\n\n<Badge color=\"blue\">Upsert Mode</Badge>\n\nIf you pass an `id` or a `source_id` that already exists in the product database, Voucherify will return a related product object with updated fields.\n\n</Note>",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "products"
            ]
          }
        ],
        "requestBody": {
          "description": "Specify the product parameters.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductsCreateRequestBody"
              },
              "examples": {
                "Example": {
                  "value": {
                    "source_id": "first_product",
                    "name": "Samsung Phone",
                    "price": 200000,
                    "attributes": [
                      "color",
                      "memory",
                      "processor"
                    ],
                    "metadata": {
                      "test": true,
                      "vendor": "Online Store"
                    },
                    "image_url": "{{internalVoucherifyURL}}"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns a product object if the operation succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsCreateResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "prod_0bae2dc5a090fd0184",
                      "source_id": "first_product",
                      "name": "Samsung Phone",
                      "price": 200000,
                      "attributes": [
                        "color",
                        "memory",
                        "processor"
                      ],
                      "metadata": {
                        "test": true,
                        "vendor": "Online Store"
                      },
                      "image_url": "https://www.website.com/image.png",
                      "created_at": "2022-09-12T12:58:22.232Z",
                      "updated_at": "2022-09-12T12:59:55.890Z",
                      "object": "product"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/{productId}": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterProductId"
          },
          "name": "productId",
          "in": "path",
          "required": true,
          "description": "A Voucherify product ID or source ID."
        }
      ],
      "get": {
        "operationId": "get-product",
        "tags": [
          "Products"
        ],
        "summary": "Get Product",
        "description": "Retrieve details of a given product and its SKUs, if any.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "products"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a product object if a valid identifier was provided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsGetResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "prod_f1r5Tpr0DuC7",
                      "source_id": "test_prod_id_1",
                      "name": "Apple iPhone 8",
                      "price": null,
                      "attributes": [
                        "color",
                        "memory"
                      ],
                      "metadata": {
                        "test": true,
                        "vendor": "Cortland"
                      },
                      "image_url": null,
                      "created_at": "2021-12-03T06:33:46.101Z",
                      "updated_at": null,
                      "object": "product",
                      "skus": {
                        "object": "list",
                        "data_ref": "data",
                        "data": [
                          {
                            "id": "sku_0a417bd1d9952f9d6f",
                            "source_id": "test_iphone_8_silver_256gb",
                            "product_id": "prod_f1r5Tpr0DuC7",
                            "sku": "iPhone 8 Silver 256GB",
                            "price": null,
                            "currency": null,
                            "attributes": {
                              "color": "silver",
                              "memory": "256"
                            },
                            "image_url": null,
                            "metadata": {},
                            "created_at": "2021-12-03T06:33:46.599097+00:00",
                            "updated_at": null,
                            "object": "sku"
                          },
                          {
                            "id": "sku_0a417bd1d9952f9d6e",
                            "source_id": "test_iphone_8_silver_64gb",
                            "product_id": "prod_f1r5Tpr0DuC7",
                            "sku": "iPhone 8 Silver 64GB",
                            "price": null,
                            "currency": null,
                            "attributes": {
                              "color": "silver",
                              "memory": "64"
                            },
                            "image_url": null,
                            "metadata": {},
                            "created_at": "2021-12-03T06:33:46.598595+00:00",
                            "updated_at": null,
                            "object": "sku"
                          }
                        ],
                        "total": 2
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error when requesting a product that has been deleted or cannot be found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find product with id test_prod_id_",
                      "request_id": "v-0bae1d3caf478da111",
                      "resource_id": "test_prod_id_",
                      "resource_type": "product"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "update-product",
        "tags": [
          "Products"
        ],
        "summary": "Update Product",
        "description": "Updates the specified product by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "products"
            ]
          }
        ],
        "requestBody": {
          "description": "Specify the parameters of the product that are to be updated.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductsUpdateRequestBody"
              },
              "examples": {
                "Example": {
                  "value": {
                    "price": 210000
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns an updated product object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsUpdateResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "prod_0bae2dc5a090fd0184",
                      "source_id": "first_product",
                      "name": "Samsung Phone",
                      "price": 210000,
                      "attributes": [
                        "color",
                        "memory",
                        "processor"
                      ],
                      "metadata": {
                        "test": false,
                        "vendor": "Online Stores"
                      },
                      "image_url": "https://www.website.com/image.png",
                      "created_at": "2022-09-12T12:58:22.232Z",
                      "updated_at": "2022-09-12T13:33:48.904Z",
                      "object": "product"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete-product",
        "tags": [
          "Products"
        ],
        "summary": "Delete Product",
        "description": "Deletes a product and all related SKUs. This operation cannot be undone. \n\nIf the `force` parameter is set to `false` or not set at all, the product and all related SKUs will be moved to [the bin](/api-reference/bin/list-bin-entries).",
        "parameters": [
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterBoolean"
            },
            "in": "query",
            "name": "force",
            "description": "If this flag is set to `true`, the product and all related SKUs will be removed permanently. If it is set to `false` or not set at all, the product and all related SKUs will be moved to the bin. Going forward, the user will be able to create another product with exactly the same `source_id`."
          }
        ],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "products"
            ]
          }
        ],
        "responses": {
          "204": {
            "description": "Returns no content if deletion is successful."
          },
          "404": {
            "description": "Returns an error indicating that the product with given ID was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Product Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find product with id prod_0a4934c50ddc5dbae",
                      "request_id": "v-0ae39cd7de8683dfd8",
                      "resource_id": "prod_0a4934c50ddc5dbae",
                      "resource_type": "product"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/bulk/async": {
      "post": {
        "operationId": "update-products-in-bulk",
        "tags": [
          "Products"
        ],
        "summary": "Update Products in Bulk",
        "description": "Update products in one asynchronous operation.\n\nThe request can include up to **10 MB** of data.\n\nThe response returns a unique asynchronous action ID. Use this ID in the query paramater of the [GET Async Action](/api-reference/async-actions/get-async-action) endpoint to check, e.g.:\n\n- The status of your request (in queue, in progress, done, or failed)\n\n- Resources that failed to be updated\n\n- The report file with details about the update\n\n\n\nIf a product object is not found, it is **upserted**. This is shown in the report file in the **GET** Async Action endpoint. The upserted resources have value `false` in the `found` column and `true` in the `updated` column.\n\nThis API request starts a process that affects Voucherify data in bulk. In the case of small jobs (like bulk update), the request is put into a queue and processed when every other bulk request placed in the queue prior to this request is finished.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "products"
            ]
          }
        ],
        "requestBody": {
          "description": "List the product fields to be updated in each product object.",
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ProductsUpdateInBulkRequestBody"
                }
              },
              "examples": {
                "Example": {
                  "value": [
                    {
                      "source_id": "first_product",
                      "name": "Samsung Phone 1",
                      "price": 220000,
                      "attributes": [
                        "color",
                        "memory",
                        "processor"
                      ],
                      "metadata": {
                        "test": true,
                        "vendor": "Online Store - 3"
                      },
                      "image_url": "{{internalVoucherifyURL}}"
                    },
                    {
                      "source_id": "second_product",
                      "name": "Samsung Phone 2",
                      "price": 230000,
                      "attributes": [
                        "color",
                        "memory",
                        "processor"
                      ],
                      "metadata": {
                        "test": true,
                        "vendor": "Online Store - 4"
                      },
                      "image_url": "{{internalVoucherifyURL}}"
                    }
                  ]
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Returns the ID of the scheduled asynchronous action. The response informs you that the request has been accepted and the resources will be updated in the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and use it as a query parameter in the [GET Async Action](/api-reference/async-actions/get-async-action) endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsUpdateInBulkResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "async_action_id": "aa_0a875d56c805df6601"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Returns an error if the payload exceeds 10 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequest"
                },
                "examples": {
                  "Request Entity Too Large": {
                    "value": {
                      "statusCode": 413,
                      "error": "Request Entity Too Large",
                      "message": "Payload content length greater than maximum allowed: 10485760"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/metadata/async": {
      "post": {
        "operationId": "update-products-metadata-in-bulk",
        "tags": [
          "Products"
        ],
        "summary": "Update Products' Metadata in Bulk",
        "description": "Updates metadata parameters for a list of products. Every resource in the list will receive the metadata defined in the request.\n\nThe request can include up to **10 MB** of data.\n\nThe response returns a unique asynchronous action ID. Use this ID in the query paramater of the [GET Async Action](/api-reference/async-actions/get-async-action) endpoint to check, e.g.:\n\n- The status of your request (in queue, in progress, done, or failed)\n\n- Resources that failed to be updated\n\n- The report file with details about the update\n\n\nIf a product object is not found, it is **upserted**. This is shown in the report file in the **GET** Async Action endpoint. The upserted resources have value `false` in the `found` column and `true` in the `updated` column.\n\nThis API request starts a process that affects Voucherify data in bulk. In the case of small jobs (like bulk update), the request is put into a queue and processed when every other bulk request placed in the queue prior to this request is finished.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "products"
            ]
          }
        ],
        "requestBody": {
          "description": "List the `source_ids` of the products you would like to update with the metadata key/value pairs.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductsMetadataUpdateInBulkRequestBody"
              },
              "examples": {
                "Example": {
                  "value": {
                    "source_ids": [
                      "123-567-3433",
                      "test_volleyball"
                    ],
                    "metadata": {
                      "label": true,
                      "origin": "PL"
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Returns the ID of the scheduled asynchronous action. The response informs you that the request has been accepted and the resources will be updated in the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and use it as a query parameter in the [GET Async Action](/api-reference/async-actions/get-async-action) endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsMetadataUpdateInBulkResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "async_action_id": "aa_0a875d56c805df6601"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Returns an error if the payload exceeds 10 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequest"
                },
                "examples": {
                  "Request Entity Too Large": {
                    "value": {
                      "statusCode": 413,
                      "error": "Request Entity Too Large",
                      "message": "Payload content length greater than maximum allowed: 10485760"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/skus/{skuId}": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterSkuId"
          },
          "name": "skuId",
          "in": "path",
          "required": true,
          "description": "A Voucherify SKU identifier or SKU source ID."
        }
      ],
      "get": {
        "operationId": "get-sku",
        "tags": [
          "Products"
        ],
        "summary": "Get SKU",
        "description": "Retrieve details of a SKU.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "skus"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns requested SKU object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkusGetResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "sku_0b1621b2f25248b79c",
                      "source_id": "sku_source_id_1",
                      "product_id": "prod_0b15f6b9f650c16990",
                      "sku": "Extra Small Blue Shirt",
                      "price": 1300,
                      "currency": "USD",
                      "attributes": {
                        "size": "XS",
                        "color": "blue",
                        "ranking": 1
                      },
                      "image_url": "",
                      "metadata": {},
                      "created_at": "2022-05-17T10:36:30.057Z",
                      "updated_at": "2022-07-01T05:34:16.822Z",
                      "object": "sku"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error indicating that the sku with given ID was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find sku with id sku_0b1621b319d248b79",
                      "request_id": "v-0b4fe3ddc55646d01d",
                      "resource_id": "sku_0b1621b319d248b79",
                      "resource_type": "sku"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/{productId}/skus": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterProductId"
          },
          "name": "productId",
          "in": "path",
          "description": "A Voucherify [product](/api-reference/products/get-product) ID or product source ID.",
          "required": true
        }
      ],
      "get": {
        "operationId": "list-SKUs-in-product",
        "tags": [
          "Products"
        ],
        "summary": "List SKUs in Product",
        "description": "Retrieve all SKUs for a given product.",
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/order"
          },
          {
            "$ref": "#/components/parameters/start_date"
          },
          {
            "$ref": "#/components/parameters/end_date"
          }
        ],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "products"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a dictionary of SKUs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsSkusListResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "object": "list",
                      "data_ref": "skus",
                      "skus": [
                        {
                          "id": "sku_0b1621b2f25248b79c",
                          "source_id": "sku_source_id_1",
                          "product_id": "prod_0b15f6b9f650c16990",
                          "sku": "Extra Small Blue Shirt",
                          "price": 1300,
                          "currency": "USD",
                          "attributes": {
                            "size": "XS",
                            "color": "blue",
                            "ranking": 1
                          },
                          "image_url": "",
                          "metadata": {},
                          "created_at": "2022-05-17T10:36:30.057Z",
                          "updated_at": "2022-07-01T05:34:16.822Z",
                          "object": "sku"
                        },
                        {
                          "id": "sku_0b1621b3181248b79d",
                          "source_id": "sku_source_id_3",
                          "product_id": "prod_0b15f6b9f650c16990",
                          "sku": "Medium Yellow Shirt",
                          "price": 1450,
                          "currency": "USD",
                          "attributes": {
                            "size": "M",
                            "color": "yellow",
                            "ranking": 3
                          },
                          "image_url": "",
                          "metadata": {},
                          "created_at": "2022-05-17T10:36:30.180Z",
                          "updated_at": "2022-07-01T05:34:16.842Z",
                          "object": "sku"
                        },
                        {
                          "id": "sku_0b1621b3199248b79e",
                          "source_id": "sku_source_id_2",
                          "product_id": "prod_0b15f6b9f650c16990",
                          "sku": "Small Red Shirt",
                          "price": 1400,
                          "currency": "USD",
                          "attributes": {
                            "size": "S",
                            "color": "red",
                            "ranking": 2
                          },
                          "image_url": "",
                          "metadata": {},
                          "created_at": "2022-05-17T10:36:30.183Z",
                          "updated_at": "2022-07-01T05:34:16.927Z",
                          "object": "sku"
                        },
                        {
                          "id": "sku_0b1621b319d248b79f",
                          "source_id": "sku_source_id_4",
                          "product_id": "prod_0b15f6b9f650c16990",
                          "sku": "Large Pink Shirt -",
                          "price": 1700,
                          "currency": "USD",
                          "attributes": {
                            "size": "L",
                            "color": "pink",
                            "ranking": 4
                          },
                          "image_url": "",
                          "metadata": {},
                          "created_at": "2022-05-17T10:36:30.187Z",
                          "updated_at": "2022-07-05T08:47:50.680Z",
                          "object": "sku"
                        }
                      ],
                      "total": 4
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error when requesting a product that has been deleted or cannot be found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find product with id prod_0b15f6b9f650c6990",
                      "request_id": "v-0bae223075878da708",
                      "resource_id": "prod_0b15f6b9f650c6990",
                      "resource_type": "product"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "create-sku",
        "tags": [
          "Products"
        ],
        "summary": "Create SKU",
        "description": "This method adds product variants to a [created product](/api-reference/products/create-product). \n\n<Note>\n\n<Badge color=\"blue\">Upsert Mode</Badge>\n\nIf you pass an `id` or a `source_id` that already exists in the sku database, Voucherify will return a related sku object with updated fields.\n\n</Note>",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "products"
            ]
          }
        ],
        "requestBody": {
          "description": "Specify the SKU parameters to be created.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductsSkusCreateRequestBody"
              },
              "examples": {
                "Example": {
                  "value": {
                    "source_id": "first_product_sku_1",
                    "sku": "Samsung phone 256GB",
                    "price": 1300,
                    "currency": "USD",
                    "attributes": {
                      "color": "vintage-black",
                      "memory": "256",
                      "processor": "Intel"
                    },
                    "image_url": "{{internalVoucherifyURL}}",
                    "metadata": {
                      "imported": true
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns the created SKU object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsSkusCreateResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "sku_0bae3b28f610fd0da1",
                      "source_id": "first_product_sku_1",
                      "product_id": "prod_0bae2dc5a090fd0184",
                      "sku": "Samsung phone 256GB",
                      "price": 1300,
                      "currency": "USD",
                      "attributes": {
                        "color": "vintage-black",
                        "memory": "256",
                        "processor": "Intel"
                      },
                      "image_url": "{{internalVoucherifyURL}}",
                      "metadata": {
                        "imported": true
                      },
                      "created_at": "2022-09-12T13:56:51.828Z",
                      "updated_at": null,
                      "object": "sku"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/{productId}/skus/{skuId}": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterProductId"
          },
          "name": "productId",
          "in": "path",
          "required": true,
          "description": "A unique Voucherify [product](/api-reference/products/get-product) ID or product source ID."
        },
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterSkuId"
          },
          "name": "skuId",
          "in": "path",
          "required": true,
          "description": "A Voucherify [SKU ID](/api-reference/products/get-sku) or SKU source ID."
        }
      ],
      "put": {
        "operationId": "update-sku",
        "tags": [
          "Products"
        ],
        "summary": "Update SKU",
        "description": "Updates the specified SKU by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.\n\nFields other than the ones listed in the request body schema won't be modified. Even if provided, they will be silently skipped.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "products"
            ]
          }
        ],
        "requestBody": {
          "description": "Specify the parameters to be updated.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductsSkusUpdateRequestBody"
              },
              "examples": {
                "Example": {
                  "value": {
                    "price": 210000,
                    "currency": "PLN"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns the SKU object with the updated parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsSkusUpdateResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "sku_0bae3b28f610fd0da1",
                      "source_id": "first_product_sku_1",
                      "product_id": "prod_0bae2dc5a090fd0184",
                      "sku": "Samsung phone 256GB",
                      "price": 210000,
                      "currency": "PLN",
                      "attributes": {
                        "color": "vintage-black",
                        "memory": "256",
                        "processor": "Intel"
                      },
                      "image_url": "{{internalVoucherifyURL}}",
                      "metadata": {
                        "imported": true
                      },
                      "created_at": "2022-09-12T13:56:51.828Z",
                      "updated_at": "2022-09-12T14:09:40.859Z",
                      "object": "sku"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete-sku",
        "tags": [
          "Products"
        ],
        "summary": "Delete SKU",
        "description": "Deletes a product SKU. This operation cannot be undone. \n\nIf the `force` parameter is set to `false` or not set at all, the SKU will be moved to [the bin](/api-reference/bin/list-bin-entries).",
        "parameters": [
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterBoolean"
            },
            "in": "query",
            "name": "force",
            "description": "If this flag is set to `true`, the SKU will be removed permanently. If it is set to `false` or not set at all, the SKU will be moved to the bin. Going forward, the user will be able to create another SKU with exactly the same `source_id`."
          }
        ],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "products"
            ]
          }
        ],
        "responses": {
          "204": {
            "description": "Returns no content if deletion is successful."
          },
          "404": {
            "description": "Returns an error indicating that the product or sku with given ID was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Product Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find product with id 123-567-343",
                      "request_id": "v-0ae3a0d26fd40ecd11",
                      "resource_id": "123-567-343",
                      "resource_type": "product"
                    }
                  },
                  "SKU Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find sku with id sku_0ae3a06b20019ba8f",
                      "request_id": "v-0ae3a1534d940ecd81",
                      "resource_id": "sku_0ae3a06b20019ba8f",
                      "resource_type": "sku"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/importCSV": {
      "post": {
        "operationId": "import-products-using-csv",
        "tags": [
          "Products"
        ],
        "summary": "Import Products using CSV",
        "description": "Import products into the repository using a CSV file.\n\nThe CSV file has to include headers in the first line.\n\n\n\n<Note>\n\n<Badge color=\"blue\">Standard product fields mapping</Badge>\n\n- Create a **comma separated value (CSV) file** or download our CSV import template. You can find an example template [here](https://s3.amazonaws.com/helpscout.net/docs/assets/5902f1c12c7d3a057f88a36d/attachments/627b82ed68d51e779443f550/Import_products_template.csv).\n- Supported CSV file headers: `name,source_id,price,attributes,image_url,Metadata_property_name`\n- **Name** is a **required** field. The remaining fields in the CSV template are optional.\n- Override/Update products' **names** in Voucherify using this method. Data will be updated for each product included in the CSV file whose **source_id** matches a source ID in Voucherify. No other data can be updated other than the product name.\n- Note that dates and date-time attributes need to be provided in compliance with the **ISO 8601 standard**. For example, 2022-03-11T09:00:00.000Z or 2022-03-11\n   - `YYYY-MM-DD`\n   - `YYYY-MM-DDTHH`\n   - `YYYY-MM-DDTHH:mm`\n   - `YYYY-MM-DDTHH:mm:ss`\n   - `YYYY-MM-DDTHH:mm:ssZ`\n   - `YYYY-MM-DDTHH:mm:ssZ`\n   - `YYYY-MM-DDTHH:mm:ss.SSSZ`\n- Columns that cannot be mapped to standard fields, will be mapped to **Custom attributes** and added as **products' metadata**. There is no limit on the number of custom attributes that you can import as metadata.\n- To provide the proper data type, you need to add all custom attributes to the metadata schema **before importing the file**. Read more [here](/prepare/metadata#add-metadata).\n- **Product attributes** (not custom attributes) need to be separated by a comma and enclosed in double quotes, i.e \"attribute1,attribute2\".\n- Headers with metadata names **can't contain white-space characters**.\n- If you import metadata defined in the schema as **arrays (multiple)**, you need to separate each value using a comma, for example:\n   - array of strings: \"subscribed,premium\"\n   - array of numbers: \"123,234\".\n   - array of dates: \"2000-01-01,2000-01-02\"\n\n</Note>\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](/api-reference/async-actions/get-async-action).",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "products"
            ]
          }
        ],
        "requestBody": {
          "description": "The file path is stored in the form `file` header.",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ProductsImportCSVRequestBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and products will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](/api-reference/async-actions/get-async-action) endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsImportCsvCreateResponseBody"
                },
                "examples": {
                  "Async Action": {
                    "value": {
                      "async_action_id": "aa_0a875d56c805df6601"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Returns an invalid payload error. You may receive this error if you have incorrectly or have not specified the content type as `multipart/form-data` in the headers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Invalid payload": {
                    "value": {
                      "code": 400,
                      "key": "invalid_payload",
                      "message": "Invalid payload",
                      "details": "Payload should have required property 'file'",
                      "request_id": "v-0c4c46bbad0136789f"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/skus/importCSV": {
      "post": {
        "operationId": "import-SKUs-using-csv",
        "tags": [
          "Products"
        ],
        "summary": "Import SKUs using CSV",
        "description": "Import SKUs into the repository using a CSV file.\n\nThe CSV file has to include headers in the first line. All properties which cannot be mapped to standard SKU fields will be added to the metadata object. You can find an example template [here](https://s3.amazonaws.com/helpscout.net/docs/assets/5902f1c12c7d3a057f88a36d/attachments/627b98d08c9b585083488a4c/Import_SKUS_template.csv). \n\n<Warning>\n\n<Badge color=\"yellow\">Import sequence</Badge>\n\nFirst import products using the [dedicated endpoint](/api-reference/products/import-products-using-csv), then import SKUs using this endpoint to properly match SKUs to products.\n\n</Warning>\n\n\n\n<Note>\n\n<Badge color=\"blue\">Standard SKU fields mapping</Badge>\n\n- **Required** fields are `source_id` and `product_id`.\n- Supported CSV file headers: `product_id,sku,source_id,price,image_url,attributes`\n- SKU **source_id** must be unique in the entire product catalog, no duplicates are allowed.\n- SKU attributes need to be in the form of a stringy-fied json, i.e.`\"{'color':'blue'}\"`. These attributes must be defined in the **product** beforehand so you can import them to the SKU.\n- You can use this method to update the following parameters in bulk: **sku** and the sku **price**.\n- Columns that cannot be mapped to standard fields will be mapped to Custom attributes and added as product metadata. There is no limit on the number of custom attributes that you can import as metadata.\n\n</Note>\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](/api-reference/async-actions/get-async-action).",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "skus"
            ]
          }
        ],
        "requestBody": {
          "description": "The file path is stored in the form `file` header.",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/SkusImportCSVRequestBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and SKUs will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](/api-reference/async-actions/get-async-action) endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkusImportCsvCreateResponseBody"
                },
                "examples": {
                  "Async Action": {
                    "value": {
                      "async_action_id": "aa_0a875d56c805df6601"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "$ref": "#/components/schemas/ParameterLimit"
        },
        "description": "Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items."
      },
      "page": {
        "name": "page",
        "in": "query",
        "required": false,
        "schema": {
          "$ref": "#/components/schemas/ParameterPage"
        },
        "description": "Which page of results to return. The lowest value is `1`."
      },
      "order": {
        "name": "order",
        "in": "query",
        "required": false,
        "schema": {
          "$ref": "#/components/schemas/ParameterOrder"
        },
        "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order."
      },
      "start_date": {
        "name": "start_date",
        "in": "query",
        "schema": {
          "$ref": "#/components/schemas/ParameterDate"
        },
        "description": "Timestamp representing the date and time which results must end on. Represented in ISO 8601 format."
      },
      "end_date": {
        "name": "end_date",
        "in": "query",
        "schema": {
          "$ref": "#/components/schemas/ParameterDate"
        },
        "description": "Timestamp representing the date and time which results must end on. Represented in ISO 8601 format."
      }
    },
    "schemas": {
      "ProductsListResponseBody": {
        "type": "object",
        "title": "Products List Response Body",
        "description": "Response body schema for **GET** `v1/products`.",
        "properties": {
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON. This object stores information about products in a dictionary.",
            "default": "list"
          },
          "data_ref": {
            "type": "string",
            "description": "Identifies the name of the attribute that contains the array of product objects.",
            "default": "products"
          },
          "products": {
            "type": "array",
            "description": "Contains array of product objects.",
            "items": {
              "$ref": "#/components/schemas/Product"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of product objects."
          }
        },
        "required": [
          "object",
          "data_ref",
          "products",
          "total"
        ]
      },
      "ProductsCreateRequestBody": {
        "type": "object",
        "description": "Request schema for **POST** `v1/products`.",
        "title": "Products Create Request Body",
        "properties": {
          "id": {
            "type": "string",
            "example": "prod_5h0wc453_1",
            "description": "A unique identifier that represents the product and is assigned by Voucherify."
          },
          "source_id": {
            "type": "string",
            "example": "productSourceID16",
            "description": "Unique product source ID."
          },
          "name": {
            "type": "string",
            "description": "Unique user-defined product name.",
            "example": "T-shirt"
          },
          "price": {
            "type": "integer",
            "description": "Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as `$100.00` being expressed as `10000`."
          },
          "attributes": {
            "type": "array",
            "description": "A list of product attributes whose values you can customize for given SKUs: `[\"color\",\"size\",\"ranking\"]`. Each child SKU can have a unique value for a given attribute.",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the product. A set of key/value pairs that you can attach to a product object. It can be useful for storing additional information about the product in a structured format."
          },
          "image_url": {
            "type": "string",
            "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the product image.",
            "example": "https://images.com/original.jpg"
          }
        }
      },
      "ProductsCreateResponseBody": {
        "type": "object",
        "title": "Products Create Response Body",
        "description": "Response body schema for **POST** `v1/products`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Product"
          }
        ]
      },
      "ProductsGetResponseBody": {
        "type": "object",
        "title": "Products Get Response Body",
        "description": "Response body schema for **GET** `v1/products/{productId}`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Product"
          }
        ]
      },
      "Error": {
        "title": "Error Object",
        "type": "object",
        "description": "Error details",
        "properties": {
          "code": {
            "type": "integer",
            "description": "Error's HTTP status code."
          },
          "key": {
            "type": "string",
            "description": "Short string describing the kind of error which occurred."
          },
          "message": {
            "type": "string",
            "description": "A human-readable message providing a short description of the error."
          },
          "details": {
            "type": "string",
            "description": "A human-readable message providing more details about the error."
          },
          "request_id": {
            "type": "string",
            "example": "v-0a885062c80375740f",
            "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team."
          },
          "resource_id": {
            "type": "string",
            "description": "Unique resource ID that can be used in another endpoint to get more details.",
            "example": "rf_0c5d710a87c8a31f86"
          },
          "resource_type": {
            "type": "string",
            "description": "The resource type.",
            "example": "voucher"
          },
          "error": {
            "type": "object",
            "description": "Includes additional information about the error.",
            "properties": {
              "message": {
                "type": "string",
                "description": "The message configured by the user in a validation rule."
              }
            }
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "ParameterProductId": {
        "type": "string",
        "example": "prod_3ttSkdxGuAfcv3"
      },
      "ProductsUpdateRequestBody": {
        "type": "object",
        "description": "Request schema for **PUT** `v1/products`.",
        "title": "Products Update Request Body",
        "properties": {
          "name": {
            "type": "string",
            "description": "Unique user-defined product name.",
            "example": "T-shirt"
          },
          "price": {
            "type": "integer",
            "description": "Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as `$100.00` being expressed as `10000`."
          },
          "attributes": {
            "type": "array",
            "description": "A list of product attributes whose values you can customize for given SKUs: `[\"color\",\"size\",\"ranking\"]`. Each child SKU can have a unique value for a given attribute.",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the product. A set of key/value pairs that you can attach to a product object. It can be useful for storing additional information about the product in a structured format."
          },
          "image_url": {
            "type": "string",
            "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the product image.",
            "example": "https://images.com/original.jpg"
          }
        }
      },
      "ProductsUpdateResponseBody": {
        "type": "object",
        "title": "Products Update Response Body",
        "description": "Response body schema for **PUT** `v1/products/{productId}`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Product"
          }
        ]
      },
      "ParameterBoolean": {
        "type": "boolean"
      },
      "ProductsUpdateInBulkRequestBody": {
        "type": "object",
        "description": "Request schema for **POST** `v1/products/bulk/async`.",
        "title": "Products Update In Bulk Request Body",
        "properties": {
          "source_id": {
            "type": "string",
            "description": "Unique product source ID from your inventory system.",
            "example": "test_prod_id_1"
          },
          "name": {
            "type": "string",
            "description": "Unique user-defined product name.",
            "example": "T-shirt"
          },
          "price": {
            "type": "integer",
            "description": "Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as `$100.00` being expressed as `10000`."
          },
          "attributes": {
            "type": "array",
            "description": "A list of product attributes whose values you can customize for given SKUs: `[\"color\",\"size\",\"ranking\"]`. Each child SKU can have a unique value for a given attribute.",
            "items": {
              "type": "string"
            }
          },
          "image_url": {
            "type": "string",
            "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the product image.",
            "example": "https://images.com/original.jpg"
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the product. A set of key/value pairs that you can attach to a product object. It can be useful for storing additional information about the product in a structured format."
          }
        },
        "required": [
          "source_id"
        ]
      },
      "ProductsUpdateInBulkResponseBody": {
        "type": "object",
        "title": "Products Update In Bulk Response Body",
        "description": "Response body schema for **POST** `v1/products/bulk/async`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/AsyncActions"
          }
        ]
      },
      "BadRequest": {
        "title": "Error Object",
        "type": "object",
        "description": "Error details",
        "properties": {
          "statusCode": {
            "type": "integer",
            "description": "Error's HTTP status code."
          },
          "error": {
            "type": "string",
            "description": "A human-readable message providing a short description of the error."
          },
          "message": {
            "type": "string",
            "description": "A human-readable message providing more details about the error."
          }
        }
      },
      "ProductsMetadataUpdateInBulkRequestBody": {
        "type": "object",
        "title": "Products Metadata Update In Bulk Request Body",
        "description": "Request schema for **POST** `v1/products/metadata/async`.",
        "properties": {
          "source_ids": {
            "type": "array",
            "description": "Array of unique product source IDs.",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the product. A set of key/value pairs that you can attach to a product object. It can be useful for storing additional information about the product in a structured format."
          }
        },
        "required": [
          "source_ids",
          "metadata"
        ]
      },
      "ProductsMetadataUpdateInBulkResponseBody": {
        "type": "object",
        "title": "Products Metadata Update In Bulk Response Body",
        "description": "Response body schema for **POST** `v1/products/metadata/async`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/AsyncActions"
          }
        ]
      },
      "SkusGetResponseBody": {
        "type": "object",
        "title": "Skus Get Response Body",
        "description": "Response body schema for **GET** `v1/skus/{skuId}`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Sku"
          }
        ]
      },
      "ParameterSkuId": {
        "type": "string",
        "example": "sku_0b661e41eccd35a8e9"
      },
      "ProductsSkusListResponseBody": {
        "type": "object",
        "title": "Products Skus List Response Body",
        "description": "Response body schema for **GET** `v1/products/{productId}/SKUs`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/SkusList"
          }
        ]
      },
      "ProductsSkusCreateRequestBody": {
        "title": "Products Skus Create Request Body",
        "type": "object",
        "description": "Request body schema for **POST** `v1/products/{productId}/skus",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique SKU ID.",
            "example": "sku_0c0c0012a9029bccef"
          },
          "source_id": {
            "type": "string",
            "example": "sku_source_id_4",
            "description": "A unique SKU identifier from your inventory system."
          },
          "sku": {
            "type": "string",
            "example": "Large Pink Shirt",
            "description": "Unique user-defined SKU name."
          },
          "price": {
            "type": "integer",
            "description": "SKU unit price. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
          },
          "currency": {
            "type": "string",
            "description": "SKU price currency.",
            "example": "USD"
          },
          "attributes": {
            "type": "object",
            "description": "The attributes object stores values for all custom attributes inherited by the SKU from the parent product. A set of key/value pairs that are attached to a SKU object and are unique to each SKU within a product family."
          },
          "image_url": {
            "type": "string",
            "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image."
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format."
          }
        }
      },
      "ProductsSkusCreateResponseBody": {
        "type": "object",
        "title": "Products Skus Create Response Body",
        "description": "Response body schema for **PUT** `v1/products/{productId}/SKUs`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Sku"
          }
        ]
      },
      "ProductsSkusUpdateRequestBody": {
        "title": "Products Skus Update Request Body",
        "type": "object",
        "description": "Request body schema for **PUT** `v1/products/{productId}/skus/{skuId}`.",
        "properties": {
          "sku": {
            "type": "string",
            "example": "Large Pink Shirt",
            "description": "Unique user-defined SKU name."
          },
          "price": {
            "type": "integer",
            "description": "SKU unit price. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
          },
          "currency": {
            "type": "string",
            "description": "SKU price currency."
          },
          "attributes": {
            "type": "object",
            "description": "The attributes object stores values for all custom attributes inherited by the SKU from the parent product. A set of key/value pairs that are attached to a SKU object and are unique to each SKU within a product family."
          },
          "image_url": {
            "type": "string",
            "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image."
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format."
          }
        }
      },
      "ProductsSkusUpdateResponseBody": {
        "type": "object",
        "title": "Products Skus Update Response Body",
        "description": "Response body schema for **PUT** `v1/products/{productId}/skus/{skuId}`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Sku"
          }
        ]
      },
      "ProductsImportCSVRequestBody": {
        "type": "object",
        "title": "Products Import CSV Request Body",
        "description": "Response body schema for **POST** `v1/products/importCSV`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ImportCSVRequestBody"
          }
        ]
      },
      "ProductsImportCsvCreateResponseBody": {
        "type": "object",
        "title": "Products Import Csv Create Response Body",
        "description": "Response body schema for **POST** `v1/products/importCSV`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/AsyncActions"
          }
        ]
      },
      "SkusImportCSVRequestBody": {
        "type": "object",
        "title": "Skus Import Csv Request Body",
        "description": "Response body schema for **POST** `v1/skus/importCSV`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ImportCSVRequestBody"
          }
        ]
      },
      "SkusImportCsvCreateResponseBody": {
        "type": "object",
        "title": "Skus Import Csv Create Response Body",
        "description": "Response body schema for **POST** `v1/skus/importCSV`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/AsyncActions"
          }
        ]
      },
      "ParameterLimit": {
        "type": "integer",
        "maximum": 100,
        "minimum": 1
      },
      "ParameterPage": {
        "type": "integer",
        "minimum": 1,
        "maximum": 100
      },
      "ParameterOrder": {
        "type": "string",
        "enum": [
          "created_at",
          "-created_at",
          "updated_at",
          "-updated_at",
          "type",
          "-type",
          "code",
          "-code",
          "campaign",
          "-campaign",
          "category",
          "-category"
        ]
      },
      "ParameterDate": {
        "type": "string",
        "example": "2023-12-22T10:13:06.487Z",
        "format": "date-time"
      },
      "Product": {
        "type": "object",
        "description": "This is an object representing a product.  \n\nThis entity should be used to map product items from your inventory management system. The aim of products is to build which reflect product-specific campaigns.",
        "title": "Product",
        "allOf": [
          {
            "$ref": "#/components/schemas/ProductWithoutSkus"
          },
          {
            "type": "object",
            "properties": {
              "skus": {
                "$ref": "#/components/schemas/SkusListForProduct"
              }
            }
          }
        ]
      },
      "AsyncActions": {
        "type": "object",
        "title": "Asynchronous Actions",
        "description": "Response to requests that are processed asynchronously.",
        "properties": {
          "async_action_id": {
            "type": "string",
            "example": "aa_0a875d56c805df6601",
            "description": "The ID of the scheduled asynchronous action."
          }
        },
        "required": [
          "async_action_id"
        ]
      },
      "Sku": {
        "title": "SKU Object",
        "type": "object",
        "description": "This is an object representing a product SKU.",
        "properties": {
          "id": {
            "type": "string",
            "example": "sku_0b1621b319d248b79f",
            "description": "A unique identifier that represents the SKU and is assigned by Voucherify."
          },
          "source_id": {
            "type": "string",
            "nullable": true,
            "example": "sku_source_id_4",
            "description": "A unique SKU identifier from your inventory system."
          },
          "product_id": {
            "type": "string",
            "example": "prod_0b15f6b9f650c16990",
            "description": "The parent product's unique ID."
          },
          "sku": {
            "type": "string",
            "nullable": true,
            "example": "Large Pink Shirt",
            "description": "Unique user-defined SKU name."
          },
          "price": {
            "type": "integer",
            "nullable": true,
            "description": "Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as `$100.00` being expressed as `10000`."
          },
          "currency": {
            "type": "string",
            "nullable": true,
            "description": "SKU price currency.",
            "example": "USD"
          },
          "attributes": {
            "type": "object",
            "description": "The attributes object stores values for all custom attributes inherited by the SKU from the parent product. A set of key/value pairs that are attached to a SKU object and are unique to each SKU within a product family."
          },
          "image_url": {
            "type": "string",
            "nullable": true,
            "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image."
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format. It can be used to create product collections."
          },
          "created_at": {
            "type": "string",
            "example": "2022-05-17T10:36:30.187Z",
            "description": "Timestamp representing the date and time when the SKU was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "nullable": true,
            "example": "2022-05-17T10:55:09.137Z",
            "description": "Timestamp representing the date and time when the SKU was updated. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "object": {
            "type": "string",
            "default": "sku",
            "description": "The type of the object represented by JSON. This object stores information about the `SKU`.",
            "enum": [
              "sku"
            ]
          }
        },
        "required": [
          "id",
          "source_id",
          "product_id",
          "sku",
          "price",
          "attributes",
          "metadata",
          "image_url",
          "created_at",
          "updated_at",
          "object"
        ]
      },
      "SkusList": {
        "type": "object",
        "description": "Contains information about SKUs.",
        "title": "SKUs List",
        "properties": {
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON. This object stores information about SKUs.",
            "default": "list"
          },
          "data_ref": {
            "type": "string",
            "description": "Identifies the name of the JSON property that contains the array of SKUs.",
            "default": "data"
          },
          "skus": {
            "type": "array",
            "description": "A dictionary that contains an array of SKUs.",
            "items": {
              "$ref": "#/components/schemas/Sku"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of SKUs in the product."
          }
        },
        "required": [
          "object",
          "data_ref",
          "skus",
          "total"
        ]
      },
      "ImportCSVRequestBody": {
        "type": "object",
        "title": "Import CSV file",
        "description": "Request body schema for importing data using a CSV file.",
        "format": "binary",
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "File path."
          }
        },
        "required": [
          "file"
        ]
      },
      "ProductWithoutSkus": {
        "title": "Product without Skus Object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique product ID assigned by Voucherify.",
            "example": "prod_0b1da8105693710357"
          },
          "source_id": {
            "type": "string",
            "nullable": true,
            "example": "productSourceID16",
            "description": "Unique product source ID."
          },
          "name": {
            "type": "string",
            "nullable": true,
            "description": "Unique user-defined product name.",
            "example": "T-shirt"
          },
          "price": {
            "type": "integer",
            "nullable": true,
            "description": "Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as `$100.00` being expressed as `10000`."
          },
          "attributes": {
            "type": "array",
            "description": "A list of product attributes whose values you can customize for given SKUs: `[\"color\",\"size\",\"ranking\"]`. Each child SKU can have a unique value for a given attribute.",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the product. A set of key/value pairs that you can attach to a product object. It can be useful for storing additional information about the product in a structured format. It can be used to create product collections."
          },
          "image_url": {
            "type": "string",
            "nullable": true,
            "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the product image.",
            "example": "https://images.com/original.jpg"
          },
          "created_at": {
            "type": "string",
            "description": "Timestamp representing the date and time when the product was created. The value is shown in the ISO 8601 format.",
            "example": "2022-05-23T06:52:55.008Z",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "nullable": true,
            "description": "Timestamp representing the date and time when the product was updated. The value is shown in the ISO 8601 format.",
            "example": "2022-05-23T09:24:07.405Z",
            "format": "date-time"
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON. This object stores information about the product.",
            "default": "product",
            "enum": [
              "product"
            ]
          }
        },
        "required": [
          "id",
          "source_id",
          "name",
          "attributes",
          "metadata",
          "object",
          "price"
        ]
      },
      "SkusListForProduct": {
        "type": "object",
        "description": "Contains information about child SKUs.",
        "title": "Skus List For Product",
        "properties": {
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON. This object stores information about SKUs.",
            "default": "list"
          },
          "data_ref": {
            "type": "string",
            "description": "Identifies the name of the JSON property that contains the array of SKUs.",
            "default": "data"
          },
          "data": {
            "type": "array",
            "description": "A dictionary that contains an array of SKUs.",
            "items": {
              "$ref": "#/components/schemas/Sku"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of SKUs in the product."
          }
        },
        "required": [
          "object",
          "data_ref",
          "data",
          "total"
        ]
      }
    },
    "securitySchemes": {
      "X-App-Id": {
        "type": "apiKey",
        "name": "X-App-Id",
        "in": "header"
      },
      "X-App-Token": {
        "type": "apiKey",
        "name": "X-App-Token",
        "in": "header"
      },
      "X-Voucherify-OAuth": {
        "type": "oauth2",
        "flows": {
          "implicit": {
            "authorizationUrl": "https://api.voucherify.io/v1/oauth/token",
            "scopes": {
              "api": "Gives access to whole server-side API.",
              "vouchers": "Gives access to all endpoints and methods starting with `v1/vouchers`.",
              "client_api": "Gives access to whole client-side API.",
              "client_vouchers": "Gives access to all endpoints and methods starting with `/client/v1/vouchers`.",
              "promotions": "Gives access to all endpoints and methods starting with `/v1/promotions`.",
              "client_promotions": "Gives access to all endpoints and methods starting with `/client/v1/promotions`",
              "campaigns": "Gives access to all endpoints and methods starting with `v1/campaigns`.",
              "client_publish": "Gives access to all endpoints and methods starting with `/client/v1/publish`.",
              "exports": "Gives access to all endpoints and methods starting with `/v1/exports`.",
              "publications": "Gives access to all endpoints and methods starting with `/v1/publications`.",
              "client_validate": "Gives access to all endpoints and methods starting with `/client/v1/validate`.",
              "validations": "Gives access to all endpoints and methods starting with `/v1/validations`.",
              "client_validations": "Gives access to all endpoints and methods starting with `/client/v1/validations`.",
              "qualifications": "Gives access to all endpoints and methods starting with `/v1/qualifications`.",
              "client_qualifications": "Gives access to all endpoints and methods starting with `/client/v1/qualifications`.",
              "client_redeem": "Gives access to all endpoints and methods starting with `/client/v1/redeem",
              "redemptions": "Gives access to all endpoints and methods starting with `/v1/redemptions`.",
              "client_redemptions": "Gives access to all endpoints and methods starting with `/client/v1/redemptions`",
              "customers": "Gives access to all endpoints and methods starting with `/v1/customers`.",
              "client_customers": "Gives access to all endpoints and methods starting with `/client/v1/customers`.",
              "orders": "Gives access to all endpoints and methods starting with `/v1/orders`.",
              "products": "Gives access to all endpoints and methods starting with `/v1/products`.",
              "skus": "Gives access to all endpoints and methods starting with `/v1/SKUs`.",
              "validation-rules": "Gives access to all endpoints and methods starting with `/v1/validation-rules`.",
              "validation-rules-assignments": "Gives access to all endpoints and methods starting with `/v1/validation-rules-assignments",
              "segments": "Gives access to all endpoints and methods starting with `/v1/segments`.",
              "events": "Gives access to all endpoints and methods starting with `/v1/events`.",
              "client_events": "Gives access to all endpoints and methods starting with `client/v1/events`.",
              "rewards": "Gives access to all endpoints and methods starting with `/v1/rewards`.",
              "assets": "Gives access to all endpoints and methods starting with `/v1/assets`.",
              "task-results": "Gives access to all endpoints and methods starting with `/v1/task-results`.",
              "loyalties": "Gives access to all endpoints and methods starting with `/v1/loyalties`.",
              "client_consents": "Gives access to all endpoints and methods starting with `client/v1/consents`.",
              "consents": "Gives access to all endpoints and methods starting with `/v1/consents`.",
              "async-actions": "Gives access to all endpoints and methods starting with `/v1/async-actions`.",
              "product-collections": "Gives access to all endpoints and methods starting with `/v1/product-collections`.",
              "categories": "Gives access to all endpoints and methods starting with `/v1/categories`.",
              "metadata-schemas": "Gives access to all endpoints and methods starting with `/v1/metadata-schemas`.",
              "locations": "Gives access to all endpoints and methods starting with `/v1/locations`.",
              "referrals": "Gives access to all endpoints and methods starting with `/v1/referrals`.",
              "trash-bin": "Gives access to all endpoints and methods starting with `/v1/trash-bin`.",
              "templates": "Gives access to all endpoints and methods starting with `/v1/templates`."
            }
          }
        }
      }
    }
  }
}