Admin API
Version v1.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Kreezalid provides an API, which makes it extremely easy for any developer to integrate external systems with our platform - adding their own layer of awesomeness on the top of Kreezalid.
The Admin API lets you build apps and integrations that extend and enhance the Kreezalid admin. You can create your own useful plugins (created exactly to fit your needs), synchronize data with other platforms or even code a customized backup solution - anything you want!
Kreezalid Admin API is organized around REST.
You can view code examples in the dark area to the right; switch the programming language of the examples with the tabs in the top right.
If anything is missing or seems incorrect, please contact our support team.
Getting started
Obtaining your secret key
To interact with the API, you need to have a unique, personal secret key, which is used to authenticate yourself within the API.
Token is an equivalent of the user name & password pair - once generated, it uniquely identifies your own account, so you should be careful with it and not disclosure it to any untrusted party (application).
To generate your secret key, you should:
- Go to your admin panel. For example: https://subdomain.mykreezalid.com/admin
- Click on the
Settings
link in the sidebar, then on the Account button - In the API access section, click on the button
Enable API access
to generate a new secret key - Note down your newly generated secret key - you are going to need it soon
Base URL
If you don't use a custom domain, you can use your custom subdomain, generated on your store creation. Be careful, the main domain name is *.mykreezalid.com. To avoid errors, you can just copy/paste the URL of your homepage:
https://subdomain.mykreezalid.com/api/v1
If you already connect a custom domain, you must use it in your API calls. As we don't follow redirects, you need to precise your primary domain (with www or without www or any other subdomain):
https://your_custom_domain.tld/api/v1
Rate limits
Admin API supports a limit of 40 requests per minute.
Past the limit, the API will return a 429 Too Many Requests error.
Status and error codes
All API queries return HTTP status codes that can tell you more about the response.
401 Unauthorized
The client doesn’t have correct authentication credentials. Check your Base URL
is correct (w/o www.).
403 Forbidden
The server is refusing to respond.
404 Not Found
The requested resource was not found. This is typically caused by incorrect endpoint calls.
429 Too Many Requests
The client has exceeded the rate limit.
5xx Errors
An internal error occurred in Kreezalid. Our technical team has been notified.
AddOns
{
"title": "Extended Warranty",
"listing_id": 234324,
"price": 12.5,
"description": "Protect your purchases beyond the standard warranty period"
}
An add-on is a supplementary product, feature, or service that can be purchased or acquired in addition to the primary item or service being offered. Add-ons typically enhance or expand the functionality, customization, or overall experience of the main product or service, providing added value to the customer.
Here are some examples of typical add-ons: Extended warranties: Many retailers offer extended warranty plans as add-ons to protect customers' purchases beyond the standard warranty period. Product customization: Some businesses allow customers to personalize their products with custom colors, engraving, or other unique features, often for an additional fee. Premium support: E-commerce platforms may offer priority customer support, dedicated account managers, or other enhanced support services as add-ons. Gift wrapping and packaging: Retailers may offer gift wrapping, gift messages, or special packaging options as add-ons, providing customers with a convenient way to send gifts directly to recipients. Installation or assembly services: Some retailers offer professional installation or assembly services for products that require expert setup, often for an additional fee.
To add Add-on to your listing, you need to create an index add_ons
in the listing. You can then POST or PATCH the add-on data to the listing's add_ons
index.
Retrieve add-on
Code samples
# You can also use wget
curl -X GET /api/v1/add_ons/{id} \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/add_ons/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/add_ons/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/add_ons/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/add_ons/{id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/add_ons/{id}',
params: {
}, headers: headers
p JSON.parse(result)
GET /add_ons/{id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | Add-on's unique identifier |
Example responses
200 Response
{
"add_on": {
"id": 0,
"object": "AddOn",
"listing_id": 324353,
"title": "Extended Warranty",
"description": "Protect your purchases beyond the standard warranty period",
"price": 12.5
}
}
Responses
Status | Description |
---|---|
200 | The add-on has been retrieved successfully |
Response Schema
Status Code 200
Name | Description |
---|---|
» add_on | |
»» id read-only | AddOn's unique identifier |
»» object read-only | |
»» listing_id | |
»» title | |
»» description | |
»» price |
Update add-on
Code samples
# You can also use wget
curl -X PATCH /api/v1/add-ons/{id} \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','/api/v1/add-ons/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/add-ons/{id}',
{
method: 'PATCH',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/add-ons/{id}',
{
method: 'PATCH',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.patch('/api/v1/add-ons/{id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.patch '/api/v1/add-ons/{id}',
params: {
}, headers: headers
p JSON.parse(result)
PATCH /add-ons/{id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | Add-on's unique identifier |
Example responses
201 Response
{
"success": true,
"message": "Add-on has been updated"
}
Responses
Status | Description |
---|---|
201 | The add-on has been updated |
400 | Some parameters are not correct |
401 | Unauthorized |
404 | Not found |
Response Schema
Status Code 201
Name | Description |
---|---|
» success | |
» message |
Get add-ons
Code samples
# You can also use wget
curl -X GET /api/v1/listings/{id}/add_ons \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/listings/{id}/add_ons', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/add_ons',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/add_ons',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/listings/{id}/add_ons', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/listings/{id}/add_ons',
params: {
}, headers: headers
p JSON.parse(result)
GET /listings/{id}/add_ons
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | AddOns's unique identifier |
Example responses
200 Response
null
Responses
Status | Description |
---|---|
200 | Retrieves a list of add-ons |
Response Schema
Create a new add-on
Code samples
# You can also use wget
curl -X POST /api/v1/listings/{id}/add_ons \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/listings/{id}/add_ons', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const inputBody = '{
"title": "string",
"price": 0,
"description": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/add_ons',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
"title": "string",
"price": 0,
"description": "string"
};
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/add_ons',
{
method: 'POST',
body: JSON.stringify(inputBody),
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/api/v1/listings/{id}/add_ons', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post '/api/v1/listings/{id}/add_ons',
params: {
}, headers: headers
p JSON.parse(result)
POST /listings/{id}/add_ons
Request parameter
{
"title": "string",
"price": 0,
"description": "string"
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | Listing's unique identifier |
Request parameters
Name | Type | Required | Description |
---|---|---|---|
title | string | true |
Example responses
201 Response
{
"add_on": {
"id": 432432,
"object": "Variant",
"external_id": "INTERNAL_REF_234324",
"listing_id": 324353,
"price": 123.5,
"price_unit": null,
"quantity": 10,
"sort_priority": 10,
"sku": "BASKT-XYZ-BLN-41",
"title": "Blue Shoes Size 41",
"weight": 0.8
}
}
Responses
Status | Description |
---|---|
201 | Add added |
Response Schema
Status Code 201
Name | Description |
---|---|
» add_on | |
»» id read-only | Variant's unique identifier |
»» object read-only | |
»» external_id | |
»» listing_id | |
»» price | |
»» price_unit | |
»» quantity | The quantity of the variant that is available for sale |
»» sort_priority | Sorts the variants with the lowest number first. Negative numbers are allowed. |
»» sku | |
»» title true | |
»» weight |
Delete add-on
Code samples
# You can also use wget
curl -X DELETE /api/v1/listings/{id}/add_ons/{addon_id} \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','/api/v1/listings/{id}/add_ons/{addon_id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/add_ons/{addon_id}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/add_ons/{addon_id}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.delete('/api/v1/listings/{id}/add_ons/{addon_id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.delete '/api/v1/listings/{id}/add_ons/{addon_id}',
params: {
}, headers: headers
p JSON.parse(result)
DELETE /listings/{id}/add_ons/{addon_id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | Listing's unique identifier |
addon_id | integer | true | Add-on's unique identifier |
Example responses
200 Response
{
"success": true,
"message": "Add-on deleted"
}
Responses
Status | Description |
---|---|
200 | Add-on deleted |
404 | Error |
Response Schema
Status Code 200
Name | Description |
---|---|
» success | |
» message | More details about the error |
Status Code 404
Name | Description |
---|---|
» success | |
» message | More details about the error |
Retrieves a count of listing add-ons
Code samples
# You can also use wget
curl -X GET /api/v1/listings/{id}/add_ons/count \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/listings/{id}/add_ons/count', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/add_ons/count',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/add_ons/count',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/listings/{id}/add_ons/count', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/listings/{id}/add_ons/count',
params: {
}, headers: headers
p JSON.parse(result)
GET /listings/{id}/add_ons/count
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | Listing's unique identifier |
Example responses
200 Response
{
"count": "4"
}
Responses
Status | Description |
---|---|
200 | Number of add-ons |
Response Schema
Status Code 200
Name | Description |
---|---|
» count |
Categories
Categories endpoint is related to Listings. Those categories are created by the admin, from the admin panel or through the API.
Categories can have children categories (or sub-categories), and those children can have themselves children indefinitely.
Search categories
Code samples
# You can also use wget
curl -X GET /api/v1/categories/search \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/categories/search', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/categories/search',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/categories/search',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/categories/search', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/categories/search',
params: {
}, headers: headers
p JSON.parse(result)
GET /categories/search
Returns a paginated list of your listing categories
Example responses
200 Response
[
{
"id": 432432,
"object": "Category",
"title": "string",
"url": "string"
}
]
Responses
Status | Description |
---|---|
200 | Search categories by criteria |
Response Schema
Status Code 200
List of results
Name | Description |
---|---|
anonymous | List of results |
» id read-only | Category's unique identifier |
» object read-only | |
» title | |
» url read-only |
Create a category
Code samples
# You can also use wget
curl -X POST /api/v1/categories \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/categories', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/categories',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/categories',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.post('/api/v1/categories', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.post '/api/v1/categories',
params: {
}, headers: headers
p JSON.parse(result)
POST /categories
Add method
Example responses
201 Response
[
{
"id": 432432,
"object": "Category",
"title": "string",
"url": "string"
}
]
Responses
Status | Description |
---|---|
201 | Success |
Response Schema
Status Code 201
Name | Description |
---|---|
anonymous | |
» id read-only | Category's unique identifier |
» object read-only | |
» title | |
» url read-only |
Events
Events are generated by some Kreezalid resources when certain actions are completed, such as the creation of a listing, the acceptance of an order, or the sign up of a user.
By requesting events, you can know when certain actions have occurred and trigger relevant actions like updating a third-party service, sending an email to a user or to the admin, etc.
Retrieve a list of events
Code samples
# You can also use wget
curl -X GET /api/v1/events \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/events', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/events',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/events',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/events', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/events',
params: {
}, headers: headers
p JSON.parse(result)
GET /events
Returns a list of your events. The events are returned sorted by creation date, with the most recent events appearing first.
Example responses
200 Response
[
{
"id": 0,
"type": "string",
"status": "string",
"object": "string",
"object_id": 0,
"created": "2023-06-07T06:43:06Z"
}
]
Responses
Status | Description |
---|---|
200 | Success |
Response Schema
Status Code 200
List of results
Name | Description |
---|---|
anonymous | List of results |
» id read-only | Event's unique identifier |
» type | |
» status | |
» object | |
» object_id | |
» created |
Retrieve an event
Code samples
# You can also use wget
curl -X GET /api/v1/events/{id} \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/events/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/events/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/events/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/events/{id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/events/{id}',
params: {
}, headers: headers
p JSON.parse(result)
GET /events/{id}
Retrieves the details of an existing event. You need only supply the unique event identifier that was returned upon event creation.
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | ID of your event. |
Example responses
200 Response
[
{
"id": 0,
"type": "string",
"status": "string",
"object": "string",
"object_id": 0,
"created": "2023-06-07T06:43:06Z"
}
]
Responses
Status | Description |
---|---|
200 | Event with id = {id} |
Response Schema
Status Code 200
Name | Description |
---|---|
anonymous | |
» id read-only | Event's unique identifier |
» type | |
» status | |
» object | |
» object_id | |
» created |
Listings
Related to listings tag
Get listings
Code samples
# You can also use wget
curl -X GET /api/v1/listings \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/listings', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/listings', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/listings',
params: {
}, headers: headers
p JSON.parse(result)
GET /listings
Example responses
200 Response
[
{
"id": 645646,
"object": "Listing",
"attributes": "[]",
"category": {},
"category_id": 432432,
"city": "New York City",
"country": "US",
"cover": "string",
"currency": "USD",
"date_online": "2023-06-07T06:43:06Z",
"description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dignissim laoreet sem, quis mollis elit rutrum a. Donec nunc urna, rhoncus in sagittis ut, elementum scelerisque libero. Quisque interdum nibh nisl, non gravida nibh molestie quis. Phasellus nunc nunc, luctus a luctus ac, iaculis sit amet turpis.</p><p>Phasellus tortor orci, posuere in mi at, blandit ullamcorper tellus. Proin vel sem aliquam, faucibus dolor quis, dictum leo. Aliquam consectetur massa at ipsum auctor, at mattis nunc porttitor. Suspendisse potenti. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>",
"external_id": "INTERNAL_REF_234324",
"lat": 40.7572114,
"lng": -73.9913385,
"location": "253 W 42nd St, New York, NY 10036, United States",
"min_qty": 1,
"medias": "string",
"order_type_id": 986545,
"price": 123.5,
"price_unit": null,
"price_with_currency": "$123.50",
"quantity": 43,
"quantity_selector": null,
"requires_shipping": true,
"shipping_methods": [],
"slug": "listing-s-slug",
"state": "NY",
"status": "out_of_stock",
"supplier": {},
"supplier_id": 655785,
"title": "Listing's title",
"url": "string",
"variants": {},
"valid_until": "2023-06-07T06:43:06Z",
"weight": 0.8
}
]
Responses
Status | Description |
---|---|
200 | List of all your listings |
Response Schema
Status Code 200
Name | Description |
---|---|
anonymous | |
» id read-only | Listing's unique identifier |
» object read-only | |
» attributes | |
» category | |
»» id read-only | Category's unique identifier |
»» object read-only | |
»» title | |
»» url read-only | |
» category_id true | Category's unique identifier |
» city | |
» country | |
» cover read-only | |
» currency | |
» date_online | |
» description | |
» external_id | |
» lat | |
» lng | |
» location | |
» min_qty | |
» medias | |
» order_type_id true | Order type's unique identifier |
» price | |
» price_unit | |
» price_with_currency read-only | |
» quantity | |
» quantity_selector | |
» requires_shipping | |
» shipping_methods | |
»» id | |
»» carrier_alias | |
»» price | |
»» sort_priority | |
»» step_price | |
»» title | |
» slug | |
» state | |
» status | |
» supplier | |
»» id read-only | User's unique identifier |
»» object read-only | |
»» account_type | |
»» address_city | |
»» address_country | |
»» address_line1 | |
»» address_line2 | |
»» address_state | |
»» address_zipcode | |
»» attributes | |
»» avatar | Absolute URL of the profile image |
»» business_name | Company or organization name |
»» can_post_listing | |
»» created | |
»» email true | |
»» first_name | |
»» group read-only | |
»»» object read-only | |
»»» id read-only | Group's unique identifier |
»»» name | |
»»» alias read-only | |
»» group_alias read-only | |
»» group_id true | |
»» group_name read-only | |
»» lang read-only | |
»» last_name read-only | |
»» locale | |
»» note | Average note based on reviews |
»» phone_country_number | |
»» phone_number | |
»» profile_url read-only | |
»» public_name read-only | |
»» status | Account status. Possible values are "enabled2" or "disabled" |
»» review_count | |
»» timezone | |
»» username | |
» supplier_id true | Supplier's unique identifier |
» title true | |
» url read-only | |
» variants | |
»» id read-only | Variant's unique identifier |
»» object read-only | |
»» external_id | |
»» listing_id | |
»» price | |
»» price_unit | |
»» quantity | The quantity of the variant that is available for sale |
»» sort_priority | Sorts the variants with the lowest number first. Negative numbers are allowed. |
»» sku | |
»» title true | |
»» weight | |
» valid_until | |
» weight |
Create listing
Code samples
# You can also use wget
curl -X POST /api/v1/listings \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/listings', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const inputBody = '{
"attributes": "[]",
"category": {
"title": "string"
},
"category_id": 432432,
"city": "New York City",
"country": "US",
"currency": "USD",
"date_online": "2023-06-07T06:43:06Z",
"description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dignissim laoreet sem, quis mollis elit rutrum a. Donec nunc urna, rhoncus in sagittis ut, elementum scelerisque libero. Quisque interdum nibh nisl, non gravida nibh molestie quis. Phasellus nunc nunc, luctus a luctus ac, iaculis sit amet turpis.</p><p>Phasellus tortor orci, posuere in mi at, blandit ullamcorper tellus. Proin vel sem aliquam, faucibus dolor quis, dictum leo. Aliquam consectetur massa at ipsum auctor, at mattis nunc porttitor. Suspendisse potenti. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>",
"external_id": "INTERNAL_REF_234324",
"lat": 40.7572114,
"lng": -73.9913385,
"location": "253 W 42nd St, New York, NY 10036, United States",
"min_qty": 1,
"medias": "string",
"order_type_id": 986545,
"price": 123.5,
"price_unit": null,
"quantity": 43,
"quantity_selector": null,
"requires_shipping": true,
"shipping_methods": [
{}
],
"slug": "listing-s-slug",
"state": "NY",
"status": "out_of_stock",
"supplier": {
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group_id": 784568,
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
},
"supplier_id": 655785,
"title": "Listing's title",
"variants": {
"external_id": "INTERNAL_REF_234324",
"listing_id": 324353,
"price": 123.5,
"price_unit": null,
"quantity": 10,
"sort_priority": 10,
"sku": "BASKT-XYZ-BLN-41",
"title": "Blue Shoes Size 41",
"weight": 0.8
},
"valid_until": "2023-06-07T06:43:06Z",
"weight": 0.8
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/listings',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
"attributes": "[]",
"category": {
"title": "string"
},
"category_id": 432432,
"city": "New York City",
"country": "US",
"currency": "USD",
"date_online": "2023-06-07T06:43:06Z",
"description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dignissim laoreet sem, quis mollis elit rutrum a. Donec nunc urna, rhoncus in sagittis ut, elementum scelerisque libero. Quisque interdum nibh nisl, non gravida nibh molestie quis. Phasellus nunc nunc, luctus a luctus ac, iaculis sit amet turpis.</p><p>Phasellus tortor orci, posuere in mi at, blandit ullamcorper tellus. Proin vel sem aliquam, faucibus dolor quis, dictum leo. Aliquam consectetur massa at ipsum auctor, at mattis nunc porttitor. Suspendisse potenti. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>",
"external_id": "INTERNAL_REF_234324",
"lat": 40.7572114,
"lng": -73.9913385,
"location": "253 W 42nd St, New York, NY 10036, United States",
"min_qty": 1,
"medias": "string",
"order_type_id": 986545,
"price": 123.5,
"price_unit": null,
"quantity": 43,
"quantity_selector": null,
"requires_shipping": true,
"shipping_methods": [
{}
],
"slug": "listing-s-slug",
"state": "NY",
"status": "out_of_stock",
"supplier": {
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group_id": 784568,
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
},
"supplier_id": 655785,
"title": "Listing's title",
"variants": {
"external_id": "INTERNAL_REF_234324",
"listing_id": 324353,
"price": 123.5,
"price_unit": null,
"quantity": 10,
"sort_priority": 10,
"sku": "BASKT-XYZ-BLN-41",
"title": "Blue Shoes Size 41",
"weight": 0.8
},
"valid_until": "2023-06-07T06:43:06Z",
"weight": 0.8
};
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/listings',
{
method: 'POST',
body: JSON.stringify(inputBody),
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/api/v1/listings', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post '/api/v1/listings',
params: {
}, headers: headers
p JSON.parse(result)
POST /listings
Request parameter
{
"attributes": "[]",
"category": {
"title": "string"
},
"category_id": 432432,
"city": "New York City",
"country": "US",
"currency": "USD",
"date_online": "2023-06-07T06:43:06Z",
"description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dignissim laoreet sem, quis mollis elit rutrum a. Donec nunc urna, rhoncus in sagittis ut, elementum scelerisque libero. Quisque interdum nibh nisl, non gravida nibh molestie quis. Phasellus nunc nunc, luctus a luctus ac, iaculis sit amet turpis.</p><p>Phasellus tortor orci, posuere in mi at, blandit ullamcorper tellus. Proin vel sem aliquam, faucibus dolor quis, dictum leo. Aliquam consectetur massa at ipsum auctor, at mattis nunc porttitor. Suspendisse potenti. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>",
"external_id": "INTERNAL_REF_234324",
"lat": 40.7572114,
"lng": -73.9913385,
"location": "253 W 42nd St, New York, NY 10036, United States",
"min_qty": 1,
"medias": "string",
"order_type_id": 986545,
"price": 123.5,
"price_unit": null,
"quantity": 43,
"quantity_selector": null,
"requires_shipping": true,
"shipping_methods": [
{}
],
"slug": "listing-s-slug",
"state": "NY",
"status": "out_of_stock",
"supplier": {
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group_id": 784568,
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
},
"supplier_id": 655785,
"title": "Listing's title",
"variants": {
"external_id": "INTERNAL_REF_234324",
"listing_id": 324353,
"price": 123.5,
"price_unit": null,
"quantity": 10,
"sort_priority": 10,
"sku": "BASKT-XYZ-BLN-41",
"title": "Blue Shoes Size 41",
"weight": 0.8
},
"valid_until": "2023-06-07T06:43:06Z",
"weight": 0.8
}
Parameters
Name | Type | Required | Description |
---|
Request parameters
Name | Type | Required | Description |
---|---|---|---|
body | Listing | true |
Enumerated Values
Parameter | Value |
---|---|
» account_type | individual |
» account_type | company |
» account_type | non-profit |
» status | enabled |
» status | disabled |
Example responses
200 Response
[
{
"id": 645646,
"object": "Listing",
"attributes": "[]",
"category": {},
"category_id": 432432,
"city": "New York City",
"country": "US",
"cover": "string",
"currency": "USD",
"date_online": "2023-06-07T06:43:06Z",
"description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dignissim laoreet sem, quis mollis elit rutrum a. Donec nunc urna, rhoncus in sagittis ut, elementum scelerisque libero. Quisque interdum nibh nisl, non gravida nibh molestie quis. Phasellus nunc nunc, luctus a luctus ac, iaculis sit amet turpis.</p><p>Phasellus tortor orci, posuere in mi at, blandit ullamcorper tellus. Proin vel sem aliquam, faucibus dolor quis, dictum leo. Aliquam consectetur massa at ipsum auctor, at mattis nunc porttitor. Suspendisse potenti. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>",
"external_id": "INTERNAL_REF_234324",
"lat": 40.7572114,
"lng": -73.9913385,
"location": "253 W 42nd St, New York, NY 10036, United States",
"min_qty": 1,
"medias": "string",
"order_type_id": 986545,
"price": 123.5,
"price_unit": null,
"price_with_currency": "$123.50",
"quantity": 43,
"quantity_selector": null,
"requires_shipping": true,
"shipping_methods": [],
"slug": "listing-s-slug",
"state": "NY",
"status": "out_of_stock",
"supplier": {},
"supplier_id": 655785,
"title": "Listing's title",
"url": "string",
"variants": {},
"valid_until": "2023-06-07T06:43:06Z",
"weight": 0.8
}
]
Responses
Status | Description |
---|---|
200 | List of all your listings |
Response Schema
Status Code 200
List of all listings
Name | Description |
---|---|
anonymous | List of all listings |
» id read-only | Listing's unique identifier |
» object read-only | |
» attributes | |
» category | |
»» id read-only | Category's unique identifier |
»» object read-only | |
»» title | |
»» url read-only | |
» category_id true | Category's unique identifier |
» city | |
» country | |
» cover read-only | |
» currency | |
» date_online | |
» description | |
» external_id | |
» lat | |
» lng | |
» location | |
» min_qty | |
» medias | |
» order_type_id true | Order type's unique identifier |
» price | |
» price_unit | |
» price_with_currency read-only | |
» quantity | |
» quantity_selector | |
» requires_shipping | |
» shipping_methods | |
»» id | |
»» carrier_alias | |
»» price | |
»» sort_priority | |
»» step_price | |
»» title | |
» slug | |
» state | |
» status | |
» supplier | |
»» id read-only | User's unique identifier |
»» object read-only | |
»» account_type | |
»» address_city | |
»» address_country | |
»» address_line1 | |
»» address_line2 | |
»» address_state | |
»» address_zipcode | |
»» attributes | |
»» avatar | Absolute URL of the profile image |
»» business_name | Company or organization name |
»» can_post_listing | |
»» created | |
»» email true | |
»» first_name | |
»» group read-only | |
»»» object read-only | |
»»» id read-only | Group's unique identifier |
»»» name | |
»»» alias read-only | |
»» group_alias read-only | |
»» group_id true | |
»» group_name read-only | |
»» lang read-only | |
»» last_name read-only | |
»» locale | |
»» note | Average note based on reviews |
»» phone_country_number | |
»» phone_number | |
»» profile_url read-only | |
»» public_name read-only | |
»» status | Account status. Possible values are "enabled2" or "disabled" |
»» review_count | |
»» timezone | |
»» username | |
» supplier_id true | Supplier's unique identifier |
» title true | |
» url read-only | |
» variants | |
»» id read-only | Variant's unique identifier |
»» object read-only | |
»» external_id | |
»» listing_id | |
»» price | |
»» price_unit | |
»» quantity | The quantity of the variant that is available for sale |
»» sort_priority | Sorts the variants with the lowest number first. Negative numbers are allowed. |
»» sku | |
»» title true | |
»» weight | |
» valid_until | |
» weight |
Retrieve listing
Code samples
# You can also use wget
curl -X GET /api/v1/listings/{id} \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/listings/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/listings/{id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/listings/{id}',
params: {
}, headers: headers
p JSON.parse(result)
GET /listings/{id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | Listing's unique identifier |
Example responses
200 Response
[
{
"id": 645646,
"object": "Listing",
"attributes": "[]",
"category": {},
"category_id": 432432,
"city": "New York City",
"country": "US",
"cover": "string",
"currency": "USD",
"date_online": "2023-06-07T06:43:06Z",
"description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dignissim laoreet sem, quis mollis elit rutrum a. Donec nunc urna, rhoncus in sagittis ut, elementum scelerisque libero. Quisque interdum nibh nisl, non gravida nibh molestie quis. Phasellus nunc nunc, luctus a luctus ac, iaculis sit amet turpis.</p><p>Phasellus tortor orci, posuere in mi at, blandit ullamcorper tellus. Proin vel sem aliquam, faucibus dolor quis, dictum leo. Aliquam consectetur massa at ipsum auctor, at mattis nunc porttitor. Suspendisse potenti. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>",
"external_id": "INTERNAL_REF_234324",
"lat": 40.7572114,
"lng": -73.9913385,
"location": "253 W 42nd St, New York, NY 10036, United States",
"min_qty": 1,
"medias": "string",
"order_type_id": 986545,
"price": 123.5,
"price_unit": null,
"price_with_currency": "$123.50",
"quantity": 43,
"quantity_selector": null,
"requires_shipping": true,
"shipping_methods": [],
"slug": "listing-s-slug",
"state": "NY",
"status": "out_of_stock",
"supplier": {},
"supplier_id": 655785,
"title": "Listing's title",
"url": "string",
"variants": {},
"valid_until": "2023-06-07T06:43:06Z",
"weight": 0.8
}
]
Responses
Status | Description |
---|---|
200 | Success |
Response Schema
Status Code 200
Name | Description |
---|---|
anonymous | |
» id read-only | Listing's unique identifier |
» object read-only | |
» attributes | |
» category | |
»» id read-only | Category's unique identifier |
»» object read-only | |
»» title | |
»» url read-only | |
» category_id true | Category's unique identifier |
» city | |
» country | |
» cover read-only | |
» currency | |
» date_online | |
» description | |
» external_id | |
» lat | |
» lng | |
» location | |
» min_qty | |
» medias | |
» order_type_id true | Order type's unique identifier |
» price | |
» price_unit | |
» price_with_currency read-only | |
» quantity | |
» quantity_selector | |
» requires_shipping | |
» shipping_methods | |
»» id | |
»» carrier_alias | |
»» price | |
»» sort_priority | |
»» step_price | |
»» title | |
» slug | |
» state | |
» status | |
» supplier | |
»» id read-only | User's unique identifier |
»» object read-only | |
»» account_type | |
»» address_city | |
»» address_country | |
»» address_line1 | |
»» address_line2 | |
»» address_state | |
»» address_zipcode | |
»» attributes | |
»» avatar | Absolute URL of the profile image |
»» business_name | Company or organization name |
»» can_post_listing | |
»» created | |
»» email true | |
»» first_name | |
»» group read-only | |
»»» object read-only | |
»»» id read-only | Group's unique identifier |
»»» name | |
»»» alias read-only | |
»» group_alias read-only | |
»» group_id true | |
»» group_name read-only | |
»» lang read-only | |
»» last_name read-only | |
»» locale | |
»» note | Average note based on reviews |
»» phone_country_number | |
»» phone_number | |
»» profile_url read-only | |
»» public_name read-only | |
»» status | Account status. Possible values are "enabled2" or "disabled" |
»» review_count | |
»» timezone | |
»» username | |
» supplier_id true | Supplier's unique identifier |
» title true | |
» url read-only | |
» variants | |
»» id read-only | Variant's unique identifier |
»» object read-only | |
»» external_id | |
»» listing_id | |
»» price | |
»» price_unit | |
»» quantity | The quantity of the variant that is available for sale |
»» sort_priority | Sorts the variants with the lowest number first. Negative numbers are allowed. |
»» sku | |
»» title true | |
»» weight | |
» valid_until | |
» weight |
Delete listing
Code samples
# You can also use wget
curl -X DELETE /api/v1/listings/{id} \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','/api/v1/listings/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.delete('/api/v1/listings/{id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.delete '/api/v1/listings/{id}',
params: {
}, headers: headers
p JSON.parse(result)
DELETE /listings/{id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | Listing's unique identifier |
Example responses
200 Response
{
"success": true,
"message": "Listing deleted"
}
Responses
Status | Description |
---|---|
200 | Listing deleted |
404 | Error |
Response Schema
Status Code 200
Name | Description |
---|---|
» success | |
» message | More details about the error |
Status Code 404
Name | Description |
---|---|
» success | |
» message | More details about the error |
Update listing
Code samples
# You can also use wget
curl -X PATCH /api/v1/listings/{id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','/api/v1/listings/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const inputBody = '{
"attributes": "[]",
"category": {
"title": "string"
},
"category_id": 432432,
"city": "New York City",
"country": "US",
"currency": "USD",
"date_online": "2023-06-07T06:43:06Z",
"description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dignissim laoreet sem, quis mollis elit rutrum a. Donec nunc urna, rhoncus in sagittis ut, elementum scelerisque libero. Quisque interdum nibh nisl, non gravida nibh molestie quis. Phasellus nunc nunc, luctus a luctus ac, iaculis sit amet turpis.</p><p>Phasellus tortor orci, posuere in mi at, blandit ullamcorper tellus. Proin vel sem aliquam, faucibus dolor quis, dictum leo. Aliquam consectetur massa at ipsum auctor, at mattis nunc porttitor. Suspendisse potenti. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>",
"external_id": "INTERNAL_REF_234324",
"lat": 40.7572114,
"lng": -73.9913385,
"location": "253 W 42nd St, New York, NY 10036, United States",
"min_qty": 1,
"medias": "string",
"order_type_id": 986545,
"price": 123.5,
"price_unit": null,
"quantity": 43,
"quantity_selector": null,
"requires_shipping": true,
"shipping_methods": [
{}
],
"slug": "listing-s-slug",
"state": "NY",
"status": "out_of_stock",
"supplier": {
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group_id": 784568,
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
},
"supplier_id": 655785,
"title": "Listing's title",
"variants": {
"external_id": "INTERNAL_REF_234324",
"listing_id": 324353,
"price": 123.5,
"price_unit": null,
"quantity": 10,
"sort_priority": 10,
"sku": "BASKT-XYZ-BLN-41",
"title": "Blue Shoes Size 41",
"weight": 0.8
},
"valid_until": "2023-06-07T06:43:06Z",
"weight": 0.8
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
"attributes": "[]",
"category": {
"title": "string"
},
"category_id": 432432,
"city": "New York City",
"country": "US",
"currency": "USD",
"date_online": "2023-06-07T06:43:06Z",
"description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dignissim laoreet sem, quis mollis elit rutrum a. Donec nunc urna, rhoncus in sagittis ut, elementum scelerisque libero. Quisque interdum nibh nisl, non gravida nibh molestie quis. Phasellus nunc nunc, luctus a luctus ac, iaculis sit amet turpis.</p><p>Phasellus tortor orci, posuere in mi at, blandit ullamcorper tellus. Proin vel sem aliquam, faucibus dolor quis, dictum leo. Aliquam consectetur massa at ipsum auctor, at mattis nunc porttitor. Suspendisse potenti. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>",
"external_id": "INTERNAL_REF_234324",
"lat": 40.7572114,
"lng": -73.9913385,
"location": "253 W 42nd St, New York, NY 10036, United States",
"min_qty": 1,
"medias": "string",
"order_type_id": 986545,
"price": 123.5,
"price_unit": null,
"quantity": 43,
"quantity_selector": null,
"requires_shipping": true,
"shipping_methods": [
{}
],
"slug": "listing-s-slug",
"state": "NY",
"status": "out_of_stock",
"supplier": {
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group_id": 784568,
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
},
"supplier_id": 655785,
"title": "Listing's title",
"variants": {
"external_id": "INTERNAL_REF_234324",
"listing_id": 324353,
"price": 123.5,
"price_unit": null,
"quantity": 10,
"sort_priority": 10,
"sku": "BASKT-XYZ-BLN-41",
"title": "Blue Shoes Size 41",
"weight": 0.8
},
"valid_until": "2023-06-07T06:43:06Z",
"weight": 0.8
};
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}',
{
method: 'PATCH',
body: JSON.stringify(inputBody),
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.patch('/api/v1/listings/{id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.patch '/api/v1/listings/{id}',
params: {
}, headers: headers
p JSON.parse(result)
PATCH /listings/{id}
Request parameter
{
"attributes": "[]",
"category": {
"title": "string"
},
"category_id": 432432,
"city": "New York City",
"country": "US",
"currency": "USD",
"date_online": "2023-06-07T06:43:06Z",
"description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dignissim laoreet sem, quis mollis elit rutrum a. Donec nunc urna, rhoncus in sagittis ut, elementum scelerisque libero. Quisque interdum nibh nisl, non gravida nibh molestie quis. Phasellus nunc nunc, luctus a luctus ac, iaculis sit amet turpis.</p><p>Phasellus tortor orci, posuere in mi at, blandit ullamcorper tellus. Proin vel sem aliquam, faucibus dolor quis, dictum leo. Aliquam consectetur massa at ipsum auctor, at mattis nunc porttitor. Suspendisse potenti. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>",
"external_id": "INTERNAL_REF_234324",
"lat": 40.7572114,
"lng": -73.9913385,
"location": "253 W 42nd St, New York, NY 10036, United States",
"min_qty": 1,
"medias": "string",
"order_type_id": 986545,
"price": 123.5,
"price_unit": null,
"quantity": 43,
"quantity_selector": null,
"requires_shipping": true,
"shipping_methods": [
{}
],
"slug": "listing-s-slug",
"state": "NY",
"status": "out_of_stock",
"supplier": {
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group_id": 784568,
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
},
"supplier_id": 655785,
"title": "Listing's title",
"variants": {
"external_id": "INTERNAL_REF_234324",
"listing_id": 324353,
"price": 123.5,
"price_unit": null,
"quantity": 10,
"sort_priority": 10,
"sku": "BASKT-XYZ-BLN-41",
"title": "Blue Shoes Size 41",
"weight": 0.8
},
"valid_until": "2023-06-07T06:43:06Z",
"weight": 0.8
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | Listing's unique identifier |
Request parameters
Name | Type | Required | Description |
---|---|---|---|
body | Listing | true |
Enumerated Values
Parameter | Value |
---|---|
» account_type | individual |
» account_type | company |
» account_type | non-profit |
» status | enabled |
» status | disabled |
Example responses
201 Response
{
"success": true,
"message": "Listing has been updated"
}
Responses
Status | Description |
---|---|
201 | The listing has been updated |
400 | Some parameters are not correct |
401 | Unauthorized |
404 | Not found |
Response Schema
Status Code 201
Name | Description |
---|---|
» success | |
» message |
Search listings by criteria
Code samples
# You can also use wget
curl -X GET /api/v1/listings/search \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/listings/search', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/search',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/search',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/listings/search', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/listings/search',
params: {
}, headers: headers
p JSON.parse(result)
GET /listings/search
Returns a list of your listing categories
Example responses
200 Response
[
{
"id": 645646,
"object": "Listing",
"attributes": "[]",
"category": {},
"category_id": 432432,
"city": "New York City",
"country": "US",
"cover": "string",
"currency": "USD",
"date_online": "2023-06-07T06:43:06Z",
"description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dignissim laoreet sem, quis mollis elit rutrum a. Donec nunc urna, rhoncus in sagittis ut, elementum scelerisque libero. Quisque interdum nibh nisl, non gravida nibh molestie quis. Phasellus nunc nunc, luctus a luctus ac, iaculis sit amet turpis.</p><p>Phasellus tortor orci, posuere in mi at, blandit ullamcorper tellus. Proin vel sem aliquam, faucibus dolor quis, dictum leo. Aliquam consectetur massa at ipsum auctor, at mattis nunc porttitor. Suspendisse potenti. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>",
"external_id": "INTERNAL_REF_234324",
"lat": 40.7572114,
"lng": -73.9913385,
"location": "253 W 42nd St, New York, NY 10036, United States",
"min_qty": 1,
"medias": "string",
"order_type_id": 986545,
"price": 123.5,
"price_unit": null,
"price_with_currency": "$123.50",
"quantity": 43,
"quantity_selector": null,
"requires_shipping": true,
"shipping_methods": [],
"slug": "listing-s-slug",
"state": "NY",
"status": "out_of_stock",
"supplier": {},
"supplier_id": 655785,
"title": "Listing's title",
"url": "string",
"variants": {},
"valid_until": "2023-06-07T06:43:06Z",
"weight": 0.8
}
]
Responses
Status | Description |
---|---|
200 | Search listing by criteria |
Response Schema
Status Code 200
List of results
Name | Description |
---|---|
anonymous | List of results |
» id read-only | Listing's unique identifier |
» object read-only | |
» attributes | |
» category | |
»» id read-only | Category's unique identifier |
»» object read-only | |
»» title | |
»» url read-only | |
» category_id true | Category's unique identifier |
» city | |
» country | |
» cover read-only | |
» currency | |
» date_online | |
» description | |
» external_id | |
» lat | |
» lng | |
» location | |
» min_qty | |
» medias | |
» order_type_id true | Order type's unique identifier |
» price | |
» price_unit | |
» price_with_currency read-only | |
» quantity | |
» quantity_selector | |
» requires_shipping | |
» shipping_methods | |
»» id | |
»» carrier_alias | |
»» price | |
»» sort_priority | |
»» step_price | |
»» title | |
» slug | |
» state | |
» status | |
» supplier | |
»» id read-only | User's unique identifier |
»» object read-only | |
»» account_type | |
»» address_city | |
»» address_country | |
»» address_line1 | |
»» address_line2 | |
»» address_state | |
»» address_zipcode | |
»» attributes | |
»» avatar | Absolute URL of the profile image |
»» business_name | Company or organization name |
»» can_post_listing | |
»» created | |
»» email true | |
»» first_name | |
»» group read-only | |
»»» object read-only | |
»»» id read-only | Group's unique identifier |
»»» name | |
»»» alias read-only | |
»» group_alias read-only | |
»» group_id true | |
»» group_name read-only | |
»» lang read-only | |
»» last_name read-only | |
»» locale | |
»» note | Average note based on reviews |
»» phone_country_number | |
»» phone_number | |
»» profile_url read-only | |
»» public_name read-only | |
»» status | Account status. Possible values are "enabled2" or "disabled" |
»» review_count | |
»» timezone | |
»» username | |
» supplier_id true | Supplier's unique identifier |
» title true | |
» url read-only | |
» variants | |
»» id read-only | Variant's unique identifier |
»» object read-only | |
»» external_id | |
»» listing_id | |
»» price | |
»» price_unit | |
»» quantity | The quantity of the variant that is available for sale |
»» sort_priority | Sorts the variants with the lowest number first. Negative numbers are allowed. |
»» sku | |
»» title true | |
»» weight | |
» valid_until | |
» weight |
Rebuild Elasticsearch index
Code samples
# You can also use wget
curl -X GET /api/v1/listings/reindex
<?php
require 'vendor/autoload.php';
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/listings/reindex', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
fetch('/api/v1/listings/reindex',
{
method: 'GET'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
fetch('/api/v1/listings/reindex',
{
method: 'GET'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.get('/api/v1/listings/reindex')
print(r.json())
require 'rest-client'
require 'json'
result = RestClient.get '/api/v1/listings/reindex',
params: {
}
p JSON.parse(result)
GET /listings/reindex
We use an Elasticsearch server to enable full-text search, filters and sort on your store.
To display listings in search results, listings need to be indexed first. We do take care of this automatically, after each listing creation or update. We also remove automatically listings from user account that have been blocked or deleted. But when you create your listings from the API, those listings are not automatically indexed.
By using this endpoint, you can choose to reindex all your listings, or only those ones that are not indexed yet.
For performance reason, you should limit the number of listings indexed at once. Default value is 999.
Parameters
Name | Type | Required | Description |
---|---|---|---|
scope | string | false | Possible values: 'all' to reindex all your listings, or 'not_indexed' to reindex only listings that have been modified after the last indexation. Default value is 'not_indexed'. |
limit | integer | false | Number of listings to reindex at once. Default value is 999. |
Responses
Status | Description |
---|---|
200 | totalListingsToReindex, listingsReindexedCount and duration |
List metafields method
Code samples
# You can also use wget
curl -X GET /api/v1/listings/{id}/metafields \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/listings/{id}/metafields', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/metafields',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/metafields',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/listings/{id}/metafields', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/listings/{id}/metafields',
params: {
}, headers: headers
p JSON.parse(result)
GET /listings/{id}/metafields
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | ID of your listing |
Example responses
200 Response
[
{
"namespace": "string",
"title": "string",
"value": "string",
"value_type": "string"
}
]
Responses
Status | Description |
---|---|
200 | List of all metafields related to the listing |
Response Schema
Status Code 200
Metafield schema
Name | Description |
---|---|
anonymous | Metafield schema |
» namespace | |
» title | |
» value | |
» value_type |
Create metafields method
Code samples
# You can also use wget
curl -X POST /api/v1/listings/{id}/metafields \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/listings/{id}/metafields', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/metafields',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/metafields',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.post('/api/v1/listings/{id}/metafields', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.post '/api/v1/listings/{id}/metafields',
params: {
}, headers: headers
p JSON.parse(result)
POST /listings/{id}/metafields
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | ID of your listing |
Example responses
200 Response
[
{
"namespace": "string",
"title": "string",
"value": "string",
"value_type": "string"
}
]
Responses
Status | Description |
---|---|
200 | Success message |
404 | Error message |
Response Schema
Status Code 200
Metafield schema
Name | Description |
---|---|
anonymous | Metafield schema |
» namespace | |
» title | |
» value | |
» value_type |
Notifications
When you do actions through the API, like creating a user, a listing or updating an order, no notification is sent. You need to call the notifications
endpoint and choose which one to send and to whom.
Send a notification
Code samples
# You can also use wget
curl -X POST /api/v1/notifications/send \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/notifications/send', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const inputBody = '{
"type": "new_order_customer",
"object_id": 185423
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/notifications/send',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
"type": "new_order_customer",
"object_id": 185423
};
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/notifications/send',
{
method: 'POST',
body: JSON.stringify(inputBody),
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/api/v1/notifications/send', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post '/api/v1/notifications/send',
params: {
}, headers: headers
p JSON.parse(result)
POST /notifications/send
Request parameter
{
"type": "new_order_customer",
"object_id": 185423
}
Parameters
Name | Type | Required | Description |
---|
Request parameters
Name | Type | Required | Description |
---|---|---|---|
type | string | true | desc type |
Enumerated Values
Parameter | Value |
---|---|
type | new_order_customer |
type | new_order_supplier |
Example responses
200 Response
{
"success": true,
"data": {
"id": 234432,
"object_id": 185423,
"content": {
"subject": "You have a new order ...",
"body": " .... "
},
"created": "2023-01-18T23:42:27Z",
"recipient": "toto@test.mail",
"transport": "email",
"type": "new_order_customer"
}
}
Responses
Status | Description |
---|---|
200 | Notification status |
Response Schema
Status Code 200
Name | Description |
---|---|
» status | |
» data |
Orders
An order is a customer's request to purchase one or more listings from a supplier. You can retrieve, update, add metafields and delete orders using the Orders endpoint.
Order Status
Orders are automatically created when a product is added to cart (when cart is enabled) or when the customer starts a Direct checkout. The status of the order is then draft.
You can retrieve all you abandonned carts by getting all orders created more than two hours ago and still with draft status.
After checkout, the status should be pending or new, depending on how the payment is handled. Pending status is used with non-automatic payment methods, such as bank wires, cash on delivery or checks. If the payment is made online (with cards), the status should be new if the payment succeeded, or failed if the payment fails. You can also keep the status draft if you want to let the user to retry the payment.
Contrary to e-commerce stores, on a multi-vendor marketplace you cannot be sure the Catalog is always up to date. That's why all orders should be moderated and validated on the vendor's side. Payment Service Provider (PSP) won't refund their fees if a transaction is cancelled. By capturing the funds only on vendor's acceptation, you can avoid losing money on order that are declined by vendors. When the order is reviewed and validated by the vendor, the status becomes accepted. If the order is not accepted, the status becomes declined.
Status service_provided, shipped and customer_confirmed depends on your order workflow, but you can use them in any order you like.
If the vendor cannot fulfill the order, or if the customer want to cancel the order, the status becomes canceled. If money has been captured (probably the case if the status is at least accepted), you need to handle the refund of the funds. The endpoint is not publicly available, but you can ask our support team to send you all relevant documentation to handle it.
Finally, when the order's workflow has come to an end, you can use the status completed. You can now consider the order like closed.
Notifications
No notifications sent when you update the order status through the API. You need to manually manage the sending of notifications. Please check the Notifications endpoint to learn how to send a notification.
Get orders
Code samples
# You can also use wget
curl -X GET /api/v1/orders \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/orders', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/orders',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/orders',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/orders', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/orders',
params: {
}, headers: headers
p JSON.parse(result)
GET /orders
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | array[string] | false | ID(s) to filter by |
status | array[string] | false | Status to retrieve. To filter on multiple status, separate them by comma |
cart_id | integer | false | Cart's unique identifier |
supplier_id | integer | false | Vendor's unique identifier |
customer_id | integer | false | Customer's unique identifier |
order_number | string | false | Order number |
start_on_date[value] | dateTime | false | Filtering value |
start_on_date[condition_type] | string | false | Filtering type |
Enumerated Values
Parameter | Value |
---|---|
start_on_date[condition_type] | gt |
start_on_date[condition_type] | gte |
start_on_date[condition_type] | lt |
start_on_date[condition_type] | lte |
start_on_date[condition_type] | eq |
start_on_date[condition_type] | notEq |
start_on_date[condition_type] | like |
start_on_date[condition_type] | notLike |
start_on_date[condition_type] | in |
start_on_date[condition_type] | notIn |
Example responses
200 Response
[
{
"id": 0,
"object": "string",
"number": "string",
"order_number": "string",
"amount": 0,
"currency": "string",
"amount_with_currency": 0,
"status": "string",
"refusal_reason": "string",
"supplier": {},
"customer": {},
"checkout_message": "string",
"customer_url": "string",
"supplier_url": "string",
"checkout_at": "2023-06-07T06:43:06Z",
"fulfillment_status": "started",
"shippings": {},
"shipping_fees_destination": "platform",
"payout": {},
"smart_fees": [],
"order_items": []
}
]
Responses
Status | Description |
---|---|
200 | List of all your orders |
404 | Order not found |
Response Schema
Status Code 200
List of all orders
Name | Description |
---|---|
anonymous | List of all orders |
» id read-only | Order's unique identifier |
» object | |
» number | |
» order_number | |
» amount | |
» currency | |
» amount_with_currency | |
» status | |
» refusal_reason | |
» supplier | |
»» id read-only | User's unique identifier |
»» object read-only | |
»» account_type | |
»» address_city | |
»» address_country | |
»» address_line1 | |
»» address_line2 | |
»» address_state | |
»» address_zipcode | |
»» attributes | |
»» avatar | Absolute URL of the profile image |
»» business_name | Company or organization name |
»» can_post_listing | |
»» created | |
»» email true | |
»» first_name | |
»» group read-only | |
»»» object read-only | |
»»» id read-only | Group's unique identifier |
»»» name | |
»»» alias read-only | |
»» group_alias read-only | |
»» group_id true | |
»» group_name read-only | |
»» lang read-only | |
»» last_name read-only | |
»» locale | |
»» note | Average note based on reviews |
»» phone_country_number | |
»» phone_number | |
»» profile_url read-only | |
»» public_name read-only | |
»» status | Account status. Possible values are "enabled2" or "disabled" |
»» review_count | |
»» timezone | |
»» username | |
» customer | |
» checkout_message | |
» customer_url | |
» supplier_url | |
» checkout_at | |
» fulfillment_status | |
» shippings | |
»» id read-only | |
»» amount | |
»» title | |
»» tracking_number | |
»» tracking_url | |
»» address | |
»»» id | |
»»» object | |
»»» city | |
»»» country | |
»»» mobile | |
»»» name | First name and last name |
»»» phone | |
»»» postcode | |
»»» state | |
»»» street | |
»»» street_option | |
» shipping_fees_destination | |
» payout | |
»» status | The payout status depends on your PSP. Please refer to their documentation |
»» amount | The payout amount in cents |
»» currency_code | Three-letter ISO 4217 currency code, in lowercase |
»» requested_at | The payout has been requested to the PSP |
»» completed_at | The payout has been submitted to the bank by the PSP |
»» arrival_date | Date of arrival of the funds in the bank account |
» smart_fees | |
»» fee_target | |
»» rule_title | |
»» fee_amount | |
» order_items | |
»» object read-only | |
»» id read-only | Order item's unique identifier |
»» add_ons | |
»» amount | |
»» configurable_options | |
»» currency | |
»» downloadable_assets | |
»» listing | |
»»» id read-only | Listing's unique identifier |
»»» object read-only | |
»»» attributes | |
»»» category | |
»»»» id read-only | Category's unique identifier |
»»»» object read-only | |
»»»» title | |
»»»» url read-only | |
»»» category_id true | Category's unique identifier |
»»» city | |
»»» country | |
»»» cover read-only | |
»»» currency | |
»»» date_online | |
»»» description | |
»»» external_id | |
»»» lat | |
»»» lng | |
»»» location | |
»»» min_qty | |
»»» medias | |
»»» order_type_id true | Order type's unique identifier |
»»» price | |
»»» price_unit | |
»»» price_with_currency read-only | |
»»» quantity | |
»»» quantity_selector | |
»»» requires_shipping | |
»»» shipping_methods | |
»»»» id | |
»»»» carrier_alias | |
»»»» price | |
»»»» sort_priority | |
»»»» step_price | |
»»»» title | |
»»» slug | |
»»» state | |
»»» status | |
»»» supplier | |
»»» supplier_id true | Supplier's unique identifier |
»»» title true | |
»»» url read-only | |
»»» variants | |
»»»» id read-only | Variant's unique identifier |
»»»» object read-only | |
»»»» external_id | |
»»»» listing_id | |
»»»» price | |
»»»» price_unit | |
»»»» quantity | The quantity of the variant that is available for sale |
»»»» sort_priority | Sorts the variants with the lowest number first. Negative numbers are allowed. |
»»»» sku | |
»»»» title true | |
»»»» weight | |
»»» valid_until | |
»»» weight | |
»» listing_id | |
»» listing_image | |
»» listing_sku | |
»» listing_title | |
»» listing_unit_price | |
»» listing_weight | |
»» qty | |
»» token | |
»» properties |
Retrieve order
Code samples
# You can also use wget
curl -X GET /api/v1/orders/{id} \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/orders/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/orders/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/orders/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/orders/{id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/orders/{id}',
params: {
}, headers: headers
p JSON.parse(result)
GET /orders/{id}
View method
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | ID of your order |
Example responses
200 Response
[
{
"id": 0,
"object": "string",
"number": "string",
"order_number": "string",
"amount": 0,
"currency": "string",
"amount_with_currency": 0,
"status": "string",
"refusal_reason": "string",
"supplier": {},
"customer": {},
"checkout_message": "string",
"customer_url": "string",
"supplier_url": "string",
"checkout_at": "2023-06-07T06:43:06Z",
"fulfillment_status": "started",
"shippings": {},
"shipping_fees_destination": "platform",
"payout": {},
"smart_fees": [],
"order_items": []
}
]
Responses
Status | Description |
---|---|
200 | Success |
Response Schema
Status Code 200
Name | Description |
---|---|
anonymous | |
» id read-only | Order's unique identifier |
» object | |
» number | |
» order_number | |
» amount | |
» currency | |
» amount_with_currency | |
» status | |
» refusal_reason | |
» supplier | |
»» id read-only | User's unique identifier |
»» object read-only | |
»» account_type | |
»» address_city | |
»» address_country | |
»» address_line1 | |
»» address_line2 | |
»» address_state | |
»» address_zipcode | |
»» attributes | |
»» avatar | Absolute URL of the profile image |
»» business_name | Company or organization name |
»» can_post_listing | |
»» created | |
»» email true | |
»» first_name | |
»» group read-only | |
»»» object read-only | |
»»» id read-only | Group's unique identifier |
»»» name | |
»»» alias read-only | |
»» group_alias read-only | |
»» group_id true | |
»» group_name read-only | |
»» lang read-only | |
»» last_name read-only | |
»» locale | |
»» note | Average note based on reviews |
»» phone_country_number | |
»» phone_number | |
»» profile_url read-only | |
»» public_name read-only | |
»» status | Account status. Possible values are "enabled2" or "disabled" |
»» review_count | |
»» timezone | |
»» username | |
» customer | |
» checkout_message | |
» customer_url | |
» supplier_url | |
» checkout_at | |
» fulfillment_status | |
» shippings | |
»» id read-only | |
»» amount | |
»» title | |
»» tracking_number | |
»» tracking_url | |
»» address | |
»»» id | |
»»» object | |
»»» city | |
»»» country | |
»»» mobile | |
»»» name | First name and last name |
»»» phone | |
»»» postcode | |
»»» state | |
»»» street | |
»»» street_option | |
» shipping_fees_destination | |
» payout | |
»» status | The payout status depends on your PSP. Please refer to their documentation |
»» amount | The payout amount in cents |
»» currency_code | Three-letter ISO 4217 currency code, in lowercase |
»» requested_at | The payout has been requested to the PSP |
»» completed_at | The payout has been submitted to the bank by the PSP |
»» arrival_date | Date of arrival of the funds in the bank account |
» smart_fees | |
»» fee_target | |
»» rule_title | |
»» fee_amount | |
» order_items | |
»» object read-only | |
»» id read-only | Order item's unique identifier |
»» add_ons | |
»» amount | |
»» configurable_options | |
»» currency | |
»» downloadable_assets | |
»» listing | |
»»» id read-only | Listing's unique identifier |
»»» object read-only | |
»»» attributes | |
»»» category | |
»»»» id read-only | Category's unique identifier |
»»»» object read-only | |
»»»» title | |
»»»» url read-only | |
»»» category_id true | Category's unique identifier |
»»» city | |
»»» country | |
»»» cover read-only | |
»»» currency | |
»»» date_online | |
»»» description | |
»»» external_id | |
»»» lat | |
»»» lng | |
»»» location | |
»»» min_qty | |
»»» medias | |
»»» order_type_id true | Order type's unique identifier |
»»» price | |
»»» price_unit | |
»»» price_with_currency read-only | |
»»» quantity | |
»»» quantity_selector | |
»»» requires_shipping | |
»»» shipping_methods | |
»»»» id | |
»»»» carrier_alias | |
»»»» price | |
»»»» sort_priority | |
»»»» step_price | |
»»»» title | |
»»» slug | |
»»» state | |
»»» status | |
»»» supplier | |
»»» supplier_id true | Supplier's unique identifier |
»»» title true | |
»»» url read-only | |
»»» variants | |
»»»» id read-only | Variant's unique identifier |
»»»» object read-only | |
»»»» external_id | |
»»»» listing_id | |
»»»» price | |
»»»» price_unit | |
»»»» quantity | The quantity of the variant that is available for sale |
»»»» sort_priority | Sorts the variants with the lowest number first. Negative numbers are allowed. |
»»»» sku | |
»»»» title true | |
»»»» weight | |
»»» valid_until | |
»»» weight | |
»» listing_id | |
»» listing_image | |
»» listing_sku | |
»» listing_title | |
»» listing_unit_price | |
»» listing_weight | |
»» qty | |
»» token | |
»» properties |
Delete method
Code samples
# You can also use wget
curl -X DELETE /api/v1/orders/{id}
<?php
require 'vendor/autoload.php';
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','/api/v1/orders/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
fetch('/api/v1/orders/{id}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
fetch('/api/v1/orders/{id}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.delete('/api/v1/orders/{id}')
print(r.json())
require 'rest-client'
require 'json'
result = RestClient.delete '/api/v1/orders/{id}',
params: {
}
p JSON.parse(result)
DELETE /orders/{id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | ID of your order |
Responses
Status | Description |
---|---|
200 | Order deleted |
404 | Order not found |
Update an order
Code samples
# You can also use wget
curl -X PATCH /api/v1/orders/{id} \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','/api/v1/orders/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/orders/{id}',
{
method: 'PATCH',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/orders/{id}',
{
method: 'PATCH',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.patch('/api/v1/orders/{id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.patch '/api/v1/orders/{id}',
params: {
}, headers: headers
p JSON.parse(result)
PATCH /orders/{id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | Order's unique identifier |
Example responses
201 Response
{
"success": true,
"message": "Order updated"
}
Responses
Status | Description |
---|---|
201 | Success |
Response Schema
Status Code 201
Name | Description |
---|---|
» success | |
» message | More details about the error |
List metafields method
Code samples
# You can also use wget
curl -X GET /api/v1/orders/{id}/metafields \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/orders/{id}/metafields', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/orders/{id}/metafields',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/orders/{id}/metafields',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/orders/{id}/metafields', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/orders/{id}/metafields',
params: {
}, headers: headers
p JSON.parse(result)
GET /orders/{id}/metafields
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | ID of your order |
Example responses
200 Response
[
{
"namespace": "string",
"title": "string",
"value": "string",
"value_type": "string"
}
]
Responses
Status | Description |
---|---|
200 | List of all metafields related to the order |
Response Schema
Status Code 200
Metafield schema
Name | Description |
---|---|
anonymous | Metafield schema |
» namespace | |
» title | |
» value | |
» value_type |
Create metafields method
Code samples
# You can also use wget
curl -X POST /api/v1/orders/{id}/metafields \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/orders/{id}/metafields', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/orders/{id}/metafields',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/orders/{id}/metafields',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.post('/api/v1/orders/{id}/metafields', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.post '/api/v1/orders/{id}/metafields',
params: {
}, headers: headers
p JSON.parse(result)
POST /orders/{id}/metafields
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | ID of your order |
Example responses
200 Response
[
{
"namespace": "string",
"title": "string",
"value": "string",
"value_type": "string"
}
]
Responses
Status | Description |
---|---|
200 | Success message |
404 | Error message |
Response Schema
Status Code 200
Metafield schema
Name | Description |
---|---|
anonymous | Metafield schema |
» namespace | |
» title | |
» value | |
» value_type |
Payment Gateways
A Payment Gateway API is a set of protocols and procedures that allow e-commerce websites, online stores, and other businesses to securely process payments over the internet. It provides a connection between a customer's bank or credit card issuer and the online store, and handles the secure transfer of payment data.
Get a list of payment gateways
Code samples
# You can also use wget
curl -X GET /api/v1/payment-gateways
<?php
require 'vendor/autoload.php';
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/payment-gateways', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
fetch('/api/v1/payment-gateways',
{
method: 'GET'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
fetch('/api/v1/payment-gateways',
{
method: 'GET'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.get('/api/v1/payment-gateways')
print(r.json())
require 'rest-client'
require 'json'
result = RestClient.get '/api/v1/payment-gateways',
params: {
}
p JSON.parse(result)
GET /payment-gateways
Responses
Status | Description |
---|---|
200 | OK |
Create a new payment gateway
Code samples
# You can also use wget
curl -X POST /api/v1/payment-gateways \
-H 'Content-Type: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/payment-gateways', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const inputBody = '{
"title": "Your Title",
"sandbox": false,
"status": "active",
"currency": "USD",
"min_transaction_size": 1,
"max_transaction_size": 3000,
"settings": []
}';
const headers = {
'Content-Type':'application/json'
};
fetch('/api/v1/payment-gateways',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
"title": "Your Title",
"sandbox": false,
"status": "active",
"currency": "USD",
"min_transaction_size": 1,
"max_transaction_size": 3000,
"settings": []
};
const headers = {
'Content-Type':'application/json'
};
fetch('/api/v1/payment-gateways',
{
method: 'POST',
body: JSON.stringify(inputBody),
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json'
}
r = requests.post('/api/v1/payment-gateways', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json'
}
result = RestClient.post '/api/v1/payment-gateways',
params: {
}, headers: headers
p JSON.parse(result)
POST /payment-gateways
Request parameter
{
"title": "Your Title",
"sandbox": false,
"status": "active",
"currency": "USD",
"min_transaction_size": 1,
"max_transaction_size": 3000,
"settings": []
}
Responses
Status | Description |
---|---|
201 | Created |
400 | Bad Request |
Get details of a specific payment gateway
Code samples
# You can also use wget
curl -X GET /api/v1/payment-gateways/{id}
<?php
require 'vendor/autoload.php';
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/payment-gateways/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
fetch('/api/v1/payment-gateways/{id}',
{
method: 'GET'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
fetch('/api/v1/payment-gateways/{id}',
{
method: 'GET'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.get('/api/v1/payment-gateways/{id}')
print(r.json())
require 'rest-client'
require 'json'
result = RestClient.get '/api/v1/payment-gateways/{id}',
params: {
}
p JSON.parse(result)
GET /payment-gateways/{id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | ID of the payment gateway |
Responses
Status | Description |
---|---|
200 | OK |
404 | Not Found |
Delete a specific payment gateway
Code samples
# You can also use wget
curl -X DELETE /api/v1/payment-gateways/{id}
<?php
require 'vendor/autoload.php';
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','/api/v1/payment-gateways/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
fetch('/api/v1/payment-gateways/{id}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
fetch('/api/v1/payment-gateways/{id}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.delete('/api/v1/payment-gateways/{id}')
print(r.json())
require 'rest-client'
require 'json'
result = RestClient.delete '/api/v1/payment-gateways/{id}',
params: {
}
p JSON.parse(result)
DELETE /payment-gateways/{id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | ID of the payment gateway |
Responses
Status | Description |
---|---|
204 | No Content |
404 | Not Found |
Update details of a specific payment gateway
Code samples
# You can also use wget
curl -X PATCH /api/v1/payment-gateways/{id} \
-H 'Content-Type: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','/api/v1/payment-gateways/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const inputBody = '{
"title": "Your Title",
"sandbox": false,
"status": "active",
"currency": "EUR",
"min_transaction_size": 10,
"max_transaction_size": 5000,
"settings": []
}';
const headers = {
'Content-Type':'application/json'
};
fetch('/api/v1/payment-gateways/{id}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
"title": "Your Title",
"sandbox": false,
"status": "active",
"currency": "EUR",
"min_transaction_size": 10,
"max_transaction_size": 5000,
"settings": []
};
const headers = {
'Content-Type':'application/json'
};
fetch('/api/v1/payment-gateways/{id}',
{
method: 'PATCH',
body: JSON.stringify(inputBody),
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json'
}
r = requests.patch('/api/v1/payment-gateways/{id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json'
}
result = RestClient.patch '/api/v1/payment-gateways/{id}',
params: {
}, headers: headers
p JSON.parse(result)
PATCH /payment-gateways/{id}
Request parameter
{
"title": "Your Title",
"sandbox": false,
"status": "active",
"currency": "EUR",
"min_transaction_size": 10,
"max_transaction_size": 5000,
"settings": []
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | ID of the payment gateway |
Responses
Status | Description |
---|---|
201 | Created |
400 | Bad Request |
404 | Not Found |
Get a list of PSP users for a specific user
Code samples
# You can also use wget
curl -X GET /api/v1/payment-gateways/external-accounts/{user_id}
<?php
require 'vendor/autoload.php';
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/payment-gateways/external-accounts/{user_id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
fetch('/api/v1/payment-gateways/external-accounts/{user_id}',
{
method: 'GET'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
fetch('/api/v1/payment-gateways/external-accounts/{user_id}',
{
method: 'GET'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.get('/api/v1/payment-gateways/external-accounts/{user_id}')
print(r.json())
require 'rest-client'
require 'json'
result = RestClient.get '/api/v1/payment-gateways/external-accounts/{user_id}',
params: {
}
p JSON.parse(result)
GET /payment-gateways/external-accounts/{user_id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
user_id | integer | true | ID of the user |
Responses
Status | Description |
---|---|
200 | OK |
404 | Not Found |
Create a new PSP user for a specific user
Code samples
# You can also use wget
curl -X POST /api/v1/payment-gateways/external-accounts/{user_id} \
-H 'Content-Type: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/payment-gateways/external-accounts/{user_id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const inputBody = '{
"external_account_id": 5,
"gateway_id": 12,
"properties": {
"preference": "static"
},
"tos_acceptance": {
"date": null,
"user_agent": "merchant",
"ip": "16.16.16.16"
}
}';
const headers = {
'Content-Type':'application/json'
};
fetch('/api/v1/payment-gateways/external-accounts/{user_id}',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
"external_account_id": 5,
"gateway_id": 12,
"properties": {
"preference": "static"
},
"tos_acceptance": {
"date": null,
"user_agent": "merchant",
"ip": "16.16.16.16"
}
};
const headers = {
'Content-Type':'application/json'
};
fetch('/api/v1/payment-gateways/external-accounts/{user_id}',
{
method: 'POST',
body: JSON.stringify(inputBody),
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json'
}
r = requests.post('/api/v1/payment-gateways/external-accounts/{user_id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json'
}
result = RestClient.post '/api/v1/payment-gateways/external-accounts/{user_id}',
params: {
}, headers: headers
p JSON.parse(result)
POST /payment-gateways/external-accounts/{user_id}
Request parameter
{
"external_account_id": 5,
"gateway_id": 12,
"properties": {
"preference": "static"
},
"tos_acceptance": {
"date": null,
"user_agent": "merchant",
"ip": "16.16.16.16"
}
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
user_id | integer | true | ID of the user |
Responses
Status | Description |
---|---|
201 | Created |
400 | Bad Request |
Delete a specific PSP user
Code samples
# You can also use wget
curl -X DELETE /api/v1/payment-gateways/external-accounts/{user_id}/{account_id}
<?php
require 'vendor/autoload.php';
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','/api/v1/payment-gateways/external-accounts/{user_id}/{account_id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
fetch('/api/v1/payment-gateways/external-accounts/{user_id}/{account_id}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
fetch('/api/v1/payment-gateways/external-accounts/{user_id}/{account_id}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.delete('/api/v1/payment-gateways/external-accounts/{user_id}/{account_id}')
print(r.json())
require 'rest-client'
require 'json'
result = RestClient.delete '/api/v1/payment-gateways/external-accounts/{user_id}/{account_id}',
params: {
}
p JSON.parse(result)
DELETE /payment-gateways/external-accounts/{user_id}/{account_id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
user_id | integer | true | ID of the user |
account_id | integer | true | ID of the PSP user |
Responses
Status | Description |
---|---|
204 | No Content |
404 | Not Found |
Update details of a specific PSP user
Code samples
# You can also use wget
curl -X PATCH /api/v1/payment-gateways/external-accounts/{user_id}/{account_id} \
-H 'Content-Type: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','/api/v1/payment-gateways/external-accounts/{user_id}/{account_id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const inputBody = '{
"external_account_id": 6,
"gateway_id": 17,
"properties": {
"preference": "dynamic"
},
"tos_acceptance": {
"date": null,
"user_agent": "merchant",
"ip": "20.20.22.2"
}
}';
const headers = {
'Content-Type':'application/json'
};
fetch('/api/v1/payment-gateways/external-accounts/{user_id}/{account_id}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
"external_account_id": 6,
"gateway_id": 17,
"properties": {
"preference": "dynamic"
},
"tos_acceptance": {
"date": null,
"user_agent": "merchant",
"ip": "20.20.22.2"
}
};
const headers = {
'Content-Type':'application/json'
};
fetch('/api/v1/payment-gateways/external-accounts/{user_id}/{account_id}',
{
method: 'PATCH',
body: JSON.stringify(inputBody),
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json'
}
r = requests.patch('/api/v1/payment-gateways/external-accounts/{user_id}/{account_id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json'
}
result = RestClient.patch '/api/v1/payment-gateways/external-accounts/{user_id}/{account_id}',
params: {
}, headers: headers
p JSON.parse(result)
PATCH /payment-gateways/external-accounts/{user_id}/{account_id}
Request parameter
{
"external_account_id": 6,
"gateway_id": 17,
"properties": {
"preference": "dynamic"
},
"tos_acceptance": {
"date": null,
"user_agent": "merchant",
"ip": "20.20.22.2"
}
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
user_id | integer | true | ID of the user |
account_id | integer | true | ID of the PSP user |
Responses
Status | Description |
---|---|
201 | Created |
400 | Bad Request |
404 | Not Found |
Shipping rates
Shipping rates are what you charge your customer in addition to the cost of the listings that they order. The cost of any shipping rates are added to a customer's order at checkout.
Retrieve a list of shipping rates
Code samples
# You can also use wget
curl -X GET /api/v1/shipping_rates \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/shipping_rates', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/shipping_rates',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/shipping_rates',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/shipping_rates', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/shipping_rates',
params: {
}, headers: headers
p JSON.parse(result)
GET /shipping_rates
Example responses
200 Response
[
{
"id": "432424",
"price": "6.95",
"step_price": "1.45",
"always_selected": true,
"title": "Standard",
"tracking_number": null,
"tracking_url": null
}
]
Responses
Status | Description |
---|---|
200 | List of available Shipping Rates |
Response Schema
Status Code 200
Name | Description |
---|---|
anonymous | |
» id read-only | Shipping rate's unique identifier |
» price | |
» step_price | |
» always_selected | |
» title | |
» tracking_number | |
» tracking_url |
Retrieve a shipping rate
Code samples
# You can also use wget
curl -X GET /api/v1/shipping_rates/{id} \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/shipping_rates/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/shipping_rates/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/shipping_rates/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/shipping_rates/{id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/shipping_rates/{id}',
params: {
}, headers: headers
p JSON.parse(result)
GET /shipping_rates/{id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | ID of your shipping rate. |
Example responses
200 Response
{
"id": "432424",
"price": "6.95",
"step_price": "1.45",
"always_selected": true,
"title": "Standard",
"tracking_number": null,
"tracking_url": null
}
Responses
Status | Description |
---|---|
200 | The shipping rate object |
Users
Users tag
List all users
Code samples
# You can also use wget
curl -X GET /api/v1/users \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/users', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/users',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/users',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/users', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/users',
params: {
}, headers: headers
p JSON.parse(result)
GET /users
Returns a list of your users. The users are returned sorted by creation date, with the most recent users appearing first.
Example responses
200 Response
[
{
"id": 545353,
"object": "User",
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group": [],
"group_alias": "string",
"group_id": 784568,
"group_name": "string",
"lang": "string",
"last_name": "Doe",
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"profile_url": "string",
"public_name": "John Doe",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
}
]
Responses
Status | Description |
---|---|
200 | Array of users resources |
Response Schema
Status Code 200
Name | Description |
---|---|
anonymous | |
» User resource | |
»» id read-only | User's unique identifier |
»» object read-only | |
»» account_type | |
»» address_city | |
»» address_country | |
»» address_line1 | |
»» address_line2 | |
»» address_state | |
»» address_zipcode | |
»» attributes | |
»» avatar | Absolute URL of the profile image |
»» business_name | Company or organization name |
»» can_post_listing | |
»» created | |
»» email true | |
»» first_name | |
»» group read-only | |
»»» object read-only | |
»»» id read-only | Group's unique identifier |
»»» name | |
»»» alias read-only | |
»» group_alias read-only | |
»» group_id true | |
»» group_name read-only | |
»» lang read-only | |
»» last_name read-only | |
»» locale | |
»» note | Average note based on reviews |
»» phone_country_number | |
»» phone_number | |
»» profile_url read-only | |
»» public_name read-only | |
»» status | Account status. Possible values are "enabled2" or "disabled" |
»» review_count | |
»» timezone | |
»» username |
Add user
Code samples
# You can also use wget
curl -X POST /api/v1/users \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/users', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const inputBody = '{
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {
"profession": "Web developer"
},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group_id": 784568,
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/users',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {
"profession": "Web developer"
},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group_id": 784568,
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
};
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/users',
{
method: 'POST',
body: JSON.stringify(inputBody),
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/api/v1/users', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post '/api/v1/users',
params: {
}, headers: headers
p JSON.parse(result)
POST /users
Request parameter
{
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {
"profession": "Web developer"
},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group_id": 784568,
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
}
Parameters
Name | Type | Required | Description |
---|
Request parameters
Name | Type | Required | Description |
---|---|---|---|
body | User | true |
Enumerated Values
Parameter | Value |
---|---|
account_type | individual |
account_type | company |
account_type | non-profit |
status | enabled |
status | disabled |
Example responses
201 Response
{
"id": 545353,
"object": "User",
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {
"profession": "Web developer"
},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group": [
{}
],
"group_alias": "string",
"group_id": 784568,
"group_name": "string",
"lang": "string",
"last_name": "Doe",
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"profile_url": "string",
"public_name": "John Doe",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
}
Responses
Status | Description |
---|---|
201 | Created User details |
400 | Bad request |
401 | Unauthorized |
404 | Not found |
Retrieve user
Code samples
# You can also use wget
curl -X GET /api/v1/users/{id} \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/users/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/users/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/users/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/users/{id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/users/{id}',
params: {
}, headers: headers
p JSON.parse(result)
GET /users/{id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | Unique identifier of the user |
Example responses
200 Response
[
{
"id": 545353,
"object": "User",
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group": [],
"group_alias": "string",
"group_id": 784568,
"group_name": "string",
"lang": "string",
"last_name": "Doe",
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"profile_url": "string",
"public_name": "John Doe",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
}
]
Responses
Status | Description |
---|---|
200 | The user object |
Response Schema
Status Code 200
Name | Description |
---|---|
anonymous | |
» User resource | |
»» id read-only | User's unique identifier |
»» object read-only | |
»» account_type | |
»» address_city | |
»» address_country | |
»» address_line1 | |
»» address_line2 | |
»» address_state | |
»» address_zipcode | |
»» attributes | |
»» avatar | Absolute URL of the profile image |
»» business_name | Company or organization name |
»» can_post_listing | |
»» created | |
»» email true | |
»» first_name | |
»» group read-only | |
»»» object read-only | |
»»» id read-only | Group's unique identifier |
»»» name | |
»»» alias read-only | |
»» group_alias read-only | |
»» group_id true | |
»» group_name read-only | |
»» lang read-only | |
»» last_name read-only | |
»» locale | |
»» note | Average note based on reviews |
»» phone_country_number | |
»» phone_number | |
»» profile_url read-only | |
»» public_name read-only | |
»» status | Account status. Possible values are "enabled2" or "disabled" |
»» review_count | |
»» timezone | |
»» username |
Delete user
Code samples
# You can also use wget
curl -X DELETE /api/v1/users/{id}
<?php
require 'vendor/autoload.php';
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','/api/v1/users/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
fetch('/api/v1/users/{id}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
fetch('/api/v1/users/{id}',
{
method: 'DELETE'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
r = requests.delete('/api/v1/users/{id}')
print(r.json())
require 'rest-client'
require 'json'
result = RestClient.delete '/api/v1/users/{id}',
params: {
}
p JSON.parse(result)
DELETE /users/{id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | User's unique identifier |
Responses
Status | Description |
---|---|
200 | User deleted |
404 | User with ID 123456 does not exist |
Update user
Code samples
# You can also use wget
curl -X PATCH /api/v1/users/{id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','/api/v1/users/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const inputBody = '{
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {
"profession": "Web developer"
},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group_id": 784568,
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/users/{id}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {
"profession": "Web developer"
},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group_id": 784568,
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
};
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/users/{id}',
{
method: 'PATCH',
body: JSON.stringify(inputBody),
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.patch('/api/v1/users/{id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.patch '/api/v1/users/{id}',
params: {
}, headers: headers
p JSON.parse(result)
PATCH /users/{id}
Request parameter
{
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {
"profession": "Web developer"
},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group_id": 784568,
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | User's unique identifier |
Request parameters
Name | Type | Required | Description |
---|---|---|---|
body | User | true |
Enumerated Values
Parameter | Value |
---|---|
account_type | individual |
account_type | company |
account_type | non-profit |
status | enabled |
status | disabled |
Example responses
201 Response
{
"success": true,
"message": "User has been updated"
}
Responses
Status | Description |
---|---|
201 | The user has been updated |
400 | Some parameters are not correct |
401 | Unauthorized |
404 | Not found |
Response Schema
Status Code 201
Name | Description |
---|---|
» success | |
» message |
Get user payment account
Code samples
# You can also use wget
curl -X GET /api/v1/users/{id}/psp_account \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/users/{id}/psp_account', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/users/{id}/psp_account',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/users/{id}/psp_account',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/users/{id}/psp_account', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/users/{id}/psp_account',
params: {
}, headers: headers
p JSON.parse(result)
GET /users/{id}/psp_account
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | ID of your user. |
Example responses
200 Response
{
"psp_account": {
"psp": "Stripe",
"config_ig": 432349,
"account_id": "acct_xxxx",
"created": "2018-11-21T00:03:58+00:00"
}
}
Responses
Status | Description |
---|---|
200 | Retrieve PSP account for the current user |
Response Schema
Status Code 200
Name | Description |
---|---|
» psp | Name of the service payment provider |
» config_ig | ID of the PSP integration |
» account_id | Account ID of the current user in the Payment Service Provider dashboard |
» created | Creation date |
Get user's metafields
Code samples
# You can also use wget
curl -X GET /api/v1/users/{id}/metafields \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/users/{id}/metafields', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/users/{id}/metafields',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/users/{id}/metafields',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/users/{id}/metafields', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/users/{id}/metafields',
params: {
}, headers: headers
p JSON.parse(result)
GET /users/{id}/metafields
List metafields method
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | ID of your user |
Example responses
200 Response
[
{
"namespace": "string",
"title": "string",
"value": "string",
"value_type": "string"
}
]
Responses
Status | Description |
---|---|
200 | List of all metafields related to the user |
Response Schema
Status Code 200
Metafield schema
Name | Description |
---|---|
anonymous | Metafield schema |
» namespace | |
» title | |
» value | |
» value_type |
Add user's metafields
Code samples
# You can also use wget
curl -X POST /api/v1/users/{id}/metafields \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/users/{id}/metafields', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/users/{id}/metafields',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/users/{id}/metafields',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.post('/api/v1/users/{id}/metafields', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.post '/api/v1/users/{id}/metafields',
params: {
}, headers: headers
p JSON.parse(result)
POST /users/{id}/metafields
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | User's unique identifier |
Example responses
200 Response
[
{
"namespace": "string",
"title": "string",
"value": "string",
"value_type": "string"
}
]
Responses
Status | Description |
---|---|
200 | Success message |
404 | Error message |
Response Schema
Status Code 200
Metafield schema
Name | Description |
---|---|
anonymous | Metafield schema |
» namespace | |
» title | |
» value | |
» value_type |
Variants
{
"title": "Blue shoes size 6",
"external_id": "INTERNAL_REF_234324",
"sku": "SKU_123",
"price": 123.5,
"quantity": 10
}
A variant refers to a specific version or option of a product that has distinct characteristics such as size, color, material, or any other attribute that differentiates it from the other versions of the same product.
For example, a T-shirt may have multiple variants such as different sizes (small, medium, large), colors (red, blue, green), or styles (short-sleeved, long-sleeved). Each variant may have a different price, SKU (stock-keeping unit), and availability.
By offering multiple variants of a product, e-commerce businesses can cater to the diverse preferences of their customers and enhance the customer shopping experience. Additionally, variants allow for better inventory management and tracking of sales performance for each specific version of a product.
You can add variants to your listing by adding a variants
index to the Listing object. You can then POST or PATCH the Listing object.
Get variants
Code samples
# You can also use wget
curl -X GET /api/v1/listings/{id}/variants \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/listings/{id}/variants', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/variants',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/variants',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/listings/{id}/variants', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/listings/{id}/variants',
params: {
}, headers: headers
p JSON.parse(result)
GET /listings/{id}/variants
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | Listing's unique identifier |
Example responses
200 Response
null
Responses
Status | Description |
---|---|
200 | Retrieves a list of product variants |
Response Schema
Create a new variant
Code samples
# You can also use wget
curl -X POST /api/v1/listings/{id}/variants \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/listings/{id}/variants', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const inputBody = '{
"title": "string",
"price": 0,
"quantity": 0,
"sku": "string",
"weight": 0
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/variants',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
"title": "string",
"price": 0,
"quantity": 0,
"sku": "string",
"weight": 0
};
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/variants',
{
method: 'POST',
body: JSON.stringify(inputBody),
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/api/v1/listings/{id}/variants', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post '/api/v1/listings/{id}/variants',
params: {
}, headers: headers
p JSON.parse(result)
POST /listings/{id}/variants
Request parameter
{
"title": "string",
"price": 0,
"quantity": 0,
"sku": "string",
"weight": 0
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | Listing's unique identifier |
Request parameters
Name | Type | Required | Description |
---|---|---|---|
title | string | true |
Example responses
201 Response
{
"variant": {
"id": 432432,
"object": "Variant",
"external_id": "INTERNAL_REF_234324",
"listing_id": 324353,
"price": 123.5,
"price_unit": null,
"quantity": 10,
"sort_priority": 10,
"sku": "BASKT-XYZ-BLN-41",
"title": "Blue Shoes Size 41",
"weight": 0.8
}
}
Responses
Status | Description |
---|---|
201 | Variant added |
Response Schema
Status Code 201
Name | Description |
---|---|
» variant | |
»» id read-only | Variant's unique identifier |
»» object read-only | |
»» external_id | |
»» listing_id | |
»» price | |
»» price_unit | |
»» quantity | The quantity of the variant that is available for sale |
»» sort_priority | Sorts the variants with the lowest number first. Negative numbers are allowed. |
»» sku | |
»» title true | |
»» weight |
Delete variant
Code samples
# You can also use wget
curl -X DELETE /api/v1/listings/{id}/variants/{variant_id} \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','/api/v1/listings/{id}/variants/{variant_id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/variants/{variant_id}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/variants/{variant_id}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.delete('/api/v1/listings/{id}/variants/{variant_id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.delete '/api/v1/listings/{id}/variants/{variant_id}',
params: {
}, headers: headers
p JSON.parse(result)
DELETE /listings/{id}/variants/{variant_id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | Listing's unique identifier |
variant_id | integer | true | Variant's unique identifier |
Example responses
200 Response
{
"success": true,
"message": "Variant deleted"
}
Responses
Status | Description |
---|---|
200 | Variant deleted |
404 | Error |
Response Schema
Status Code 200
Name | Description |
---|---|
» success | |
» message | More details about the error |
Status Code 404
Name | Description |
---|---|
» success | |
» message | More details about the error |
Retrieves a count of listing variants
Code samples
# You can also use wget
curl -X GET /api/v1/listings/{id}/variants/count \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/listings/{id}/variants/count', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/variants/count',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/listings/{id}/variants/count',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/listings/{id}/variants/count', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/listings/{id}/variants/count',
params: {
}, headers: headers
p JSON.parse(result)
GET /listings/{id}/variants/count
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | Listing's unique identifier |
Example responses
200 Response
{
"count": "4"
}
Responses
Status | Description |
---|---|
200 | Number of variants |
Response Schema
Status Code 200
Name | Description |
---|---|
» count |
Retrieve variant
Code samples
# You can also use wget
curl -X GET /api/v1/variants/{id} \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/variants/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/variants/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/variants/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v1/variants/{id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v1/variants/{id}',
params: {
}, headers: headers
p JSON.parse(result)
GET /variants/{id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | Variant's unique identifier |
Example responses
200 Response
{
"variant": {
"id": 432432,
"object": "Variant",
"external_id": "INTERNAL_REF_234324",
"listing_id": 324353,
"price": 123.5,
"price_unit": null,
"quantity": 10,
"sort_priority": 10,
"sku": "BASKT-XYZ-BLN-41",
"title": "Blue Shoes Size 41",
"weight": 0.8
}
}
Responses
Status | Description |
---|---|
200 | Variant's details |
Response Schema
Status Code 200
Name | Description |
---|---|
» variant | |
»» id read-only | Variant's unique identifier |
»» object read-only | |
»» external_id | |
»» listing_id | |
»» price | |
»» price_unit | |
»» quantity | The quantity of the variant that is available for sale |
»» sort_priority | Sorts the variants with the lowest number first. Negative numbers are allowed. |
»» sku | |
»» title true | |
»» weight |
Update variant
Code samples
# You can also use wget
curl -X PATCH /api/v1/variants/{id} \
-H 'Accept: application/json'
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','/api/v1/variants/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/variants/{id}',
{
method: 'PATCH',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('/api/v1/variants/{id}',
{
method: 'PATCH',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json'
}
r = requests.patch('/api/v1/variants/{id}', headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.patch '/api/v1/variants/{id}',
params: {
}, headers: headers
p JSON.parse(result)
PATCH /variants/{id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | integer | true | Variant's unique identifier |
Example responses
201 Response
{
"success": true,
"message": "Variant has been updated"
}
Responses
Status | Description |
---|---|
201 | The variant has been updated |
400 | Some parameters are not correct |
401 | Unauthorized |
404 | Not found |
Response Schema
Status Code 201
Name | Description |
---|---|
» success | |
» message |
Schemas
ErrorResponse
{
"code": 400,
"status": "error",
"message": "Some parameters are not correct"
}
Properties
Fields | Type | Description |
---|---|---|
code | integer | Class AppController |
status | string | |
message | string |
AddOn
{
"id": 0,
"object": "AddOn",
"listing_id": 324353,
"title": "Extended Warranty",
"description": "Protect your purchases beyond the standard warranty period",
"price": 12.5
}
Properties
Fields | Type | Description |
---|---|---|
id read-only | integer | AddOn's unique identifier |
object read-only | string | |
listing_id | integer | |
title | string | |
description | string | |
price | number(double)¦null |
Category
{
"id": 432432,
"object": "Category",
"title": "string",
"url": "string"
}
Properties
Fields | Type | Description |
---|---|---|
id read-only | integer | Category's unique identifier |
object read-only | string | |
title | string | |
url read-only | string |
Event
{
"id": 0,
"type": "string",
"status": "string",
"object": "string",
"object_id": 0,
"created": "2023-06-07T06:43:06Z"
}
Properties
Fields | Type | Description |
---|---|---|
id read-only | integer | Event's unique identifier |
type | string | |
status | string | |
object | string | |
object_id | integer | |
created | dateTime |
Group
{
"object": "Group",
"id": 784568,
"name": "VIP Customers",
"alias": "vip-customers"
}
Properties
Fields | Type | Description |
---|---|---|
object read-only | string | |
id read-only | integer | Group's unique identifier |
name | string | |
alias read-only | string |
Listing
{
"id": 645646,
"object": "Listing",
"attributes": "[]",
"category": {
"id": 432432,
"object": "Category",
"title": "string",
"url": "string"
},
"category_id": 432432,
"city": "New York City",
"country": "US",
"cover": "string",
"currency": "USD",
"date_online": "2023-06-07T06:43:06Z",
"description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dignissim laoreet sem, quis mollis elit rutrum a. Donec nunc urna, rhoncus in sagittis ut, elementum scelerisque libero. Quisque interdum nibh nisl, non gravida nibh molestie quis. Phasellus nunc nunc, luctus a luctus ac, iaculis sit amet turpis.</p><p>Phasellus tortor orci, posuere in mi at, blandit ullamcorper tellus. Proin vel sem aliquam, faucibus dolor quis, dictum leo. Aliquam consectetur massa at ipsum auctor, at mattis nunc porttitor. Suspendisse potenti. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>",
"external_id": "INTERNAL_REF_234324",
"lat": 40.7572114,
"lng": -73.9913385,
"location": "253 W 42nd St, New York, NY 10036, United States",
"min_qty": 1,
"medias": "string",
"order_type_id": 986545,
"price": 123.5,
"price_unit": null,
"price_with_currency": "$123.50",
"quantity": 43,
"quantity_selector": null,
"requires_shipping": true,
"shipping_methods": [
{}
],
"slug": "listing-s-slug",
"state": "NY",
"status": "out_of_stock",
"supplier": {
"id": 545353,
"object": "User",
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group": [],
"group_alias": "string",
"group_id": 784568,
"group_name": "string",
"lang": "string",
"last_name": "Doe",
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"profile_url": "string",
"public_name": "John Doe",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
},
"supplier_id": 655785,
"title": "Listing's title",
"url": "string",
"variants": {
"id": 432432,
"object": "Variant",
"external_id": "INTERNAL_REF_234324",
"listing_id": 324353,
"price": 123.5,
"price_unit": null,
"quantity": 10,
"sort_priority": 10,
"sku": "BASKT-XYZ-BLN-41",
"title": "Blue Shoes Size 41",
"weight": 0.8
},
"valid_until": "2023-06-07T06:43:06Z",
"weight": 0.8
}
Properties
Fields | Type | Description |
---|---|---|
id read-only | integer | Listing's unique identifier |
object read-only | string | |
attributes | [any] | |
category | Category | |
category_id - required | integer | Category's unique identifier |
city | string¦null | |
country | string¦null | |
cover read-only | string¦null | |
currency | string | |
date_online | dateTime | |
description | string¦null | |
external_id | string¦null | |
lat | number¦null | |
lng | number¦null | |
location | string¦null | |
min_qty | number¦null | |
medias | string | |
order_type_id - required | integer | Order type's unique identifier |
price | number¦null | |
price_unit | integer¦null | |
price_with_currency read-only | string | |
quantity | integer¦null | |
quantity_selector | string¦null | |
requires_shipping | boolean | |
shipping_methods | [object] | |
» id | integer | |
» carrier_alias | string | |
» price | number | |
» sort_priority | number | |
» step_price | number | |
» title | string | |
slug | string¦null | |
state | string¦null | |
status | string | |
supplier | User | |
supplier_id - required | integer | Supplier's unique identifier |
title - required | string | |
url read-only | string | |
variants | Variant | |
valid_until | dateTime | |
weight | number |
Metafield
{
"namespace": "string",
"title": "string",
"value": "string",
"value_type": "string"
}
Properties
Fields | Type | Description |
---|---|---|
namespace | string | |
title | string | |
value | string | |
value_type | string |
Order
{
"id": 0,
"object": "string",
"number": "string",
"order_number": "string",
"amount": 0,
"currency": "string",
"amount_with_currency": 0,
"status": "string",
"refusal_reason": "string",
"supplier": {
"id": 545353,
"object": "User",
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group": [],
"group_alias": "string",
"group_id": 784568,
"group_name": "string",
"lang": "string",
"last_name": "Doe",
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"profile_url": "string",
"public_name": "John Doe",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
},
"customer": {
"id": 545353,
"object": "User",
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {
"profession": "Web developer"
},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group": [],
"group_alias": "string",
"group_id": 784568,
"group_name": "string",
"lang": "string",
"last_name": "Doe",
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"profile_url": "string",
"public_name": "John Doe",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
},
"checkout_message": "string",
"customer_url": "string",
"supplier_url": "string",
"checkout_at": "2023-06-07T06:43:06Z",
"fulfillment_status": "started",
"shippings": {
"id": 0,
"amount": 0,
"title": "string",
"tracking_number": "string",
"tracking_url": "string",
"address": {}
},
"shipping_fees_destination": "platform",
"payout": {
"status": "string",
"amount": 0,
"currency_code": "string",
"requested_at": "2023-06-07T06:43:06Z",
"completed_at": "2023-06-07T06:43:06Z",
"arrival_date": "2023-06-07T06:43:06Z"
},
"smart_fees": [
{}
],
"order_items": [
{}
]
}
Properties
Fields | Type | Description |
---|---|---|
id read-only | integer | Order's unique identifier |
object | string | |
number | string | |
order_number | string | |
amount | number | |
currency | string | |
amount_with_currency | number | |
status | string | |
refusal_reason | string | |
supplier | User | |
customer | User | |
checkout_message | string | |
customer_url | string | |
supplier_url | string | |
checkout_at | dateTime | |
fulfillment_status | string | |
shippings | Shippings | |
shipping_fees_destination | string | |
payout | Payout | |
smart_fees | [SmartFees] | |
order_items | [OrderItem] |
Enumerated Values
Property | Value |
---|---|
fulfillment_status | started |
fulfillment_status | scheduled |
fulfillment_status | prepared |
fulfillment_status | shipped |
fulfillment_status | in_transit |
fulfillment_status | available |
fulfillment_status | delivered |
fulfillment_status | executed |
fulfillment_status | canceled |
fulfillment_status | error |
shipping_fees_destination | platform |
shipping_fees_destination | supplier |
OrderItem
{
"object": "string",
"id": 0,
"add_ons": [
null
],
"amount": 0,
"configurable_options": [
null
],
"currency": "string",
"downloadable_assets": [
null
],
"listing": {
"id": 645646,
"object": "Listing",
"attributes": "[]",
"category": {},
"category_id": 432432,
"city": "New York City",
"country": "US",
"cover": "string",
"currency": "USD",
"date_online": "2023-06-07T06:43:06Z",
"description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dignissim laoreet sem, quis mollis elit rutrum a. Donec nunc urna, rhoncus in sagittis ut, elementum scelerisque libero. Quisque interdum nibh nisl, non gravida nibh molestie quis. Phasellus nunc nunc, luctus a luctus ac, iaculis sit amet turpis.</p><p>Phasellus tortor orci, posuere in mi at, blandit ullamcorper tellus. Proin vel sem aliquam, faucibus dolor quis, dictum leo. Aliquam consectetur massa at ipsum auctor, at mattis nunc porttitor. Suspendisse potenti. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>",
"external_id": "INTERNAL_REF_234324",
"lat": 40.7572114,
"lng": -73.9913385,
"location": "253 W 42nd St, New York, NY 10036, United States",
"min_qty": 1,
"medias": "string",
"order_type_id": 986545,
"price": 123.5,
"price_unit": null,
"price_with_currency": "$123.50",
"quantity": 43,
"quantity_selector": null,
"requires_shipping": true,
"shipping_methods": [],
"slug": "listing-s-slug",
"state": "NY",
"status": "out_of_stock",
"supplier": {},
"supplier_id": 655785,
"title": "Listing's title",
"url": "string",
"variants": {},
"valid_until": "2023-06-07T06:43:06Z",
"weight": 0.8
},
"listing_id": 0,
"listing_image": "string",
"listing_sku": "string",
"listing_title": "string",
"listing_unit_price": 0,
"listing_weight": 0,
"qty": 0,
"token": "string",
"properties": [
null
]
}
Properties
Fields | Type | Description |
---|---|---|
object read-only | string | |
id read-only | integer | Order item's unique identifier |
add_ons | [any] | |
amount | integer | |
configurable_options | [any] | |
currency | string | |
downloadable_assets | [any] | |
listing | Listing | |
listing_id | integer | |
listing_image | string | |
listing_sku | string | |
listing_title | string | |
listing_unit_price | number | |
listing_weight | number | |
qty | number | |
token | string | |
properties | [any] |
Payout
{
"status": "string",
"amount": 0,
"currency_code": "string",
"requested_at": "2023-06-07T06:43:06Z",
"completed_at": "2023-06-07T06:43:06Z",
"arrival_date": "2023-06-07T06:43:06Z"
}
Properties
Fields | Type | Description |
---|---|---|
status | string | The payout status depends on your PSP. Please refer to their documentation |
amount | integer | The payout amount in cents |
currency_code | string | Three-letter ISO 4217 currency code, in lowercase |
requested_at | dateTime | The payout has been requested to the PSP |
completed_at | string(date-time)¦null | The payout has been submitted to the bank by the PSP |
arrival_date | string(date-time)¦null | Date of arrival of the funds in the bank account |
ShippingRates
{
"id": "432424",
"price": "6.95",
"step_price": "1.45",
"always_selected": true,
"title": "Standard",
"tracking_number": null,
"tracking_url": null
}
Properties
Fields | Type | Description |
---|---|---|
id read-only | integer | Shipping rate's unique identifier |
price | number | |
step_price | number | |
always_selected | boolean | |
title | string | |
tracking_number | string¦null | |
tracking_url | string¦null |
Shippings
{
"id": 0,
"amount": 0,
"title": "string",
"tracking_number": "string",
"tracking_url": "string",
"address": {
"id": 0,
"object": "string",
"city": "string",
"country": "string",
"mobile": "string",
"name": "string",
"phone": "string",
"postcode": "string",
"state": "string",
"street": "string",
"street_option": "string"
}
}
Properties
Fields | Type | Description |
---|---|---|
id read-only | integer | |
amount | number | |
title | string | |
tracking_number | string | |
tracking_url | string | |
address | object | |
» id | integer | |
» object | string | |
» city | string | |
» country | string | |
» mobile | string | |
» name | string | First name and last name |
» phone | string | |
» postcode | string | |
» state | string | |
» street | string | |
» street_option | string |
SmartFees
{
"fee_target": "string",
"rule_title": "string",
"fee_amount": "string"
}
Properties
Fields | Type | Description |
---|---|---|
fee_target | string | |
rule_title | string | |
fee_amount | string |
User
{
"id": 545353,
"object": "User",
"account_type": "individual",
"address_city": "New-York City",
"address_country": "US",
"address_line1": "253 W 42nd St",
"address_line2": null,
"address_state": "NY",
"address_zipcode": "NY 10036",
"attributes": {
"profession": "Web developer"
},
"avatar": "string",
"business_name": "ACME",
"can_post_listing": true,
"created": "2023-06-07T06:43:06Z",
"email": "admin@acme.com",
"first_name": "John",
"group": [
{}
],
"group_alias": "string",
"group_id": 784568,
"group_name": "string",
"lang": "string",
"last_name": "Doe",
"locale": "en",
"note": "4.5",
"phone_country_number": "+1",
"phone_number": "212-398-2600",
"profile_url": "string",
"public_name": "John Doe",
"status": "enabled",
"review_count": "3",
"timezone": "America/New_York",
"username": "BestJohnDoe"
}
User resource
Properties
Fields | Type | Description |
---|---|---|
id read-only | integer | User's unique identifier |
object read-only | string | |
account_type | string | |
address_city | string | |
address_country | string | |
address_line1 | string¦null | |
address_line2 | string¦null | |
address_state | string¦null | |
address_zipcode | string¦null | |
attributes | [any]¦null | |
avatar | string¦null | Absolute URL of the profile image |
business_name | string¦null | Company or organization name |
can_post_listing | boolean | |
created | dateTime | |
email - required | string | |
first_name | string¦null | |
group read-only | [Group] | |
group_alias read-only | string | |
group_id - required | integer | |
group_name read-only | string | |
lang read-only | string | |
last_name read-only | string | |
locale | string¦null | |
note | integer | Average note based on reviews |
phone_country_number | string¦null | |
phone_number | string¦null | |
profile_url read-only | string | |
public_name read-only | string | |
status | string | Account status. Possible values are "enabled2" or "disabled" |
review_count | integer | |
timezone | string | |
username | string¦null |
Enumerated Values
Property | Value |
---|---|
account_type | individual |
account_type | company |
account_type | non-profit |
status | enabled |
status | disabled |
Variant
{
"id": 432432,
"object": "Variant",
"external_id": "INTERNAL_REF_234324",
"listing_id": 324353,
"price": 123.5,
"price_unit": null,
"quantity": 10,
"sort_priority": 10,
"sku": "BASKT-XYZ-BLN-41",
"title": "Blue Shoes Size 41",
"weight": 0.8
}
Properties
Fields | Type | Description |
---|---|---|
id read-only | integer | Variant's unique identifier |
object read-only | string | |
external_id | string¦null | |
listing_id | integer | |
price | number¦null | |
price_unit | integer¦null | |
quantity | number¦null | The quantity of the variant that is available for sale |
sort_priority | number¦null | Sorts the variants with the lowest number first. Negative numbers are allowed. |
sku | string¦null | |
title - required | string | |
weight | number |
Types Reference
Our API utilizes following types:
Type | Description | Example |
---|---|---|
boolean | true or false | true |
date | date in Y-m-d format | 2023-02-20 |
dateTime | date in c format | 2023-02-20T09:18:15.000+01:0 |
float | a floating-point number with . used as the separator | 123.45 |
integer | a 32-bit signed integer | 12345678 |
string | an UTF-8 string of variadic length | Hello World! |