Skip to main content
POST
/
v1
/
availability
/
recalculate
Recalculate availability scores
curl --request POST \
  --url http://localhost:3000/v1/availability/recalculate \
  --header 'Content-Type: application/json' \
  --data '
{
  "product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "only_rfc_items": false,
  "limit": 500
}
'
import requests

url = "http://localhost:3000/v1/availability/recalculate"

payload = {
    "product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "only_rfc_items": False,
    "limit": 500
}
headers = {"Content-Type": "application/json"}

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

print(response.text)
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    only_rfc_items: false,
    limit: 500
  })
};

fetch('http://localhost:3000/v1/availability/recalculate', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_PORT => "3000",
  CURLOPT_URL => "http://localhost:3000/v1/availability/recalculate",
  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([
    'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'only_rfc_items' => false,
    'limit' => 500
  ]),
  CURLOPT_HTTPHEADER => [
    "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 := "http://localhost:3000/v1/availability/recalculate"

	payload := strings.NewReader("{\n  \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"only_rfc_items\": false,\n  \"limit\": 500\n}")

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

	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("http://localhost:3000/v1/availability/recalculate")
  .header("Content-Type", "application/json")
  .body("{\n  \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"only_rfc_items\": false,\n  \"limit\": 500\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("http://localhost:3000/v1/availability/recalculate")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"only_rfc_items\": false,\n  \"limit\": 500\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "updated": 123,
  "errors": 123,
  "result": {
    "score": 123,
    "tier": "<string>",
    "confidence": {
      "level": "<string>",
      "lower": 123,
      "upper": 123
    },
    "total_events": 123,
    "events_by_type": {},
    "events_by_location": {}
  }
}

Body

application/json
product_id
string<uuid>
only_rfc_items
boolean
default:false
limit
integer
Required range: 1 <= x <= 1000

Response

200 - application/json

Recalculation result

success
boolean
required
updated
number
required
errors
number
required
result
object