curl --request GET \
--url https://api.mercemur.com/api/v1/products \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mercemur.com/api/v1/products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mercemur.com/api/v1/products"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mercemur.com/api/v1/products"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mercemur.com/api/v1/products",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": [
{
"attributes": {},
"created_at": "<string>",
"description": null,
"discountable": true,
"handle": "<string>",
"height": null,
"hs_code": null,
"id": "<string>",
"images": [
{
"alt_text": null,
"id": "<string>",
"rank": 123,
"url": "<string>"
}
],
"length": null,
"material": null,
"meta_description": null,
"meta_title": null,
"mid_code": null,
"options": [
{
"id": "<string>",
"title": "<string>",
"values": [
"<string>"
]
}
],
"origin_country": null,
"published_at": null,
"status": "<string>",
"subtitle": null,
"thumbnail": null,
"title": "<string>",
"type_id": "<string>",
"unpublish_at": null,
"updated_at": "<string>",
"variants": [
{
"allow_backorder": true,
"currency_code": "<string>",
"id": "<string>",
"manage_inventory": true,
"price_minor": 123,
"requires_shipping": true,
"selections": {
"Color": "<string>",
"Size": "<string>"
},
"sku": null,
"title": "<string>",
"variant_rank": 123
}
],
"weight": null,
"width": null
}
],
"page": {
"has_more": true,
"next_cursor": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>",
"reason": "malformed_json"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>",
"reason": "malformed_json"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>",
"reason": "malformed_json"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>",
"reason": "malformed_json"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>",
"reason": "malformed_json"
}
}List products
The store’s products, newest first. ?updated_after= SELECTS A DIFFERENT ORDERING rather than filtering this one. The default walk descends created_at; with updated_after the list climbs updated_at ASCENDING, which is what makes an incremental sync safe over a mutable column: a product edited while you are paging moves FORWARD past your cursor and is handed to you again, instead of moving behind it and being skipped silently. A CURSOR BELONGS TO ONE WALK. Both carry a timestamp but compare it against different columns, so a cursor from the default list sent with updated_after is refused, and so is the reverse. Continue a sync walk by sending updated_after on every page along with the cursor. EXPECT TO SEE A ROW TWICE rather than to miss one: that is the trade this ordering makes, and it is the right way round for reconciliation. ?handle= resolves a storefront URL segment to a product. It is unique per store, so it returns at most one row.
curl --request GET \
--url https://api.mercemur.com/api/v1/products \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mercemur.com/api/v1/products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mercemur.com/api/v1/products"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mercemur.com/api/v1/products"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mercemur.com/api/v1/products",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": [
{
"attributes": {},
"created_at": "<string>",
"description": null,
"discountable": true,
"handle": "<string>",
"height": null,
"hs_code": null,
"id": "<string>",
"images": [
{
"alt_text": null,
"id": "<string>",
"rank": 123,
"url": "<string>"
}
],
"length": null,
"material": null,
"meta_description": null,
"meta_title": null,
"mid_code": null,
"options": [
{
"id": "<string>",
"title": "<string>",
"values": [
"<string>"
]
}
],
"origin_country": null,
"published_at": null,
"status": "<string>",
"subtitle": null,
"thumbnail": null,
"title": "<string>",
"type_id": "<string>",
"unpublish_at": null,
"updated_at": "<string>",
"variants": [
{
"allow_backorder": true,
"currency_code": "<string>",
"id": "<string>",
"manage_inventory": true,
"price_minor": 123,
"requires_shipping": true,
"selections": {
"Color": "<string>",
"Size": "<string>"
},
"sku": null,
"title": "<string>",
"variant_rank": 123
}
],
"weight": null,
"width": null
}
],
"page": {
"has_more": true,
"next_cursor": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>",
"reason": "malformed_json"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>",
"reason": "malformed_json"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>",
"reason": "malformed_json"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>",
"reason": "malformed_json"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resource": "<string>",
"field": "<string>",
"reason": "malformed_json"
}
}Authorizations
A secret API key. Publishable keys cannot reach this API. A key may carry an expiry, and an expired key is refused exactly like an unknown one, with a 401 that names no reason; check the key's expires_at in the dashboard rather than inferring it from a response. When a merchant rolls a key's secret they choose a grace window of up to 3 days, and for its duration BOTH the new secret and the one it replaced authenticate, so an integration moves over on its own deploy schedule instead of at the instant the button is pressed. Move before the window closes: after it, the old secret is refused. Nothing else about this contract moves with a roll. The key keeps its id and its scopes, so the only thing an integration updates is the credential itself.
Query Parameters
One product by its storefront URL segment, which is unique per store, so a page can be resolved in one call rather than by walking the catalogue. An EMPTY value is a 400 rather than "no filter": it would otherwise return the whole catalogue to a caller that believes it holds one product.
Products in one state. An unrecognised value is a 400 naming the accepted set, not an empty page, because an empty page is indistinguishable from a store with none.
Products touched at or after this RFC3339 instant, for reconciling a catalogue incrementally instead of re-reading it. It does NOT filter this list: supplying it SELECTS A DIFFERENT ORDERING. The default walk descends created_at; this one climbs updated_at, because that is the only ordering in which a keyset walk over a mutable column cannot skip a row. A product edited mid-walk moves forward past your position and is returned again, so the walk is AT LEAST ONCE: apply the state of each row you receive and a repeat costs nothing, while a miss is a price or a title your catalogue never learns about. A cursor from one ordering is refused by the other, since the same position means something different in each.
Rows per page. Out of range is a 400 rather than a silent clamp, so a client asking for more than 100 learns it did not get it.
1 <= x <= 100The next_cursor from the previous page. Opaque: decode nothing from it and construct nothing by hand, since its encoding is not part of this contract. Omit it to read the first page.