Exports

Initiate export request

Initiate an export request based on the specified filter criteria.

post/api-offers/offers-exports

Request

Headers

x-site-contextstring required
Example:{"date": "2023-01-01T00:00:00.000Z", "channel": 12, "account": "1234abcd5678efgh9ijklmno","stage":"production"}

The x-site-context header is a JSON object that contains information about the source you wish to pull from. The mandatory account is the 24 character identifier found in Copilot. The channel (Sales channel ID), stage (environment name), and date attributes can be used to further narrow the scope of your data source.

Request body

type'REDEMPTION' | 'CALCULATED_PRICE' required

The type of data to export.

Example request

{
  "type": "REDEMPTION",
  "filters": [
    {
      "field": "storeId",
      "value": "store001",
      "operator": "EQUAL"
    }
  ]
}

Response

Created

exportIdstring required

The unique ID for the export request that is used to retrieve the export details.

startedAtstring required

The start time of the export process.

endedAtstring nullable

The end time of the export process.

totalDataExportednumber

The total number of exported data in the csv file. Each row in the csv file represents one record of exported data.

status'IN_PROGRESS' | 'COMPLETED' | 'ERROR' required

The status of the export process. The download exported CSV file endpoint can generate a download URL only if the export status is COMPLETED.

typestring required

The type of data to export.

Example response

{
  "exportId": "ab50fe48-5da0-4e77-92d1-bb629eedf19e",
  "startedAt": "2023-05-17T21:24:52.398Z",
  "endedAt": "null",
  "status": "IN_PROGRESS",
  "errors": [],
  "type": "REDEMPTION",
  "filters": [
    {
      "field": "storeId",
      "value": "store001",
      "operator": "EQUAL"
    }
  ]
}

Changes

No recorded changes to this operation across all 2 revisions of this API.