Update Draft Consignment

This API is used to update an existing draft consignment. After updating, the draft still remains in NEW_DRAFT status and is not processed.

Endpoint Information

Property Value
URL {{BASE_URL}}/api/v1/consignments/draft/{draft_consignment_id}
HTTP Method PUT
Content Type application/json
Authentication APIKEY header

When to Use?

Scenario Description
Address correction Updating sender or recipient address
Adding packages Completing missing package information
Reference update Changing order number or reference
Changing provider Selecting a different carrier

Note: The draft is not processed after updating. To process, use the Process Draft endpoint.


Request Parameters

URL Parameters

Parameter Type Required Description
draft_consignment_id Integer REQUIRED Draft consignment ID

Body Parameters

All parameters from the Create Draft Consignment page can be used.

Partial Update: Only send the fields you want to update. Fields not sent will remain unchanged.


Example Usage

Adding Package Information

curl -X PUT "{{BASE_URL}}/api/v1/consignments/draft/242" \
  -H "Content-Type: application/json" \
  -H "APIKEY: {{APIKEY}}" \
  -d '{
    "packages": [
        {
            "package_type": 1,
            "post_type": 4,
            "weight": 2,
            "length": 15,
            "width": 15,
            "height": 15,
            "dangerous_goods": false,
            "items": [
                {
                    "description": "Bosch Coffee Machine",
                    "gtip": "851671900000",
                    "origin": "TR",
                    "currency_code": "USD",
                    "quantity": 1,
                    "unit_price": 200
                }
            ]
        }
    ]
}'

Updating Recipient Address

PUT {{BASE_URL}}/api/v1/consignments/draft/242
Content-Type: application/json
APIKEY: {{APIKEY}}

{
    "consignee": {
        "name": "John Smith",
        "address": "456 New Street",
        "city": "Munich",
        "state": "Bavaria",
        "postal_code": "80331"
    }
}

Updating Reference Number

PUT {{BASE_URL}}/api/v1/consignments/draft/242
Content-Type: application/json
APIKEY: {{APIKEY}}

{
    "reference_no": "ORDER-2024-002-UPDATED"
}

API Response

Successful Response

{
    "status": true,
    "message": "Draft consignment updated",
    "data": {
        "id": 242,
        "uuid": "aa203bc1-c2f0-46c3-a635-f59abccd1c4a",
        "provider_id": 7,
        "preference": 0,
        "barcode": null,
        "reference_no": null,
        "invoice_number": null,
        "status": 24,
        "status_message": "New draft",
        "weight": 2,
        "desi": 0.68,
        "consignor": {
            "name": "Sender Company Inc.",
            "country": "Turkey",
            "country_iso3": "TUR",
            "state": "İstanbul",
            "city": "Kadıköy",
            "address": "Moda Caddesi No:1",
            "postal_code": "34758",
            "phone": "+902161234567",
            "email": "info@company.com"
        },
        "consignee": {
            "name": "Hans Mueller",
            "country": "Germany",
            "country_iso3": "DEU",
            "state": "Hamburg",
            "city": "Altona",
            "address": "Beispielstraße 123",
            "postal_code": "22765",
            "phone": "+4940123456",
            "email": "hans@example.de"
        },
        "packages": [
            {
                "id": 238,
                "package_type": 1,
                "post_type": 4,
                "weight": 2,
                "width": 15,
                "length": 15,
                "height": 15,
                "desi": 0.68,
                "dangerous_goods": false,
                "items": [
                    {
                        "id": 204,
                        "description": "Bosch Coffee Machine",
                        "gtip": "851671900000",
                        "origin": "TR",
                        "currency": "USD",
                        "unit_price": 200,
                        "quantity": 1
                    }
                ]
            }
        ],
        "documents": [],
        "special_services": [],
        "consignment_type": 2,
        "incoterms_type": 2,
        "created_at": "2025-05-07 18:14:45",
        "updated_at": "2025-05-07 18:30:06"
    }
}

Response Fields

Field Type Description
id Integer Draft consignment ID
uuid String Draft consignment UUID
status Integer Consignment status. Still 24 after update
weight Float Total weight (kg)
desi Float Calculated volumetric weight
packages Array Updated package list
updated_at String Last update date

Error Responses

{
    "status": false,
    "errors": [
        {
            "message": "reference_no: Reference number \"ORDER-2024-001\" has already been used."
        }
    ]
}

Common Error Scenarios

Error Description Solution
Consignment not found Draft not found Use the correct ID
Not in draft status Consignment already processed Only status: 24 drafts can be updated
Reference number has already been used Reference number exists Use a unique reference

Next Steps

After updating the draft:

  1. Process: Activate the consignment with Process Draft
  2. Update Again: You can update again with this endpoint if needed
  3. Delete: You can delete the draft if needed