Create XFFR-Compliant Booking
curl --request POST \
--url https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/bookings/xffr \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"messageHeader": {
"messageReferenceID": "<string>",
"messageName": "Air Waybill",
"messageType": "740",
"dateTimeStamp": "2023-11-07T05:31:56Z",
"messageVersion": "3.10",
"senderParty": [
{
"primaryID": "<string>"
}
],
"recipientParty": [
{
"primaryID": "<string>"
}
],
"conversationID": "<string>"
},
"businessHeader": {
"bookingRequestID": "<string>",
"senderAssignedID": "<string>",
"includedHeaderNote": [
{
"contentCode": "<string>",
"content": "<string>"
}
]
},
"masterConsignment": {
"grossWeightMeasure": {
"value": 4999999.55,
"unitCode": "KGM"
},
"totalPieceQuantity": 49999,
"requestorParty": {
"name": "<string>",
"roleCode": "<string>",
"primaryID": "<string>",
"accountID": "<string>",
"postalStructuredAddress": {
"postcodeCode": "<string>",
"streetName": "<string>",
"cityName": "<string>",
"cityID": "<string>",
"countryID": "<string>",
"countryName": "<string>",
"countrySubDivisionName": "<string>",
"countrySubDivisionID": "<string>"
},
"definedTradeContact": {
"personName": "<string>",
"departmentName": "<string>",
"directTelephoneCommunication": {
"completeNumber": "<string>"
},
"uriEmailCommunication": {
"uriID": "jsmith@example.com"
}
},
"role": "<string>",
"cargoAgentID": "<string>",
"specifiedCargoAgentLocation": {
"id": "<string>"
}
},
"specifiedLogisticsTransportMovement": [
{
"id": "<string>",
"spaceAllocationCode": "<string>",
"departureEvent": {
"scheduledOccurrenceDateTime": "2023-11-07T05:31:56Z",
"occurrenceLocation": {
"id": "<string>",
"name": "<string>",
"typeCode": "Airport"
},
"latestAcceptanceRelatedDateTime": "2023-11-07T05:31:56Z"
},
"arrivalEvent": {
"scheduledOccurrenceDateTime": "2023-11-07T05:31:56Z",
"occurrenceLocation": {
"id": "<string>",
"name": "<string>",
"typeCode": "Airport"
},
"latestAcceptanceRelatedDateTime": "2023-11-07T05:31:56Z"
},
"sequenceNumeric": 5000,
"modeCode": "4",
"mode": "<string>",
"pieceQuantity": 49999,
"tareGrossWeightMeasure": {
"value": 1,
"unitCode": "KGM"
},
"grossVolumeMeasure": {
"value": 1,
"unitCode": "MTQ"
},
"allotmentID": "<string>",
"serviceCode": "<string>",
"productIdentifier": "<string>",
"usedLogisticsTransportMeans": {
"name": "<string>"
},
"serviceParameters": {
"serviceParameterTypeCode": "T",
"totalTransitTime": 123,
"latestAcceptanceTime": "<string>",
"timeOfAvailability": "<string>"
}
}
],
"id": "<string>",
"grossVolumeMeasure": {
"value": 1,
"unitCode": "MTQ"
},
"densityGroupCode": "<string>",
"productID": "<string>",
"summaryDescription": "<string>",
"handlingSPHInstructions": [
{
"descriptionCode": "<string>",
"description": "<string>"
}
],
"handlingSSRInstructions": [
{
"description": "<string>",
"descriptionCode": "<string>"
}
],
"includedCustomsNote": [
{
"content": "<string>",
"contentCode": "<string>",
"subjectCode": "<string>",
"countryID": "<string>"
}
],
"includedMasterConsignmentItem": [
{
"typeCode": "<string>",
"pieceQuantity": 49999,
"grossWeightMeasure": {
"value": 1,
"unitCode": "KGM"
},
"originCountry": {
"id": "<string>"
},
"packageDetails": [
{
"typeCode": "<string>",
"quantity": 2,
"grossWeightMeasure": {
"value": 1,
"unitCode": "KGM"
},
"lengthMeasure": {
"value": 1,
"unitCode": "CMT"
},
"widthMeasure": {
"value": 1,
"unitCode": "CMT"
},
"heightMeasure": {
"value": 1,
"unitCode": "CMT"
}
}
]
}
]
}
}
'import requests
url = "https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/bookings/xffr"
payload = {
"messageHeader": {
"messageReferenceID": "<string>",
"messageName": "Air Waybill",
"messageType": "740",
"dateTimeStamp": "2023-11-07T05:31:56Z",
"messageVersion": "3.10",
"senderParty": [{ "primaryID": "<string>" }],
"recipientParty": [{ "primaryID": "<string>" }],
"conversationID": "<string>"
},
"businessHeader": {
"bookingRequestID": "<string>",
"senderAssignedID": "<string>",
"includedHeaderNote": [
{
"contentCode": "<string>",
"content": "<string>"
}
]
},
"masterConsignment": {
"grossWeightMeasure": {
"value": 4999999.55,
"unitCode": "KGM"
},
"totalPieceQuantity": 49999,
"requestorParty": {
"name": "<string>",
"roleCode": "<string>",
"primaryID": "<string>",
"accountID": "<string>",
"postalStructuredAddress": {
"postcodeCode": "<string>",
"streetName": "<string>",
"cityName": "<string>",
"cityID": "<string>",
"countryID": "<string>",
"countryName": "<string>",
"countrySubDivisionName": "<string>",
"countrySubDivisionID": "<string>"
},
"definedTradeContact": {
"personName": "<string>",
"departmentName": "<string>",
"directTelephoneCommunication": { "completeNumber": "<string>" },
"uriEmailCommunication": { "uriID": "jsmith@example.com" }
},
"role": "<string>",
"cargoAgentID": "<string>",
"specifiedCargoAgentLocation": { "id": "<string>" }
},
"specifiedLogisticsTransportMovement": [
{
"id": "<string>",
"spaceAllocationCode": "<string>",
"departureEvent": {
"scheduledOccurrenceDateTime": "2023-11-07T05:31:56Z",
"occurrenceLocation": {
"id": "<string>",
"name": "<string>",
"typeCode": "Airport"
},
"latestAcceptanceRelatedDateTime": "2023-11-07T05:31:56Z"
},
"arrivalEvent": {
"scheduledOccurrenceDateTime": "2023-11-07T05:31:56Z",
"occurrenceLocation": {
"id": "<string>",
"name": "<string>",
"typeCode": "Airport"
},
"latestAcceptanceRelatedDateTime": "2023-11-07T05:31:56Z"
},
"sequenceNumeric": 5000,
"modeCode": "4",
"mode": "<string>",
"pieceQuantity": 49999,
"tareGrossWeightMeasure": {
"value": 1,
"unitCode": "KGM"
},
"grossVolumeMeasure": {
"value": 1,
"unitCode": "MTQ"
},
"allotmentID": "<string>",
"serviceCode": "<string>",
"productIdentifier": "<string>",
"usedLogisticsTransportMeans": { "name": "<string>" },
"serviceParameters": {
"serviceParameterTypeCode": "T",
"totalTransitTime": 123,
"latestAcceptanceTime": "<string>",
"timeOfAvailability": "<string>"
}
}
],
"id": "<string>",
"grossVolumeMeasure": {
"value": 1,
"unitCode": "MTQ"
},
"densityGroupCode": "<string>",
"productID": "<string>",
"summaryDescription": "<string>",
"handlingSPHInstructions": [
{
"descriptionCode": "<string>",
"description": "<string>"
}
],
"handlingSSRInstructions": [
{
"description": "<string>",
"descriptionCode": "<string>"
}
],
"includedCustomsNote": [
{
"content": "<string>",
"contentCode": "<string>",
"subjectCode": "<string>",
"countryID": "<string>"
}
],
"includedMasterConsignmentItem": [
{
"typeCode": "<string>",
"pieceQuantity": 49999,
"grossWeightMeasure": {
"value": 1,
"unitCode": "KGM"
},
"originCountry": { "id": "<string>" },
"packageDetails": [
{
"typeCode": "<string>",
"quantity": 2,
"grossWeightMeasure": {
"value": 1,
"unitCode": "KGM"
},
"lengthMeasure": {
"value": 1,
"unitCode": "CMT"
},
"widthMeasure": {
"value": 1,
"unitCode": "CMT"
},
"heightMeasure": {
"value": 1,
"unitCode": "CMT"
}
}
]
}
]
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messageHeader: {
messageReferenceID: '<string>',
messageName: 'Air Waybill',
messageType: '740',
dateTimeStamp: '2023-11-07T05:31:56Z',
messageVersion: '3.10',
senderParty: [{primaryID: '<string>'}],
recipientParty: [{primaryID: '<string>'}],
conversationID: '<string>'
},
businessHeader: {
bookingRequestID: '<string>',
senderAssignedID: '<string>',
includedHeaderNote: [{contentCode: '<string>', content: '<string>'}]
},
masterConsignment: {
grossWeightMeasure: {value: 4999999.55, unitCode: 'KGM'},
totalPieceQuantity: 49999,
requestorParty: {
name: '<string>',
roleCode: '<string>',
primaryID: '<string>',
accountID: '<string>',
postalStructuredAddress: {
postcodeCode: '<string>',
streetName: '<string>',
cityName: '<string>',
cityID: '<string>',
countryID: '<string>',
countryName: '<string>',
countrySubDivisionName: '<string>',
countrySubDivisionID: '<string>'
},
definedTradeContact: {
personName: '<string>',
departmentName: '<string>',
directTelephoneCommunication: {completeNumber: '<string>'},
uriEmailCommunication: {uriID: 'jsmith@example.com'}
},
role: '<string>',
cargoAgentID: '<string>',
specifiedCargoAgentLocation: {id: '<string>'}
},
specifiedLogisticsTransportMovement: [
{
id: '<string>',
spaceAllocationCode: '<string>',
departureEvent: {
scheduledOccurrenceDateTime: '2023-11-07T05:31:56Z',
occurrenceLocation: {id: '<string>', name: '<string>', typeCode: 'Airport'},
latestAcceptanceRelatedDateTime: '2023-11-07T05:31:56Z'
},
arrivalEvent: {
scheduledOccurrenceDateTime: '2023-11-07T05:31:56Z',
occurrenceLocation: {id: '<string>', name: '<string>', typeCode: 'Airport'},
latestAcceptanceRelatedDateTime: '2023-11-07T05:31:56Z'
},
sequenceNumeric: 5000,
modeCode: '4',
mode: '<string>',
pieceQuantity: 49999,
tareGrossWeightMeasure: {value: 1, unitCode: 'KGM'},
grossVolumeMeasure: {value: 1, unitCode: 'MTQ'},
allotmentID: '<string>',
serviceCode: '<string>',
productIdentifier: '<string>',
usedLogisticsTransportMeans: {name: '<string>'},
serviceParameters: {
serviceParameterTypeCode: 'T',
totalTransitTime: 123,
latestAcceptanceTime: '<string>',
timeOfAvailability: '<string>'
}
}
],
id: '<string>',
grossVolumeMeasure: {value: 1, unitCode: 'MTQ'},
densityGroupCode: '<string>',
productID: '<string>',
summaryDescription: '<string>',
handlingSPHInstructions: [{descriptionCode: '<string>', description: '<string>'}],
handlingSSRInstructions: [{description: '<string>', descriptionCode: '<string>'}],
includedCustomsNote: [
{
content: '<string>',
contentCode: '<string>',
subjectCode: '<string>',
countryID: '<string>'
}
],
includedMasterConsignmentItem: [
{
typeCode: '<string>',
pieceQuantity: 49999,
grossWeightMeasure: {value: 1, unitCode: 'KGM'},
originCountry: {id: '<string>'},
packageDetails: [
{
typeCode: '<string>',
quantity: 2,
grossWeightMeasure: {value: 1, unitCode: 'KGM'},
lengthMeasure: {value: 1, unitCode: 'CMT'},
widthMeasure: {value: 1, unitCode: 'CMT'},
heightMeasure: {value: 1, unitCode: 'CMT'}
}
]
}
]
}
})
};
fetch('https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/bookings/xffr', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/bookings/xffr",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'messageHeader' => [
'messageReferenceID' => '<string>',
'messageName' => 'Air Waybill',
'messageType' => '740',
'dateTimeStamp' => '2023-11-07T05:31:56Z',
'messageVersion' => '3.10',
'senderParty' => [
[
'primaryID' => '<string>'
]
],
'recipientParty' => [
[
'primaryID' => '<string>'
]
],
'conversationID' => '<string>'
],
'businessHeader' => [
'bookingRequestID' => '<string>',
'senderAssignedID' => '<string>',
'includedHeaderNote' => [
[
'contentCode' => '<string>',
'content' => '<string>'
]
]
],
'masterConsignment' => [
'grossWeightMeasure' => [
'value' => 4999999.55,
'unitCode' => 'KGM'
],
'totalPieceQuantity' => 49999,
'requestorParty' => [
'name' => '<string>',
'roleCode' => '<string>',
'primaryID' => '<string>',
'accountID' => '<string>',
'postalStructuredAddress' => [
'postcodeCode' => '<string>',
'streetName' => '<string>',
'cityName' => '<string>',
'cityID' => '<string>',
'countryID' => '<string>',
'countryName' => '<string>',
'countrySubDivisionName' => '<string>',
'countrySubDivisionID' => '<string>'
],
'definedTradeContact' => [
'personName' => '<string>',
'departmentName' => '<string>',
'directTelephoneCommunication' => [
'completeNumber' => '<string>'
],
'uriEmailCommunication' => [
'uriID' => 'jsmith@example.com'
]
],
'role' => '<string>',
'cargoAgentID' => '<string>',
'specifiedCargoAgentLocation' => [
'id' => '<string>'
]
],
'specifiedLogisticsTransportMovement' => [
[
'id' => '<string>',
'spaceAllocationCode' => '<string>',
'departureEvent' => [
'scheduledOccurrenceDateTime' => '2023-11-07T05:31:56Z',
'occurrenceLocation' => [
'id' => '<string>',
'name' => '<string>',
'typeCode' => 'Airport'
],
'latestAcceptanceRelatedDateTime' => '2023-11-07T05:31:56Z'
],
'arrivalEvent' => [
'scheduledOccurrenceDateTime' => '2023-11-07T05:31:56Z',
'occurrenceLocation' => [
'id' => '<string>',
'name' => '<string>',
'typeCode' => 'Airport'
],
'latestAcceptanceRelatedDateTime' => '2023-11-07T05:31:56Z'
],
'sequenceNumeric' => 5000,
'modeCode' => '4',
'mode' => '<string>',
'pieceQuantity' => 49999,
'tareGrossWeightMeasure' => [
'value' => 1,
'unitCode' => 'KGM'
],
'grossVolumeMeasure' => [
'value' => 1,
'unitCode' => 'MTQ'
],
'allotmentID' => '<string>',
'serviceCode' => '<string>',
'productIdentifier' => '<string>',
'usedLogisticsTransportMeans' => [
'name' => '<string>'
],
'serviceParameters' => [
'serviceParameterTypeCode' => 'T',
'totalTransitTime' => 123,
'latestAcceptanceTime' => '<string>',
'timeOfAvailability' => '<string>'
]
]
],
'id' => '<string>',
'grossVolumeMeasure' => [
'value' => 1,
'unitCode' => 'MTQ'
],
'densityGroupCode' => '<string>',
'productID' => '<string>',
'summaryDescription' => '<string>',
'handlingSPHInstructions' => [
[
'descriptionCode' => '<string>',
'description' => '<string>'
]
],
'handlingSSRInstructions' => [
[
'description' => '<string>',
'descriptionCode' => '<string>'
]
],
'includedCustomsNote' => [
[
'content' => '<string>',
'contentCode' => '<string>',
'subjectCode' => '<string>',
'countryID' => '<string>'
]
],
'includedMasterConsignmentItem' => [
[
'typeCode' => '<string>',
'pieceQuantity' => 49999,
'grossWeightMeasure' => [
'value' => 1,
'unitCode' => 'KGM'
],
'originCountry' => [
'id' => '<string>'
],
'packageDetails' => [
[
'typeCode' => '<string>',
'quantity' => 2,
'grossWeightMeasure' => [
'value' => 1,
'unitCode' => 'KGM'
],
'lengthMeasure' => [
'value' => 1,
'unitCode' => 'CMT'
],
'widthMeasure' => [
'value' => 1,
'unitCode' => 'CMT'
],
'heightMeasure' => [
'value' => 1,
'unitCode' => 'CMT'
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/bookings/xffr"
payload := strings.NewReader("{\n \"messageHeader\": {\n \"messageReferenceID\": \"<string>\",\n \"messageName\": \"Air Waybill\",\n \"messageType\": \"740\",\n \"dateTimeStamp\": \"2023-11-07T05:31:56Z\",\n \"messageVersion\": \"3.10\",\n \"senderParty\": [\n {\n \"primaryID\": \"<string>\"\n }\n ],\n \"recipientParty\": [\n {\n \"primaryID\": \"<string>\"\n }\n ],\n \"conversationID\": \"<string>\"\n },\n \"businessHeader\": {\n \"bookingRequestID\": \"<string>\",\n \"senderAssignedID\": \"<string>\",\n \"includedHeaderNote\": [\n {\n \"contentCode\": \"<string>\",\n \"content\": \"<string>\"\n }\n ]\n },\n \"masterConsignment\": {\n \"grossWeightMeasure\": {\n \"value\": 4999999.55,\n \"unitCode\": \"KGM\"\n },\n \"totalPieceQuantity\": 49999,\n \"requestorParty\": {\n \"name\": \"<string>\",\n \"roleCode\": \"<string>\",\n \"primaryID\": \"<string>\",\n \"accountID\": \"<string>\",\n \"postalStructuredAddress\": {\n \"postcodeCode\": \"<string>\",\n \"streetName\": \"<string>\",\n \"cityName\": \"<string>\",\n \"cityID\": \"<string>\",\n \"countryID\": \"<string>\",\n \"countryName\": \"<string>\",\n \"countrySubDivisionName\": \"<string>\",\n \"countrySubDivisionID\": \"<string>\"\n },\n \"definedTradeContact\": {\n \"personName\": \"<string>\",\n \"departmentName\": \"<string>\",\n \"directTelephoneCommunication\": {\n \"completeNumber\": \"<string>\"\n },\n \"uriEmailCommunication\": {\n \"uriID\": \"jsmith@example.com\"\n }\n },\n \"role\": \"<string>\",\n \"cargoAgentID\": \"<string>\",\n \"specifiedCargoAgentLocation\": {\n \"id\": \"<string>\"\n }\n },\n \"specifiedLogisticsTransportMovement\": [\n {\n \"id\": \"<string>\",\n \"spaceAllocationCode\": \"<string>\",\n \"departureEvent\": {\n \"scheduledOccurrenceDateTime\": \"2023-11-07T05:31:56Z\",\n \"occurrenceLocation\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"typeCode\": \"Airport\"\n },\n \"latestAcceptanceRelatedDateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"arrivalEvent\": {\n \"scheduledOccurrenceDateTime\": \"2023-11-07T05:31:56Z\",\n \"occurrenceLocation\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"typeCode\": \"Airport\"\n },\n \"latestAcceptanceRelatedDateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"sequenceNumeric\": 5000,\n \"modeCode\": \"4\",\n \"mode\": \"<string>\",\n \"pieceQuantity\": 49999,\n \"tareGrossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"grossVolumeMeasure\": {\n \"value\": 1,\n \"unitCode\": \"MTQ\"\n },\n \"allotmentID\": \"<string>\",\n \"serviceCode\": \"<string>\",\n \"productIdentifier\": \"<string>\",\n \"usedLogisticsTransportMeans\": {\n \"name\": \"<string>\"\n },\n \"serviceParameters\": {\n \"serviceParameterTypeCode\": \"T\",\n \"totalTransitTime\": 123,\n \"latestAcceptanceTime\": \"<string>\",\n \"timeOfAvailability\": \"<string>\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"grossVolumeMeasure\": {\n \"value\": 1,\n \"unitCode\": \"MTQ\"\n },\n \"densityGroupCode\": \"<string>\",\n \"productID\": \"<string>\",\n \"summaryDescription\": \"<string>\",\n \"handlingSPHInstructions\": [\n {\n \"descriptionCode\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"handlingSSRInstructions\": [\n {\n \"description\": \"<string>\",\n \"descriptionCode\": \"<string>\"\n }\n ],\n \"includedCustomsNote\": [\n {\n \"content\": \"<string>\",\n \"contentCode\": \"<string>\",\n \"subjectCode\": \"<string>\",\n \"countryID\": \"<string>\"\n }\n ],\n \"includedMasterConsignmentItem\": [\n {\n \"typeCode\": \"<string>\",\n \"pieceQuantity\": 49999,\n \"grossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"originCountry\": {\n \"id\": \"<string>\"\n },\n \"packageDetails\": [\n {\n \"typeCode\": \"<string>\",\n \"quantity\": 2,\n \"grossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"lengthMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n },\n \"widthMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n },\n \"heightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n }\n }\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/bookings/xffr")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"messageHeader\": {\n \"messageReferenceID\": \"<string>\",\n \"messageName\": \"Air Waybill\",\n \"messageType\": \"740\",\n \"dateTimeStamp\": \"2023-11-07T05:31:56Z\",\n \"messageVersion\": \"3.10\",\n \"senderParty\": [\n {\n \"primaryID\": \"<string>\"\n }\n ],\n \"recipientParty\": [\n {\n \"primaryID\": \"<string>\"\n }\n ],\n \"conversationID\": \"<string>\"\n },\n \"businessHeader\": {\n \"bookingRequestID\": \"<string>\",\n \"senderAssignedID\": \"<string>\",\n \"includedHeaderNote\": [\n {\n \"contentCode\": \"<string>\",\n \"content\": \"<string>\"\n }\n ]\n },\n \"masterConsignment\": {\n \"grossWeightMeasure\": {\n \"value\": 4999999.55,\n \"unitCode\": \"KGM\"\n },\n \"totalPieceQuantity\": 49999,\n \"requestorParty\": {\n \"name\": \"<string>\",\n \"roleCode\": \"<string>\",\n \"primaryID\": \"<string>\",\n \"accountID\": \"<string>\",\n \"postalStructuredAddress\": {\n \"postcodeCode\": \"<string>\",\n \"streetName\": \"<string>\",\n \"cityName\": \"<string>\",\n \"cityID\": \"<string>\",\n \"countryID\": \"<string>\",\n \"countryName\": \"<string>\",\n \"countrySubDivisionName\": \"<string>\",\n \"countrySubDivisionID\": \"<string>\"\n },\n \"definedTradeContact\": {\n \"personName\": \"<string>\",\n \"departmentName\": \"<string>\",\n \"directTelephoneCommunication\": {\n \"completeNumber\": \"<string>\"\n },\n \"uriEmailCommunication\": {\n \"uriID\": \"jsmith@example.com\"\n }\n },\n \"role\": \"<string>\",\n \"cargoAgentID\": \"<string>\",\n \"specifiedCargoAgentLocation\": {\n \"id\": \"<string>\"\n }\n },\n \"specifiedLogisticsTransportMovement\": [\n {\n \"id\": \"<string>\",\n \"spaceAllocationCode\": \"<string>\",\n \"departureEvent\": {\n \"scheduledOccurrenceDateTime\": \"2023-11-07T05:31:56Z\",\n \"occurrenceLocation\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"typeCode\": \"Airport\"\n },\n \"latestAcceptanceRelatedDateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"arrivalEvent\": {\n \"scheduledOccurrenceDateTime\": \"2023-11-07T05:31:56Z\",\n \"occurrenceLocation\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"typeCode\": \"Airport\"\n },\n \"latestAcceptanceRelatedDateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"sequenceNumeric\": 5000,\n \"modeCode\": \"4\",\n \"mode\": \"<string>\",\n \"pieceQuantity\": 49999,\n \"tareGrossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"grossVolumeMeasure\": {\n \"value\": 1,\n \"unitCode\": \"MTQ\"\n },\n \"allotmentID\": \"<string>\",\n \"serviceCode\": \"<string>\",\n \"productIdentifier\": \"<string>\",\n \"usedLogisticsTransportMeans\": {\n \"name\": \"<string>\"\n },\n \"serviceParameters\": {\n \"serviceParameterTypeCode\": \"T\",\n \"totalTransitTime\": 123,\n \"latestAcceptanceTime\": \"<string>\",\n \"timeOfAvailability\": \"<string>\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"grossVolumeMeasure\": {\n \"value\": 1,\n \"unitCode\": \"MTQ\"\n },\n \"densityGroupCode\": \"<string>\",\n \"productID\": \"<string>\",\n \"summaryDescription\": \"<string>\",\n \"handlingSPHInstructions\": [\n {\n \"descriptionCode\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"handlingSSRInstructions\": [\n {\n \"description\": \"<string>\",\n \"descriptionCode\": \"<string>\"\n }\n ],\n \"includedCustomsNote\": [\n {\n \"content\": \"<string>\",\n \"contentCode\": \"<string>\",\n \"subjectCode\": \"<string>\",\n \"countryID\": \"<string>\"\n }\n ],\n \"includedMasterConsignmentItem\": [\n {\n \"typeCode\": \"<string>\",\n \"pieceQuantity\": 49999,\n \"grossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"originCountry\": {\n \"id\": \"<string>\"\n },\n \"packageDetails\": [\n {\n \"typeCode\": \"<string>\",\n \"quantity\": 2,\n \"grossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"lengthMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n },\n \"widthMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n },\n \"heightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n }\n }\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/bookings/xffr")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messageHeader\": {\n \"messageReferenceID\": \"<string>\",\n \"messageName\": \"Air Waybill\",\n \"messageType\": \"740\",\n \"dateTimeStamp\": \"2023-11-07T05:31:56Z\",\n \"messageVersion\": \"3.10\",\n \"senderParty\": [\n {\n \"primaryID\": \"<string>\"\n }\n ],\n \"recipientParty\": [\n {\n \"primaryID\": \"<string>\"\n }\n ],\n \"conversationID\": \"<string>\"\n },\n \"businessHeader\": {\n \"bookingRequestID\": \"<string>\",\n \"senderAssignedID\": \"<string>\",\n \"includedHeaderNote\": [\n {\n \"contentCode\": \"<string>\",\n \"content\": \"<string>\"\n }\n ]\n },\n \"masterConsignment\": {\n \"grossWeightMeasure\": {\n \"value\": 4999999.55,\n \"unitCode\": \"KGM\"\n },\n \"totalPieceQuantity\": 49999,\n \"requestorParty\": {\n \"name\": \"<string>\",\n \"roleCode\": \"<string>\",\n \"primaryID\": \"<string>\",\n \"accountID\": \"<string>\",\n \"postalStructuredAddress\": {\n \"postcodeCode\": \"<string>\",\n \"streetName\": \"<string>\",\n \"cityName\": \"<string>\",\n \"cityID\": \"<string>\",\n \"countryID\": \"<string>\",\n \"countryName\": \"<string>\",\n \"countrySubDivisionName\": \"<string>\",\n \"countrySubDivisionID\": \"<string>\"\n },\n \"definedTradeContact\": {\n \"personName\": \"<string>\",\n \"departmentName\": \"<string>\",\n \"directTelephoneCommunication\": {\n \"completeNumber\": \"<string>\"\n },\n \"uriEmailCommunication\": {\n \"uriID\": \"jsmith@example.com\"\n }\n },\n \"role\": \"<string>\",\n \"cargoAgentID\": \"<string>\",\n \"specifiedCargoAgentLocation\": {\n \"id\": \"<string>\"\n }\n },\n \"specifiedLogisticsTransportMovement\": [\n {\n \"id\": \"<string>\",\n \"spaceAllocationCode\": \"<string>\",\n \"departureEvent\": {\n \"scheduledOccurrenceDateTime\": \"2023-11-07T05:31:56Z\",\n \"occurrenceLocation\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"typeCode\": \"Airport\"\n },\n \"latestAcceptanceRelatedDateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"arrivalEvent\": {\n \"scheduledOccurrenceDateTime\": \"2023-11-07T05:31:56Z\",\n \"occurrenceLocation\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"typeCode\": \"Airport\"\n },\n \"latestAcceptanceRelatedDateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"sequenceNumeric\": 5000,\n \"modeCode\": \"4\",\n \"mode\": \"<string>\",\n \"pieceQuantity\": 49999,\n \"tareGrossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"grossVolumeMeasure\": {\n \"value\": 1,\n \"unitCode\": \"MTQ\"\n },\n \"allotmentID\": \"<string>\",\n \"serviceCode\": \"<string>\",\n \"productIdentifier\": \"<string>\",\n \"usedLogisticsTransportMeans\": {\n \"name\": \"<string>\"\n },\n \"serviceParameters\": {\n \"serviceParameterTypeCode\": \"T\",\n \"totalTransitTime\": 123,\n \"latestAcceptanceTime\": \"<string>\",\n \"timeOfAvailability\": \"<string>\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"grossVolumeMeasure\": {\n \"value\": 1,\n \"unitCode\": \"MTQ\"\n },\n \"densityGroupCode\": \"<string>\",\n \"productID\": \"<string>\",\n \"summaryDescription\": \"<string>\",\n \"handlingSPHInstructions\": [\n {\n \"descriptionCode\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"handlingSSRInstructions\": [\n {\n \"description\": \"<string>\",\n \"descriptionCode\": \"<string>\"\n }\n ],\n \"includedCustomsNote\": [\n {\n \"content\": \"<string>\",\n \"contentCode\": \"<string>\",\n \"subjectCode\": \"<string>\",\n \"countryID\": \"<string>\"\n }\n ],\n \"includedMasterConsignmentItem\": [\n {\n \"typeCode\": \"<string>\",\n \"pieceQuantity\": 49999,\n \"grossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"originCountry\": {\n \"id\": \"<string>\"\n },\n \"packageDetails\": [\n {\n \"typeCode\": \"<string>\",\n \"quantity\": 2,\n \"grossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"lengthMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n },\n \"widthMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n },\n \"heightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n }\n }\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"bookingRequestID": "<string>",
"awbNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"xffrMessageID": "<string>"
}{
"error": "validation_error",
"errorDescription": "<string>",
"errorUri": "<string>",
"validationErrors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"error": "conflict",
"errorDescription": "<string>",
"errorUri": "<string>"
}Bookings
Create XFFR-Compliant Booking
Creates a new shipment booking using IATA XFFR v3.10 standard format. Supports both XML and JSON representations of the XFFR message.
POST
/
api
/
bookings
/
xffr
Create XFFR-Compliant Booking
curl --request POST \
--url https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/bookings/xffr \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"messageHeader": {
"messageReferenceID": "<string>",
"messageName": "Air Waybill",
"messageType": "740",
"dateTimeStamp": "2023-11-07T05:31:56Z",
"messageVersion": "3.10",
"senderParty": [
{
"primaryID": "<string>"
}
],
"recipientParty": [
{
"primaryID": "<string>"
}
],
"conversationID": "<string>"
},
"businessHeader": {
"bookingRequestID": "<string>",
"senderAssignedID": "<string>",
"includedHeaderNote": [
{
"contentCode": "<string>",
"content": "<string>"
}
]
},
"masterConsignment": {
"grossWeightMeasure": {
"value": 4999999.55,
"unitCode": "KGM"
},
"totalPieceQuantity": 49999,
"requestorParty": {
"name": "<string>",
"roleCode": "<string>",
"primaryID": "<string>",
"accountID": "<string>",
"postalStructuredAddress": {
"postcodeCode": "<string>",
"streetName": "<string>",
"cityName": "<string>",
"cityID": "<string>",
"countryID": "<string>",
"countryName": "<string>",
"countrySubDivisionName": "<string>",
"countrySubDivisionID": "<string>"
},
"definedTradeContact": {
"personName": "<string>",
"departmentName": "<string>",
"directTelephoneCommunication": {
"completeNumber": "<string>"
},
"uriEmailCommunication": {
"uriID": "jsmith@example.com"
}
},
"role": "<string>",
"cargoAgentID": "<string>",
"specifiedCargoAgentLocation": {
"id": "<string>"
}
},
"specifiedLogisticsTransportMovement": [
{
"id": "<string>",
"spaceAllocationCode": "<string>",
"departureEvent": {
"scheduledOccurrenceDateTime": "2023-11-07T05:31:56Z",
"occurrenceLocation": {
"id": "<string>",
"name": "<string>",
"typeCode": "Airport"
},
"latestAcceptanceRelatedDateTime": "2023-11-07T05:31:56Z"
},
"arrivalEvent": {
"scheduledOccurrenceDateTime": "2023-11-07T05:31:56Z",
"occurrenceLocation": {
"id": "<string>",
"name": "<string>",
"typeCode": "Airport"
},
"latestAcceptanceRelatedDateTime": "2023-11-07T05:31:56Z"
},
"sequenceNumeric": 5000,
"modeCode": "4",
"mode": "<string>",
"pieceQuantity": 49999,
"tareGrossWeightMeasure": {
"value": 1,
"unitCode": "KGM"
},
"grossVolumeMeasure": {
"value": 1,
"unitCode": "MTQ"
},
"allotmentID": "<string>",
"serviceCode": "<string>",
"productIdentifier": "<string>",
"usedLogisticsTransportMeans": {
"name": "<string>"
},
"serviceParameters": {
"serviceParameterTypeCode": "T",
"totalTransitTime": 123,
"latestAcceptanceTime": "<string>",
"timeOfAvailability": "<string>"
}
}
],
"id": "<string>",
"grossVolumeMeasure": {
"value": 1,
"unitCode": "MTQ"
},
"densityGroupCode": "<string>",
"productID": "<string>",
"summaryDescription": "<string>",
"handlingSPHInstructions": [
{
"descriptionCode": "<string>",
"description": "<string>"
}
],
"handlingSSRInstructions": [
{
"description": "<string>",
"descriptionCode": "<string>"
}
],
"includedCustomsNote": [
{
"content": "<string>",
"contentCode": "<string>",
"subjectCode": "<string>",
"countryID": "<string>"
}
],
"includedMasterConsignmentItem": [
{
"typeCode": "<string>",
"pieceQuantity": 49999,
"grossWeightMeasure": {
"value": 1,
"unitCode": "KGM"
},
"originCountry": {
"id": "<string>"
},
"packageDetails": [
{
"typeCode": "<string>",
"quantity": 2,
"grossWeightMeasure": {
"value": 1,
"unitCode": "KGM"
},
"lengthMeasure": {
"value": 1,
"unitCode": "CMT"
},
"widthMeasure": {
"value": 1,
"unitCode": "CMT"
},
"heightMeasure": {
"value": 1,
"unitCode": "CMT"
}
}
]
}
]
}
}
'import requests
url = "https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/bookings/xffr"
payload = {
"messageHeader": {
"messageReferenceID": "<string>",
"messageName": "Air Waybill",
"messageType": "740",
"dateTimeStamp": "2023-11-07T05:31:56Z",
"messageVersion": "3.10",
"senderParty": [{ "primaryID": "<string>" }],
"recipientParty": [{ "primaryID": "<string>" }],
"conversationID": "<string>"
},
"businessHeader": {
"bookingRequestID": "<string>",
"senderAssignedID": "<string>",
"includedHeaderNote": [
{
"contentCode": "<string>",
"content": "<string>"
}
]
},
"masterConsignment": {
"grossWeightMeasure": {
"value": 4999999.55,
"unitCode": "KGM"
},
"totalPieceQuantity": 49999,
"requestorParty": {
"name": "<string>",
"roleCode": "<string>",
"primaryID": "<string>",
"accountID": "<string>",
"postalStructuredAddress": {
"postcodeCode": "<string>",
"streetName": "<string>",
"cityName": "<string>",
"cityID": "<string>",
"countryID": "<string>",
"countryName": "<string>",
"countrySubDivisionName": "<string>",
"countrySubDivisionID": "<string>"
},
"definedTradeContact": {
"personName": "<string>",
"departmentName": "<string>",
"directTelephoneCommunication": { "completeNumber": "<string>" },
"uriEmailCommunication": { "uriID": "jsmith@example.com" }
},
"role": "<string>",
"cargoAgentID": "<string>",
"specifiedCargoAgentLocation": { "id": "<string>" }
},
"specifiedLogisticsTransportMovement": [
{
"id": "<string>",
"spaceAllocationCode": "<string>",
"departureEvent": {
"scheduledOccurrenceDateTime": "2023-11-07T05:31:56Z",
"occurrenceLocation": {
"id": "<string>",
"name": "<string>",
"typeCode": "Airport"
},
"latestAcceptanceRelatedDateTime": "2023-11-07T05:31:56Z"
},
"arrivalEvent": {
"scheduledOccurrenceDateTime": "2023-11-07T05:31:56Z",
"occurrenceLocation": {
"id": "<string>",
"name": "<string>",
"typeCode": "Airport"
},
"latestAcceptanceRelatedDateTime": "2023-11-07T05:31:56Z"
},
"sequenceNumeric": 5000,
"modeCode": "4",
"mode": "<string>",
"pieceQuantity": 49999,
"tareGrossWeightMeasure": {
"value": 1,
"unitCode": "KGM"
},
"grossVolumeMeasure": {
"value": 1,
"unitCode": "MTQ"
},
"allotmentID": "<string>",
"serviceCode": "<string>",
"productIdentifier": "<string>",
"usedLogisticsTransportMeans": { "name": "<string>" },
"serviceParameters": {
"serviceParameterTypeCode": "T",
"totalTransitTime": 123,
"latestAcceptanceTime": "<string>",
"timeOfAvailability": "<string>"
}
}
],
"id": "<string>",
"grossVolumeMeasure": {
"value": 1,
"unitCode": "MTQ"
},
"densityGroupCode": "<string>",
"productID": "<string>",
"summaryDescription": "<string>",
"handlingSPHInstructions": [
{
"descriptionCode": "<string>",
"description": "<string>"
}
],
"handlingSSRInstructions": [
{
"description": "<string>",
"descriptionCode": "<string>"
}
],
"includedCustomsNote": [
{
"content": "<string>",
"contentCode": "<string>",
"subjectCode": "<string>",
"countryID": "<string>"
}
],
"includedMasterConsignmentItem": [
{
"typeCode": "<string>",
"pieceQuantity": 49999,
"grossWeightMeasure": {
"value": 1,
"unitCode": "KGM"
},
"originCountry": { "id": "<string>" },
"packageDetails": [
{
"typeCode": "<string>",
"quantity": 2,
"grossWeightMeasure": {
"value": 1,
"unitCode": "KGM"
},
"lengthMeasure": {
"value": 1,
"unitCode": "CMT"
},
"widthMeasure": {
"value": 1,
"unitCode": "CMT"
},
"heightMeasure": {
"value": 1,
"unitCode": "CMT"
}
}
]
}
]
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messageHeader: {
messageReferenceID: '<string>',
messageName: 'Air Waybill',
messageType: '740',
dateTimeStamp: '2023-11-07T05:31:56Z',
messageVersion: '3.10',
senderParty: [{primaryID: '<string>'}],
recipientParty: [{primaryID: '<string>'}],
conversationID: '<string>'
},
businessHeader: {
bookingRequestID: '<string>',
senderAssignedID: '<string>',
includedHeaderNote: [{contentCode: '<string>', content: '<string>'}]
},
masterConsignment: {
grossWeightMeasure: {value: 4999999.55, unitCode: 'KGM'},
totalPieceQuantity: 49999,
requestorParty: {
name: '<string>',
roleCode: '<string>',
primaryID: '<string>',
accountID: '<string>',
postalStructuredAddress: {
postcodeCode: '<string>',
streetName: '<string>',
cityName: '<string>',
cityID: '<string>',
countryID: '<string>',
countryName: '<string>',
countrySubDivisionName: '<string>',
countrySubDivisionID: '<string>'
},
definedTradeContact: {
personName: '<string>',
departmentName: '<string>',
directTelephoneCommunication: {completeNumber: '<string>'},
uriEmailCommunication: {uriID: 'jsmith@example.com'}
},
role: '<string>',
cargoAgentID: '<string>',
specifiedCargoAgentLocation: {id: '<string>'}
},
specifiedLogisticsTransportMovement: [
{
id: '<string>',
spaceAllocationCode: '<string>',
departureEvent: {
scheduledOccurrenceDateTime: '2023-11-07T05:31:56Z',
occurrenceLocation: {id: '<string>', name: '<string>', typeCode: 'Airport'},
latestAcceptanceRelatedDateTime: '2023-11-07T05:31:56Z'
},
arrivalEvent: {
scheduledOccurrenceDateTime: '2023-11-07T05:31:56Z',
occurrenceLocation: {id: '<string>', name: '<string>', typeCode: 'Airport'},
latestAcceptanceRelatedDateTime: '2023-11-07T05:31:56Z'
},
sequenceNumeric: 5000,
modeCode: '4',
mode: '<string>',
pieceQuantity: 49999,
tareGrossWeightMeasure: {value: 1, unitCode: 'KGM'},
grossVolumeMeasure: {value: 1, unitCode: 'MTQ'},
allotmentID: '<string>',
serviceCode: '<string>',
productIdentifier: '<string>',
usedLogisticsTransportMeans: {name: '<string>'},
serviceParameters: {
serviceParameterTypeCode: 'T',
totalTransitTime: 123,
latestAcceptanceTime: '<string>',
timeOfAvailability: '<string>'
}
}
],
id: '<string>',
grossVolumeMeasure: {value: 1, unitCode: 'MTQ'},
densityGroupCode: '<string>',
productID: '<string>',
summaryDescription: '<string>',
handlingSPHInstructions: [{descriptionCode: '<string>', description: '<string>'}],
handlingSSRInstructions: [{description: '<string>', descriptionCode: '<string>'}],
includedCustomsNote: [
{
content: '<string>',
contentCode: '<string>',
subjectCode: '<string>',
countryID: '<string>'
}
],
includedMasterConsignmentItem: [
{
typeCode: '<string>',
pieceQuantity: 49999,
grossWeightMeasure: {value: 1, unitCode: 'KGM'},
originCountry: {id: '<string>'},
packageDetails: [
{
typeCode: '<string>',
quantity: 2,
grossWeightMeasure: {value: 1, unitCode: 'KGM'},
lengthMeasure: {value: 1, unitCode: 'CMT'},
widthMeasure: {value: 1, unitCode: 'CMT'},
heightMeasure: {value: 1, unitCode: 'CMT'}
}
]
}
]
}
})
};
fetch('https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/bookings/xffr', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/bookings/xffr",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'messageHeader' => [
'messageReferenceID' => '<string>',
'messageName' => 'Air Waybill',
'messageType' => '740',
'dateTimeStamp' => '2023-11-07T05:31:56Z',
'messageVersion' => '3.10',
'senderParty' => [
[
'primaryID' => '<string>'
]
],
'recipientParty' => [
[
'primaryID' => '<string>'
]
],
'conversationID' => '<string>'
],
'businessHeader' => [
'bookingRequestID' => '<string>',
'senderAssignedID' => '<string>',
'includedHeaderNote' => [
[
'contentCode' => '<string>',
'content' => '<string>'
]
]
],
'masterConsignment' => [
'grossWeightMeasure' => [
'value' => 4999999.55,
'unitCode' => 'KGM'
],
'totalPieceQuantity' => 49999,
'requestorParty' => [
'name' => '<string>',
'roleCode' => '<string>',
'primaryID' => '<string>',
'accountID' => '<string>',
'postalStructuredAddress' => [
'postcodeCode' => '<string>',
'streetName' => '<string>',
'cityName' => '<string>',
'cityID' => '<string>',
'countryID' => '<string>',
'countryName' => '<string>',
'countrySubDivisionName' => '<string>',
'countrySubDivisionID' => '<string>'
],
'definedTradeContact' => [
'personName' => '<string>',
'departmentName' => '<string>',
'directTelephoneCommunication' => [
'completeNumber' => '<string>'
],
'uriEmailCommunication' => [
'uriID' => 'jsmith@example.com'
]
],
'role' => '<string>',
'cargoAgentID' => '<string>',
'specifiedCargoAgentLocation' => [
'id' => '<string>'
]
],
'specifiedLogisticsTransportMovement' => [
[
'id' => '<string>',
'spaceAllocationCode' => '<string>',
'departureEvent' => [
'scheduledOccurrenceDateTime' => '2023-11-07T05:31:56Z',
'occurrenceLocation' => [
'id' => '<string>',
'name' => '<string>',
'typeCode' => 'Airport'
],
'latestAcceptanceRelatedDateTime' => '2023-11-07T05:31:56Z'
],
'arrivalEvent' => [
'scheduledOccurrenceDateTime' => '2023-11-07T05:31:56Z',
'occurrenceLocation' => [
'id' => '<string>',
'name' => '<string>',
'typeCode' => 'Airport'
],
'latestAcceptanceRelatedDateTime' => '2023-11-07T05:31:56Z'
],
'sequenceNumeric' => 5000,
'modeCode' => '4',
'mode' => '<string>',
'pieceQuantity' => 49999,
'tareGrossWeightMeasure' => [
'value' => 1,
'unitCode' => 'KGM'
],
'grossVolumeMeasure' => [
'value' => 1,
'unitCode' => 'MTQ'
],
'allotmentID' => '<string>',
'serviceCode' => '<string>',
'productIdentifier' => '<string>',
'usedLogisticsTransportMeans' => [
'name' => '<string>'
],
'serviceParameters' => [
'serviceParameterTypeCode' => 'T',
'totalTransitTime' => 123,
'latestAcceptanceTime' => '<string>',
'timeOfAvailability' => '<string>'
]
]
],
'id' => '<string>',
'grossVolumeMeasure' => [
'value' => 1,
'unitCode' => 'MTQ'
],
'densityGroupCode' => '<string>',
'productID' => '<string>',
'summaryDescription' => '<string>',
'handlingSPHInstructions' => [
[
'descriptionCode' => '<string>',
'description' => '<string>'
]
],
'handlingSSRInstructions' => [
[
'description' => '<string>',
'descriptionCode' => '<string>'
]
],
'includedCustomsNote' => [
[
'content' => '<string>',
'contentCode' => '<string>',
'subjectCode' => '<string>',
'countryID' => '<string>'
]
],
'includedMasterConsignmentItem' => [
[
'typeCode' => '<string>',
'pieceQuantity' => 49999,
'grossWeightMeasure' => [
'value' => 1,
'unitCode' => 'KGM'
],
'originCountry' => [
'id' => '<string>'
],
'packageDetails' => [
[
'typeCode' => '<string>',
'quantity' => 2,
'grossWeightMeasure' => [
'value' => 1,
'unitCode' => 'KGM'
],
'lengthMeasure' => [
'value' => 1,
'unitCode' => 'CMT'
],
'widthMeasure' => [
'value' => 1,
'unitCode' => 'CMT'
],
'heightMeasure' => [
'value' => 1,
'unitCode' => 'CMT'
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/bookings/xffr"
payload := strings.NewReader("{\n \"messageHeader\": {\n \"messageReferenceID\": \"<string>\",\n \"messageName\": \"Air Waybill\",\n \"messageType\": \"740\",\n \"dateTimeStamp\": \"2023-11-07T05:31:56Z\",\n \"messageVersion\": \"3.10\",\n \"senderParty\": [\n {\n \"primaryID\": \"<string>\"\n }\n ],\n \"recipientParty\": [\n {\n \"primaryID\": \"<string>\"\n }\n ],\n \"conversationID\": \"<string>\"\n },\n \"businessHeader\": {\n \"bookingRequestID\": \"<string>\",\n \"senderAssignedID\": \"<string>\",\n \"includedHeaderNote\": [\n {\n \"contentCode\": \"<string>\",\n \"content\": \"<string>\"\n }\n ]\n },\n \"masterConsignment\": {\n \"grossWeightMeasure\": {\n \"value\": 4999999.55,\n \"unitCode\": \"KGM\"\n },\n \"totalPieceQuantity\": 49999,\n \"requestorParty\": {\n \"name\": \"<string>\",\n \"roleCode\": \"<string>\",\n \"primaryID\": \"<string>\",\n \"accountID\": \"<string>\",\n \"postalStructuredAddress\": {\n \"postcodeCode\": \"<string>\",\n \"streetName\": \"<string>\",\n \"cityName\": \"<string>\",\n \"cityID\": \"<string>\",\n \"countryID\": \"<string>\",\n \"countryName\": \"<string>\",\n \"countrySubDivisionName\": \"<string>\",\n \"countrySubDivisionID\": \"<string>\"\n },\n \"definedTradeContact\": {\n \"personName\": \"<string>\",\n \"departmentName\": \"<string>\",\n \"directTelephoneCommunication\": {\n \"completeNumber\": \"<string>\"\n },\n \"uriEmailCommunication\": {\n \"uriID\": \"jsmith@example.com\"\n }\n },\n \"role\": \"<string>\",\n \"cargoAgentID\": \"<string>\",\n \"specifiedCargoAgentLocation\": {\n \"id\": \"<string>\"\n }\n },\n \"specifiedLogisticsTransportMovement\": [\n {\n \"id\": \"<string>\",\n \"spaceAllocationCode\": \"<string>\",\n \"departureEvent\": {\n \"scheduledOccurrenceDateTime\": \"2023-11-07T05:31:56Z\",\n \"occurrenceLocation\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"typeCode\": \"Airport\"\n },\n \"latestAcceptanceRelatedDateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"arrivalEvent\": {\n \"scheduledOccurrenceDateTime\": \"2023-11-07T05:31:56Z\",\n \"occurrenceLocation\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"typeCode\": \"Airport\"\n },\n \"latestAcceptanceRelatedDateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"sequenceNumeric\": 5000,\n \"modeCode\": \"4\",\n \"mode\": \"<string>\",\n \"pieceQuantity\": 49999,\n \"tareGrossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"grossVolumeMeasure\": {\n \"value\": 1,\n \"unitCode\": \"MTQ\"\n },\n \"allotmentID\": \"<string>\",\n \"serviceCode\": \"<string>\",\n \"productIdentifier\": \"<string>\",\n \"usedLogisticsTransportMeans\": {\n \"name\": \"<string>\"\n },\n \"serviceParameters\": {\n \"serviceParameterTypeCode\": \"T\",\n \"totalTransitTime\": 123,\n \"latestAcceptanceTime\": \"<string>\",\n \"timeOfAvailability\": \"<string>\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"grossVolumeMeasure\": {\n \"value\": 1,\n \"unitCode\": \"MTQ\"\n },\n \"densityGroupCode\": \"<string>\",\n \"productID\": \"<string>\",\n \"summaryDescription\": \"<string>\",\n \"handlingSPHInstructions\": [\n {\n \"descriptionCode\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"handlingSSRInstructions\": [\n {\n \"description\": \"<string>\",\n \"descriptionCode\": \"<string>\"\n }\n ],\n \"includedCustomsNote\": [\n {\n \"content\": \"<string>\",\n \"contentCode\": \"<string>\",\n \"subjectCode\": \"<string>\",\n \"countryID\": \"<string>\"\n }\n ],\n \"includedMasterConsignmentItem\": [\n {\n \"typeCode\": \"<string>\",\n \"pieceQuantity\": 49999,\n \"grossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"originCountry\": {\n \"id\": \"<string>\"\n },\n \"packageDetails\": [\n {\n \"typeCode\": \"<string>\",\n \"quantity\": 2,\n \"grossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"lengthMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n },\n \"widthMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n },\n \"heightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n }\n }\n ]\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/bookings/xffr")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"messageHeader\": {\n \"messageReferenceID\": \"<string>\",\n \"messageName\": \"Air Waybill\",\n \"messageType\": \"740\",\n \"dateTimeStamp\": \"2023-11-07T05:31:56Z\",\n \"messageVersion\": \"3.10\",\n \"senderParty\": [\n {\n \"primaryID\": \"<string>\"\n }\n ],\n \"recipientParty\": [\n {\n \"primaryID\": \"<string>\"\n }\n ],\n \"conversationID\": \"<string>\"\n },\n \"businessHeader\": {\n \"bookingRequestID\": \"<string>\",\n \"senderAssignedID\": \"<string>\",\n \"includedHeaderNote\": [\n {\n \"contentCode\": \"<string>\",\n \"content\": \"<string>\"\n }\n ]\n },\n \"masterConsignment\": {\n \"grossWeightMeasure\": {\n \"value\": 4999999.55,\n \"unitCode\": \"KGM\"\n },\n \"totalPieceQuantity\": 49999,\n \"requestorParty\": {\n \"name\": \"<string>\",\n \"roleCode\": \"<string>\",\n \"primaryID\": \"<string>\",\n \"accountID\": \"<string>\",\n \"postalStructuredAddress\": {\n \"postcodeCode\": \"<string>\",\n \"streetName\": \"<string>\",\n \"cityName\": \"<string>\",\n \"cityID\": \"<string>\",\n \"countryID\": \"<string>\",\n \"countryName\": \"<string>\",\n \"countrySubDivisionName\": \"<string>\",\n \"countrySubDivisionID\": \"<string>\"\n },\n \"definedTradeContact\": {\n \"personName\": \"<string>\",\n \"departmentName\": \"<string>\",\n \"directTelephoneCommunication\": {\n \"completeNumber\": \"<string>\"\n },\n \"uriEmailCommunication\": {\n \"uriID\": \"jsmith@example.com\"\n }\n },\n \"role\": \"<string>\",\n \"cargoAgentID\": \"<string>\",\n \"specifiedCargoAgentLocation\": {\n \"id\": \"<string>\"\n }\n },\n \"specifiedLogisticsTransportMovement\": [\n {\n \"id\": \"<string>\",\n \"spaceAllocationCode\": \"<string>\",\n \"departureEvent\": {\n \"scheduledOccurrenceDateTime\": \"2023-11-07T05:31:56Z\",\n \"occurrenceLocation\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"typeCode\": \"Airport\"\n },\n \"latestAcceptanceRelatedDateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"arrivalEvent\": {\n \"scheduledOccurrenceDateTime\": \"2023-11-07T05:31:56Z\",\n \"occurrenceLocation\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"typeCode\": \"Airport\"\n },\n \"latestAcceptanceRelatedDateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"sequenceNumeric\": 5000,\n \"modeCode\": \"4\",\n \"mode\": \"<string>\",\n \"pieceQuantity\": 49999,\n \"tareGrossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"grossVolumeMeasure\": {\n \"value\": 1,\n \"unitCode\": \"MTQ\"\n },\n \"allotmentID\": \"<string>\",\n \"serviceCode\": \"<string>\",\n \"productIdentifier\": \"<string>\",\n \"usedLogisticsTransportMeans\": {\n \"name\": \"<string>\"\n },\n \"serviceParameters\": {\n \"serviceParameterTypeCode\": \"T\",\n \"totalTransitTime\": 123,\n \"latestAcceptanceTime\": \"<string>\",\n \"timeOfAvailability\": \"<string>\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"grossVolumeMeasure\": {\n \"value\": 1,\n \"unitCode\": \"MTQ\"\n },\n \"densityGroupCode\": \"<string>\",\n \"productID\": \"<string>\",\n \"summaryDescription\": \"<string>\",\n \"handlingSPHInstructions\": [\n {\n \"descriptionCode\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"handlingSSRInstructions\": [\n {\n \"description\": \"<string>\",\n \"descriptionCode\": \"<string>\"\n }\n ],\n \"includedCustomsNote\": [\n {\n \"content\": \"<string>\",\n \"contentCode\": \"<string>\",\n \"subjectCode\": \"<string>\",\n \"countryID\": \"<string>\"\n }\n ],\n \"includedMasterConsignmentItem\": [\n {\n \"typeCode\": \"<string>\",\n \"pieceQuantity\": 49999,\n \"grossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"originCountry\": {\n \"id\": \"<string>\"\n },\n \"packageDetails\": [\n {\n \"typeCode\": \"<string>\",\n \"quantity\": 2,\n \"grossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"lengthMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n },\n \"widthMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n },\n \"heightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n }\n }\n ]\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/bookings/xffr")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messageHeader\": {\n \"messageReferenceID\": \"<string>\",\n \"messageName\": \"Air Waybill\",\n \"messageType\": \"740\",\n \"dateTimeStamp\": \"2023-11-07T05:31:56Z\",\n \"messageVersion\": \"3.10\",\n \"senderParty\": [\n {\n \"primaryID\": \"<string>\"\n }\n ],\n \"recipientParty\": [\n {\n \"primaryID\": \"<string>\"\n }\n ],\n \"conversationID\": \"<string>\"\n },\n \"businessHeader\": {\n \"bookingRequestID\": \"<string>\",\n \"senderAssignedID\": \"<string>\",\n \"includedHeaderNote\": [\n {\n \"contentCode\": \"<string>\",\n \"content\": \"<string>\"\n }\n ]\n },\n \"masterConsignment\": {\n \"grossWeightMeasure\": {\n \"value\": 4999999.55,\n \"unitCode\": \"KGM\"\n },\n \"totalPieceQuantity\": 49999,\n \"requestorParty\": {\n \"name\": \"<string>\",\n \"roleCode\": \"<string>\",\n \"primaryID\": \"<string>\",\n \"accountID\": \"<string>\",\n \"postalStructuredAddress\": {\n \"postcodeCode\": \"<string>\",\n \"streetName\": \"<string>\",\n \"cityName\": \"<string>\",\n \"cityID\": \"<string>\",\n \"countryID\": \"<string>\",\n \"countryName\": \"<string>\",\n \"countrySubDivisionName\": \"<string>\",\n \"countrySubDivisionID\": \"<string>\"\n },\n \"definedTradeContact\": {\n \"personName\": \"<string>\",\n \"departmentName\": \"<string>\",\n \"directTelephoneCommunication\": {\n \"completeNumber\": \"<string>\"\n },\n \"uriEmailCommunication\": {\n \"uriID\": \"jsmith@example.com\"\n }\n },\n \"role\": \"<string>\",\n \"cargoAgentID\": \"<string>\",\n \"specifiedCargoAgentLocation\": {\n \"id\": \"<string>\"\n }\n },\n \"specifiedLogisticsTransportMovement\": [\n {\n \"id\": \"<string>\",\n \"spaceAllocationCode\": \"<string>\",\n \"departureEvent\": {\n \"scheduledOccurrenceDateTime\": \"2023-11-07T05:31:56Z\",\n \"occurrenceLocation\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"typeCode\": \"Airport\"\n },\n \"latestAcceptanceRelatedDateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"arrivalEvent\": {\n \"scheduledOccurrenceDateTime\": \"2023-11-07T05:31:56Z\",\n \"occurrenceLocation\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"typeCode\": \"Airport\"\n },\n \"latestAcceptanceRelatedDateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"sequenceNumeric\": 5000,\n \"modeCode\": \"4\",\n \"mode\": \"<string>\",\n \"pieceQuantity\": 49999,\n \"tareGrossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"grossVolumeMeasure\": {\n \"value\": 1,\n \"unitCode\": \"MTQ\"\n },\n \"allotmentID\": \"<string>\",\n \"serviceCode\": \"<string>\",\n \"productIdentifier\": \"<string>\",\n \"usedLogisticsTransportMeans\": {\n \"name\": \"<string>\"\n },\n \"serviceParameters\": {\n \"serviceParameterTypeCode\": \"T\",\n \"totalTransitTime\": 123,\n \"latestAcceptanceTime\": \"<string>\",\n \"timeOfAvailability\": \"<string>\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"grossVolumeMeasure\": {\n \"value\": 1,\n \"unitCode\": \"MTQ\"\n },\n \"densityGroupCode\": \"<string>\",\n \"productID\": \"<string>\",\n \"summaryDescription\": \"<string>\",\n \"handlingSPHInstructions\": [\n {\n \"descriptionCode\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"handlingSSRInstructions\": [\n {\n \"description\": \"<string>\",\n \"descriptionCode\": \"<string>\"\n }\n ],\n \"includedCustomsNote\": [\n {\n \"content\": \"<string>\",\n \"contentCode\": \"<string>\",\n \"subjectCode\": \"<string>\",\n \"countryID\": \"<string>\"\n }\n ],\n \"includedMasterConsignmentItem\": [\n {\n \"typeCode\": \"<string>\",\n \"pieceQuantity\": 49999,\n \"grossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"originCountry\": {\n \"id\": \"<string>\"\n },\n \"packageDetails\": [\n {\n \"typeCode\": \"<string>\",\n \"quantity\": 2,\n \"grossWeightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"KGM\"\n },\n \"lengthMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n },\n \"widthMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n },\n \"heightMeasure\": {\n \"value\": 1,\n \"unitCode\": \"CMT\"\n }\n }\n ]\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"bookingRequestID": "<string>",
"awbNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"xffrMessageID": "<string>"
}{
"error": "validation_error",
"errorDescription": "<string>",
"errorUri": "<string>",
"validationErrors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"error": "conflict",
"errorDescription": "<string>",
"errorUri": "<string>"
}Reference Documentation
For more information on XFFR-compliant bookings using IATA standards, please refer to:
- IATA XFFR v3.10
- IATA Reference: XFFR / EQ.E6ACA.10
- Message Type: 740 (Air Waybill)
- Version: 3.10
Authorizations
ApiKeyAuthApiKeyHeader
Body
application/jsonapplication/xml
⌘I