diff --git a/documentation/guides/csv-export.mdx b/documentation/guides/csv-export.mdx index 7fdbcb7b4..17967912c 100644 --- a/documentation/guides/csv-export.mdx +++ b/documentation/guides/csv-export.mdx @@ -51,6 +51,18 @@ Voucherify enables programmable export of: 4. To [download the export file](/api-reference/exports/download-export), use the provided URL together with authentication headers. + +**Download URL base differs by region.** The `result.url` returned by [Get Export](/api-reference/exports/get-export) points at a region-specific host, not the standard API host: + +- Europe: `https://download.voucherify.io` +- US: `https://us1.download.voucherify.io` +- Asia: `https://as1.download.voucherify.io` + +**Authentication headers are still required.** The `token` query parameter embedded in `result.url` identifies the export — it does **not** replace your API credentials. Every download request must also include your `X-App-Id` and `X-App-Token` headers (or an OAuth token). Without them, the download responds with `401 Unauthorized`. + +**The download token is short-lived.** If you receive a `401 Unauthorized` even though your headers are correct, the token in `result.url` has likely expired. Call [Get Export](/api-reference/exports/get-export) again to obtain a fresh `result.url` and download immediately. + + ## Filters Voucherify allows you to specify the time frame for the records you want to retrieve. Thanks to this mechanism, it should be easy to implement a pagination mechanism. See the example of a request body: diff --git a/documentation/openapi/exports.json b/documentation/openapi/exports.json index dc3b83f38..eaf54979a 100644 --- a/documentation/openapi/exports.json +++ b/documentation/openapi/exports.json @@ -426,7 +426,7 @@ "Exports" ], "summary": "Download Export", - "description": "Download the contents of the exported CSV file. \n\n\n\n> 📘 Important notes\n>\n> **Base URL:** \n> - `https://download.voucherify.io` (Europe) \n> - `https://us1.download.voucherify.io` (US) \n> - `https://as1.download.voucherify.io` (Asia) \n>\n> **Token:** Can be found within the `result` parameter of the [Get Export](/api-reference/exports/get-export) method response.", + "description": "Download the contents of the exported CSV file. \n\n\n\n> 📘 Important notes\n>\n> **Base URL:** \n> - `https://download.voucherify.io` (Europe) \n> - `https://us1.download.voucherify.io` (US) \n> - `https://as1.download.voucherify.io` (Asia) \n>\n> **Token:** Can be found within the `result` parameter of the [Get Export](/api-reference/exports/get-export) method response.\n>\n> **Authentication headers are still required.** The `token` query parameter identifies the export — it does not replace your API credentials. Every download request must also send your `X-App-Id` and `X-App-Token` headers (or an OAuth token).\n>\n> **The token is short-lived.** If a `401 Unauthorized` is returned even with correct credentials, call [Get Export](/api-reference/exports/get-export) again to obtain a fresh `result.url` and download immediately.", "parameters": [], "security": [ {