> For the complete documentation index, see [llms.txt](https://apidocs.gsped.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.gsped.com/gsped-api-english-version/spedizioni-e-dintorni/shipment/shipment-objects/qrcode.md).

# qrCode

object

## Description

Object containing the information needed to show, for some [enabled couriers](#enabled-couriers), a multi-purpose QR code.

{% hint style="warning" %}
The **label** must be at least **10x18 cm** long instead of the usual 10x15 cm
{% endhint %}

```json
"qrCode":{
  "url":"XXXXXX", // QR code di questo url
  "post_upload":{ // crea 1 oggetto S3 sul bucket su cui poi verrà fatto PUT oggetto
    "file_type" :"PDF" // nome univoco deciso da Gsped (id spedizione)
  },
  "registrazione_esito":true
}
```

This object can be set in only one way at a time.

<table data-full-width="true"><thead><tr><th width="212">Field</th><th width="109" data-type="checkbox">Required</th><th width="107">Encoding</th><th>Description</th></tr></thead><tbody><tr><td>url</td><td>false</td><td>string</td><td>Fixed URL to show in the qrCode</td></tr><tr><td>post_upload</td><td>false</td><td>object</td><td>Container of keys used to create an S3 object on the bucket, which will then be filled with a PUT</td></tr><tr><td>post_upload.file_type</td><td>false</td><td>string</td><td>Extension of the file that will be uploaded later</td></tr><tr><td>registrazione_esito</td><td>false</td><td>bool</td><td>Creates a qrCode pointing to a page where whoever has access (normally the driver who sees the label) can change the shipment status on Gsped.</td></tr></tbody></table>

1. You enter directly the *url* you want to show in the QR code
2. You fill in only the *post\_upload* part, entering the extension of the file that will be uploaded later.
3. You set *registrazione\_esito* to create a URL for changing the shipment status.

{% hint style="danger" %}
**The modes are not compatible with each other, so they must be used exclusively.**
{% endhint %}

### **post\_upload details**

**With post\_upload**, the response to the SHIPMENT POST will give you a URL (inside the qrCode object) to which you upload the file once it is available.

```json
"qrCode": [
    {
        "putUrl": "XXX", // Url pur il PUT
        "url":"XXX" // Url per il GET, presente nel barcode
    }
]
```

Here is an upload example:

```bash
curl -X PUT -T "/path/to/file" "Gsped upload url"
```

For tidiness and consistency, the file name must be the GSPED ID of the newly created shipment including the file extension, for example 12345.pdf

{% hint style="warning" %}
The links are valid for 7 days\
If they have expired, they can be renewed through the [dedicated API endpoint](https://apidocs.gsped.com/gsped-api-english-version/spedizioni-e-dintorni/refreshqr)
{% endhint %}

### registrazione\_esito details

The page shown to whoever lands on the qrCode page looks like this and lets them report the following statuses:

![](https://1888732240-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFSMqbryyHACmde6RvwRY%2Fuploads%2F2BUFvbziTr5ryCbKWf4u%2Fesempio_esito.png?alt=media)

### Protection with a PIN code

You can protect your QR code from unwanted access by using a PIN code.

Regardless of the usage mode, just add the **pin\_code** parameter with the desired code.

This way, when the QR code is scanned, the PIN code will be requested before proceeding.

The code must be at least 6 and at most 32 characters long.

Here are some examples:

```json
"qrCode":{
  "url":"XXXXXX",
  "pin_code": "test1234"
}
```

```json
"qrCode":{
  "post_upload":{
    "file_type" :"PDF"
  },
  "pin_code": "test1234"
}
```

```json
"qrCode":{
  "registrazione_esito":true,
  "pin_code": "test1234"
}
```

## Enabled couriers

<table><thead><tr><th width="127">ID</th><th>Courier</th></tr></thead><tbody><tr><td>1</td><td>BRT</td></tr><tr><td>2</td><td>TNT</td></tr><tr><td>19</td><td>Poste Delivery Business Inviosystem</td></tr><tr><td>70</td><td>Dummy1</td></tr><tr><td>71</td><td>Dummy2</td></tr><tr><td>72</td><td>Dummy3</td></tr><tr><td>73</td><td>Dummy4</td></tr><tr><td>74</td><td>Dummy5</td></tr><tr><td>75</td><td>Dummy6</td></tr><tr><td>76</td><td>Dummy7</td></tr><tr><td>77</td><td>Dummy8</td></tr><tr><td>78</td><td>Dummy9</td></tr><tr><td>79</td><td>Dummy10</td></tr><tr><td>90</td><td>Italsempione</td></tr><tr><td>91</td><td>Logisticando</td></tr><tr><td>92</td><td>CSILogistica</td></tr><tr><td>93</td><td>Ribosped</td></tr><tr><td>94</td><td>Zust - Tiesse</td></tr><tr><td>95</td><td>Lynx</td></tr><tr><td>97</td><td>Speditalia</td></tr><tr><td>101</td><td>GLS</td></tr><tr><td>104</td><td>DHL</td></tr><tr><td>131</td><td>Fercam</td></tr><tr><td>182</td><td>DHL WLA</td></tr></tbody></table>
