{
  "info": {
    "_postman_id": "52a73d4b-108f-4724-95f8-9ae90f6ae5e3",
    "name": "VoucherCart APIs",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "Authentication",
      "item": [
        {
          "name": "Authorisation",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "const responseJson = pm.response.json();",
                  "pm.environment.set(\"jwtToken\", responseJson.accessToken);",
                  "pm.environment.set(\"refreshToken\", responseJson.refreshToken);"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "basic",
              "basic": [
                {
                  "key": "password",
                  "value": "{{password}}",
                  "type": "string"
                },
                {
                  "key": "username",
                  "value": "{{username}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"subdomain\" : \"{{subdomain}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/authorize",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "authorize"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Refresh Authorisation",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "const responseJson = pm.response.json();",
                  "pm.environment.set(\"jwtToken\", responseJson.accessToken);",
                  "pm.environment.set(\"refreshToken\", responseJson.refreshToken);"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "PUT",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/refresh?accessToken={{jwtToken}}&refreshToken={{refreshToken}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "refresh"
              ],
              "query": [
                {
                  "description": "JWT Token",
                  "key": "accessToken",
                  "value": "{{jwtToken}}"
                },
                {
                  "description": "Refresh token acquired during authorization. Starts with RT letters.",
                  "key": "refreshToken",
                  "value": "{{refreshToken}}"
                }
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Orders",
      "item": [
        {
          "name": "List all orders",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "refreshToken",
                "value": "{{refreshToken}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": ""
            },
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/orders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "orders"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Product refund list",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/orders/{{orderId}}/products/{{productId}}/refunds",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "orders",
                "{{orderId}}",
                "products",
                "{{productId}}",
                "refunds"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Product redemption list",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/orders/{{orderId}}/products/{{productId}}/redemptions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "orders",
                "{{orderId}}",
                "products",
                "{{productId}}",
                "redemptions"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retrieve an order",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "refreshToken",
                "value": "{{refreshToken}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": ""
            },
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/orders/{{orderId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "orders",
                "{{orderId}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Create an eVoucher Order (Buyer)",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  ""
                ]
              }
            }
          ],
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "refreshToken",
                "value": "{{refreshToken}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"purchaser\": {\n        \"name\": \"{{$randomFullName}}\",\n        \"email\": \"{{$randomEmail}}\",\n        \"phone\": \"{{$randomPhoneNumber}}\"\n    },\n    \"sale_location_id\": {{saleLocationId}},\n    \"products\": [\n        {\n        \"voucher_id\": {{voucherId}},\n        \"layout_id\": {{layoutId}},\n        \"option_id\": {{optionId}},\n        \"option_amount\": {\n                \"amount\": 100,\n                \"currency\": \"GBP\"\n        },\n        \"voucher_version\": 2,\n        \"hide_price\": false,\n        \"message\": \"{{$randomLoremSentence}}\",\n        \"delivery_method\": \"electronic\",\n        \"internal_note\": null,\n        \"voucher_from\": \"{{$randomCompanyName}}\",\n        \"voucher_to\": \"{{$randomFirstName}}\"\n        }\n    ],\n    \"language\": \"en\"\n}\n",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/orders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "orders"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Create an eVoucher Order (Recipient)",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "refreshToken",
                "value": "{{refreshToken}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"language\": \"en\",\n    \"purchaser\": {\n        \"name\": \"{{$randomFullName}}\",\n        \"email\": \"{{$randomEmail}}\",\n        \"phone\": \"{{$randomPhoneNumber}}\"\n    },\n    \"sale_location_id\": {{saleLocationId}},\n    \"products\": [\n        {\n        \"voucher_id\": {{voucherId}},\n        \"layout_id\": {{layoutId}},\n        \"option_id\": {{optionId}},\n        \"option_amount\": {\n                \"amount\": 10000,\n                \"currency\": \"GBP\"\n        },\n        \"recipient\": {\n        \"name\": \"{{$randomFullName}}\",\n        \"email\": \"{{$randomEmail}}\"\n        },\n        \"voucher_version\": 2,\n        \"hide_price\": false,\n        \"message\": \"{{$randomLoremSentence}}\",\n        \"delivery_method\": \"electronic\",\n        \"internal_note\": null,\n        \"voucher_from\": \"{{$randomCompanyName}}\",\n        \"voucher_to\": \"{{$randomFirstName}}\"\n        }\n    ]\n}\n",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/orders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "orders"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Cancel a product",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"reason\": \"Order cancelled in Shopify, order #1001\",\n    \"send_email_to_buyer\": false\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/orders/{{orderId}}/products/{{productId}}/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "orders",
                "{{orderId}}",
                "products",
                "{{productId}}",
                "cancel"
              ]
            },
            "description": "Cancels one product of an order and voids its voucher, without recording a refund. To void a voucher whose money was returned, use **Refund a product** instead, so that reports show it as refunded.\n\nWhen the client has a Shopify integration, the Shopify discount code of the voucher is deleted as well.\n\n**Body**\n- `reason`: required, string. Shown with the cancellation in the dashboard.\n- `send_email_to_buyer`: required, boolean. Sends the cancellation email to the buyer.\n\n**Permission**: Refund.\n\nReturns 204 with an empty body on success, 400 if the product cannot be cancelled, 404 if the order or the product does not exist on your account."
          },
          "response": []
        },
        {
          "name": "Refund a product",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"through_payment_gateway\": false,\n    \"send_email_to_buyer\": false,\n    \"reason\": \"Refunded in Shopify, order #1001\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/orders/{{orderId}}/products/{{productId}}/refund",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "orders",
                "{{orderId}}",
                "products",
                "{{productId}}",
                "refund"
              ]
            },
            "description": "Refunds one product of an order and voids its voucher. A fully redeemed voucher cannot be refunded; a multi-use voucher that is only partly redeemed can be.\n\nWhen the client has a Shopify integration, the Shopify discount code of the voucher is deleted as well.\n\n**Body**\n- `through_payment_gateway`: required, boolean. `true` returns the money through the payment gateway the order was paid with. Use `false` when the money is returned outside VoucherCart, for example for a manual order paid elsewhere.\n- `send_email_to_buyer`: required, boolean. Sends the refund email to the buyer. Ignored when `through_payment_gateway` is `true`: the email is then always sent.\n- `reason`: optional, string. Shown with the refund in the dashboard and in reports.\n\n**Permission**: Refund.\n\nReturns 204 with an empty body on success, 400 if the product cannot be refunded (for example the voucher was fully redeemed, already refunded, or ordered as free or charity; the message says why), 404 if the order or the product does not exist on your account."
          },
          "response": []
        },
        {
          "name": "Record a manual payment",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"order_id\": {{orderId}},\n    \"payment_type\": \"credit_debit_card\",\n    \"payment_reference_number\": \"Shopify #1001\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/audit-order-payment-audits",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "audit-order-payment-audits"
              ]
            },
            "description": "Records how a manual order was paid, and its payment reference — the same as the \"Payment reference\" field when a manual order is created in the dashboard. Send it once, right after the order is created with `is_paid: true`.\n\nThe payment type and the reference are shown on the order in the dashboard and in the \"Manual Payment Type\" and \"Manual Payment Reference\" columns of the Orders export.\n\n**Body**\n- `order_id`: required, integer. The order the payment belongs to.\n- `payment_type`: required, one of `cash`, `credit_debit_card`, `free`, `charity`.\n- `payment_reference_number`: optional, string or null. Your reference for the payment, for example the order number in your shop.\n\n**Permission**: Create Manual Orders.\n\nReturns 201; the `Location` header points to the new record. To change the reference later, send `PATCH {{baseUrl}}/sales-pages/{{salesPageId}}/audit-order-payment-audits/{Id}` with `payment_reference_number`, where `{Id}` is the last part of the `Location` header."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Vouchers",
      "item": [
        {
          "name": "List all vouchers",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "refreshToken",
                "value": "{{refreshToken}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": ""
            },
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/vouchers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "vouchers"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retrieve a voucher",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "refreshToken",
                "value": "{{refreshToken}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": ""
            },
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/vouchers/{{voucherId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "vouchers",
                "{{voucherId}}"
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Redemption",
      "item": [
        {
          "name": "Create a redemption",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"redeem_location\": {{redeemLocationId}},\n    \"voucher_code\": \"{{voucherCode}}\",\n    \"reductor\": 1000\n  }",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/redemptions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "redemptions"
              ]
            }
          },
          "response": []
        },
        {
          "name": "List all redemptions",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/redemptions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "redemptions"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retrieve a redemption",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/redemptions/{{redemptionId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "redemptions",
                "{{redemptionId}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Cancel a redemption",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/orders/{{orderId}}/products/{{productId}}/cancel-redeem/{{redemptionId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "orders",
                "{{orderId}}",
                "products",
                "{{productId}}",
                "cancel-redeem",
                "{{redemptionId}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retrieve a voucher status",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/voucher-status?voucher_code={{voucherCode}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "voucher-status"
              ],
              "query": [
                {
                  "description": "Required. The code printed on the voucher.",
                  "key": "voucher_code",
                  "value": "{{voucherCode}}"
                }
              ]
            },
            "description": "Finds a voucher by its code and returns its balance, its redeem period and its redemptions. Nothing is redeemed.\n\nOnly vouchers sold by your account are found. A voucher whose order is not paid is not found.\n\nThe code is matched as in **Create a redemption**, with one difference: when the sales page belongs to an organisation, a redemption also finds vouchers sold by the other accounts of the organisation, and this endpoint does not. For such a voucher it answers 404, although a redemption with the same `voucher_code` may succeed.\n\nReturns 200 when the voucher was found, 400 when `voucher_code` is missing or longer than 255 characters, 404 when no paid voucher of your account has this code."
          },
          "response": []
        },
        {
          "name": "List all redeem locations",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/redeem-locations",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "redeem-locations"
              ],
              "query": [
                {
                  "description": "Optional when authenticated. Only locations of this sales page, plus locations not tied to any sales page. Left out, all locations of the merchant are listed.",
                  "key": "sales_page_id",
                  "value": "{{salesPageId}}",
                  "disabled": true
                },
                {
                  "description": "Optional. Page size, default 10.",
                  "key": "limit",
                  "value": "10",
                  "disabled": true
                },
                {
                  "description": "Optional. Locations are listed by name, A to Z, with the default `desc`; `asc` reverses the list.",
                  "key": "order",
                  "value": "desc",
                  "disabled": true
                },
                {
                  "description": "Optional. `next` or `previous` from the previous response.",
                  "key": "cursor",
                  "value": "",
                  "disabled": true
                }
              ]
            },
            "description": "Returns the merchant's redeem locations as a List object with cursor pagination (see the Pagination section of the API docs). Use the `id` of a location as `{{redeemLocationId}}` in **Create a redemption**, or the `id` of one with `is_sale_location: true` as `{{saleLocationId}}` when creating an order.\n\nEach location is `physical` (with an address) or `online` (with a URL and instructions).\n\nUnder `/v2` a plain array is returned instead of a List object."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Sales page",
      "item": [
        {
          "name": "Get sales page id",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "refreshToken",
                "value": "{{refreshToken}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sales-pages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages"
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Reports",
      "item": [
        {
          "name": "Orders export",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/reports/orders-export?start_date&end_date",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "reports",
                "orders-export"
              ],
              "query": [
                {
                  "value": "",
                  "description": "REQUIRED - ISO 8601 date string ex. 2019-08-19T11:00:39Z",
                  "key": "start_date"
                },
                {
                  "value": "",
                  "description": "REQUIRED - ISO 8601 date string ex. 2019-08-19T11:00:39Z",
                  "key": "end_date"
                },
                {
                  "value": "true",
                  "description": "Default: true",
                  "key": "include_refunded_or_cancelled",
                  "disabled": true
                },
                {
                  "value": "true",
                  "description": "Default: true",
                  "key": "include_not_refunded_or_cancelled",
                  "disabled": true
                },
                {
                  "value": "true",
                  "description": "Default: true",
                  "key": "include_redeemed",
                  "disabled": true
                },
                {
                  "value": "true",
                  "description": "Default: true",
                  "key": "include_partially_redeemed",
                  "disabled": true
                },
                {
                  "value": "true",
                  "description": "Default: true",
                  "key": "include_not_redeemed",
                  "disabled": true
                },
                {
                  "value": "true",
                  "description": "Default: false, can only be true if not_expired_only is not",
                  "key": "expired_only",
                  "disabled": true
                },
                {
                  "value": "true",
                  "description": "Default: false, can only be true if expired_only is not",
                  "key": "not_expired_only",
                  "disabled": true
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Refund report",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/reports/refunds",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "reports",
                "refunds"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Reseller vouchers report",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/reports/reseller-vouchers?reseller_hash=",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "reports",
                "reseller-vouchers"
              ],
              "query": [
                {
                  "key": "reseller_hash",
                  "description": "REQUIRED",
                  "value": ""
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Reseller sales page report",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/reports/reseller-sales-pages?reseller_hash=",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "reports",
                "reseller-sales-pages"
              ],
              "query": [
                {
                  "key": "reseller_hash",
                  "description": "REQUIRED",
                  "value": ""
                }
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Categories",
      "item": [
        {
          "name": "List all categories",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/categories",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "categories"
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Webhooks",
      "item": [
        {
          "name": "List all webhooks",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "webhooks"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retrieve webhook",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/webhooks/{{webhookId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "webhooks",
                "{{webhookId}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Create a webhook",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"url\": \"https://www.example.com/webhooks/vouchercart\",\n    \"secret\": null,\n    \"enabled_events\": [\n        \"order.created\"\n    ],\n    \"description\": \"Webhook description\",\n    \"active\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "webhooks"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Update webhook",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "PUT",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"id\": {{webhookId}},\n    \"url\": \"https://www.example.com\",\n    \"secret\": null,\n    \"enabled_events\": [\n        \"order.created\"\n    ],\n    \"description\": \"Webhook description updated again\",\n    \"active\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/webhooks/{{webhookId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "webhooks",
                "{{webhookId}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Delete webhook",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/webhooks/{{webhookId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "webhooks",
                "{{webhookId}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Webhook history",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/webhooks/{{webhookId}}/history",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "webhooks",
                "{{webhookId}}",
                "history"
              ]
            },
            "description": "Returns the delivery history of one webhook as a plain array, newest first. This list is not paginated.\n\nThere is one entry per event, written once the event has been delivered or after its last attempt has failed. Each entry holds the `url` the event was sent to, the full Event object in `payload`, and `response_status` (the HTTP status code of the response, or `null` when no response was received). `response` does not hold the response body: it is an empty array when a response was received, otherwise `null`.\n\nReturns 404 if the webhook does not exist on this sales page."
          },
          "response": []
        }
      ]
    },
    {
      "name": "VC Cards",
      "item": [
        {
          "name": "List all VC cards",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/vc-cards",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "vc-cards"
              ],
              "query": [
                {
                  "value": "",
                  "description": "Optional. Only the card with this card number or NFC UID.",
                  "key": "vc_card_token_uid",
                  "disabled": true
                },
                {
                  "value": "",
                  "description": "Optional. Only cards of the owner with this email address.",
                  "key": "email",
                  "disabled": true
                },
                {
                  "value": "",
                  "description": "Optional. Only cards holding this voucher (Product ID).",
                  "key": "order_product_id",
                  "disabled": true
                },
                {
                  "value": "products",
                  "description": "Optional. `products` turns each product into a full Product object.",
                  "key": "expand[]",
                  "disabled": true
                },
                {
                  "value": "10",
                  "description": "Optional. Page size, default 10, min 1, max 50.",
                  "key": "limit",
                  "disabled": true
                },
                {
                  "value": "desc",
                  "description": "Optional. `desc` (default) or `asc`, by `created_at`.",
                  "key": "order",
                  "disabled": true
                },
                {
                  "value": "",
                  "description": "Optional. `next` or `previous` from the previous response. Other paging parameters are then ignored.",
                  "key": "cursor",
                  "disabled": true
                }
              ]
            },
            "description": "Returns the cards of the sales page as a List object, newest first, with cursor pagination (see the Pagination section of the API docs).\n\n**Filters (all optional)**\n- `vc_card_token_uid`: the card number or NFC UID printed on or read from the card.\n- `email`: the card owner's email address.\n- `order_product_id`: only cards that hold this voucher (Product ID).\n\n**Expanding**\n`expand[]=products` turns each item of `products` into a full Product object with `purchased_at`, `order_id`, `voucherCode`, `domain_name` and `is_paid` added.\n\n`owner` is included whenever the card has an owner. `state_reason` is included only for `inactive` cards."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": ""
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"id\": \"6f1c2b9e-3d4a-4b8e-9a51-2c7d8e9f0a11\",\n      \"object\": \"vc-card\",\n      \"state\": \"active\",\n      \"client_id\": 123,\n      \"client_name\": \"Example Hotel\",\n      \"created_at\": \"2026-09-14T10:21:05.000000Z\",\n      \"vc_card_tokens\": [\n        {\n          \"type\": \"VcCardTokenNFC\",\n          \"vc_card_uid\": \"04A1B2C3D4E5F6\",\n          \"is_active\": true\n        }\n      ],\n      \"products\": [\n        {\n          \"order_product_id\": 985635\n        }\n      ],\n      \"owner\": {\n        \"id\": 4567,\n        \"full_name\": \"Jane Example\",\n        \"email\": \"jane@example.com\",\n        \"phone\": \"+441234567890\",\n        \"vc_promotions_enabled\": false,\n        \"vcc_promotions_enabled\": true\n      }\n    }\n  ],\n  \"count\": 1,\n  \"previous\": \"eyJkaXIiOiJwcmV2aW91cyIsImN1cnNvciI6IjZmMWMyYjllLTNkNGEtNGI4ZS05YTUxLTJjN2Q4ZTlmMGExMSIsIm9yZGVyX2J5IjoidmMuY3JlYXRlZF9hdCIsIm9yZGVyIjoiREVTQyIsImxpbWl0IjoxMH0=\",\n  \"has_previous\": false,\n  \"next\": \"eyJkaXIiOiJuZXh0IiwiY3Vyc29yIjoiNmYxYzJiOWUtM2Q0YS00YjhlLTlhNTEtMmM3ZDhlOWYwYTExIiwib3JkZXJfYnkiOiJ2Yy5jcmVhdGVkX2F0Iiwib3JkZXIiOiJERVNDIiwibGltaXQiOjEwfQ==\",\n  \"has_next\": false,\n  \"per_page\": 10\n}"
            }
          ]
        },
        {
          "name": "Retrieve a VC card",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/vc-cards/{{vcCardId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "vc-cards",
                "{{vcCardId}}"
              ],
              "query": [
                {
                  "key": "expand[]",
                  "description": "Optional. `products` turns each product into a full Product object.",
                  "value": "products",
                  "disabled": true
                }
              ]
            },
            "description": "Returns one card.\n\n`{{vcCardId}}` is the card's UUID (the `id` field in the list response).\n\n`expand[]=products` turns each item of `products` into a full Product object. `owner` is included whenever the card has an owner.\n\nReturns 404 if the card does not exist or belongs to another account."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": ""
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"id\": \"6f1c2b9e-3d4a-4b8e-9a51-2c7d8e9f0a11\",\n  \"object\": \"vc-card\",\n  \"state\": \"active\",\n  \"client_id\": 123,\n  \"client_name\": \"Example Hotel\",\n  \"created_at\": \"2026-09-14T10:21:05.000000Z\",\n  \"vc_card_tokens\": [\n    {\n      \"type\": \"VcCardTokenNFC\",\n      \"vc_card_uid\": \"04A1B2C3D4E5F6\",\n      \"is_active\": true\n    }\n  ],\n  \"products\": [\n    {\n      \"order_product_id\": 985635\n    }\n  ],\n  \"owner\": {\n    \"id\": 4567,\n    \"full_name\": \"Jane Example\",\n    \"email\": \"jane@example.com\",\n    \"phone\": \"+441234567890\",\n    \"vc_promotions_enabled\": false,\n    \"vcc_promotions_enabled\": true\n  }\n}"
            }
          ]
        },
        {
          "name": "List VC card activity",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/vc-cards/{{vcCardId}}/activity",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "vc-cards",
                "{{vcCardId}}",
                "activity"
              ],
              "query": [
                {
                  "value": "10",
                  "description": "Optional. Page size, default 10, min 1, max 50.",
                  "key": "limit",
                  "disabled": true
                },
                {
                  "value": "",
                  "description": "Optional. `next` or `previous` from the previous response.",
                  "key": "cursor",
                  "disabled": true
                }
              ]
            },
            "description": "Returns the history of one card (activations, deactivations, product changes and similar events) as a paginated list, oldest first.\n\nCommon `type` values: `Card Activated`, `Card Deactivated`, `Card Reactivated`, `Card Activation Skipped`. `comment` holds the reason given, if any.\n\nReturns 404 if the card does not exist or belongs to another account.\n\nNote: on production this endpoint answers 500 until the fix for the missing pagination helper is released."
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": ""
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"object\": \"vc-card-activity\",\n      \"id\": 30210,\n      \"vc_card_id\": \"6f1c2b9e-3d4a-4b8e-9a51-2c7d8e9f0a11\",\n      \"created_by_name\": \"Front Desk\",\n      \"created_by_email\": \"frontdesk@example.com\",\n      \"admin_logged_as\": null,\n      \"comment\": null,\n      \"type\": \"Card Activated\",\n      \"user_id\": 812,\n      \"user_type\": \"jwt\",\n      \"user_ip\": \"203.0.113.10\",\n      \"created_at\": \"2026-09-14T10:21:05.000000Z\"\n    },\n    {\n      \"object\": \"vc-card-activity\",\n      \"id\": 30211,\n      \"vc_card_id\": \"6f1c2b9e-3d4a-4b8e-9a51-2c7d8e9f0a11\",\n      \"created_by_name\": \"Front Desk\",\n      \"created_by_email\": \"frontdesk@example.com\",\n      \"admin_logged_as\": null,\n      \"comment\": \"Card reported lost\",\n      \"type\": \"Card Deactivated\",\n      \"user_id\": 812,\n      \"user_type\": \"jwt\",\n      \"user_ip\": \"203.0.113.10\",\n      \"created_at\": \"2026-10-02T09:12:44.000000Z\"\n    }\n  ],\n  \"per_page\": 25,\n  \"previous\": null,\n  \"has_previous\": false,\n  \"next\": null,\n  \"has_next\": false\n}"
            }
          ]
        },
        {
          "name": "Deactivate a VC card",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"reason\": \"Card reported lost\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/vc-cards/{{vcCardId}}/deactivate",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "vc-cards",
                "{{vcCardId}}",
                "deactivate"
              ]
            },
            "description": "Blocks a card, for example when it is lost or stolen. The card state becomes `inactive` and `reason` is saved in the card activity. If the card has an owner, we email the owner to confirm. Deactivating a card that is already inactive changes nothing.\n\n**Body**\n- `reason`: required, string.\n\n**Permission**: `manage.orders`.\n\nReturns 204 with an empty body on success, 400 when `reason` is missing, 404 if the card does not exist or belongs to another account."
          },
          "response": []
        },
        {
          "name": "Activate a VC card",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"reason\": \"Card found by the guest\",\n    \"confirmation\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/vc-cards/{{vcCardId}}/activate",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "vc-cards",
                "{{vcCardId}}",
                "activate"
              ]
            },
            "description": "Makes a card usable.\n\n- For an `inactive` card this is a reactivation: `reason` is saved in the card activity and the owner (if any) receives an email.\n- For a card in the `initial` state it is the first activation.\n\n**Body**\n- `reason`: required, string.\n- `confirmation`: required, must be `true`.\n\n**Permission**: `vccard.reactivate`.\n\nReturns 204 with an empty body on success, 400 when a field is missing or the card cannot be activated in its current state, 404 if the card does not exist or belongs to another account."
          },
          "response": []
        },
        {
          "name": "Assign an owner to a VC card",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{jwtToken}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"full_name\": \"Jane Example\",\n    \"email\": \"jane@example.com\",\n    \"phone\": \"+441234567890\",\n    \"vc_promotions_enabled\": false,\n    \"vcc_promotions_enabled\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/sales-pages/{{salesPageId}}/vc-cards/{{vcCardId}}/owner",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sales-pages",
                "{{salesPageId}}",
                "vc-cards",
                "{{vcCardId}}",
                "owner"
              ]
            },
            "description": "Registers a card to a person and activates the card.\n\nIf an owner with this email already exists, we update their name, phone and marketing choices with the values sent. Otherwise we create a new owner. When `vcc_promotions_enabled` is `true`, we also add the owner to your default newsletter list.\n\n**Body**\n- `full_name`: required, string, max 255.\n- `email`: required, email, max 255.\n- `phone`: optional, string.\n- `vc_promotions_enabled`: optional, boolean, default `false`. Marketing from VoucherCart.\n- `vcc_promotions_enabled`: optional, boolean, default `false`. Marketing from you.\n\nReturns 204 with an empty body on success, 400 `Card already has a owner` if the card is registered to someone else, 404 if the card does not exist or belongs to another account."
          },
          "response": []
        }
      ],
      "description": "Physical and digital VoucherCart cards (VC Cards) linked to a sales page.\n\nA card holds a list of products (purchased vouchers), one or more tokens (for example an NFC chip UID) and, once registered, an owner.\n\n**Requirements**\n\n- VC Cards must be enabled for the account. Otherwise these endpoints answer `401`.\n    \n- `{{vcCardId}}` is the card's UUID (the `id` field in the list response).\n    \n\n**Card states**\n\n- `initial` — the card exists but has not been activated yet.\n    \n- `active` — the card can be used.\n    \n- `inactive` — the card was deactivated. `state_reason` holds the reason given.\n    \n\n**Emails to the card owner**  \nDeactivating a card, and activating it again after a deactivation, sends an email to the card owner (if the card has one)."
    }
  ],
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          ""
        ]
      }
    },
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "exec": [
          ""
        ]
      }
    }
  ]
}
