Update product (offer) availability by id
curl --request PUT \
--url https://api.fourthwall.com/open-api/v1.0/products/{productId}/availability \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"available": true
}
'import requests
url = "https://api.fourthwall.com/open-api/v1.0/products/{productId}/availability"
payload = { "available": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({available: true})
};
fetch('https://api.fourthwall.com/open-api/v1.0/products/{productId}/availability', 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.fourthwall.com/open-api/v1.0/products/{productId}/availability",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'available' => true
]),
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.fourthwall.com/open-api/v1.0/products/{productId}/availability"
payload := strings.NewReader("{\n \"available\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.fourthwall.com/open-api/v1.0/products/{productId}/availability")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"available\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fourthwall.com/open-api/v1.0/products/{productId}/availability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"available\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"name": "My t-shirt",
"slug": "my-t-shirt",
"description": "My t-shirt description",
"state": {
"type": "<string>"
},
"access": {
"type": "<string>"
},
"images": [
{
"id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"url": "https://fourthwall.com/image.png",
"width": 800,
"height": 600,
"transformedUrl": "https://fourthwall.com/image.png"
}
],
"variants": [
{
"id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"name": "My t-shirt - Black, L",
"sku": "WDEK-DRE200L",
"unitPrice": {
"value": 10,
"currency": "USD"
},
"attributes": {
"description": "Black, L",
"color": {
"name": "Black",
"swatch": "#000000"
},
"size": {
"name": "L"
}
},
"stock": {
"type": "<string>",
"inStock": 5
},
"weight": {
"value": 1,
"unit": "kg"
},
"dimensions": {
"length": 1,
"width": 2,
"height": 3,
"unit": "cm"
},
"images": [
{
"id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"url": "https://fourthwall.com/image.png",
"width": 800,
"height": 600,
"transformedUrl": "https://fourthwall.com/image.png"
}
],
"compareAtPrice": {
"value": 10,
"currency": "USD"
},
"unitCost": {
"value": 10,
"currency": "USD"
},
"creatorDeclaredCost": {
"value": 10,
"currency": "USD"
},
"thumbnailImage": {
"id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"url": "https://fourthwall.com/image.png",
"width": 800,
"height": 600,
"transformedUrl": "https://fourthwall.com/image.png"
}
}
],
"createdAt": "2020-08-13T09:05:36.939Z",
"updatedAt": "2020-08-13T09:05:36.939Z",
"thumbnailImage": {
"id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"url": "https://fourthwall.com/image.png",
"width": 800,
"height": 600,
"transformedUrl": "https://fourthwall.com/image.png"
},
"additionalInformation": {
"sizeAndFit": "<string>",
"guaranteeAndReturns": "<string>",
"moreDetails": "<string>"
},
"sizeGuide": {
"fitGuideUrls": [
"<string>"
],
"previewUrl": "<string>",
"fileUrl": "<string>",
"description": "<string>",
"fitGuideDescription": "<string>"
},
"digitalFiles": [
{
"uri": "https://storage.googleapis.com/bucket/shop/offer/file",
"name": "my-ebook.pdf",
"fileSize": "15.4 MB",
"mediaType": "application/pdf"
}
]
}Products
Update Product Availability
Toggle whether a product is visible and available for purchase on your storefront
PUT
/
open-api
/
v1.0
/
products
/
{productId}
/
availability
Update product (offer) availability by id
curl --request PUT \
--url https://api.fourthwall.com/open-api/v1.0/products/{productId}/availability \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"available": true
}
'import requests
url = "https://api.fourthwall.com/open-api/v1.0/products/{productId}/availability"
payload = { "available": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({available: true})
};
fetch('https://api.fourthwall.com/open-api/v1.0/products/{productId}/availability', 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.fourthwall.com/open-api/v1.0/products/{productId}/availability",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'available' => true
]),
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.fourthwall.com/open-api/v1.0/products/{productId}/availability"
payload := strings.NewReader("{\n \"available\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.fourthwall.com/open-api/v1.0/products/{productId}/availability")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"available\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fourthwall.com/open-api/v1.0/products/{productId}/availability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"available\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"name": "My t-shirt",
"slug": "my-t-shirt",
"description": "My t-shirt description",
"state": {
"type": "<string>"
},
"access": {
"type": "<string>"
},
"images": [
{
"id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"url": "https://fourthwall.com/image.png",
"width": 800,
"height": 600,
"transformedUrl": "https://fourthwall.com/image.png"
}
],
"variants": [
{
"id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"name": "My t-shirt - Black, L",
"sku": "WDEK-DRE200L",
"unitPrice": {
"value": 10,
"currency": "USD"
},
"attributes": {
"description": "Black, L",
"color": {
"name": "Black",
"swatch": "#000000"
},
"size": {
"name": "L"
}
},
"stock": {
"type": "<string>",
"inStock": 5
},
"weight": {
"value": 1,
"unit": "kg"
},
"dimensions": {
"length": 1,
"width": 2,
"height": 3,
"unit": "cm"
},
"images": [
{
"id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"url": "https://fourthwall.com/image.png",
"width": 800,
"height": 600,
"transformedUrl": "https://fourthwall.com/image.png"
}
],
"compareAtPrice": {
"value": 10,
"currency": "USD"
},
"unitCost": {
"value": 10,
"currency": "USD"
},
"creatorDeclaredCost": {
"value": 10,
"currency": "USD"
},
"thumbnailImage": {
"id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"url": "https://fourthwall.com/image.png",
"width": 800,
"height": 600,
"transformedUrl": "https://fourthwall.com/image.png"
}
}
],
"createdAt": "2020-08-13T09:05:36.939Z",
"updatedAt": "2020-08-13T09:05:36.939Z",
"thumbnailImage": {
"id": "00aa4abd-5778-4199-8161-0b49b2f212e5",
"url": "https://fourthwall.com/image.png",
"width": 800,
"height": 600,
"transformedUrl": "https://fourthwall.com/image.png"
},
"additionalInformation": {
"sizeAndFit": "<string>",
"guaranteeAndReturns": "<string>",
"moreDetails": "<string>"
},
"sizeGuide": {
"fitGuideUrls": [
"<string>"
],
"previewUrl": "<string>",
"fileUrl": "<string>",
"description": "<string>",
"fitGuideDescription": "<string>"
},
"digitalFiles": [
{
"uri": "https://storage.googleapis.com/bucket/shop/offer/file",
"name": "my-ebook.pdf",
"fileSize": "15.4 MB",
"mediaType": "application/pdf"
}
]
}OAuth scope:
offer_writeAPI keys have full access to this endpoint.This endpoint does not update inventory quantities. It only toggles product visibility on your storefront.
- Setting
available: truemakes the product visible and purchasable - Setting
available: falsehides the product from your storefront
Authorizations
oauthbasicAuth
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Body
application/json
Response
OK
Example:
"00aa4abd-5778-4199-8161-0b49b2f212e5"
Example:
"My t-shirt"
Example:
"my-t-shirt"
Example:
"My t-shirt description"
Available options:
STANDARD, GIFT_CARD, UNKNOWN - Available
- Available
- Sold Out
Show child attributes
Show child attributes
- Archived
- Archived
- Archived
- Archived
- Hidden
- Private
- Public
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Example:
"2020-08-13T09:05:36.939Z"
Example:
"2020-08-13T09:05:36.939Z"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Digital files attached to this offer. Only present for digital offers.
Show child attributes
Show child attributes
⌘I