Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Update variant inventory quantity
cURL
curl --request PATCH \ --url https://admin.fanfare.io/api/products/{productId}/variants/{variantId}/inventory \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "inventoryQuantity": 123 } '
const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: JSON.stringify({inventoryQuantity: 123}) }; fetch('https://admin.fanfare.io/api/products/{productId}/variants/{variantId}/inventory', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
import requests url = "https://admin.fanfare.io/api/products/{productId}/variants/{variantId}/inventory" payload = { "inventoryQuantity": 123 } headers = { "Authorization": "Bearer <token>", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.text)
package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://admin.fanfare.io/api/products/{productId}/variants/{variantId}/inventory" payload := strings.NewReader("{\n \"inventoryQuantity\": 123\n}") req, _ := http.NewRequest("PATCH", 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)) }
{ "archived": true, "createdAt": "2023-11-07T05:31:56Z", "createdBy": "<string>", "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "inventoryPolicy": "untracked", "inventoryQuantity": 123, "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "price": "<string>", "productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "sku": "<string>", "metadata": {}, "primaryExternalId": "<string>", "primaryLastSyncedAt": "2023-11-07T05:31:56Z", "primarySourceVendor": "<string>", "primarySyncSourceId": "<string>", "updatedAt": "2023-11-07T05:31:56Z", "updatedBy": "<string>" }
{ "error": "validation_error", "issues": [ { "expected": "<string>", "kind": "<string>", "message": "<string>", "path": [ { "input": "<unknown>", "key": "<string>", "origin": "<string>", "type": "<string>" } ], "received": "<string>", "type": "<string>" } ] }
{ "error": "<string>" }
Fanfare secret key. Keep secret credentials on your server.
Variant inventory updated successfully
untracked
deny
continue
^\d{1,12}(\.\d{1,8})?$
1
Show child attributes