Table of Contents

Update Shipment API

PATCH /api/v3/shipments

Overview

The Update Shipment API modifies an existing shipment in Fredi. It allows updating shipment information such as addresses, package details, carrier configuration, or customs data after the shipment has already been created.

The request body structure is identical to the Create Shipment API, but the operation updates an existing shipment rather than creating a new one.

Important

The shipment must already exist in the system! The API identifies the shipment using the shipmentReference field!

Endpoint

GET /api/v3/shipments

This endpoint allows you to:

  • Update shipment addresses
  • Modify package details
  • Update shipment references
  • Change carrier services
  • Update customs information
  • Modify pickup configuration
  • Update shipment items

Authentication

All requests must include a valid Bearer token.

Header Required Description
Authorization Yes Bearer {access_token}
Content-Type Yes application/json

See: Authentication

The request structure is the same as the Create Shipment API, but with a mandatory shipmentReference attribute to identify the shipment to be updated.

Request Body

The Update Shipment API expects a JSON payload containing the shipment reference and the fields to be updated.

Note

Multiple shipments can be updated in a single request using the shipment[] array!

{
  "shipment": [
    {
      "settings": {},
      "carrierDetails": {},
      "shipmentInfo": {}
    }
  ]
}

Structure

Note

The schema tree below is automatically generated from the OpenAPI specification!

📋 Click a field to see its JSON path

Loading schema…

Note

The example below is automatically generated from the OpenAPI specification!

Sample Request

Show Sample Request
{
     "shipment": [
        {
            "settings": {
                "documentLanguage": "en",
                "printDocuments": true,
                "printSettings": {
                    "labelType": "ZEBRA",
                    "labelSize": "ZPL_200",
                    "printLabel": true,
                    "splitByParcel": false
                }
            },
            "carrierDetails": {
                "carrierCode": "GLSSHP",
                "productCode": "PARCEL",
                "serviceDataName": "GLS",
                "carrierId": 6
            },
            "shipmentInfo": {
                "shipmentReference": "SHIP2026",
                "currentExchangeRate": 0,
                "grossAmount": 0,
                "international": {
                    "declaredValueAmount": 0,
                    "customsEnclosure": false,
                    "collectiveCustomsClearance": false,
                    "containsDocuments": false,
                    "meansOfTransportation": {
                        "modeOfTransportDomestic": 0,
                        "modeOfTransportBorder": 0,
                        "crossBorderTransportationType": 0,
                        "departureTransportationType": 0
                    }
                },
                "addressData": [
                    {
                        "sender": {
                            "name": "German Complete Address",
                            "name2": "john2test",
                            "name3": "ncncvnn",
                            "street": "Ensisheimerstr",
                            "houseNo": "4",
                            "postalCode": "79346",
                            "city": "Endingen am Kaiserstuhl",
                            "countryIsoCode": "DE",
                            "contactPerson": {
                                "name": "John Doee",
                                "phone": "45645645",
                                "mobile": "5645645645",
                                "email": "testttt@tt.in"
                            }
                        },
                        "recipient": {
                            "name": "German Complete Address",
                            "name2": "john2test",
                            "name3": "ncncvnn",
                            "street": "Ensisheimerstr",
                            "houseNo": "4",
                            "postalCode": "79346",
                            "city": "Endingen am Kaiserstuhl",
                            "countryIsoCode": "DE",
                            "contactPerson": {
                                "name": "John Doee",
                                "phone": "45645645",
                                "mobile": "5645645645",
                                "email": "testttt@tt.in"
                            },
                            "settings": {
                                "saveAddress": false,
                                "sendShipmentInformation": false
                            }
                        }
                    }
                ],
                "paymentInfo": {
                    "splitDutyVat": false
                },
                "shipmentItems": [
                    {
                        "objType": "Package",
                        "packageCode": "TEST_PACK",
                        "dimensions": {
                            "length": 5,
                            "width": 5,
                            "height": 5
                        },
                        "netWeight": 5,
                        "grossWeight": 5,
                        "quantity": 0,
                        "insuranceAmount": 0,
                        "declaredValueAmount": 0,
                        "packageCodeDangerousGoods": "TEST_PACK"
                    }
                ]
            }
        }
    ]
}

Responses

Code Description
200 Success – Shipment created successfully.
201 Success – Shipment saved successfully.
400 Bad Request – invalid shipment data.
401 Unauthorized – user is not authenticated or lacks required role
422 Validation Error
500 Internal Server Error

Response Format

200 Success – Shipment created successfully
{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.3.1",
  "title": "Success – Shipment created successfully",
  "status": 200,
  "data": {
    "shipmentReference": "SHIP-100045",
    "carrierCode": "DHL",
    "trackingNumber": "JD014600006542345678",
    "labelGenerated": true,
    "documents": [
      {
        "documentType": "LABEL",
        "format": "PDF",
        "content": "base64EncodedLabelContent"
      }
    ]
  }
}

Field Description

Field Type Description
type string Reference to the HTTP specification for the response type.
title string Short message describing the result of the request.
status integer HTTP status code returned by the API.
data object Contains shipment details generated after successful processing.
data.shipmentReference string Unique identifier for the created shipment.
data.carrierCode string Carrier used for the shipment.
data.trackingNumber string Tracking number assigned by the carrier.
data.labelGenerated boolean Indicates whether the shipping label was successfully generated.
data.documents array List of documents returned by the API (for example, shipping labels).

400 Bad Request
{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
  "title": "One or more validation errors occurred.",
  "status": 400,
  "errors": {
    "$": [
      "':' is invalid after a single JSON value. Expected end of data. **Path**: $ | LineNumber: 0 | BytePositionInLine: 10."
    ],
    "objShipment": [
      "The objShipment field is required."
    ]
  },
  "traceId": "00-0a9e238310fc1a3ee316c4f1ef554ed9-e4028dfefbc4b5a7-00"
}

Field Description

Field Type Description
type string URL reference to the HTTP specification describing the error type.
title string Short description of the error.
status integer HTTP status code returned by the API.
errors object Contains detailed validation errors for specific fields.
errors.$ array JSON parsing errors related to the request body format.
errors.objShipment array Indicates that the required objShipment field is missing.
traceId string Unique identifier used for tracing the request in server logs.

Important Notes

  • Carrier-specific fields depend on configured carrier integrations.
  • International fields are mandatory for cross-border shipments.
  • Dangerous goods must comply with carrier restrictions.
  • Label generation depends on carrier configuration.
Back to top ↑