Skip to main content
POST
/
v1
/
exports
Create
curl --request POST \
  --url https://{defaultHost}/v1/exports \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "export": {
    "type": "orders",
    "email": "person@example.com"
  }
}
'
import requests

url = "https://{defaultHost}/v1/exports"

payload = { "export": {
"type": "orders",
"email": "person@example.com"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({export: {type: 'orders', email: 'person@example.com'}})
};

fetch('https://{defaultHost}/v1/exports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/v1/exports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'export' => [
'type' => 'orders',
'email' => 'person@example.com'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://{defaultHost}/v1/exports"

payload := strings.NewReader("{\n \"export\": {\n \"type\": \"orders\",\n \"email\": \"person@example.com\"\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://{defaultHost}/v1/exports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"export\": {\n \"type\": \"orders\",\n \"email\": \"person@example.com\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{defaultHost}/v1/exports")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"export\": {\n \"type\": \"orders\",\n \"email\": \"person@example.com\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "ef216440-a1aa-4b45-8ca1-3f4daa560fd3",
  "object": "export",
  "email": "person@example.com",
  "file_url": null,
  "record_count": 0,
  "status": "pending",
  "type": "orders",
  "created_at": 1782485830,
  "updated_at": 1782485830
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
export
object

Response

200 - application/json

Success

id
string | null

The UUID of the specific object.

object
string

A string describing the object type returned.

type
string

The type of export – one of charges, coupons, customers, orders, prices, promotions, refunds, subscriptions.

email
string

The email where the export will be sent.

file_url
string | null

The URL for accessing the export file.

status
string

The status of the export – one of pending, processed, or sent.

record_count
number

The number of records that were exported.

created_at
integer | null

Time at which the object was created. Measured in seconds since the Unix epoch.

updated_at
integer | null

Time at which the object was last updated. Measured in seconds since the Unix epoch.