v1

latestOpenAPI 3.0.02026-07-2455104.8 MB
Carrier Integration Service Contract

Create shipment

The request a Xentral instance makes to an external carrier service to generate a shipping label.

post/xentral/shipments

Headers

Accept-Languagestring required

ISO 15897 locale.

Example:de-DE

The used locale of the user making the request. Use this header to determine the language of the localised fields in the response

Request body

referencestring

A reference description that can be printed on the label. Depending on the Xentral configuration can for example contain a Delivery Note number, or some other information

shipmentType'outbound' | 'return' required

Informs whether the shipment is of outbound or return type.

Example request

{
  "reference": "Xentral order: 1234566",
  "carrier": {
    "product": {
      "carrierOptions": [
        {
          "id": "age-check",
          "value": "economy"
        }
      ]
    }
  },
  "parcels": [
    {
      "id": "675ea55c-ab95-425a-977f-c70da64aa3e2"
    }
  ],
  "insurance": {
    "value": {
      "amount": "13.37",
      "currency": "EUR"
    }
  },
  "label": {
    "size": "A4"
  },
  "deliveryNote": {
    "id": "1337"
  },
  "return": {
    "id": "1337"
  },
  "shipment": {
    "id": "1337"
  },
  "salesOrder": {
    "id": "1337"
  },
  "exportDeclarations": [
    {
      "itemNumber": "12345",
      "title": "Book",
      "description": "Harry Steward biography first edition",
      "price": 15.99,
      "currency": "EUR",
      "quantity": 10,
      "unitOfMeasure": "PCS",
      "customsTariffNumbers": [
        {
          "typeCode": "outbound",
          "value": "84713000"
        }
      ],
      "exportControlClassificationNumber": "US123456789",
      "countryOfOrigin": "US",
      "netWeight": 0.1,
      "grossWeight": 0.7
    }
  ]
}

Response

Response body for generating a shipment.

idstring required

The Unique ID of the shipment. This ID is used to cancel the shipment and must be unique across all shipments generated by the service.

Example response

{
  "shippingLabels": [
    {
      "parcelId": "675ea55c-ab95-425a-977f-c70da64aa3e2",
      "trackingId": "123456789",
      "trackingUrl": "https://tracking.post.ch/track/123456789",
      "label": {
        "type": "pdf",
        "data": "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADOSURBVHgB1ZZpDoUwCITxnaT3v1SP0mdN49YNEDJKbPxhmfnSBVwS0frg4kfguAKEQBTjuibJZ2Tt7HGO/XMIxzvGZB5Z8+xRfA+A+wRLiJZ2BdCb6GGeowkwSrA0HwLMEi3MpwAcgSfmLACukDaHBSARlM5lA3CFpaslApgZaLZKDNAz0h5WFUALQntT1AB3CG2tKLnwdvyxLYAeQug1hBYiaCmGNiNoO35iztV45y+ZpfkMogLwMB9BVABe5j2ICsDTvAVRxrJRAAPejv8TASt8b/v+egAAAABJRU5ErkJggg=="
      }
    }
  ],
  "id": "675ea55c-ab95-425a-977f-c70da64aa3e2",
  "carrier": {
    "name": "Post Swiss"
  }
}