Create Draft Consignment

This API is used to create a draft consignment. Draft consignments are used when all information is not yet ready or when you want to save it for processing later.

Endpoint Information

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

Idempotency: This endpoint supports duplicate request protection. For details, see Idempotency.


What is a Draft Consignment?

Draft consignments differ from regular consignments in the following ways:

Feature Regular Consignment Draft Consignment
Required Fields All basic fields required Only consignor and consignee required
Shipping Label Created immediately Not created
Status SENDED_TO_PROVIDER NEW_DRAFT (status: 24)
Processing Processed instantly Processed later with Process

When to Use?

  • When package information is not yet known
  • When bulk consignment entry will be made
  • When consignment information needs to be completed later
  • When you want to create a consignment record when an order is received and process it after packaging

Request Parameters

Basic Parameters

Parameter Name Parameter Type Required Description
preference Integer CONDITIONAL Carrier preference. Required if provider_id is not specified. Available Values
provider_id Integer CONDITIONAL Carrier ID. Required if preference is 0. Available Values
address_resolver_type Integer OPTIONAL Address resolution type. Default: 0. Available Values
reference_no String (MAX 255) OPTIONAL Reference number
invoice_number String (MAX 255) OPTIONAL Invoice number
incoterms_type Integer OPTIONAL Customs delivery terms. Default: 2 (DDU). Available Values
specific_shipping_method String (MAX 255) OPTIONAL Provider shipping method. Available Values
generate_provider_barcode Bool OPTIONAL Automatic barcode assignment. Default: false
specific_provider_barcode String (MAX 255) OPTIONAL Custom barcode definition

Sender Information

Parameter Name Parameter Type Required Description
consignor.name String (MAX 255) OPTIONAL Sender name
consignor.attention_name String (MAX 255) OPTIONAL Sender alternate name
consignor.country String (2-3 CHAR) OPTIONAL Country code (ISO2 or ISO3 format)
consignor.state String (MAX 100) OPTIONAL State/Province
consignor.city String (MAX 100) OPTIONAL City/District
consignor.postal_code String (MAX 30) OPTIONAL Postal code
consignor.address String (MAX 1000) OPTIONAL Full address
consignor.phone_number String (MAX 20) OPTIONAL Phone number
consignor.email String (MAX 255) OPTIONAL Email address
consignor.tax_number String (MAX 255) OPTIONAL Tax number
consignor.eori_number String (MAX 255) OPTIONAL EORI number (for EU countries)
consignor.state_code String (MAX 255) CONDITIONAL State code (required for USA, Canada, Ireland)

Recipient Information

Parameter Name Parameter Type Required Description
consignee.name String (MAX 255) OPTIONAL Recipient name
consignee.attention_name String (MAX 255) OPTIONAL Recipient alternate name
consignee.country String (2-3 CHAR) OPTIONAL Country code (ISO2 or ISO3 format)
consignee.state String (MAX 100) OPTIONAL State/Province
consignee.city String (MAX 100) OPTIONAL City/District
consignee.postal_code String (MAX 30) OPTIONAL Postal code
consignee.address String (MAX 1000) OPTIONAL Full address
consignee.phone_number String (MAX 20) OPTIONAL Phone number
consignee.email String (MAX 255) OPTIONAL Email address
consignee.tax_number String (MAX 255) OPTIONAL Tax number
consignee.eori_number String (MAX 255) OPTIONAL EORI number
consignee.state_code String (MAX 255) CONDITIONAL State code (required for USA, Canada, Ireland)

Package Information (Optional)

Package information is optional for draft consignments. It can be added later in the Update Draft or Process stage.

Parameter Name Parameter Type Required Description
packages.package_type Integer OPTIONAL Package type. 1 (Box) or 2 (Envelope)
packages.provider_packaging_type String OPTIONAL Provider specific packaging type
packages.post_type Integer OPTIONAL Post type
packages.weight Float OPTIONAL Package weight (kg)
packages.length Float OPTIONAL Package length (cm)
packages.width Float OPTIONAL Package width (cm)
packages.height Float OPTIONAL Package height (cm)
packages.dangerous_goods Boolean OPTIONAL Contains dangerous goods?

Package Content Information (Optional)

Parameter Name Parameter Type Required Description
packages.items.description String (MAX 255) OPTIONAL Product description
packages.items.gtip String (MAX 16) OPTIONAL HS code (for international)
packages.items.origin String (2-3 CHAR) OPTIONAL Country of origin
packages.items.currency_code String (3 CHAR) OPTIONAL Currency code
packages.items.unit_price Float OPTIONAL Unit price
packages.items.quantity Integer OPTIONAL Quantity
packages.items.category String (MAX 255) OPTIONAL Category

Document Information (Optional)

Parameter Name Parameter Type Required Description
documents.id Integer REQUIRED Previously uploaded document ID

Note: For document upload, see the Document Upload API page.

Special Services Information (Optional)

Parameter Name Parameter Type Required Description
special_services.service_type String REQUIRED Service type (e.g., CASH_ON_DELIVERY)
special_services.details.$dynamic Dynamic CONDITIONAL Dynamic parameters for each service type

Note: For detailed information about special services, see the Special Services page.


Example Usage

Minimal Draft Creation (Address Information Only)

curl -X POST "{{BASE_URL}}/api/v1/consignments/draft" \
  -H "Content-Type: application/json" \
  -H "APIKEY: {{APIKEY}}" \
  -d '{
    "provider_id": 7,
    "preference": 0,
    "consignor": {
        "name": "Sender Company Inc.",
        "country": "TR",
        "state": "İstanbul",
        "city": "Kadıköy",
        "postal_code": "34758",
        "address": "Moda Caddesi No:1",
        "phone_number": "+902161234567",
        "email": "info@company.com"
    },
    "consignee": {
        "name": "Hans Mueller",
        "country": "DE",
        "state": "Hamburg",
        "city": "Altona",
        "postal_code": "22765",
        "address": "Beispielstraße 123",
        "phone_number": "+4940123456",
        "email": "hans@example.de"
    }
}'

Full Draft Creation (Including Package Information)

{
    "provider_id": 7,
    "preference": 0,
    "incoterms_type": 2,
    "reference_no": "ORDER-2024-001",
    "consignor": {
        "name": "Sender Company Inc.",
        "country": "TR",
        "state": "İstanbul",
        "city": "Kadıköy",
        "postal_code": "34758",
        "address": "Moda Caddesi No:1",
        "phone_number": "+902161234567",
        "tax_number": "1234567890"
    },
    "consignee": {
        "name": "Hans Mueller",
        "country": "DE",
        "state": "Hamburg",
        "city": "Altona",
        "postal_code": "22765",
        "address": "Beispielstraße 123",
        "phone_number": "+4940123456"
    },
    "packages": [
        {
            "package_type": 1,
            "post_type": 4,
            "weight": 1.5,
            "length": 30,
            "width": 20,
            "height": 15,
            "dangerous_goods": false,
            "items": [
                {
                    "description": "Electronic Device",
                    "gtip": "854370900000",
                    "origin": "TR",
                    "currency_code": "EUR",
                    "unit_price": 150.00,
                    "quantity": 1
                }
            ]
        }
    ]
}

API Response

Successful Response

{
    "status": true,
    "message": "Draft consignment created",
    "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": 0,
        "desi": 0,
        "consignor": {
            "name": "Sender Company Inc.",
            "attention_name": null,
            "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",
            "attention_name": null,
            "country": "Germany",
            "country_iso3": "DEU",
            "state": "Hamburg",
            "city": "Altona",
            "address": "Beispielstraße 123",
            "postal_code": "22765",
            "phone": "+4940123456",
            "email": "hans@example.de"
        },
        "packages": [],
        "documents": [],
        "special_services": [],
        "consignment_type": 2,
        "incoterms_type": 2,
        "specific_shipping_method": null,
        "specific_provider_barcode": null,
        "created_at": "2025-05-07 18:14:45",
        "updated_at": "2025-05-07 18:14:45"
    }
}

Response Fields

Field Type Description
id Integer Draft consignment ID
uuid String Draft consignment UUID
status Integer Consignment status. 24 = New Draft
status_message String Status description
consignment_type Integer Consignment type. 1 = Domestic, 2 = International
incoterms_type Integer Incoterms value
packages Array Package list (can be empty)

Error Responses

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

Common Error Scenarios

Error Description Solution
Reference number has already been used The same reference has been used before Use a unique reference number
When preference is specific, provider_id not be null If preference: 0, provider_id is required Add provider_id or use a different preference

Next Steps

After creating a draft consignment:

  1. Update: Complete missing information with Update Draft
  2. Process: When all information is complete, activate the consignment with Process Draft
  3. Delete: You can delete the draft if needed

Important: Draft consignments are not sent to the carrier and no label is created until they are processed.