Pickup (pickup request)

Pick-up management

Pickup - GET

It returns information about the pick-up requests.

Pick-up information retrieval .

GET https://api.gsped.it/[INSTANCE]/pickup

Query Parameters

Headers

{
    "status": 2,
    "num_spedizione": "",
    "error": "",
    "id": 70058437,
    "note": "",
    "note_orm": "",
    "num_orm": "CBJ180121002626"
}

Snippets example

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.gsped.it/sandbox/pickup?id_sped=12345',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'x-api-key: YOUR-API-KEY'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Pickup - POST

It sends the courier a pick-up request.

Please Note:

This endpoint, unless errors in the name fields and/or incorrect data, always returns the 200, status code, even in the event that the shipment has not successfully performed.

Always check the status field in the pick-up response.

If the value of the field is 0.6 or 10 the pick-up has not been requested (in most of cases because of unmanageable dates or times not accepted by the courier)

Not all the couriers provide these information immediately, therefore check with the Gsped technicians about the couriers you want to use this endpoint with.

Send pick-up request

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

Headers

Request Body

{
    "status": 2,
    "num_spedizione": "",
    "error": "",
    "id": 70061546,
    "note": "",
    "note_orm": "",
    "num_orm": "CBJ180121002626"
}

Example snippets

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.gsped.it/sandbox/pickup',
  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 =>'{
  "client_id": 390,
  "corriere": 1,
  "servizio": 0,
  "colli": 1,
  "peso": 5,
  "date_req_ritiro": "2022-01-14",
  "opening_time": "09:00",
  "closing_time": "17:30",
  "ddt_alpha": "2001504697",
  "ddt_num": 2001504697,
  "sender_name": "Test mittente",
  "sender_addr": "VIA PRINCIPESSA CLOTILDE, 70",
  "sender_cap": "10134",
  "sender_city": "Torino",
  "sender_contact": "contatto mittente",
  "sender_prov": "TO",
  "sender_country_code": "IT",
  "sender_email": "test@gsped.com",
  "sender_phone": "3208281234",
  "note_sender": "",
  "rcpt_addr": "Via Pier Santi Mattarella, 1",
  "rcpt_cap": "92100",
  "rcpt_city": "AGRIGENTO",
  "rcpt_contact": "contatto destinatario",
  "rcpt_country_code": "IT",
  "rcpt_email": "test@gsped.com",
  "rcpt_name": "test destinatario",
  "rcpt_phone": "0922601234",
  "rcpt_prov": "AG",
  "merce": "Articoli arredamento",
  "daticolli": [
    {
      "n_collo": 1,
      "altezza": 50,
      "larghezza": 35,
      "lunghezza": 25,
      "peso": 10,
      "volume": 0.014
    }
  ]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'x-api-key: YOUR-API-KEY'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Last updated