Shipment Confirm

Shipment confirm operation

This operation confirms that the generated shipments have correctly managed and are going to be given to the courier/s

On the Gsped interface the confirmed shipments are transferred from the section Outgoing shipments to the section Expedition started

The confirm operation could be performed in two ways :

Using the labeling data ( client_id ). In this case all the shipments of the client_id will be confirmed. Using the shipping list ( ID spedizioni ). In this case the single shipments will be confirmed.

PLEASE NOTE : ****In the confirm operation the HTTP 200 code is returned - even if the shipments are not actually confirmed - in the following situations:

  • If you attempt to confirm shipments that have already been confirmed

  • If you attempt to confirm with the status error and/or shipments that are still in progress.

Pay attention to the message returned in the field status; here there will be indicated how many shipments have been confirmed and how many not. Example: "10 shipments confirmed, 2 errors occurred"

In case there are shipments we are not able to confirm, in the array errors there will be indicated which shipments have not been confirmed.

Please note: During this operation it is possible to request the creation of the shipping manifest to show the courier at the withdrawal of the goods.

Shipment confirm and creation of the shipping manifest (additional)

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

Headers

Name
Type
Description

Content-Type*

String

application/json

x-api-key*

String

Api Key given by Gsped

Request Body

Name
Type
Description

client_id*

Integer

Value communicated by Gsped (in alternative to the ID parameter)

id*

Array

List of the numeric IDs of the shipments to confirm (in alternative to the client ID)

create_manifest

String

Accepted values Y or N

\

If Y, in the response the field manifest with the PDF of the shipping manifest will be included.

{
  "status": "25 spedizioni confermate, 0 errori",
  "errors": [],
  "manifest": "JVBERi0xLjMKM......UVPRgo=",
  "manifest_id": 10006
}

Example Snippets :

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://api.gsped.it/sandbox/shipmentConfirm',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS =>'{
  "create_manifest" : "Y",
  "id": [
    "12345",
    "12346",
    "12347"
  ]
}',
    CURLOPT_HTTPHEADER => array(
        'Content-Type: application/json',
        'x-api-key: YOUR-API-KEY'
    ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;php

Last updated