Order To Shipment

Shipment creation from an order

This endpoint is used to process the orders downloaded from marketplace or e-commerce by Gsped

The call to this endpoint generates the shipment using the address of the order recipient.

Shipment creation from an order

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

Generates a shipment from an order to process it and update the ecommerce/marketplace

Headers

NameTypeDescription

x-api-key*

String

APIKEY given by Gsped

Request Body

NameTypeDescription

client_id*

Int

Client ID Gsped

order_ref*

Order reference

packages*

Int

Number of parcels

platform

String

Name of the platform that created the order

weight*

Float

Weight of the order

{
  "status": "OK",
  "order_ref": "FC3926207",
  "label_jpg": [
    "base64 label string"
  ],
  "label_pdf": [
    "base64 label string"
  ],
  "label_zpl": [
    "ZPL label string"
  ]
}

Example Snippets

<?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;
}

Last updated