Set on-hand stock for many SKUs
curl --request POST \
--url https://api-v2.riqra.com/public/v1/stock/levels/set \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"sku": "SKU-001",
"locationId": "0b2e9f5a-1c3d-4e6f-8a9b-0c1d2e3f4a5b",
"onHand": 42
}
]
}
'import requests
url = "https://api-v2.riqra.com/public/v1/stock/levels/set"
payload = { "items": [
{
"sku": "SKU-001",
"locationId": "0b2e9f5a-1c3d-4e6f-8a9b-0c1d2e3f4a5b",
"onHand": 42
}
] }
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({
items: [
{sku: 'SKU-001', locationId: '0b2e9f5a-1c3d-4e6f-8a9b-0c1d2e3f4a5b', onHand: 42}
]
})
};
fetch('https://api-v2.riqra.com/public/v1/stock/levels/set', 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-v2.riqra.com/public/v1/stock/levels/set",
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([
'items' => [
[
'sku' => 'SKU-001',
'locationId' => '0b2e9f5a-1c3d-4e6f-8a9b-0c1d2e3f4a5b',
'onHand' => 42
]
]
]),
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-v2.riqra.com/public/v1/stock/levels/set"
payload := strings.NewReader("{\n \"items\": [\n {\n \"sku\": \"SKU-001\",\n \"locationId\": \"0b2e9f5a-1c3d-4e6f-8a9b-0c1d2e3f4a5b\",\n \"onHand\": 42\n }\n ]\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-v2.riqra.com/public/v1/stock/levels/set")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"sku\": \"SKU-001\",\n \"locationId\": \"0b2e9f5a-1c3d-4e6f-8a9b-0c1d2e3f4a5b\",\n \"onHand\": 42\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.riqra.com/public/v1/stock/levels/set")
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 \"items\": [\n {\n \"sku\": \"SKU-001\",\n \"locationId\": \"0b2e9f5a-1c3d-4e6f-8a9b-0c1d2e3f4a5b\",\n \"onHand\": 42\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"sku": "<string>",
"locationId": "<string>",
"status": 200,
"onHand": 123,
"committed": 123,
"available": 123,
"code": "<string>",
"message": "<string>"
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}Stock
Set on-hand stock for many SKUs
Absolute SET of the on-hand quantity per (sku, location). Requires the stock:write scope. Reservations (committed) are system-owned and never written here. The request is 200 when structurally valid; each row carries its own status in the results array.
POST
/
stock
/
levels
/
set
Set on-hand stock for many SKUs
curl --request POST \
--url https://api-v2.riqra.com/public/v1/stock/levels/set \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"sku": "SKU-001",
"locationId": "0b2e9f5a-1c3d-4e6f-8a9b-0c1d2e3f4a5b",
"onHand": 42
}
]
}
'import requests
url = "https://api-v2.riqra.com/public/v1/stock/levels/set"
payload = { "items": [
{
"sku": "SKU-001",
"locationId": "0b2e9f5a-1c3d-4e6f-8a9b-0c1d2e3f4a5b",
"onHand": 42
}
] }
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({
items: [
{sku: 'SKU-001', locationId: '0b2e9f5a-1c3d-4e6f-8a9b-0c1d2e3f4a5b', onHand: 42}
]
})
};
fetch('https://api-v2.riqra.com/public/v1/stock/levels/set', 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-v2.riqra.com/public/v1/stock/levels/set",
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([
'items' => [
[
'sku' => 'SKU-001',
'locationId' => '0b2e9f5a-1c3d-4e6f-8a9b-0c1d2e3f4a5b',
'onHand' => 42
]
]
]),
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-v2.riqra.com/public/v1/stock/levels/set"
payload := strings.NewReader("{\n \"items\": [\n {\n \"sku\": \"SKU-001\",\n \"locationId\": \"0b2e9f5a-1c3d-4e6f-8a9b-0c1d2e3f4a5b\",\n \"onHand\": 42\n }\n ]\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-v2.riqra.com/public/v1/stock/levels/set")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"sku\": \"SKU-001\",\n \"locationId\": \"0b2e9f5a-1c3d-4e6f-8a9b-0c1d2e3f4a5b\",\n \"onHand\": 42\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.riqra.com/public/v1/stock/levels/set")
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 \"items\": [\n {\n \"sku\": \"SKU-001\",\n \"locationId\": \"0b2e9f5a-1c3d-4e6f-8a9b-0c1d2e3f4a5b\",\n \"onHand\": 42\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"sku": "<string>",
"locationId": "<string>",
"status": 200,
"onHand": 123,
"committed": 123,
"available": 123,
"code": "<string>",
"message": "<string>"
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}Autorizaciones
Public API key presented as Authorization: Bearer rq_live_….
Cuerpo
application/json
Required array length:
1 - 100 elementsShow child attributes
Show child attributes
Respuesta
Per-row results.
One result per requested item, in request order.
Show child attributes
Show child attributes
⌘I