LogoLogo
Italiano
Italiano
  • OVERVIEW
    • Etichette in 5 minuti
    • Introduzione
    • Autenticazione
    • Formato Richieste e Risposte
    • Corrieri e servizi
    • Codici Gsped
    • Throttling
  • Spedizioni e Dintorni
    • Shipment
      • Shipment objects
        • carrierData
        • courierSpecificData
        • courierData
          • additional_charges
        • dettagli_ordine
        • dati_colli
        • dettagli_scarico
        • incoterm
        • operativita_destinatario
        • parties
        • qrCode
        • trade_documents
      • Casi d'uso
        • Contrassegni
          • Contrassegno nazionale
          • Contrassegno Internazionale
        • PUDO (punti di ritiro)
        • Ritiro contestuale
        • Servizi accessori
      • Corrieri
        • Corrieri abilitati al PLT(paperless)
        • AlpiExpress
        • ALT
        • Amazon Prime
        • Amazon Shipping
        • Arcese B2C
        • Arco Spedizioni
        • Asendia
        • Bianchi Trasporti
        • Bracchi
        • BRT
        • Ceva
        • Chronopost
        • Colissimo
        • Correos ES
        • Correos Express
        • CSI Logistica
        • Dachser Iberia
        • Db Schenker
        • DHL
          • Resi in franchigia - RGR
        • DHL BENELUX
        • DHL Freight
        • DHL Parcel
        • DHL Paket
        • DHL Parcel DE
        • DHL WLA
        • DSV
        • Dummy 1-10
        • Ecourier
        • Fedex
        • Fercam
        • Ferrari Trasporti
        • Geodis
        • Glovo
        • GLS
        • GLS France
        • GLS Spain
        • HR Parcel
        • Inpost
        • Italsempione
        • Liccardi
        • Lynx
        • Logisticando
        • MBE
        • Milkman
        • Nacex
        • Nexive
        • Paack
        • Poste CH
        • Poste Delivery Business
        • QHD
        • Rhenus Logistics
        • Ribosped
        • San Marino Mail
        • SDA
        • Sendabox
        • Sending
        • Seur
        • Skynet
        • Speditalia
        • Spring
        • Stef
        • Susa
        • SVL
        • Stuart
        • SwissPost
        • Tiesse Zust
        • Tipsa
        • TNT
        • UPS
        • USPS Return
        • VEEPEE
    • ShipmentsList
    • Shipment by DDT Alpha
    • Shipment By DDT Num
    • Shipment Confirm
    • Shipment Confirm By Ddt Num
    • Shipment References
    • Pickup (richieste di ritiro)
    • POD (prove di consegna)
    • RefreshQr
    • Reprint
    • Reprint By Reference
    • Tracking
    • Upload Documents
    • Add Parcel
    • CloseDoc
    • ShipmentFromCourier
  • Gestione Ordini
    • Orders
    • Order To Shipment
  • Rating
    • Rate Comparativa
  • Mail transazionali
    • TransactionalEmail
  • Validation
    • Validation
      • Codice Fiscale (TIN)
      • Partita IVA (VAT)
  • Webhooks
    • Webhooks
      • Webhook Spedizioni
Powered by GitBook
On this page
  • Recupera listato ordini
  • Recupera un ordine e dettagli
  • Caricamento ordini e dettagli
  • Modifica ordini e dettagli di ordine esistente

Was this helpful?

  1. Gestione Ordini

Orders

Caricamento ordini su Gsped

Questo endpoint serve a caricare ordini e relativi dettagli su Gsped per permetterne l'evasione via API o via interfaccia web con conseguente generazione delle etichette di spedizione.

Molto utile quando ci si trova a dover gestire diversi punti di evasione ordini che utilizzano l'interfaccia web di Gsped ma per cui non è possibile attivare un connettore per lo scarico automatico degli ordini.

Recupera listato ordini

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

Headers

Name
Type
Description

x-api-key*

String

APIKEY fornita da Gsped

Query Parameters

Name
Type
Description

id

int[]

seleziona se id IN [id, id, ...]

client_id

int[]

seleziona se client_id IN [client_id, client_id, ...] Eventuali client_id errati o non permessi verranno ignorati

order_ref

string[]

seleziona se order_ref IN [order_ref, order_ref, ...] Ogni stringa max 50 char

email

string

seleziona se email = email Max 50 char

data_ordine_da

Y-m-d

Seleziona se data_ordine ≥ data_ordine_da

data_ordine_a

Y-m-d

Seleziona se data_ordine <= data_ordine_a

status

string[]

seleziona se status IN [status, status, ...] Max 3 char

exclude_status

string[]

seleziona se status NOT IN [status, status, ...] Max 3 char

corriere

int[]

seleziona se corriere IN [corriere, corriere, ...]

exclude_corriere

int[]

seleziona se corriere NOT IN [corriere, corriere, ...]

invoice_number

string[]

seleziona se invoice_number IN [invoice_number, invoice_number, ...]

invoice_date_da

Y-m-d

Seleziona se invoice_date ≥ invoice_date_da

invoice_date_a

Y-m-d

Seleziona se invoice_date <= invoice_date_a

withDetails

1 | 0

Se 1 ritorna anche i dettagli dell'ordine

perPage

1...100

numero di risultati per pagina richiesti

page

int

numero di pagina richiesta

orderBy

id | client_id | order_ref | email | data_ordine | status | corriere | invoice_number | invoice_date

nome del campo su cui ordinare (default id)

order

ASC | DESC

verso dell'ordinamento (default DESC)

{
    "status": 200,
    "errors": [],
    "response": {
        "gType": "list",
        "resource": "ordini",
        "page": "1",
        "totPages": 440,
        "totEntries": 879,
        "entries": 2,
        "ordini": [
            {
                "address": "1 Central Park S, Apartment 507",
                "city": "New York",
                "client_id": "390",
                "contrassegno": "0.00",
                "country_code": "US",
                "corriere": "0",
                "valuta": "EUR",
                "valore_doganale": "150.000",
                "email": "test@test.com",
                "id": "879",
                "assicurazione": "0.00",
                "generic1": null,
                "generic2": null,
                "generic3": null,
                "generic4": null,
                "generic5": null,
                "generic6": null,
                "generic7": null,
                "generic8": null,
                "generic9": null,
                "generic10": null,
                "invoice_date": null,
                "invoice_number": null,
                "name": "Markus Schmid",
                "note": "",
                "order_ref": "TEST_NUOVO_FEDEX",
                "phone": "1123521455",
                "prov": "NY",
                "servizio": "0",
                "tag1": "gsped",
                "totale_lordo": "150.00",
                "vat_code": null,
                "cap": "10019",
                "data_ordine": "2025-02-03 00:00:00",
                "status": "1.0"
            },
            {
                "address": "Rosenweg 6",
                "city": "Feusisberg",
                "client_id": "390",
                "contrassegno": "0.00",
                "country_code": "CH",
                "corriere": "0",
                "valuta": "EUR",
                "valore_doganale": "150.000",
                "email": "test@test.com",
                "id": "878",
                "assicurazione": "0.00",
                "generic1": null,
                "generic2": null,
                "generic3": null,
                "generic4": null,
                "generic5": null,
                "generic6": null,
                "generic7": null,
                "generic8": null,
                "generic9": null,
                "generic10": null,
                "invoice_date": null,
                "invoice_number": null,
                "name": "Markus Schmid",
                "note": "",
                "order_ref": "TEST_NUOVO_FEDEX",
                "phone": "123123123",
                "prov": "FA",
                "servizio": "0",
                "tag1": "gsped",
                "totale_lordo": "150.00",
                "vat_code": null,
                "cap": "8835",
                "data_ordine": "2025-01-31 00:00:00",
                "status": "1.0"
            }
        ],
        "previousPageUrl": null,
        "nextPageUrl": "https://api.gsped.it/testbed/orders?perPage=2&page=2&totEntries=879"
    }
}
{
    "status": 400,
    "errors": [
        "The selected order is invalid. (0)"
    ]
}

Codici di esempio

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.gsped.it/sandbox/orders",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "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;
}
import http.client

conn = http.client.HTTPSConnection("api.gsped.it")

payload = ""

headers = {
    'Content-Type': "application/json",
    'x-api-key': "YOUR-API-KEY"
    }

conn.request("GET", "/sandbox/orders", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.gsped.it/sandbox/orders"

	payload := strings.NewReader("")

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

	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("x-api-key", "YOUR-API-KEY")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("https://api.gsped.it/sandbox/orders"),
    Headers =
    {
        { "x-api-key", "YOUR-API-KEY" },
    },
    Content = new StringContent("")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
curl --request GET \
  --url https://api.gsped.it/sandbox/orders \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: YOUR-API-KEY'

Recupera un ordine e dettagli

GET https://api.gsped.it/[ISTANZA]/Orders/[ID_ORDINE]

Recupera un ordine e i relativi dettagli da Gsped

Headers

Name
Type
Description

x-api-key*

String

APIKEY fornita da Gsped

{
    "address": "piazza ambrosoli 13",
    "city": "alessandria",
    "client_id": 390,
    "cod": 123.45,
    "country": "IT",
    "currency": "EUR",
    "customs_value": 123.45,
    "email": "pippo@pippo.it",
    "id": 1,
    "insurance": 123.45,
    "invoice_date": "2023-06-05",
    "invoice_number": 12345678,
    "name": "mario rossi",
    "notes": "testo delle note",
    "order_ref": "ordrif56780",
    "phone": 1311750253,
    "province": "AL",
    "rows": [
        {
            "country_of_origin": "DE",
            "description": "Descrizione riga ordine",
            "qty": 1,
            "sku": "art3",
        }
    ],
    "total": 0,
    "warehouse": "",
    "zip": 15121
}
{
    "status": false,
    "error": "Invalid API key "
}
{
    "error": "Ordine non trovato",
    "code": 404
}

Snippets codice di esempio

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.gsped.it/sandbox/orders/1",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "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;
}
import http.client

conn = http.client.HTTPSConnection("api.gsped.it")

payload = ""

headers = {
    'Content-Type': "application/json",
    'x-api-key': "YOUR-API-KEY"
    }

conn.request("GET", "/sandbox/orders/1", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.gsped.it/sandbox/orders/1"

	payload := strings.NewReader("")

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

	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("x-api-key", "YOUR-API-KEY")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("https://api.gsped.it/sandbox/orders/1"),
    Headers =
    {
        { "x-api-key", "YOUR-API-KEY" },
    },
    Content = new StringContent("")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
curl --request GET \
  --url https://api.gsped.it/sandbox/orders/1 \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: YOUR-API-KEY'

Caricamento ordini e dettagli

POST https://api.gsped.it/[ISTANZA]/Orders

Permette di caricare gli ordini ed i relativi dettagli su Gsped

Headers

Name
Type
Description

x-api-key*

String

APIKEY fornita da Gsped

Request Body

Name
Type
Description

client_id*

Int

Client ID Gsped

zip*

String

Zipcode Destinatario

city*

String

Città Destinatario

address*

String

Indirizzo Destinatario

name*

String

Nome Destinatario

order_ref*

String

Riferimento ordine

email*

String

Indirizzo email Destinatario

country*

String

Country code iso 2 char

province*

String

Sigla Provincia o Stato

insurance

Float

Valore assicurazione

cod

Float

Valore del contrasssegno

phone*

String

Numero di telefono

rows.description

String

Descrizione dettaglio ordine

warehouse

String

Magazzino

notes

String

Note ordine

rows.qty

Int

Quantità dettaglio

rows.sku

String

SKU dettaglio

rows.country_of_origin

String

Country code iso 2 char di origine della merce

invoice_date

String

Data della fattura dell'ordine

invoice_number

String

Numero della fattura dell'ordine

rows.hs_code

String

HS code dettaglio

rows.barcode_riga

String

Stringa barcode singolo item

rows.prezzo_singolo

String

Prezzo singolo item

rows.peso_riga

String

Peso singolo item

{
  "status": "OK",
  "order_id": 572602
}
{
  "status": false,
  "error": "Invalid API key "
}
{
  "status": "FAILED",
  "error": "Dati ordine non presenti o in formato sbagliato"
}

Snippets codice di esempio

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.gsped.it/sandbox/orders",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\n  \"client_id\": 638,\n  \"order_ref\": \"test-gsped-3\",\n  \"name\": \"mario rossi\",\n  \"address\": \"piazza ambrosoli 13\",\n  \"city\": \"alessandria\",\n  \"zip\": \"15121\",\n  \"province\": \"AL\",\n  \"country\": \"IT\",\n  \"email\": \"pippo@pippo.it\",\n  \"phone\": \"01311750253\",\n  \"cod\": 10,\n  \"insurance\": 0,\n  \"notes\": \"testo delle note\",\n  \"customs_value\": 123.45,\n  \"currency\": \"EUR\",\n  \"warehouse\": \"\",\n  \"tag\" : \"pippo1\",\n  \"rows\": [\n    {\n    \t\"description\" : \"Cosa rossa 1\",\n      \"sku\": \"art3\",\n      \"qty\": 1\n    },\n    {\n    \t\"description\" : \"Cosa rossa 2\",\n      \"sku\": \"art4\",\n      \"qty\": 2\n    }\n  ]\n}",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "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;
}
import http.client

conn = http.client.HTTPSConnection("api.gsped.it")

payload = "{\n  \"client_id\": 638,\n  \"order_ref\": \"test-gsped-3\",\n  \"name\": \"mario rossi\",\n  \"address\": \"piazza ambrosoli 13\",\n  \"city\": \"alessandria\",\n  \"zip\": \"15121\",\n  \"province\": \"AL\",\n  \"country\": \"IT\",\n  \"email\": \"pippo@pippo.it\",\n  \"phone\": \"01311750253\",\n  \"cod\": 10,\n  \"insurance\": 0,\n  \"notes\": \"testo delle note\",\n  \"customs_value\": 123.45,\n  \"currency\": \"EUR\",\n  \"warehouse\": \"\",\n  \"tag\" : \"pippo1\",\n  \"rows\": [\n    {\n    \t\"description\" : \"Cosa rossa 1\",\n      \"sku\": \"art3\",\n      \"qty\": 1\n    },\n    {\n    \t\"description\" : \"Cosa rossa 2\",\n      \"sku\": \"art4\",\n      \"qty\": 2\n    }\n  ]\n}"

headers = {
    'Content-Type': "application/json",
    'x-api-key': "YOUR-API-KEY"
    }

conn.request("POST", "/sandbox/orders", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.gsped.it/sandbox/orders"

	payload := strings.NewReader("{\n  \"client_id\": 638,\n  \"order_ref\": \"test-gsped-3\",\n  \"name\": \"mario rossi\",\n  \"address\": \"piazza ambrosoli 13\",\n  \"city\": \"alessandria\",\n  \"zip\": \"15121\",\n  \"province\": \"AL\",\n  \"country\": \"IT\",\n  \"email\": \"pippo@pippo.it\",\n  \"phone\": \"01311750253\",\n  \"cod\": 10,\n  \"insurance\": 0,\n  \"notes\": \"testo delle note\",\n  \"customs_value\": 123.45,\n  \"currency\": \"EUR\",\n  \"warehouse\": \"\",\n  \"tag\" : \"pippo1\",\n  \"rows\": [\n    {\n    \t\"description\" : \"Cosa rossa 1\",\n      \"sku\": \"art3\",\n      \"qty\": 1\n    },\n    {\n    \t\"description\" : \"Cosa rossa 2\",\n      \"sku\": \"art4\",\n      \"qty\": 2\n    }\n  ]\n}")

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

	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("x-api-key", "YOUR-API-KEY")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("https://api.gsped.it/sandbox/orders"),
    Headers =
    {
        { "x-api-key", "YOUR-API-KEY" },
    },
    Content = new StringContent("{\n  \"client_id\": 638,\n  \"order_ref\": \"test-gsped-3\",\n  \"name\": \"mario rossi\",\n  \"address\": \"piazza ambrosoli 13\",\n  \"city\": \"alessandria\",\n  \"zip\": \"15121\",\n  \"province\": \"AL\",\n  \"country\": \"IT\",\n  \"email\": \"pippo@pippo.it\",\n  \"phone\": \"01311750253\",\n  \"cod\": 10,\n  \"insurance\": 0,\n  \"notes\": \"testo delle note\",\n  \"customs_value\": 123.45,\n  \"currency\": \"EUR\",\n  \"warehouse\": \"\",\n  \"tag\" : \"pippo1\",\n  \"rows\": [\n    {\n    \t\"description\" : \"Cosa rossa 1\",\n      \"sku\": \"art3\",\n      \"qty\": 1\n    },\n    {\n    \t\"description\" : \"Cosa rossa 2\",\n      \"sku\": \"art4\",\n      \"qty\": 2\n    }\n  ]\n}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
curl --request POST \
  --url https://api.gsped.it/sandbox/orders \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: YOUR-API-KEY' \
  --data '{
  "client_id": 638,
  "order_ref": "test-gsped-3",
  "name": "mario rossi",
  "address": "piazza ambrosoli 13",
  "city": "alessandria",
  "zip": "15121",
  "province": "AL",
  "country": "IT",
  "email": "pippo@pippo.it",
  "phone": "01311750253",
  "cod": 10,
  "insurance": 0,
  "notes": "testo delle note",
  "customs_value": 123.45,
  "currency": "EUR",
  "warehouse": "",
  "tag" : "pippo1",
  "rows": [
    {
    	"description" : "Cosa rossa 1",
      "sku": "art3",
      "qty": 1
    },
    {
    	"description" : "Cosa rossa 2",
      "sku": "art4",
      "qty": 2
    }
  ]
}'

Modifica ordini e dettagli di ordine esistente

PATCH https://api.gsped.it/[ISTANZA]/Orders/[ID_ORDINE]

Permette di modificare un ordine ed i relativi dettagli su Gsped

Headers

Name
Type
Description

x-api-key*

String

APIKEY fornita da Gsped

Request Body

Name
Type
Description

client_id*

Int

Client ID Gsped

name*

String

Nome Destinatario

order_ref*

String

Riferimento ordine

address*

String

Indirizzo Destinatario

cod

Float

Valore del contrasssegno

phone*

String

Numero di telefono

email*

String

Indirizzo email Destinatario

country*

String

Country code iso 2 char

province*

String

Sigla Provincia o Stato

zip*

String

Zipcode Destinatario

city*

String

Città Destinatario

rows.description

String

Descrizione dettaglio ordine

warehouse

String

Magazzino

notes

String

Note ordine

invoice_number

String

Numero della fattura dell'ordine

invoice_date

String

Data della fattura dell'ordine

insurance

Float

Valore assicurazione

rows.hs_code

String

HS code dettaglio

rows.qty

Int

Quantità dettaglio

rows.sku

String

SKU dettaglio

rows.country_of_origin

String

Country code iso 2 char di origine della merce

{
  "status": "OK",
  "order_id": 572602
}
{
  "status": "FAILED",
  "error": "Dati ordine non presenti o in formato sbagliato"
}
{
  "status": false,
  "error": "Invalid API key "
}

Snippets codice di esempio

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.gsped.it/sandbox/orders/1",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PATCH",
  CURLOPT_POSTFIELDS => "{\n  \"client_id\": 638,\n  \"order_ref\": \"test-gsped-3\",\n  \"name\": \"mario rossi\",\n  \"address\": \"piazza ambrosoli 13\",\n  \"city\": \"alessandria\",\n  \"zip\": \"15121\",\n  \"province\": \"AL\",\n  \"country\": \"IT\",\n  \"email\": \"pippo@pippo.it\",\n  \"phone\": \"01311750253\",\n  \"cod\": 10,\n  \"insurance\": 0,\n  \"notes\": \"testo delle note\",\n  \"customs_value\": 123.45,\n  \"currency\": \"EUR\",\n  \"warehouse\": \"\",\n  \"tag\" : \"pippo1\",\n  \"rows\": [\n    {\n    \t\"description\" : \"Cosa rossa 1\",\n      \"sku\": \"art3\",\n      \"qty\": 1\n    },\n    {\n    \t\"description\" : \"Cosa rossa 2\",\n      \"sku\": \"art4\",\n      \"qty\": 2\n    }\n  ]\n}",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "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;
}
import http.client

conn = http.client.HTTPSConnection("api.gsped.it")

payload = "{\n  \"client_id\": 638,\n  \"order_ref\": \"test-gsped-3\",\n  \"name\": \"mario rossi\",\n  \"address\": \"piazza ambrosoli 13\",\n  \"city\": \"alessandria\",\n  \"zip\": \"15121\",\n  \"province\": \"AL\",\n  \"country\": \"IT\",\n  \"email\": \"pippo@pippo.it\",\n  \"phone\": \"01311750253\",\n  \"cod\": 10,\n  \"insurance\": 0,\n  \"notes\": \"testo delle note\",\n  \"customs_value\": 123.45,\n  \"currency\": \"EUR\",\n  \"warehouse\": \"\",\n  \"tag\" : \"pippo1\",\n  \"rows\": [\n    {\n    \t\"description\" : \"Cosa rossa 1\",\n      \"sku\": \"art3\",\n      \"qty\": 1\n    },\n    {\n    \t\"description\" : \"Cosa rossa 2\",\n      \"sku\": \"art4\",\n      \"qty\": 2\n    }\n  ]\n}"

headers = {
    'Content-Type': "application/json",
    'x-api-key': "YOUR-API-KEY"
    }

conn.request("PATCH", "/sandbox/orders/1", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.gsped.it/sandbox/orders/1"

	payload := strings.NewReader("{\n  \"client_id\": 638,\n  \"order_ref\": \"test-gsped-3\",\n  \"name\": \"mario rossi\",\n  \"address\": \"piazza ambrosoli 13\",\n  \"city\": \"alessandria\",\n  \"zip\": \"15121\",\n  \"province\": \"AL\",\n  \"country\": \"IT\",\n  \"email\": \"pippo@pippo.it\",\n  \"phone\": \"01311750253\",\n  \"cod\": 10,\n  \"insurance\": 0,\n  \"notes\": \"testo delle note\",\n  \"customs_value\": 123.45,\n  \"currency\": \"EUR\",\n  \"warehouse\": \"\",\n  \"tag\" : \"pippo1\",\n  \"rows\": [\n    {\n    \t\"description\" : \"Cosa rossa 1\",\n      \"sku\": \"art3\",\n      \"qty\": 1\n    },\n    {\n    \t\"description\" : \"Cosa rossa 2\",\n      \"sku\": \"art4\",\n      \"qty\": 2\n    }\n  ]\n}")

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

	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("x-api-key", "YOUR-API-KEY")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Patch,
    RequestUri = new Uri("https://api.gsped.it/sandbox/orders/1"),
    Headers =
    {
        { "x-api-key", "YOUR-API-KEY" },
    },
    Content = new StringContent("{\n  \"client_id\": 638,\n  \"order_ref\": \"test-gsped-3\",\n  \"name\": \"mario rossi\",\n  \"address\": \"piazza ambrosoli 13\",\n  \"city\": \"alessandria\",\n  \"zip\": \"15121\",\n  \"province\": \"AL\",\n  \"country\": \"IT\",\n  \"email\": \"pippo@pippo.it\",\n  \"phone\": \"01311750253\",\n  \"cod\": 10,\n  \"insurance\": 0,\n  \"notes\": \"testo delle note\",\n  \"customs_value\": 123.45,\n  \"currency\": \"EUR\",\n  \"warehouse\": \"\",\n  \"tag\" : \"pippo1\",\n  \"rows\": [\n    {\n    \t\"description\" : \"Cosa rossa 1\",\n      \"sku\": \"art3\",\n      \"qty\": 1\n    },\n    {\n    \t\"description\" : \"Cosa rossa 2\",\n      \"sku\": \"art4\",\n      \"qty\": 2\n    }\n  ]\n}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
curl --request PATCH \
  --url https://api.gsped.it/sandbox/orders/1 \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: YOUR-API-KEY' \
  --data '{
  "client_id": 638,
  "order_ref": "test-gsped-3",
  "name": "mario rossi",
  "address": "piazza ambrosoli 13",
  "city": "alessandria",
  "zip": "15121",
  "province": "AL",
  "country": "IT",
  "email": "pippo@pippo.it",
  "phone": "01311750253",
  "cod": 10,
  "insurance": 0,
  "notes": "testo delle note",
  "customs_value": 123.45,
  "currency": "EUR",
  "warehouse": "",
  "tag" : "pippo1",
  "rows": [
    {
    	"description" : "Cosa rossa 1",
      "sku": "art3",
      "qty": 1
    },
    {
    	"description" : "Cosa rossa 2",
      "sku": "art4",
      "qty": 2
    }
  ]
}'

N.B. Non è possibile modificare un ordine nel caso in cui l'ordine sia collegato ad una spedizione già confermata.

Comportamento in caso l'ordine sia collegato ad una spedizione da confermare: se la spedizione è extraUE e il corriere supporta i CIN se il corriere supporta la shipmentPatch dei dati CIN si esegue l'aggiornamento sul corriere, altrimenti la spedizione verrà messa in errore in quanto dovrà essere rigenerata con i nuovi dati ordine.

PreviousShipmentFromCourierNextOrder To Shipment

Last updated 3 months ago

Was this helpful?