Create an export

How to create an export via API

To create a new export, send a POST request to the /api/exports endpoint, passing the resource arguments in the request body.

Request

POST https://yourdomain.commercelayer.io/api/exports

Arguments

Body Parameter
Type
Required

type

string

Required

attributes.resource_type

string

Required

attributes.format

string

Optional

attributes.includes

array

Optional

attributes.fields

array

Optional

attributes.filters

object

Optional

attributes.dry_data

boolean

Optional

attributes.reference

string

Optional

attributes.reference_origin

string

Optional

attributes.metadata

object

Optional

Example

The following request creates a new export:

curl -g -X POST \
  'https://yourdomain.commercelayer.io/api/exports' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
  "data": {
    "type": "exports",
    "attributes": {
      "resource_type": "skus"
    }
  }
}'

Last updated