Request AWB stock
curl --request POST \
--url https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/requests \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"organizationId": "org-123",
"airlinePrefix": "157",
"requestedStock": 100,
"validityPeriod": 12
}
'import requests
url = "https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/requests"
payload = {
"organizationId": "org-123",
"airlinePrefix": "157",
"requestedStock": 100,
"validityPeriod": 12
}
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({
organizationId: 'org-123',
airlinePrefix: '157',
requestedStock: 100,
validityPeriod: 12
})
};
fetch('https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/requests', 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/requests",
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([
'organizationId' => 'org-123',
'airlinePrefix' => '157',
'requestedStock' => 100,
'validityPeriod' => 12
]),
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/requests"
payload := strings.NewReader("{\n \"organizationId\": \"org-123\",\n \"airlinePrefix\": \"157\",\n \"requestedStock\": 100,\n \"validityPeriod\": 12\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/awb-stock/requests")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"organizationId\": \"org-123\",\n \"airlinePrefix\": \"157\",\n \"requestedStock\": 100,\n \"validityPeriod\": 12\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/requests")
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 \"organizationId\": \"org-123\",\n \"airlinePrefix\": \"157\",\n \"requestedStock\": 100,\n \"validityPeriod\": 12\n}"
response = http.request(request)
puts response.read_body{
"requestId": "req-123456789",
"status": "pending",
"organizationId": "org-123",
"airlinePrefix": "157",
"requestedStock": 100,
"validityPeriod": 12,
"submittedAt": "2024-01-15T10:30:00Z",
"allocatedStock": 0,
"validFrom": "2024-01-15",
"validTo": "2025-01-15",
"processedAt": null,
"notes": "Request for Q1 2024 operations",
"approvalNotes": null
}{
"error": "validation_error",
"errorDescription": "Invalid AWB stock request parameters",
"errorUri": "https://docs.example.com/awb-stock/errors",
"validationErrors": [
{
"field": "requestedStock",
"message": "Requested stock must be between 1 and 10000",
"code": "INVALID_RANGE"
},
{
"field": "airlinePrefix",
"message": "Invalid airline prefix format",
"code": "INVALID_FORMAT"
}
]
}{
"error": "invalid_grant",
"errorDescription": "Invalid client credentials provided",
"errorUri": "https://docs.example.com/oauth/errors"
}AWB Stock Management
Request AWB Stock
ACA/EPO requests AWB stock allocation from airline
POST
/
api
/
awb-stock
/
requests
Request AWB stock
curl --request POST \
--url https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/requests \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"organizationId": "org-123",
"airlinePrefix": "157",
"requestedStock": 100,
"validityPeriod": 12
}
'import requests
url = "https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/requests"
payload = {
"organizationId": "org-123",
"airlinePrefix": "157",
"requestedStock": 100,
"validityPeriod": 12
}
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({
organizationId: 'org-123',
airlinePrefix: '157',
requestedStock: 100,
validityPeriod: 12
})
};
fetch('https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/requests', 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/requests",
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([
'organizationId' => 'org-123',
'airlinePrefix' => '157',
'requestedStock' => 100,
'validityPeriod' => 12
]),
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/requests"
payload := strings.NewReader("{\n \"organizationId\": \"org-123\",\n \"airlinePrefix\": \"157\",\n \"requestedStock\": 100,\n \"validityPeriod\": 12\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/awb-stock/requests")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"organizationId\": \"org-123\",\n \"airlinePrefix\": \"157\",\n \"requestedStock\": 100,\n \"validityPeriod\": 12\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://1a557de0-701c-477d-bedd-433520441dae.mock.pstmn.io/api/awb-stock/requests")
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 \"organizationId\": \"org-123\",\n \"airlinePrefix\": \"157\",\n \"requestedStock\": 100,\n \"validityPeriod\": 12\n}"
response = http.request(request)
puts response.read_body{
"requestId": "req-123456789",
"status": "pending",
"organizationId": "org-123",
"airlinePrefix": "157",
"requestedStock": 100,
"validityPeriod": 12,
"submittedAt": "2024-01-15T10:30:00Z",
"allocatedStock": 0,
"validFrom": "2024-01-15",
"validTo": "2025-01-15",
"processedAt": null,
"notes": "Request for Q1 2024 operations",
"approvalNotes": null
}{
"error": "validation_error",
"errorDescription": "Invalid AWB stock request parameters",
"errorUri": "https://docs.example.com/awb-stock/errors",
"validationErrors": [
{
"field": "requestedStock",
"message": "Requested stock must be between 1 and 10000",
"code": "INVALID_RANGE"
},
{
"field": "airlinePrefix",
"message": "Invalid airline prefix format",
"code": "INVALID_FORMAT"
}
]
}{
"error": "invalid_grant",
"errorDescription": "Invalid client credentials provided",
"errorUri": "https://docs.example.com/oauth/errors"
}ACA/EPO requests AWB stock from airline.
Reference Documentation
For more information on ACA stock request, please refer to:
- Pages 12-13 of “Functional_Requirements_V18 FINAL”: https://belli.sg/4nxxCDR
Authorizations
ApiKeyAuthApiKeyHeader
Body
application/json
Response
Stock request submitted successfully
Unique identifier for the stock request
Example:
"req-123456789"
Current status of the stock request
Available options:
pending, approved, rejected, processing Example:
"pending"
Organization identifier that made the request
Example:
"org-123"
Airline AWB prefix requested
Example:
"157"
Number of AWB stock units requested
Example:
100
Validity period in months as requested
Example:
12
Timestamp when the request was submitted
Example:
"2024-01-15T10:30:00Z"
Number of AWB stock units allocated (if any)
Example:
0
Validity start date for allocated stock
Example:
"2024-01-15"
Validity end date for allocated stock
Example:
"2025-01-15"
Timestamp when the request was processed (if applicable)
Example:
null
Additional notes or comments
Example:
"Request for Q1 2024 operations"
Notes from the airline regarding approval/rejection
Example:
null