For the complete documentation index, see llms.txt. This page is also available as Markdown.

Orders

Uploading orders to Gsped

This endpoint is used to upload orders and their details to Gsped so that they can be fulfilled via API or via the web interface, with the resulting generation of the shipping labels.

It is very useful when you have to manage several order fulfilment points that use the Gsped web interface but for which a connector for automatic order download cannot be activated.

Retrieve order list

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

Headers

Name
Type
Description

x-api-key*

String

APIKEY provided by Gsped

Query Parameters

Name
Type
Description

id

int[]

selects if id IN [id, id, ...]

client_id

int[]

selects if client_id IN [client_id, client_id, ...] Any wrong or not permitted client_ids are ignored

order_ref

string[]

selects if order_ref IN [order_ref, order_ref, ...] Each string max 50 char

email

string

selects if email = email Max 50 char

data_ordine_da

Y-m-d

Selects if data_ordine ≥ data_ordine_da

data_ordine_a

Y-m-d

Selects if data_ordine <= data_ordine_a

status

string[]

selects if status IN [status, status, ...] Max 3 char

exclude_status

string[]

selects if status NOT IN [status, status, ...] Max 3 char

corriere

int[]

selects if corriere IN [corriere, corriere, ...]

exclude_corriere

int[]

selects if corriere NOT IN [corriere, corriere, ...]

invoice_number

string[]

selects if invoice_number IN [invoice_number, invoice_number, ...]

invoice_date_da

Y-m-d

Selects if invoice_date ≥ invoice_date_da

invoice_date_a

Y-m-d

Selects if invoice_date <= invoice_date_a

withDetails

1 | 0

If 1, the order details are also returned

perPage

1...100

number of results per page requested

page

int

page number requested

orderBy

id | client_id | order_ref | email | data_ordine | status | corriere | invoice_number | invoice_date

name of the field to sort by (default id)

order

ASC | DESC

sort direction (default DESC)

Example code

Retrieve an order and its details

GET https://api.gsped.it/[INSTANCE]/Orders/[ID_ORDINE]

Retrieves an order and its details from Gsped

Headers

Name
Type
Description

x-api-key*

String

APIKEY provided by Gsped

The response also contains rcpt_type, the shipment fields vat_seller, sender_eori, rcpt_eori, ddt_num, tipo_incasso, chi_paga, addebito_dogana, incoterm and parties (null if not set) and, for each detail in rows, id and dati_doganali. The id identifies the detail to edit in the PATCH.

Example code snippets

Upload orders and details

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

Lets you upload orders and their details to Gsped

Headers

Name
Type
Description

x-api-key*

String

APIKEY provided by Gsped

Request Body

Name
Type
Description

client_id*

Int

Client ID Gsped

zip*

String

Recipient zip code

city*

String

Recipient city

address*

String

Recipient address

name*

String

Recipient name

order_ref*

String

Order reference

email*

String

Recipient email address

country*

String

Country code iso 2 char

province*

String

Province or State code

insurance

Float

Insured value

customs_value

Float

Customs value

cod

Float

Cash on delivery (COD) value

phone*

String

Phone number

rows.description

String

Order detail description

warehouse

String

Warehouse

notes

String

Order notes

rows.qty

Int

Detail quantity

rows.sku

String

Detail SKU

rows.country_of_origin

String

Country code iso 2 char of origin of the goods

invoice_date

String

Date of the order invoice

invoice_number

String

Number of the order invoice

rows.hs_code

String

Detail HS code

rows.barcode_riga

String

Barcode string of the single item

rows.prezzo_singolo

String

Single item price

rows.peso_riga

String

Single item weight

corriere

int

Gsped courier ID

servizio

int

Gsped courier service ID

rcpt_type

int

Recipient type: 0 not specified, 1 private, 2 business

rows.dati_doganali

Object

Customs data of the detail, in dati_doganali.pid the product codes, see EU customs reform 2026

vat_code

String

Recipient VAT number, max 20 char

vat_seller

String

Seller VAT number, max 20 char

sender_eori

String

Sender EORI number, max 20 char

rcpt_eori

String

Recipient EORI number, max 20 char

ddt_num

Int

Number of the shipment's transport document, max 15 digits

tipo_incasso

Int

Cash on delivery collection type, see Gsped codes

chi_paga

Int

Carriage: 0 paid, 1 forward

addebito_dogana

Int

Who pays duties and customs charges: 0 default, 1 sender, 2 third party. mittente, destinatario, terzo are also accepted

incoterm

Object

Incoterm of the shipment, as in the Shipment, see incoterm

parties

Object

Customs parties of the shipment, as in the Shipment, see parties

vat_code, vat_seller, sender_eori, rcpt_eori, ddt_num, tipo_incasso, chi_paga and addebito_dogana are shipment fields: they are validated with the same rules as the Shipment and are passed to the shipment created with Order To Shipment only if set. vat_code becomes the shipment's vat_buyer.

incoterm and parties are checked only when the shipment is created, because the required data depends on the courier.

Example code snippets

Edit orders and details of an existing order

PATCH https://api.gsped.it/[INSTANCE]/Orders/[ID_ORDINE]

Lets you edit an order and its details on Gsped

Headers

Name
Type
Description

x-api-key*

String

APIKEY provided by Gsped

Request Body

Name
Type
Description

client_id*

Int

Client ID Gsped

name*

String

Recipient name

order_ref*

String

Order reference

address*

String

Recipient address

cod

Float

Cash on delivery (COD) value

phone*

String

Phone number

email*

String

Recipient email address

country*

String

Country code iso 2 char

province*

String

Province or State code

zip*

String

Recipient zip code

city*

String

Recipient city

rows.description

String

Order detail description

warehouse

String

Warehouse

notes

String

Order notes

invoice_number

String

Number of the order invoice

invoice_date

String

Date of the order invoice

insurance

Float

Insured value

customs_value

Float

Customs value

rows.hs_code

String

Detail HS code

rows.qty

Int

Detail quantity

rows.sku

String

Detail SKU

rows.country_of_origin

String

Country code iso 2 char of origin of the goods

corriere

Int

Gsped courier ID

servizio

Int

Gsped courier service ID

rcpt_type

Int

Recipient type: 0 not specified, 1 private, 2 business. If not sent it stays unchanged

rows.id

Int

ID of the detail to edit, returned when retrieving the order

rows.dati_doganali

Object

Customs data of the detail, in dati_doganali.pid the product codes, see EU customs reform 2026

vat_code

String

Recipient VAT number, max 20 char

vat_seller

String

Seller VAT number, max 20 char

sender_eori

String

Sender EORI number, max 20 char

rcpt_eori

String

Recipient EORI number, max 20 char

ddt_num

Int

Number of the shipment's transport document, max 15 digits

tipo_incasso

Int

Cash on delivery collection type, see Gsped codes

chi_paga

Int

Carriage: 0 paid, 1 forward

addebito_dogana

Int

Who pays duties and customs charges: 0 default, 1 sender, 2 third party. mittente, destinatario, terzo are also accepted

incoterm

Object

Incoterm of the shipment, as in the Shipment, see incoterm

parties

Object

Customs parties of the shipment, as in the Shipment, see parties

The details sent in rows are matched to the saved ones through rows.id:

  • detail with id: only the fields sent are updated

  • detail without id: it is added to the order

  • saved detail not present in rows: it is deleted

  • rows missing or empty: the details stay unchanged

An id that does not belong to the order or is repeated is rejected with a 400 error. dati_doganali sent replaces the saved one of the detail: codes not sent are deleted, null or empty deletes them all. If dati_doganali is not sent the codes stay unchanged.

Shipment fields (vat_seller, sender_eori, rcpt_eori, ddt_num, tipo_incasso, chi_paga, addebito_dogana):

  • not sent: they stay unchanged

  • null or empty: they are deleted and the shipment will use the value Gsped derives from the order, see Order To Shipment

incoterm and parties sent replace the saved ones; null or empty deletes them; if not sent they stay unchanged.

Example code snippets

Behaviour when the order is linked to a shipment still to be confirmed: if the shipment is non-EU and the courier supports CINs, if the courier supports the shipmentPatch of CIN data, the update is performed on the courier; otherwise the shipment is set to error because it must be regenerated with the new order data.

Last updated