Skip to main content
POST
/
v1
/
orders
/
export
curl --request POST \
--url https://{cluster}.voucherify.io/v1/orders/export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '{
"parameters": {
"fields": [
"id",
"source_id",
"status",
"created_at",
"updated_at",
"amount",
"discount_amount",
"items_discount_amount",
"total_discount_amount",
"total_amount",
"customer_id",
"referrer_id",
"metadata.payment_mean"
]
}
}'
{
  "id": "exp_pT2Y1mgYsAgRAqsWTGf7PQX7",
  "object": "export",
  "created_at": "2022-09-09T10:45:52.362Z",
  "status": "SCHEDULED",
  "channel": "API",
  "exported_object": "order",
  "parameters": {
    "fields": [
      "id",
      "source_id",
      "status",
      "created_at",
      "updated_at",
      "amount",
      "discount_amount",
      "items_discount_amount",
      "total_discount_amount",
      "total_amount",
      "customer_id",
      "referrer_id",
      "metadata.payment_mean"
    ]
  },
  "result": null,
  "user_id": null
}

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required
Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json

Specify which order parameters you would like to export.

Request body schema for POST v1/orders/export.

parameters
object

List of available fields and filters that can be exported with an order along with the sorting order of the returned data.

Response

Returns the id of the export object and status of the file generation process. The id is used in the <!-- [Get Export](OpenAPI.json/paths/~1exports~1{exportId}/get) -->Get Export method to generate the url for the downloadable CSV file or in the <!-- [Download Export](OpenAPI.json/paths/~1exports~1{export_Id}/get) -->Download Export method to return the contents of the CSV file. The status indicates whether the file has been scheduled for creation.

Response body schema for POST v1/orders/export.

id
string
required

Unique export ID.

object
enum<string>
default:export
required

The type of object being represented. This object stores information about the export.

Available options:
export
created_at
string<date-time>
required

Timestamp representing the date and time when the export was scheduled in ISO 8601 format.

status
enum<string>
default:SCHEDULED
required

Status of the export. Informs you whether the export has already been completed, i.e. indicates whether the file containing the exported data has been generated.

Available options:
SCHEDULED
result
null
required

Contains the URL of the CSV file.

user_id
string
required

Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the channel value is WEBSITE.

exported_object
enum<string>
default:order
required

The type of object to be exported.

Available options:
order
channel
string

The channel through which the export was triggered.

parameters
object

List of available fields and filters that can be exported with an order along with the sorting order of the returned data.

I