> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://wt.hhr.systems/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://wt.hhr.systems/_mcp/server.

# Pay and issue tickets

POST https://api.sar.worldticket.cloud/ota/v2015b/OTA#OTA_AirDemandTicketRQ
Content-Type: application/json

Pay from the pre-funded wallet with `paymentType` `4` and issue the tickets. Reference the booking by its W1 record locator. The response returns a ticket number, `totalAmount`, and `netAmount` for each passenger.


Reference: https://wt.hhr.systems/hhr-ticketing-system-api/ticketing/issue-tickets

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /ota/v2015b/OTA#OTA_AirDemandTicketRQ:
    post:
      operationId: issueTickets
      summary: Pay and issue tickets
      description: >
        Pay from the pre-funded wallet with `paymentType` `4` and issue the
        tickets. Reference the booking by its W1 record locator. The response
        returns a ticket number, `totalAmount`, and `netAmount` for each
        passenger.
      tags:
        - Ticketing
      parameters:
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
        - name: local-name
          in: header
          description: Routes the request to the ticketing operation.
          required: true
          schema:
            $ref: >-
              #/components/schemas/OtaV2015BOtaOtaAirDemandTicketRqPostParametersLocalName
      responses:
        '200':
          description: Issued tickets with amounts per passenger.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AirDemandTicketResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AirDemandTicketRequest'
servers:
  - url: https://api.sar.worldticket.cloud
    description: Production
  - url: https://test-api.worldticket.net
    description: Test
components:
  schemas:
    OtaV2015BOtaOtaAirDemandTicketRqPostParametersLocalName:
      type: string
      enum:
        - OTA_AirDemandTicketRQ
      default: OTA_AirDemandTicketRQ
      title: OtaV2015BOtaOtaAirDemandTicketRqPostParametersLocalName
    RequestorID:
      type: object
      properties:
        id:
          type: string
          description: Agent identifier.
        name:
          type: string
          description: Agency name.
        type:
          type: string
          description: Requestor type.
      title: RequestorID
    BookingChannel:
      type: object
      properties:
        type:
          type: string
      title: BookingChannel
    Source:
      type: object
      properties:
        isocurrency:
          type: string
          description: ISO currency code. Always SAR.
        isoCurrency:
          type: string
          description: ISO currency code (used by the cancel operation).
        requestorID:
          $ref: '#/components/schemas/RequestorID'
        bookingChannel:
          $ref: '#/components/schemas/BookingChannel'
      title: Source
    Pos:
      type: object
      properties:
        source:
          type: array
          items:
            $ref: '#/components/schemas/Source'
      description: Point of sale. Identifies the agent and channel behind the request.
      title: Pos
    AirDemandTicketRequestDemandTicketDetailMessageFunctionItems:
      type: object
      properties:
        function:
          type: string
      title: AirDemandTicketRequestDemandTicketDetailMessageFunctionItems
    AirDemandTicketRequestDemandTicketDetailBookingReferenceIdType:
      type: string
      enum:
        - '14'
      title: AirDemandTicketRequestDemandTicketDetailBookingReferenceIdType
    AirDemandTicketRequestDemandTicketDetailBookingReferenceIdCompanyName:
      type: object
      properties:
        code:
          type: string
      title: AirDemandTicketRequestDemandTicketDetailBookingReferenceIdCompanyName
    AirDemandTicketRequestDemandTicketDetailBookingReferenceId:
      type: object
      properties:
        id:
          type: string
          description: W1 record locator.
        type:
          $ref: >-
            #/components/schemas/AirDemandTicketRequestDemandTicketDetailBookingReferenceIdType
        companyName:
          $ref: >-
            #/components/schemas/AirDemandTicketRequestDemandTicketDetailBookingReferenceIdCompanyName
      title: AirDemandTicketRequestDemandTicketDetailBookingReferenceId
    PaymentType:
      type: string
      enum:
        - '1'
        - '4'
        - '5'
        - '32'
        - '40'
      description: >
        Payment type. 1 Cash, 4 Debit account (wallet), 5 Credit card, 32
        External, 40 Invoice. Ticketing draws from the pre-funded wallet with
        type 4.
      title: PaymentType
    AirDemandTicketRequestDemandTicketDetailPaymentInfoItemsCreditCardInfoItems:
      type: object
      properties:
        cardHolderName:
          type: string
      title: >-
        AirDemandTicketRequestDemandTicketDetailPaymentInfoItemsCreditCardInfoItems
    AirDemandTicketRequestDemandTicketDetailPaymentInfoItems:
      type: object
      properties:
        paymentType:
          $ref: '#/components/schemas/PaymentType'
        creditCardInfo:
          type: array
          items:
            $ref: >-
              #/components/schemas/AirDemandTicketRequestDemandTicketDetailPaymentInfoItemsCreditCardInfoItems
      title: AirDemandTicketRequestDemandTicketDetailPaymentInfoItems
    AirDemandTicketRequestDemandTicketDetail:
      type: object
      properties:
        messageFunction:
          type: array
          items:
            $ref: >-
              #/components/schemas/AirDemandTicketRequestDemandTicketDetailMessageFunctionItems
        bookingReferenceID:
          $ref: >-
            #/components/schemas/AirDemandTicketRequestDemandTicketDetailBookingReferenceId
        paymentInfo:
          type: array
          items:
            $ref: >-
              #/components/schemas/AirDemandTicketRequestDemandTicketDetailPaymentInfoItems
      title: AirDemandTicketRequestDemandTicketDetail
    AirDemandTicketRequest:
      type: object
      properties:
        pos:
          $ref: '#/components/schemas/Pos'
        version:
          type: string
        demandTicketDetail:
          $ref: '#/components/schemas/AirDemandTicketRequestDemandTicketDetail'
      required:
        - pos
        - version
        - demandTicketDetail
      title: AirDemandTicketRequest
    AirDemandTicketResponseSuccess:
      type: object
      properties: {}
      title: AirDemandTicketResponseSuccess
    AirDemandTicketResponseTicketItemInfoItems:
      type: object
      properties:
        ticketNumber:
          type: string
        type:
          type: string
        totalAmount:
          type: number
          format: double
        netAmount:
          type: number
          format: double
        paymentType:
          $ref: '#/components/schemas/PaymentType'
      title: AirDemandTicketResponseTicketItemInfoItems
    AirDemandTicketResponse:
      type: object
      properties:
        success:
          $ref: '#/components/schemas/AirDemandTicketResponseSuccess'
        bookingReferenceID:
          type: object
          additionalProperties:
            description: Any type
        ticketItemInfo:
          type: array
          items:
            $ref: '#/components/schemas/AirDemandTicketResponseTicketItemInfoItems'
          description: One entry per passenger, with the ticket number and amounts.
        timeStamp:
          type: string
        version:
          type: number
          format: double
        retransmissionIndicator:
          type: boolean
      title: AirDemandTicketResponse

```

## Examples



**Request**

```json
{
  "pos": {
    "source": [
      {
        "isocurrency": "SAR",
        "requestorID": {
          "id": "AGENT001",
          "name": "Sample Travel",
          "type": "4"
        },
        "bookingChannel": {
          "type": "OTA"
        }
      }
    ]
  },
  "version": "2.001",
  "demandTicketDetail": {
    "messageFunction": [
      {
        "function": "ET"
      }
    ],
    "bookingReferenceID": {
      "id": "N6G2NW",
      "type": "14",
      "companyName": {
        "code": "W1"
      }
    },
    "paymentInfo": [
      {
        "paymentType": "4",
        "creditCardInfo": [
          {
            "cardHolderName": "Sample Travel"
          }
        ]
      }
    ]
  }
}
```

**Response**

```json
{
  "success": {},
  "bookingReferenceID": {
    "companyName": {
      "code": "W1"
    },
    "id": "N6G2NW",
    "type": "14"
  },
  "ticketItemInfo": [
    {
      "ticketNumber": "3333330058951",
      "type": "E_TICKET",
      "totalAmount": 380.65,
      "netAmount": 331,
      "paymentType": "4",
      "passengerName": {
        "givenName": [
          "BARAA"
        ],
        "passengerTypeCode": "ADT",
        "surname": "BUKHARI"
      }
    },
    {
      "ticketNumber": "3333330058952",
      "type": "E_TICKET",
      "totalAmount": 380.65,
      "netAmount": 331,
      "paymentType": "4",
      "passengerName": {
        "givenName": [
          "SARA"
        ],
        "passengerTypeCode": "ADT",
        "surname": "BUKHARI"
      }
    }
  ],
  "timeStamp": "2026-05-01T09:31:02.880Z",
  "version": 2.001,
  "retransmissionIndicator": false
}
```

**SDK Code**

```python
import requests

url = "https://api.sar.worldticket.cloud/ota/v2015b/OTA#OTA_AirDemandTicketRQ"

payload = {
    "pos": { "source": [
            {
                "isocurrency": "SAR",
                "requestorID": {
                    "id": "AGENT001",
                    "name": "Sample Travel",
                    "type": "4"
                },
                "bookingChannel": { "type": "OTA" }
            }
        ] },
    "version": "2.001",
    "demandTicketDetail": {
        "messageFunction": [{ "function": "ET" }],
        "bookingReferenceID": {
            "id": "N6G2NW",
            "type": "14",
            "companyName": { "code": "W1" }
        },
        "paymentInfo": [
            {
                "paymentType": "4",
                "creditCardInfo": [{ "cardHolderName": "Sample Travel" }]
            }
        ]
    }
}
headers = {
    "local-name": "OTA_AirDemandTicketRQ",
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.sar.worldticket.cloud/ota/v2015b/OTA#OTA_AirDemandTicketRQ';
const options = {
  method: 'POST',
  headers: {
    'local-name': 'OTA_AirDemandTicketRQ',
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: '{"pos":{"source":[{"isocurrency":"SAR","requestorID":{"id":"AGENT001","name":"Sample Travel","type":"4"},"bookingChannel":{"type":"OTA"}}]},"version":"2.001","demandTicketDetail":{"messageFunction":[{"function":"ET"}],"bookingReferenceID":{"id":"N6G2NW","type":"14","companyName":{"code":"W1"}},"paymentInfo":[{"paymentType":"4","creditCardInfo":[{"cardHolderName":"Sample Travel"}]}]}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sar.worldticket.cloud/ota/v2015b/OTA#OTA_AirDemandTicketRQ"

	payload := strings.NewReader("{\n  \"pos\": {\n    \"source\": [\n      {\n        \"isocurrency\": \"SAR\",\n        \"requestorID\": {\n          \"id\": \"AGENT001\",\n          \"name\": \"Sample Travel\",\n          \"type\": \"4\"\n        },\n        \"bookingChannel\": {\n          \"type\": \"OTA\"\n        }\n      }\n    ]\n  },\n  \"version\": \"2.001\",\n  \"demandTicketDetail\": {\n    \"messageFunction\": [\n      {\n        \"function\": \"ET\"\n      }\n    ],\n    \"bookingReferenceID\": {\n      \"id\": \"N6G2NW\",\n      \"type\": \"14\",\n      \"companyName\": {\n        \"code\": \"W1\"\n      }\n    },\n    \"paymentInfo\": [\n      {\n        \"paymentType\": \"4\",\n        \"creditCardInfo\": [\n          {\n            \"cardHolderName\": \"Sample Travel\"\n          }\n        ]\n      }\n    ]\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("local-name", "OTA_AirDemandTicketRQ")
	req.Header.Add("x-api-key", "YOUR_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(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.sar.worldticket.cloud/ota/v2015b/OTA#OTA_AirDemandTicketRQ")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["local-name"] = 'OTA_AirDemandTicketRQ'
request["x-api-key"] = 'YOUR_API_KEY'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"pos\": {\n    \"source\": [\n      {\n        \"isocurrency\": \"SAR\",\n        \"requestorID\": {\n          \"id\": \"AGENT001\",\n          \"name\": \"Sample Travel\",\n          \"type\": \"4\"\n        },\n        \"bookingChannel\": {\n          \"type\": \"OTA\"\n        }\n      }\n    ]\n  },\n  \"version\": \"2.001\",\n  \"demandTicketDetail\": {\n    \"messageFunction\": [\n      {\n        \"function\": \"ET\"\n      }\n    ],\n    \"bookingReferenceID\": {\n      \"id\": \"N6G2NW\",\n      \"type\": \"14\",\n      \"companyName\": {\n        \"code\": \"W1\"\n      }\n    },\n    \"paymentInfo\": [\n      {\n        \"paymentType\": \"4\",\n        \"creditCardInfo\": [\n          {\n            \"cardHolderName\": \"Sample Travel\"\n          }\n        ]\n      }\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.sar.worldticket.cloud/ota/v2015b/OTA#OTA_AirDemandTicketRQ")
  .header("local-name", "OTA_AirDemandTicketRQ")
  .header("x-api-key", "YOUR_API_KEY")
  .header("Content-Type", "application/json")
  .body("{\n  \"pos\": {\n    \"source\": [\n      {\n        \"isocurrency\": \"SAR\",\n        \"requestorID\": {\n          \"id\": \"AGENT001\",\n          \"name\": \"Sample Travel\",\n          \"type\": \"4\"\n        },\n        \"bookingChannel\": {\n          \"type\": \"OTA\"\n        }\n      }\n    ]\n  },\n  \"version\": \"2.001\",\n  \"demandTicketDetail\": {\n    \"messageFunction\": [\n      {\n        \"function\": \"ET\"\n      }\n    ],\n    \"bookingReferenceID\": {\n      \"id\": \"N6G2NW\",\n      \"type\": \"14\",\n      \"companyName\": {\n        \"code\": \"W1\"\n      }\n    },\n    \"paymentInfo\": [\n      {\n        \"paymentType\": \"4\",\n        \"creditCardInfo\": [\n          {\n            \"cardHolderName\": \"Sample Travel\"\n          }\n        ]\n      }\n    ]\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sar.worldticket.cloud/ota/v2015b/OTA#OTA_AirDemandTicketRQ', [
  'body' => '{
  "pos": {
    "source": [
      {
        "isocurrency": "SAR",
        "requestorID": {
          "id": "AGENT001",
          "name": "Sample Travel",
          "type": "4"
        },
        "bookingChannel": {
          "type": "OTA"
        }
      }
    ]
  },
  "version": "2.001",
  "demandTicketDetail": {
    "messageFunction": [
      {
        "function": "ET"
      }
    ],
    "bookingReferenceID": {
      "id": "N6G2NW",
      "type": "14",
      "companyName": {
        "code": "W1"
      }
    },
    "paymentInfo": [
      {
        "paymentType": "4",
        "creditCardInfo": [
          {
            "cardHolderName": "Sample Travel"
          }
        ]
      }
    ]
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'local-name' => 'OTA_AirDemandTicketRQ',
    'x-api-key' => 'YOUR_API_KEY',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.sar.worldticket.cloud/ota/v2015b/OTA#OTA_AirDemandTicketRQ");
var request = new RestRequest(Method.POST);
request.AddHeader("local-name", "OTA_AirDemandTicketRQ");
request.AddHeader("x-api-key", "YOUR_API_KEY");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"pos\": {\n    \"source\": [\n      {\n        \"isocurrency\": \"SAR\",\n        \"requestorID\": {\n          \"id\": \"AGENT001\",\n          \"name\": \"Sample Travel\",\n          \"type\": \"4\"\n        },\n        \"bookingChannel\": {\n          \"type\": \"OTA\"\n        }\n      }\n    ]\n  },\n  \"version\": \"2.001\",\n  \"demandTicketDetail\": {\n    \"messageFunction\": [\n      {\n        \"function\": \"ET\"\n      }\n    ],\n    \"bookingReferenceID\": {\n      \"id\": \"N6G2NW\",\n      \"type\": \"14\",\n      \"companyName\": {\n        \"code\": \"W1\"\n      }\n    },\n    \"paymentInfo\": [\n      {\n        \"paymentType\": \"4\",\n        \"creditCardInfo\": [\n          {\n            \"cardHolderName\": \"Sample Travel\"\n          }\n        ]\n      }\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "local-name": "OTA_AirDemandTicketRQ",
  "x-api-key": "YOUR_API_KEY",
  "Content-Type": "application/json"
]
let parameters = [
  "pos": ["source": [
      [
        "isocurrency": "SAR",
        "requestorID": [
          "id": "AGENT001",
          "name": "Sample Travel",
          "type": "4"
        ],
        "bookingChannel": ["type": "OTA"]
      ]
    ]],
  "version": "2.001",
  "demandTicketDetail": [
    "messageFunction": [["function": "ET"]],
    "bookingReferenceID": [
      "id": "N6G2NW",
      "type": "14",
      "companyName": ["code": "W1"]
    ],
    "paymentInfo": [
      [
        "paymentType": "4",
        "creditCardInfo": [["cardHolderName": "Sample Travel"]]
      ]
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sar.worldticket.cloud/ota/v2015b/OTA#OTA_AirDemandTicketRQ")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```