v2
REST API · v2

Delnext API
Documentation

Integrate parcel tracking, pickup points, and order creation directly into your platform with the Delnext REST API — fast, reliable, and designed for developers.

7Endpoints
JSONResponse format
POSTHTTP method
hash_keyAuth scheme
Base URL
URL
https://api.delnext.com
📨
Content-Type
All requests accept application/x-www-form-urlencoded or application/json
📥
Response Format
All responses are application/json with UTF-8 encoding.
🔒
HTTPS
All API calls must be made over HTTPS. Calls over plain HTTP will be refused.
Authentication
ℹ️ Authentication uses a hash_key (API key) passed as a POST body parameter — not a header. This key is provided by the Delnext team when your account is created. Contact your account manager to request your key.

The Tracking endpoint is public and does not require authentication. All other endpoints (Pickup Points, Create Order, Reference Label) require a valid hash_key in the request body. An invalid or missing key returns a JSON error with success: 0.

Example auth error
{
  "success": 0,
  "message": "Restricted API"
}
Error Handling

Errors are returned as JSON with a success: 0 field and a human-readable message. Validation errors return HTTP 422; all other API errors return 200 with success: 0.

HTTP StatusMeaning
200Request processed — check success field for business-level error
400Missing required parameter (e.g. no tracking_number)
422Validation failed — see message for details
500Internal server error — contact Delnext support
Endpoints
POST /api/v2/tracking Track one or more parcels 🌐 Public

Query the current status and full event history of one or more parcels by their Delnext tracking number. No authentication is required. You can pass up to 100 comma-separated tracking numbers in a single request.

Parameters
ParameterTypeRequiredDescription
tracking_number string Required Delnext tracking code(s), comma-separated. Max 100 per request.
Example Request
cURL
curl -X POST https://api.delnext.com/api/v2/tracking \
  -d "tracking_number=DNX123456"
Response
JSON
{
  "Reference":     "DNX123456",
  "Destination":   "Lisboa, PT",
  "CurrentStatus": "In transit",
  "History": [
    {
      "Date":        "2026-03-18",
      "Time":        "14:32",
      "Description": "Departed from hub"
    },
    {
      "Date":        "2026-03-17",
      "Time":        "09:10",
      "Description": "Parcel received at origin"
    }
  ]
}
ℹ️ When multiple tracking numbers are requested, the response is an object keyed by tracking number.
JSON
{
  "DNX123456": {
    "Reference":     "DNX123456",
    "CurrentStatus": "Delivered",
    "History": [ ... ]
  },
  "DNX789012": {
    "Reference":     "DNX789012",
    "CurrentStatus": "In transit",
    "History": [ ... ]
  }
}
JSON — 400
{ "Error": "Missing tracking_number parameter" }
POST /api/v2/pickup-points Find nearby pickup points 🔑 hash_key

Returns a list of available pickup/PUDO points near a given postal code. Requires a valid hash_key and the corresponding account must have Pickup Points permission enabled.

Parameters
ParameterTypeRequiredDescription
hash_key string Required Your API key.
zip_code string Required Postal code to search around.
country_code string Optional ISO 3166-1 alpha-2 country code. Default: "PT".
Example Request
cURL
curl -X POST https://api.delnext.com/api/v2/pickup-points \
  -d "hash_key=YOUR_API_KEY" \
  -d "zip_code=1000-001" \
  -d "country_code=PT"
Response
JSON
{
  "success": 1,
  "message": "Completed",
  "pickup_points": [
    {
      "id":      "PP001",
      "name":    "CTT Agência Central Lisboa",
      "address": "Rua do Comércio 1, 1100-150 Lisboa",
      "lat":     38.7074,
      "lng":     -9.1368
    }
  ]
}
JSON
{
  "success": 0,
  "message": "Authentication Required"
}
POST /api/v2/create-order Create a new shipping order 🔑 hash_key

Creates a new shipping order in the Delnext platform and returns a tracking code, shipping label PDF (base64), and order ID. Requires a valid hash_key.

⚠️ Credits are debited from your account upon a successful order creation. Ensure your sender and receiver details are complete and correct before calling this endpoint.
📮 Portugal postal code validation: When the receiver country is PT, the receiver_post_code is validated against the official Portuguese postal code registry. Invalid codes will return an error — use the exact format XXXX-XXX (e.g. 4000-065).
Sender Parameters
ParameterTypeRequiredDescription
hash_keystringRequiredYour API key.
sender_first_namestringRequiredSender first name.
sender_last_namestringOptionalSender last name.
sender_companystringRequiredSender company name.
sender_street_addressstringRequiredSender street address.
sender_post_codestringRequiredSender postal code.
sender_citystringRequiredSender city.
sender_countrystringRequiredISO2, ISO3 or full country name (e.g. "PT").
sender_telephonestringRequiredSender phone number.
sender_emailstringRequiredSender e-mail address.
Receiver Parameters
ParameterTypeRequiredDescription
receiver_first_namestringRequiredMax 60 characters.
receiver_last_namestringOptionalMax 60 characters.
receiver_companystringOptionalReceiver company name.
receiver_street_addressstringRequiredMax 100 characters.
receiver_post_codestringRequired5 digits if Spain.
receiver_citystringRequiredReceiver city.
receiver_countrystringRequiredISO2, ISO3 or full country name.
receiver_telephonestringRequiredReceiver phone number.
receiver_emailstringOptionalReceiver e-mail address.
Parcel Parameters
ParameterTypeRequiredDescription
parcel_weightfloatRequiredWeight in kg, min 0.01.
parcel_lengthfloatRequiredLength in cm, min 0.01.
parcel_widthfloatRequiredWidth in cm, min 0.01.
parcel_heightfloatRequiredHeight in cm, min 0.01.
parcel_num_of_volumesintegerOptionalNumber of volumes. Default: 1.
parcel_referencestringRequiredYour internal reference or order ID.
parcel_contentsstringRequiredDescription of parcel contents.
parcel_content_valuefloatConditionalDeclared value (€). Required for non-business accounts.
parcel_service_typeintegerRequiredService type ID (1–10). See Service Types.
parcel_insuredstringOptionalSet to "1" or "yes" to add insurance.
pickup_point_numberstringConditionalRequired when parcel_service_type = 4 (PUDO).
codintegerOptionalCash-on-delivery flag. 0 or 1.
products_commentstringOptionalInternal comment. Truncated to 61 characters.
Example Request
cURL
curl -X POST https://api.delnext.com/api/v2/create-order \
  -d "hash_key=YOUR_API_KEY" \
  -d "sender_first_name=João" \
  -d "sender_company=Empresa Lda" \
  -d "sender_street_address=Rua das Flores, 10" \
  -d "sender_post_code=1000-001" \
  -d "sender_city=Lisboa" \
  -d "sender_country=PT" \
  -d "sender_telephone=211451900" \
  -d "sender_email=sender@empresa.pt" \
  -d "receiver_first_name=Maria" \
  -d "receiver_street_address=Av. da Liberdade, 50" \
  -d "receiver_post_code=4000-065" \
  -d "receiver_city=Porto" \
  -d "receiver_country=PT" \
  -d "receiver_telephone=912345678" \
  -d "parcel_weight=2.5" \
  -d "parcel_length=30" \
  -d "parcel_width=20" \
  -d "parcel_height=15" \
  -d "parcel_reference=ORDER-001" \
  -d "parcel_contents=Electronics" \
  -d "parcel_service_type=1"
Response
JSON
{
  "success":       1,
  "tracking_code": "DNX789012",
  "orders_id":     98765,
  "pdf":           "JVBERi0xLjQKJcOk..."  // base64-encoded shipping label PDF
}
JSON
{
  "success": 0,
  "message": "Insufficient credits"
}
POST /api/v2/reference-label Retrieve a shipping label by reference 🔑 hash_key

Retrieves the shipping label PDF (base64) for an existing order, identified by the parcel reference number passed during order creation. Useful when the PDF was not stored at creation time, or when the Create Order response returned a "Label creation is in process" message.

Parameters
ParameterTypeRequiredDescription
hash_key string Required Your API key.
reference_number string Required The parcel_reference value used when creating the order.
Example Request
cURL
curl -X POST https://api.delnext.com/api/v2/reference-label \
  -d "hash_key=YOUR_API_KEY" \
  -d "reference_number=ORDER-001"
Response
JSON
{
  "success":   1,
  "orders_id": 98765,
  "pdf":       "JVBERi0xLjQKJcOk..."  // base64-encoded shipping label PDF
}
ℹ️ If the label is still being generated (e.g. immediately after order creation), the API returns success: 0 with a pending message. Retry after 1 minute.
JSON
{
  "success":   0,
  "orders_id": 98765,
  "message":   "Label creation is in process. Please try again in 1 minute."
}
JSON
{
  "success": 0,
  "message": "No order found for the given reference number"
}
POST /api/v2/label Download a shipping label by order ID 🔑 hash_key

Returns the shipping label PDF (base64-encoded) for a given order. You can look up by Delnext order_id or by your own reference (the parcel_reference used when creating the order). If the label was generated locally and is missing from storage, it will be automatically regenerated.

Parameters
ParameterTypeRequiredDescription
hash_key string Required Your API key.
order_id integer Conditional Delnext order ID. Required if reference is not provided.
reference string Conditional Your parcel reference (parcel_reference from Create Order). Required if order_id is not provided.
Example Request
cURL — by order_id
curl -X POST https://api.delnext.com/api/v2/label \
  -d "hash_key=YOUR_API_KEY" \
  -d "order_id=98765"
cURL — by reference
curl -X POST https://api.delnext.com/api/v2/label \
  -d "hash_key=YOUR_API_KEY" \
  -d "reference=ORDER-001"
Response
JSON
{
  "success":   1,
  "orders_id": 98765,
  "pdf":       "JVBERi0xLjQKJcOk..."  // base64-encoded shipping label PDF
}
JSON
{
  "success": 0,
  "message": "Order not found."
}
POST /api/v2/order-details Get parcel details for an order 🔑 hash_key

Returns the list of parcels associated with an order, including tracking numbers and prices. You can look up by Delnext order_id or by your own reference. When looking up by reference, all matching orders are returned.

Parameters
ParameterTypeRequiredDescription
hash_key string Required Your API key.
order_id integer Conditional Delnext order ID. Required if reference is not provided.
reference string Conditional Your parcel reference (parcel_reference from Create Order). Required if order_id is not provided.
Example Request
cURL — by order_id
curl -X POST https://api.delnext.com/api/v2/order-details \
  -d "hash_key=YOUR_API_KEY" \
  -d "order_id=98765"
cURL — by reference
curl -X POST https://api.delnext.com/api/v2/order-details \
  -d "hash_key=YOUR_API_KEY" \
  -d "reference=ORDER-001"
Response
JSON
{
  "success": 1,
  "parcels": [
    {
      "Id":             12301,
      "Reference":     "ORDER-001",
      "OrderId":        98765,
      "TrackingNumber": "DNX789012",
      "Parcel_Price":   5.50
    }
  ]
}
JSON
{
  "success": 0,
  "message": "Order not found."
}
POST /api/v2/cancel-order Cancel a pending order 🔑 hash_key

Cancels an order and all its parcels, setting their status to Voided (5). Only orders in status 1 (Pending) or 13 (Processing) can be cancelled. Orders already sent, delivered, or in any other final state will be rejected.

⚠️ Cancellation is irreversible. Once cancelled, an order cannot be reactivated. Contact Delnext support if you need further assistance.
Parameters
ParameterTypeRequiredDescription
hash_key string Required Your API key. Must have cancel order permission enabled.
order_number integer Required The Delnext orders_id returned by Create Order.
Example Request
cURL
curl -X POST https://api.delnext.com/api/v2/cancel-order \
  -d "hash_key=YOUR_API_KEY" \
  -d "order_number=98765"
Response
JSON
{
  "success": 1,
  "message": "Your order number #98765 has been cancelled successfully"
}
JSON
{
  "success": 0,
  "message": "Order number #98765 can not be cancelled. Please contact support team."
}
Service Types

The parcel_service_type field in Create Order determines the delivery method. The system may auto-correct the service type based on destination postal code and country.

IDDescriptionNotes
1Standard Home DeliveryDefault service for Portugal, Spain, France, Italy
2Priority / ExpressFaster delivery, subject to availability
3EconomyLower cost, longer transit time
4Pickup Point (PUDO)Requires pickup_point_number
Supported Countries

Country fields accept ISO 3166-1 alpha-2 codes, ISO 3166-1 alpha-3 codes, or full English country names.

ISO2Country
PTPortugal
ESSpain
FRFrance
ITItaly
DEGermany
NLNetherlands
PLPoland