Download OpenAPI specification:Download
Webhook API specification of all supported endpoints that can be implemented on partner side to enable specified functionality. Such implemented and exposed endpoints can be registered in OXnet to get several types of notifications and reports. Endpoint URLs doesn't need to be according to specified paths, it is just example, it can be artibrary URL.
See also REST API definition of OXnet system.
Please take extra care about naming package vs. parcel. Package is a term we used in first version in OXnet, now we prefer parcel. On some places we still call it package to keep backward compatibility. Same is for driver vs. courier. Driver is older name for courier. Webhooks are newer name over callbacks.
Endpoint security is something which is individual per partner and is not part of this API definition. Security is partially ensured by computing signatures (see 'ApiKeySignature' properties). Signature is computed from pre-defined part that is specified per endpoint functionality. It is defined per operations. Algorithm to encoding signature is something to be discussed individually. Standard endcoding is base64(sha256([data])), alternative encoding is lowercase(base64(sha256([data]))). Base64 encoding is applied on byte array of SHA256 hash, not its hexadecimal form. Example: content "parcel001superSECRETkey211231" will be encoded to "xI4S+9cM1QHXpRQ92hzJ9bvliStgDyo/kH9on4MwFBI=". Other encodings can be implemented in future.
Webhook API endpoints are about to change in future as the OXnet system is growing with new features. E.g. Adding new useful info about parcel entity can happen. In order to keep integrations running it is critical to have "ignore unknown" policy on receiving data. This is a strong recommendation to be able to throw away unknown properties in request body and/or unspecified custom HTTP headers. Compatible changes can be announced in some cases, but it is not necessary and the integration process cannot rely on announcements of compatible changes.
Webhook API incompatible changes will be avoided whenever it is possible with all technical and legal requirements. If some webhook API endpoint would need to be changed in an incompabible way it would be:
Time to live of notifications and reports is few hours. If endpoint is not responding within 30 seconds or fails with 4xx or 5xx HTTP code then it is automatically repeated. First few minutes it is retried several times as a try to deliver it as soon as possible. After initial few minutes the webhook is triggered once per few minutes.
All notifications, events and reports contain timestamp information. Timestamp naturally orders the events. Depending on use case and combination of registered webhooks the timestamp should be considered.
For example, if all parcel changed are consumed then timestamp can be persisted in order to be able reject change events if they are delivered out of order.
Order of events cannot be secured by other mechanism because of re-delivery support and other technical reasons.
Notification body contains basic information about parcel, notification event time. Successful result is any of specified 2xx HTTP codes. Any 4xx or 5xx will be retried.
Basic info about stored parcel
packageId required | string <uuid> (ParcelId) Parcel id |
packageNumber | string (ParcelNumber) External parcel number |
pointId | string <uuid> (PointId) Point id |
storedBy required | string Value: "driver" Constant: |
statusChangeEpochMillis required | integer <int64> (Timestamp) Event date and time in milliseconds since UNIX epoch |
apiKeySignature required | string API key signature that secures callback endpoint. Signature is encoded according to API key encoding mode, the raw value for encoding is composition of "[packageNumber][defined API key][notification event date in UTC timezone in format YYMMDD]". API key is given by partner or is empty. API key signature should be verified at callback endpoint server. |
{- "packageId": "471cc1d4-ec27-4504-b7c2-949af95662bc",
- "packageNumber": "string",
- "pointId": "20a7be04-0667-469f-8fa4-da6cf02369c8",
- "storedBy": "driver",
- "statusChangeEpochMillis": 0,
- "apiKeySignature": "string"
}
Notification body contains basic information about parcel, notification event time. Successful result is any of specified 2xx HTTP codes. Any 4xx or 5xx will be retried.
Basic info about picked up parcel
packageId required | string <uuid> (ParcelId) Parcel id |
packageNumber | string (ParcelNumber) External parcel number |
pointId | string <uuid> (PointId) Point id |
status required | string Value: "completed" Constant: |
statusChangeEpochMillis required | integer <int64> (Timestamp) Event date and time in milliseconds since UNIX epoch |
apiKeySignature required | string API key signature that secures callback endpoint. Signature is encoded according to API key encoding mode, the raw value for encoding is composition of "[packageNumber][defined API key][notification event date in UTC timezone in format YYMMDD]". API key is given by partner or is empty. API key signature should be verified at callback endpoint server. |
{- "packageId": "471cc1d4-ec27-4504-b7c2-949af95662bc",
- "packageNumber": "string",
- "pointId": "20a7be04-0667-469f-8fa4-da6cf02369c8",
- "status": "completed",
- "statusChangeEpochMillis": 0,
- "apiKeySignature": "string"
}
Notification body contains basic information about parcel, notification event time. Successful result is any of specified 2xx HTTP codes. Any 4xx or 5xx will be retried.
Basic info about displaced parcel
packageId required | string <uuid> (ParcelId) Parcel id |
packageNumber | string (ParcelNumber) External parcel number |
pointId | string <uuid> (PointId) Point id |
status required | string Value: "displaced" Constant: |
statusChangeEpochMillis required | integer <int64> (Timestamp) Event date and time in milliseconds since UNIX epoch |
apiKeySignature required | string API key signature that secures callback endpoint. Signature is encoded according to API key encoding mode, the raw value for encoding is composition of "[packageNumber][defined API key][notification event date in UTC timezone in format YYMMDD]". API key is given by partner or is empty. API key signature should be verified at callback endpoint server. |
{- "packageId": "471cc1d4-ec27-4504-b7c2-949af95662bc",
- "packageNumber": "string",
- "pointId": "20a7be04-0667-469f-8fa4-da6cf02369c8",
- "status": "displaced",
- "statusChangeEpochMillis": 0,
- "apiKeySignature": "string"
}
Notification body contains complete information about parcel that is available also on APIin context of vendor project, parcel change time. Successful result is any of specified 2xx HTTP codes. Any 4xx or 5xx will be retried. See also "carrierParcelChanged" operation.
Complete info about changed parcel
required | object (Parcel) |
timestamp required | integer <int64> (Timestamp) Event date and time in milliseconds since UNIX epoch |
apiKeySignature required | string API key signature that secures callback endpoint. Signature is encoded according to API key encoding mode, the raw value for encoding is composition of "[JSON representation of parcel data][defined API key][notification event date in UTC timezone in format YYMMDD]". API key is given by partner or is empty. API key signature should be verified at callback endpoint server. |
{- "parcel": {
- "parcelId": "345e42cb-ca03-4c8a-83ee-610d83fac952",
- "parcelNumber": "string",
- "customer": {
- "name": "string",
- "email": "string",
- "phone": "string"
}, - "cancellationReason": "string",
- "status": "ACCEPTED",
- "vendorId": "e9b57fab-1850-44d4-8499-71fd15c845a0",
- "projectId": "5a8591dd-4039-49df-9202-96385ba3eff8",
- "pointId": "20a7be04-0667-469f-8fa4-da6cf02369c8",
- "carrierIdentifier": "string",
- "itemBatches": [
- {
- "boxId": "581a0eb8-0aea-43e0-98f4-166b3a940c60",
- "boxType": "_1U1D",
- "items": [
- {
- "internalIdentifier": "string",
- "weight": 0,
- "labelUrl": "string",
- "dimensions": {
- "width": 0,
- "height": 0,
- "depth": 0
}
}
]
}
], - "reservedFromDate": "2019-08-24T14:15:22Z",
- "reservedUntilDate": "2019-08-24T14:15:22Z",
- "created": "2019-08-24T14:15:22Z",
- "modified": "2019-08-24T14:15:22Z",
- "payment": {
- "amount": "string",
- "currency": "CZK",
- "paid": "2019-08-24T14:15:22Z"
}
}, - "timestamp": 0,
- "apiKeySignature": "string"
}
Notification body contains complete information about parcel that is available also on API in context of carrier, info about courier id who stored or picked up parcel, payment data, parcel change time. Successful result is any of specified 2xx HTTP codes. Any 4xx or 5xx will be retried.
Complete info about changed parcel
required | object (CarrierParcel) |
timestamp required | integer <int64> (Timestamp) Event date and time in milliseconds since UNIX epoch |
apiKeySignature required | string API key signature that secures callback endpoint. Signature is encoded according to API key encoding mode, the raw value for encoding is composition of "[JSON representation of parcel data][defined API key][notification event date in UTC timezone in format YYMMDD]". API key is given by partner or is empty. API key signature should be verified at callback endpoint server. |
{- "parcel": {
- "parcelId": "345e42cb-ca03-4c8a-83ee-610d83fac952",
- "parcelNumber": "string",
- "customer": {
- "name": "string",
- "email": "string",
- "phone": "string"
}, - "cancellationReason": "string",
- "status": "ACCEPTED",
- "vendorId": "e9b57fab-1850-44d4-8499-71fd15c845a0",
- "projectId": "5a8591dd-4039-49df-9202-96385ba3eff8",
- "pointId": "20a7be04-0667-469f-8fa4-da6cf02369c8",
- "carrierIdentifier": "string",
- "itemBatches": [
- {
- "boxId": "581a0eb8-0aea-43e0-98f4-166b3a940c60",
- "boxType": "_1U1D",
- "items": [
- {
- "internalIdentifier": "string",
- "weight": 0,
- "labelUrl": "string",
- "dimensions": {
- "width": 0,
- "height": 0,
- "depth": 0
}
}
]
}
], - "reservedFromDate": "2019-08-24T14:15:22Z",
- "reservedUntilDate": "2019-08-24T14:15:22Z",
- "created": "2019-08-24T14:15:22Z",
- "modified": "2019-08-24T14:15:22Z",
- "payment": {
- "amount": "string",
- "currency": "CZK",
- "paid": "2019-08-24T14:15:22Z"
}, - "courierIdStored": "string",
- "courierIdDisplaced": "string"
}, - "timestamp": 0,
- "apiKeySignature": "string"
}
Report is scheduled regularly. Report contains complete list of expired parcels. Each item of the report contains both internal and external parcel ID and point ID. Successful result is any of specified 2xx HTTP codes. Any 4xx or 5xx will be retried.
Complete info about changed parcel
required | object |
timestamp required | integer <int64> (Timestamp) Event date and time in milliseconds since UNIX epoch |
apiKeySignature required | string API key signature that secures callback endpoint. Signature is encoded according to API key encoding mode, the raw value for encoding is composition of "[JSON representation of expired parcels][defined API key][notification event date in UTC timezone in format YYMMDD]". API key is given by partner or is empty. API key signature should be verified at callback endpoint server. |
{- "expiredParcels": {
- "parcelId": "345e42cb-ca03-4c8a-83ee-610d83fac952",
- "parcelNumber": "string",
- "pointId": "20a7be04-0667-469f-8fa4-da6cf02369c8"
}, - "timestamp": 0,
- "apiKeySignature": "string"
}
Verification of courier is called during courier login. As a response courier identifier is expected, same identifier is then stored by OXnet system into parcel entity. Successful result is any of specified 2xx HTTP codes. Any 4xx or 5xx is considered as unsuccessful login.
Report of expired parcels
username required | string |
password required | string |
pointId | string <uuid> (PointId) Point id |
timestamp required | integer <int64> (EpochSeconds) Time in epoch seconds |
apiKeySignature required | string API key signature that secures callback endpoint. Signature is encoded according to API key encoding mode, the raw value for encoding is composition of "[username]:[password][defined API key][notification event date in UTC timezone in format YYMMDD]". API key is given by partner or is empty. API key signature should be verified at callback endpoint server. |
{- "id": "string"
}
Notification body contains complete information about point that is available also on API. Successful result is any of specified 2xx HTTP codes. Any 4xx or 5xx will be retried.
Complete info about changed point
required | object (Point) Point description |
timestamp required | integer <int64> (Timestamp) Event date and time in milliseconds since UNIX epoch |
apiKeySignature required | string API key signature that secures callback endpoint. Signature is encoded according to API key encoding mode, the raw value for encoding is composition of "[JSON representation of point data][defined API key][notification event date in UTC timezone in format YYMMDD]". API key is given by partner or is empty. API key signature should be verified at callback endpoint server. |
{- "point": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "businessId": "string",
- "summary": "string",
- "geolocation": {
- "lng": 0,
- "lat": 0
}, - "address": {
- "addressLine1": "Kolbenova 764/12",
- "addressLine2": "string",
- "city": "string",
- "street": "Kolbenova",
- "streetNumber": 764,
- "conscriptionNumber": 12,
- "postalCode": "string",
- "country": "string"
}, - "detailedDescription": "string",
- "openingHoursSpecification": "string",
- "openingHours": {
- "monday": {
- "type": "CLOSED",
- "from": "07:00",
- "to": "23:00"
}, - "tuesday": {
- "type": "CLOSED",
- "from": "07:00",
- "to": "23:00"
}, - "wednesday": {
- "type": "CLOSED",
- "from": "07:00",
- "to": "23:00"
}, - "thursday": {
- "type": "CLOSED",
- "from": "07:00",
- "to": "23:00"
}, - "friday": {
- "type": "CLOSED",
- "from": "07:00",
- "to": "23:00"
}, - "saturday": {
- "type": "CLOSED",
- "from": "07:00",
- "to": "23:00"
}, - "sunday": {
- "type": "CLOSED",
- "from": "07:00",
- "to": "23:00"
}
}, - "serialNumber": "string",
- "status": "IN_CONSTRUCTION",
- "paymentTerminal": "NONE",
- "images": [
- {
- "url": "string"
}
], - "created": "2019-08-24T14:15:22Z",
- "modified": "2019-08-24T14:15:22Z",
- "outageReason": "string",
- "timeZone": "string"
}, - "timestamp": 0,
- "apiKeySignature": "string"
}
Notification body contains complete information about point outage that is available also on API in context of point-outage. Successful result is any of specified 2xx HTTP codes. Any 4xx or 5xx will be retried.
Complete info about changed point outage
required | object (PointOutage) |
operation required | string (PointOutageOperationEnum) Enum: "CREATED" "EDITED" "DELETED" Status:
|
timestamp required | integer <int64> (Timestamp) Event date and time in milliseconds since UNIX epoch |
apiKeySignature required | string API key signature that secures callback endpoint. Signature is encoded according to API key encoding mode, the raw value for encoding is composition of "[JSON representation of pointOutage data][defined API key][notification event date in UTC timezone in format YYMMDD]". API key is given by partner or is empty. API key signature should be verified at callback endpoint server. |
{- "pointOutage": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "pointId": "20a7be04-0667-469f-8fa4-da6cf02369c8",
- "from": "2019-08-24T14:15:22Z",
- "until": "2019-08-24T14:15:22Z",
- "reason": "string",
- "type": "PLANNED",
- "modified": "2019-08-24T14:15:22Z"
}, - "operation": "CREATED",
- "timestamp": 0,
- "apiKeySignature": "string"
}