Skip to main content
POST
/
products
/
{product}
/
back-in-stock
Register for a back-in-stock notification
curl --request POST \
  --url https://api.marzipan.co/v1/products/{product}/back-in-stock \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "ada@example.com",
  "market": "uk"
}
'
import requests

url = "https://api.marzipan.co/v1/products/{product}/back-in-stock"

payload = {
"email": "ada@example.com",
"market": "uk"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

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

fetch('https://api.marzipan.co/v1/products/{product}/back-in-stock', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.marzipan.co/v1/products/{product}/back-in-stock",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'ada@example.com',
'market' => 'uk'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

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

curl_close($curl);

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

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

func main() {

url := "https://api.marzipan.co/v1/products/{product}/back-in-stock"

payload := strings.NewReader("{\n \"email\": \"ada@example.com\",\n \"market\": \"uk\"\n}")

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

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

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.marzipan.co/v1/products/{product}/back-in-stock")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"ada@example.com\",\n \"market\": \"uk\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.marzipan.co/v1/products/{product}/back-in-stock")

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

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

response = http.request(request)
puts response.read_body
{
  "message": "You will be notified when this product is back in stock."
}
{
"message": "The email field is required.",
"errors": {
"email": [
"The email field is required."
]
}
}

Authorizations

Authorization
string
header
required

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

Path Parameters

product
string<uuid>
required

The id of the product to subscribe to.

Body

application/json
email
string<email>
required

Email address to notify when the product is back in stock.

market
string

Optional market/region identifier for the notification context.

Response

The email was registered for a back-in-stock notification.

message
string