Stocks

Elenco delle giacenze

Stocks

Questo endpoint permette di ottenere l'elenco delle giacenze.

GET https://api.gsped.it/[ISTANZA]/Stocks

Query parameters

Name
Type
Description

client_id*

int

ID del cliente (o del cliente fatturato)

days

int

Recupera giacenze aperte negli ultimi X giorni (minimo 1, massimo 90, default 10)

Headers

Name
Type
Description

x-api-key*

string

API key fornita da Gsped

{
    "status": 200,
    "response": [
        {...},
        {...},
    ]
}

Snippets codice di esempio

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.gsped.it/sandbox/Stocks?client_id=123",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_POSTFIELDS => "",
  CURLOPT_HTTPHEADER => [
    "x-api-key: YOUR-API-KEY"
  ],
]);

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

curl_close($curl);

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

Last updated

Was this helpful?