Skip to content

Integration

Get started

To start receiving webhook events in your app:

  1. Create and test a webhook endpoint handler to receive event data POST requests.
  2. Contact your InPost Account Manager or the Integration Team.
  3. Share events you want to subscribe to (see Tracking Events).
  4. Share your HTTPS URL that should receive the notifications.
  5. Secure webhook by choosing your authentication method and exchange secrets with InPost.

Payload

Every webhook call is a HTTP POST with a JSON body and a fixed set of headers.

Headers

HeaderExampleDescription
x-inpost-api-version2024-06-01Version of the payload being used in the request
x-inpost-topicShipment.TrackingAll tracking events have this header set to Shipment.Tracking
x-inpost-event-idXXX123Unique id of the event
x-inpost-timestamp2024-04-26T14:00:03.165ZDate and time when the webhook event is sent, in UTC
x-inpost-signatureXXXXXXX12345Signature of the request

Body

As of today, there is only one webhook event object structure, used for the Shipment.Tracking topic. A field reference and a JSON example are below.

Example

{
  "customerReference": "XXXXXX",
  "trackingNumber": "XXXXXX",
  "eventId": "XYZ123",
  "eventCode": "ABC987",
  "timestamp": "2024-04-26T14:00:03.165Z",
  "location": {
    "id": "PL_ASDF",
    "type": "PUDO_POINT",
    "name": "ASDF",
    "address": "Street Example 1",
    "postalCode": "12-345",
    "city": "Town Example 1",
    "country": "PL",
    "description": "On the left side of Petrol Station XYZ"
  },
  "delivery": {
    "recipientName": "John Doe",
    "deliveryNotes": "Leave behind a flower pot"
  },
  "shipment": {
    "type": "OUTBOUND"
  },
  "returnToSender": {
    "trackingNumber": "XXXXXXXX"
  },
  "newDestination": {
    "id": "PL_XYZ",
    "type": "LOCKER_POINT",
    "name": "XYZ",
    "address": "Street Example 2",
    "postalCode": "98-765",
    "city": "Town Example 2",
    "country": "PL",
    "description": "Behind a shop building"
  }
}
  • Event Object (root object)
FieldNullable?TypeDescription
customerReferenceYesStringReference/ID passed by the merchant when creating the shipment
trackingNumberNoStringTracking number generated by InPost
eventIdNoStringUnique id of the event (same as x-inpost-event-id header)
eventCodeNoStringCode of the event (refer to the event catalogue documentation for the possible values)
timestampNoStringDate and time when the event occurred, in an ISO 8601 standard format, e.g. 2026-01-01T01:01:01.123Z
locationYesLocation objectLocation of the event
deliveryYesDelivery objectInformation about the delivery. Returned only for delivery events (see Tracking Events for the full catalogue).
shipmentYesShipment objectInformation about the shipment, when it's an outbound or return event
returnToSenderYesReturnToSender objectThe parcel's data for return-to-sender. Returned only for return-to-sender events (RTS.1001)
newDestinationYesLocation objectInformation about the new destination for a redirected parcel. Returned only for redirection events: LMD.3001, LMD.3002, LMD.3003, LMD.3004, LMD.3005, LMD.3006, LMD.3007, LMD.3012, LMD.3013, LMD.3014
  • Location Object
FieldNullable?TypeDescription
idYesStringID of the location, returned only when type is LOCKER_POINT or PUDO_POINT
typeNoStringType of location, allowable values: LOCKER_POINT, LOGISTIC_CENTER, PUDO_POINT, ADDRESS, MPOK_POINT
nameYesStringName of the location, returned only when type is LOCKER_POINT or PUDO_POINT
addressYesStringStreet, door number
postalCodeYesStringPostal code
cityYesStringCity name
countryYesStringCountry code (ISO 3166-1 alpha-2), e.g. PL
descriptionYesStringDescription of the location, returned only when type is LOCKER_POINT or PUDO_POINT
  • Delivery Object
FieldNullable?TypeDescription
recipientNameYesStringName of person who received the parcel
deliveryNotesYesStringNotes provided by the courier upon delivery
  • Shipment Object
FieldNullable?TypeDescription
typeYesStringType of shipment, allowable values: OUTBOUND, RETURN
  • ReturnToSender Object
FieldNullable?TypeDescription
trackingNumberYesStringTracking number of the returned parcel

Security

No authentication is enforced by default, but it is strongly recommended that you implement one of the following, so your endpoint isn't open to spoofed requests.

MethodHow it worksBest for
Webhook SignatureInPost signs each request, subscriber system verifies the signature using a shared secretRecommended — no extra network exposure, verifies both an integrity and an origin
Custom Header(s)A shared secret value sent as a header (e.g. x-api-key) on every requestSimple setups where header-based checks are enough
Basic AuthenticationStandard HTTP Authorization: Basic <credentials>Legacy integrations with an existing Basic Auth gateway

We are supporting two methods of signing webhooks:

  • HMAC signature generated using a shared secret key
  • Digital signature generated based on a rotated InPost public key (deprecated)

InPost signs the request and sends the signature in the x-inpost-signature header.

During configuration, subscriber must choose if signature should include request <body> or <x-inpost-timestamp>.<body>.

See Webhook Signature Verification with a detailed explanation, verified examples, and code samples in Python, Java, .NET, PHP and JavaScript.

Custom Header(s)

A value previously agreed with InPost is sent as an HTTP header on every request, e.g. x-api-key: <value>. The header name is configurable, and you can request up to 3 custom headers. Share with the Integration Team:

  • header name (e.g. x-api-key)
  • header value

Basic Authentication

Standard HTTP Basic access authentication: Authorization: Basic <credentials>, where <credentials> is the Base64 encoding of user:password. Share with the Integration Team:

  • user
  • password (12-30 characters)