# CloseDoc

### General Information

The **CloseDoc** is a custom endpoint used in special cases.

PLEASE NOTE: It stays not for \[shipmentConfirm] (shipment-confirm.md) (still required) and must be performed before the shipmentConfirm to update the data of the shipment, to be sent to the courier together with the confirmation.

{% hint style="warning" %}
The enabled couriers are:
{% endhint %}

<table><thead><tr><th width="196.33333333333331">Gsped courier ID</th><th width="235">Courier</th><th>Notes</th></tr></thead><tbody><tr><td>1</td><td>BRT</td><td>Only B / B2 solution</td></tr><tr><td>70-79</td><td>Corrieri Dummy</td><td></td></tr><tr><td>90</td><td>Italsempione</td><td></td></tr><tr><td>91</td><td>Logisticando</td><td></td></tr><tr><td>93</td><td>Ribosped</td><td></td></tr><tr><td>94</td><td>Zust - Tiesse</td><td></td></tr><tr><td>95</td><td>Lynx</td><td></td></tr><tr><td>97</td><td>Speditalia</td><td></td></tr><tr><td>100</td><td>Arco</td><td>Available by mid-May</td></tr><tr><td>101</td><td>GLS</td><td></td></tr><tr><td>105</td><td>SDA</td><td>Only InvioSystem solution</td></tr><tr><td>131</td><td>Fercam</td><td></td></tr><tr><td>144</td><td>Dimotrans</td><td></td></tr><tr><td>151</td><td>Malga</td><td></td></tr><tr><td>164</td><td>Ceva</td><td></td></tr><tr><td>165</td><td>Bianchi Trasporti</td><td></td></tr><tr><td>172</td><td>Nippon Express</td><td></td></tr><tr><td>174</td><td>Aldieri</td><td></td></tr><tr><td>179</td><td>Liccardi</td><td></td></tr><tr><td>186</td><td>Susa</td><td></td></tr></tbody></table>

If different shipments have the same ddt\_num, the Closedoc allows to set the same ddt\_alpha value (alphanumeric sender reference), the COD and the custom value on a grouped shipment using the courier's unification solutions.

Example: after a call to the shipment for a specific ddt\_num each parcel has been labeled with the same ddt\_num. After the label printing for each parcel the warehouse system generates the DDT number, determines whether the shipment has to be with COD and calls the CloseDoc, setting the DDT number and the COD (if required) to be put on the grouped shipment.

### Prerequisites

The fundamental prerequisite to using the CloseDoc is the use of the same ddt\_num (numeric sender reference) for all the shipments created with the POST at the endpoint [shipment](https://apidocs.gsped.com/gsped-api-english-version/spedizioni-e-dintorni/shipment). This value allows our system to identify the shipments to update in case of CloseDoc call.

### How does it work

## Shipment update for a ddt\_num

<mark style="color:green;">`POST`</mark> `https://api.gsped.it/[INSTANCE]/closeDoc`

Body in JSON.

#### Request Body

| Name                                         | Type   | Description                                                                                                            |
| -------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------- |
| client\_id<mark style="color:red;">\*</mark> | Int    | Client ID provided by GSped                                                                                            |
| ddt\_num<mark style="color:red;">\*</mark>   | String | Numerical reference of the shipment                                                                                    |
| ddt\_alpha<mark style="color:red;">\*</mark> | String | Alphanumerical reference of the shipment                                                                               |
| contrassegno                                 | Float  | COD amount                                                                                                             |
| modalita\_incasso                            | Int    | [Type of payment - COD](https://apidocs.gsped.com/gsped-api-english-version/overview/codici-gsped#type-of-payment-cod) |
| valore\_doganale                             | Float  | Custom value                                                                                                           |

{% tabs %}
{% tab title="200: OK Update successfully occurred" %}

```javascript
{
    "status": 200
}
```

{% endtab %}

{% tab title="400: Bad Request Wrong payload" %}

```javascript
{
    "error": "Il corriere selezionato non permette la closeDoc"
}
```

{% endtab %}
{% endtabs %}
