curl --request PUT \
--url https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/reply/{requestId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "approved",
"allocatedStock": 100,
"validFrom": "2024-01-15",
"validTo": "2025-01-15",
"startNumber": "157000001",
"endNumber": "157000100",
"notes": "Stock allocated as requested. Please ensure proper usage compliance.",
"rejectionReason": "Insufficient stock availability"
}
'import requests
url = "https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/reply/{requestId}"
payload = {
"status": "approved",
"allocatedStock": 100,
"validFrom": "2024-01-15",
"validTo": "2025-01-15",
"startNumber": "157000001",
"endNumber": "157000100",
"notes": "Stock allocated as requested. Please ensure proper usage compliance.",
"rejectionReason": "Insufficient stock availability"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
status: 'approved',
allocatedStock: 100,
validFrom: '2024-01-15',
validTo: '2025-01-15',
startNumber: '157000001',
endNumber: '157000100',
notes: 'Stock allocated as requested. Please ensure proper usage compliance.',
rejectionReason: 'Insufficient stock availability'
})
};
fetch('https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/reply/{requestId}', 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/awb-stock/reply/{requestId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'status' => 'approved',
'allocatedStock' => 100,
'validFrom' => '2024-01-15',
'validTo' => '2025-01-15',
'startNumber' => '157000001',
'endNumber' => '157000100',
'notes' => 'Stock allocated as requested. Please ensure proper usage compliance.',
'rejectionReason' => 'Insufficient stock availability'
]),
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/awb-stock/reply/{requestId}"
payload := strings.NewReader("{\n \"status\": \"approved\",\n \"allocatedStock\": 100,\n \"validFrom\": \"2024-01-15\",\n \"validTo\": \"2025-01-15\",\n \"startNumber\": \"157000001\",\n \"endNumber\": \"157000100\",\n \"notes\": \"Stock allocated as requested. Please ensure proper usage compliance.\",\n \"rejectionReason\": \"Insufficient stock availability\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/reply/{requestId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"approved\",\n \"allocatedStock\": 100,\n \"validFrom\": \"2024-01-15\",\n \"validTo\": \"2025-01-15\",\n \"startNumber\": \"157000001\",\n \"endNumber\": \"157000100\",\n \"notes\": \"Stock allocated as requested. Please ensure proper usage compliance.\",\n \"rejectionReason\": \"Insufficient stock availability\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/reply/{requestId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"approved\",\n \"allocatedStock\": 100,\n \"validFrom\": \"2024-01-15\",\n \"validTo\": \"2025-01-15\",\n \"startNumber\": \"157000001\",\n \"endNumber\": \"157000100\",\n \"notes\": \"Stock allocated as requested. Please ensure proper usage compliance.\",\n \"rejectionReason\": \"Insufficient stock availability\"\n}"
response = http.request(request)
puts response.read_body{
"requestId": "req-123456789",
"status": "approved",
"allocatedStock": 100,
"repliedAt": "2024-01-15T14:30:00Z",
"startNumber": "157000001",
"endNumber": "157000100",
"validFrom": "2024-01-15",
"validTo": "2025-01-15",
"notes": "Stock allocated as requested. Please ensure proper usage compliance."
}{
"error": "validation_error",
"errorDescription": "Invalid AWB stock reply parameters",
"errorUri": "https://docs.example.com/awb-stock/reply-errors",
"validationErrors": [
{
"field": "allocatedStock",
"message": "Allocated stock must be between 0 and requested amount",
"code": "INVALID_ALLOCATION"
},
{
"field": "status",
"message": "Status must be one of: approved, rejected, partially_approved",
"code": "INVALID_STATUS"
}
]
}{
"error": "invalid_grant",
"errorDescription": "Invalid client credentials provided",
"errorUri": "https://docs.example.com/oauth/errors"
}Reply to AWB Stock Request
Airline replies to an AWB stock request with approval/rejection and allocation details
curl --request PUT \
--url https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/reply/{requestId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "approved",
"allocatedStock": 100,
"validFrom": "2024-01-15",
"validTo": "2025-01-15",
"startNumber": "157000001",
"endNumber": "157000100",
"notes": "Stock allocated as requested. Please ensure proper usage compliance.",
"rejectionReason": "Insufficient stock availability"
}
'import requests
url = "https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/reply/{requestId}"
payload = {
"status": "approved",
"allocatedStock": 100,
"validFrom": "2024-01-15",
"validTo": "2025-01-15",
"startNumber": "157000001",
"endNumber": "157000100",
"notes": "Stock allocated as requested. Please ensure proper usage compliance.",
"rejectionReason": "Insufficient stock availability"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
status: 'approved',
allocatedStock: 100,
validFrom: '2024-01-15',
validTo: '2025-01-15',
startNumber: '157000001',
endNumber: '157000100',
notes: 'Stock allocated as requested. Please ensure proper usage compliance.',
rejectionReason: 'Insufficient stock availability'
})
};
fetch('https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/reply/{requestId}', 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/awb-stock/reply/{requestId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'status' => 'approved',
'allocatedStock' => 100,
'validFrom' => '2024-01-15',
'validTo' => '2025-01-15',
'startNumber' => '157000001',
'endNumber' => '157000100',
'notes' => 'Stock allocated as requested. Please ensure proper usage compliance.',
'rejectionReason' => 'Insufficient stock availability'
]),
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/awb-stock/reply/{requestId}"
payload := strings.NewReader("{\n \"status\": \"approved\",\n \"allocatedStock\": 100,\n \"validFrom\": \"2024-01-15\",\n \"validTo\": \"2025-01-15\",\n \"startNumber\": \"157000001\",\n \"endNumber\": \"157000100\",\n \"notes\": \"Stock allocated as requested. Please ensure proper usage compliance.\",\n \"rejectionReason\": \"Insufficient stock availability\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/reply/{requestId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"approved\",\n \"allocatedStock\": 100,\n \"validFrom\": \"2024-01-15\",\n \"validTo\": \"2025-01-15\",\n \"startNumber\": \"157000001\",\n \"endNumber\": \"157000100\",\n \"notes\": \"Stock allocated as requested. Please ensure proper usage compliance.\",\n \"rejectionReason\": \"Insufficient stock availability\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/reply/{requestId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"approved\",\n \"allocatedStock\": 100,\n \"validFrom\": \"2024-01-15\",\n \"validTo\": \"2025-01-15\",\n \"startNumber\": \"157000001\",\n \"endNumber\": \"157000100\",\n \"notes\": \"Stock allocated as requested. Please ensure proper usage compliance.\",\n \"rejectionReason\": \"Insufficient stock availability\"\n}"
response = http.request(request)
puts response.read_body{
"requestId": "req-123456789",
"status": "approved",
"allocatedStock": 100,
"repliedAt": "2024-01-15T14:30:00Z",
"startNumber": "157000001",
"endNumber": "157000100",
"validFrom": "2024-01-15",
"validTo": "2025-01-15",
"notes": "Stock allocated as requested. Please ensure proper usage compliance."
}{
"error": "validation_error",
"errorDescription": "Invalid AWB stock reply parameters",
"errorUri": "https://docs.example.com/awb-stock/reply-errors",
"validationErrors": [
{
"field": "allocatedStock",
"message": "Allocated stock must be between 0 and requested amount",
"code": "INVALID_ALLOCATION"
},
{
"field": "status",
"message": "Status must be one of: approved, rejected, partially_approved",
"code": "INVALID_STATUS"
}
]
}{
"error": "invalid_grant",
"errorDescription": "Invalid client credentials provided",
"errorUri": "https://docs.example.com/oauth/errors"
}Reference Documentation
- Pages 13, 32-33 of “Functional_Requirements_V18 FINAL”: https://belli.sg/4nxxCDR
Authorizations
Path Parameters
Unique request identifier
Body
Reply status for the AWB stock request
approved, rejected, partially_approved "approved"
Number of AWB stock units allocated (0 if rejected)
100
Validity start date for allocated stock
"2024-01-15"
Validity end date for allocated stock
"2025-01-15"
Starting AWB number in allocated range (if approved)
"157000001"
Ending AWB number in allocated range (if approved)
"157000100"
Additional notes from the airline
"Stock allocated as requested. Please ensure proper usage compliance."
Reason for rejection (if status is rejected)
"Insufficient stock availability"
Response
Reply submitted successfully
Unique request identifier
"req-123456789"
Updated request status after reply
approved, rejected, partially_approved "approved"
Number of AWB stock units allocated
100
Timestamp when the reply was submitted
"2024-01-15T14:30:00Z"
Starting AWB number in allocated range
"157000001"
Ending AWB number in allocated range
"157000100"
Validity start date for allocated stock
"2024-01-15"
Validity end date for allocated stock
"2025-01-15"
Additional notes from the airline
"Stock allocated as requested. Please ensure proper usage compliance."