---
title: Subscribe Air Waybill
slug: subscribe-air-waybill
icon: 🛄
createdAt: 2022-08-17T06:26:33.000Z
---

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://tnt-api.rpalabs.io/api/v1/track_and_trace/air/air_waybills/subscribe",
  "name": "Overview",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "kind": "required",
        "name": "Authorization",
        "type": "string",
        "description": "Bearer access token from login api"
      }
    ],
    "bodyDataParameters": [
      {
        "kind": "required",
        "name": "carrier_code",
        "type": "string",
        "description": "airline code of the specific cargo"
      },
      {
        "kind": "required",
        "name": "awb_number",
        "type": "string",
        "description": "awb number of the specific cargo"
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "nUhpI6_uMjaYnNqTgh4CN",
        "code": "{\r\n    \"message\": \"Air Waybill was subscribed successfully\"\r\n}",
        "language": "200",
        "customLabel": ""
      },
      {
        "id": "qXVaTeSnjAbD2E9n0GcMl",
        "code": "{\r\n    \"message\": \"Request validation error\",\r\n    \"status\": 400,\r\n    \"error_code\": 1,\r\n    \"error_fields\": {\r\n        \"carrier_code\": [\r\n            \"Carrier code not supported. Carrier code must be one of ['UA', 'HO', 'LH', 'FX', 'KA', 'LA', 'AF', 'OK', 'ET', 'GF', 'KL', 'PR', 'LO', 'QF', 'SA', 'NZ', '9C', 'AI', 'AY', 'BW', 'FI', 'CK', 'LY', 'SK', 'BA', 'GA', 'JL', 'AV', 'AM', 'UC', 'ES', 'QR', 'CX', 'CV', 'HA', 'EK', 'KE', 'TA', '5J', 'NH', 'TG', 'F5', 'KU', 'CM', 'MH', 'MK', 'K4', 'CI', '6E', 'SC', 'C8', '5Y', 'A3', 'PO', '5X', 'ZH', 'RJ', 'W5', 'AD', 'RU', 'UL', 'HL', 'SQ', 'BI', 'NX', 'BR', 'KQ', 'LX', 'MF', 'MU', 'CZ', 'AE', 'CF', '4X', 'AK', 'M6', 'GS', 'RH', 'D7', 'HX', 'M7', 'Y8', '6R', 'HU', 'FD', 'WY', 'O3', 'VS', 'KZ', 'OZ', 'UX', 'CA', '3V']\"\r\n        ]\r\n    }\r\n}",
        "language": "400",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "qXVaTeSnjAbD2E9n0GcMl"
  },
  "examples": {
    "languages": [
      {
        "id": "gbFa-jLIAn9hQ9v7rXwti",
        "code": "curl --location --request POST 'https://tnt-api.rpalabs.io/api/v1/track_and_trace/air/air_waybills/subscribe' \\\n--header 'Accept: application/json' \\\n--header 'Authorization: string' \\\n--data-raw '{\"carrier_code\":\"string\",\"awb_number\":\"string\"}'",
        "language": "curl",
        "customLabel": ""
      },
      {
        "id": "qhKM8xNsndsVXuWcnL8N6",
        "code": "var request = require('request');\nvar options = {\n   'method': 'POST',\n   'url': 'https://tnt-api.rpalabs.io/api/v1/track_and_trace/air/air_waybills/subscribe',\n   'headers': {\n      'Accept': 'application/json',\n      'Authorization': 'string'\n   },\n   body: '{\"carrier_code\":\"string\",\"awb_number\":\"string\"}'\n\n};\nrequest(options, function (error, response) {\n   if (error) throw new Error(error);\n   console.log(response.body);\n});\n",
        "language": "nodejs",
        "customLabel": ""
      },
      {
        "id": "Gw_JD9y8DqStM24kZfEwm",
        "code": "var myHeaders = new Headers();\nmyHeaders.append(\"Accept\", \"application/json\");\nmyHeaders.append(\"Authorization\", \"string\");\n\nvar raw = \"{\\\"carrier_code\\\":\\\"string\\\",\\\"awb_number\\\":\\\"string\\\"}\";\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://tnt-api.rpalabs.io/api/v1/track_and_trace/air/air_waybills/subscribe\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));",
        "language": "javascript",
        "customLabel": ""
      },
      {
        "id": "d1Mk7hrEM2xjVV5Wau-BG",
        "code": "import http.client\n\nconn = http.client.HTTPSConnection(\"tnt-api.rpalabs.io\")\npayload = \"{\\\"carrier_code\\\":\\\"string\\\",\\\"awb_number\\\":\\\"string\\\"}\"\nheaders = {\n   'Accept': 'application/json',\n   'Authorization': 'string'\n}\nconn.request(\"POST\", \"/api/v1/track_and_trace/air/air_waybills/subscribe\", payload, headers)\nres = conn.getresponse()\ndata = res.read()\nprint(data.decode(\"utf-8\"))",
        "language": "python",
        "customLabel": ""
      },
      {
        "id": "hIE3QYlRCm8cp96e86zXQ",
        "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"https://tnt-api.rpalabs.io/api/v1/track_and_trace/air/air_waybills/subscribe\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Authorization\"] = \"string\"\nrequest.body = \"{\\\"carrier_code\\\":\\\"string\\\",\\\"awb_number\\\":\\\"string\\\"}\"\n\nresponse = https.request(request)\nputs response.read_body\n",
        "language": "ruby",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "qhKM8xNsndsVXuWcnL8N6"
  },
  "description": "This endpoint lets users to subscribe air waybills and allows the air wabill information to be stored in the database.",
  "currentNewParameter": {
    "label": "Header Parameter",
    "value": "headerParameters"
  }
}
```
:::



:::hint{type="danger"}
See the [Error Handling page](https://developers.rpalabs.io/error-handling) for troubleshooting any errors.
:::

### ✉️ Need some help?

If you encounter a problem or require assistance, please contact our support team with details regarding your request at [support@rippey.ai.](support@rippey.ai) A representative will connect with you soon. 😊
