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

Was this helpful?

  1. Gestione Ordini

Order To Shipment

Creazione spedizione da un ordine

Questo endpoint viene usato per evadere ordini scaricati da Gsped da marketplace o ecommerce mediante i propri connettori.

La chiamata a questo endpoint genera la spedizione usando come destinatario l'indirizzo di spedizione dell'ordine.

Creazione spedizione da un Ordine

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

Crea una spedizione da un ordine per ottenere evasione ed aggiornamento su piattaforma ecommerce/marketplace

Headers

Name
Type
Description

x-api-key*

String

APIKEY fornita da Gsped

Request Body

Name
Type
Description

client_id*

Int

Client ID Gsped

platform

String

Nome piattaforma origine ordine

packages*

Int

Numero dei colli

order_ref*

Riferimento ordine

weight*

Float

Peso dell'ordine

{
  "status": "OK",
  "order_ref": "FC3926207",
  "label_jpg": [
    "base64 label string"
  ],
  "label_pdf": [
    "base64 label string"
  ],
  "label_zpl": [
    "ZPL label string"
  ]
}
{
  "status": "ERROR",
  "error_description": "Ordine non trovato",
  "order_ref": "WrongRif"
}
{
  "status": "ERROR",
  "error_description": "Dati ordine non presenti o in formato sbagliato",
  "order_ref": ""
}
{
  "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/OrderToShipment",
  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\t\"client_id\": 1,\n\t\"order_ref\": \"14326\",\n\t\"packages\": 2,\n\t\"platform\": \"woocommerce\",\n\t\"weight\": 7.09\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\t\"client_id\": 1,\n\t\"order_ref\": \"14326\",\n\t\"packages\": 2,\n\t\"platform\": \"woocommerce\",\n\t\"weight\": 7.09\n}"

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

conn.request("POST", "/sandbox/OrderToShipment", 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/OrderToShipment"

	payload := strings.NewReader("{\n\t\"client_id\": 1,\n\t\"order_ref\": \"14326\",\n\t\"packages\": 2,\n\t\"platform\": \"woocommerce\",\n\t\"weight\": 7.09\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/OrderToShipment"),
    Headers =
    {
        { "x-api-key", "YOUR-API-KEY" },
    },
    Content = new StringContent("{\n\t\"client_id\": 1,\n\t\"order_ref\": \"14326\",\n\t\"packages\": 2,\n\t\"platform\": \"woocommerce\",\n\t\"weight\": 7.09\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/OrderToShipment \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: YOUR-API-KEY' \
  --data '{
	"client_id": 1,
	"order_ref": "14326",
	"packages": 2,
	"platform": "woocommerce",
	"weight": 7.09
}'
PreviousOrdersNextRate Comparativa

Last updated 1 year ago

Was this helpful?