Articles in this section

AGW Platform Remarks Templating System

Published:

AGW Platform Remarks Templating System — Syntax Reference

> Companion article. Remarks explains what remarks are and how an agent uses them during and after booking. This article documents how a remark template is written — every element BookingPad understands, what it does, and what it produces in the exported AIR/MIR line.
>
> Audience: agencies specifying a template with AirGateway, and AirGateway staff configuring one. Templates are configured per agency (and optionally per corporate profile) by AirGateway — they are not editable from within BookingPad.


1. How a template is processed

A remark template is plain text. BookingPad reads it line by line and turns each line into a row of the remarks form:

  • Anything outside curly braces is printed as-is — this is a hardcoded remark.
  • Anything inside { … } becomes a field — either something the agent fills in (data primitive) or something the system fills in (system-filled).
  • A few special markers control repetition rather than producing output — flow control.

When the agent saves, BookingPad re-joins everything into the final remark text that is sent to the airline and exported to your mid/back-office.

The four building blocks

Block Written as Who fills it Purpose
Hardcoded bare text nobody — fixed Prefixes, codes, separators, labels
Data primitive {Label:type(constraints)modifier} the agent The data you actually want to capture
Flow control {{#passengers}} … {{/passengers}} nobody — structural Repeat a line once per passenger
System-filled {Label:token} BookingPad Values already known from the booking, the order or the user session

Anatomy of a field

{ Label : type ( constraints ) modifier }
   │       │         │            │
   │       │         │            └─ ! = mandatory, ? = optional, none = regular
   │       │         └─ length, precision or list values
   │       └─ data type, or a system-filled token
   └─ the label shown to the agent inside the input box

The label is also the internal key for that field, so labels must be unique within a template (the only exception is fields inside a passenger loop, which BookingPad de-duplicates automatically).


2. Hardcoded remarks

Any text outside braces is reproduced verbatim, in position, on every booking.

RM*AC-INV/

Typical uses: the GDS/back-office command prefix, fixed separators (/, -, *), and fixed labels.

Comment and heading lines

A line beginning with # is displayed in bold in the BookingPad form, which makes it useful as a visual section heading for the agent.

#--- ACCOUNTING ---

> # lines are still exported. They are a display convention, not a comment syntax. If a line must not reach the AIR file, it must not be in the template.

Reserved word

A hardcoded line or text fragment that begins with the word passenger (any capitalisation) is reserved for the passenger heading generated by the passenger loop (see §4) and is silently removed from the exported text. Never start hardcoded text with Passenger; use PAX, Traveller or a code instead.


3. Data primitive remarks (agent completes)

These render as an input the agent must complete.

Data types

Type Written as Renders as Validation
Free text {Reference} text box none
String {Reference:str} text box none
String, max length {Reference:str(10)} text box at most 10 characters
String, min + max {Reference:str(3,10)} text box between 3 and 10 characters
Integer {Cost centre:int} numeric box whole numbers only; e, +, - and . are blocked at the keyboard
Integer, max length {Cost centre:int(6)} numeric box whole numbers, at most 6 digits
Decimal {Fee:float} numeric box any decimal; e, +, - blocked
Decimal, fixed precision {Fee:float(2)} numeric box at most 2 digits after the decimal point
List {Channel:list(ONLINE,OFFLINE,GROUP)} dropdown single selection from the listed values, plus a - Clear - entry

Notes:

  • str is the explicit name for text, but any unrecognised type name also behaves as free text. Use str for clarity.
  • A min length alone is not supported — str(3,10) sets both bounds; str(10) sets only the maximum.
  • List values are separated by commas and cannot themselves contain a comma or a closing parenthesis.
  • Lists are single-select only. For multiple values, use several list fields.

Field modifiers

Modifier Field type Agent behaviour What is exported
! Mandatory Must be completed; the remark cannot be saved until it is The line is always sent
? Optional May be left empty If left empty, the whole line is removed from the exported remark
(none) Regular May be left empty The line is sent regardless, with the field’s position left blank
{Cost centre:int(6)!}      mandatory — blocks saving
{Project:str(20)?}         optional — empty ⇒ its line disappears
{Comment:str(40)}          regular  — empty ⇒ line sent with a gap

> A modifier requires an explicit type. {Reference!} is read as a free-text field whose label is literally Reference!. Write {Reference:str!}.
>
> ? removes the line, not the field. Put an optional field on a line of its own. A line mixing an optional field with other content will not export cleanly if the optional field is left empty.


4. Flow control remarks

Flow control markers produce no text of their own. They tell BookingPad to repeat a line for every passenger on the booking.

Explicit passenger loop

{{#passengers}}
RM*PAX-{Trav ref:travelerReference}
{{/passengers}}

The {{#passengers}} and {{/passengers}} marker lines are removed. The line between them is emitted once per passenger, each occurrence preceded in the form by an automatically generated heading:

PASSENGER JOHN SMITH (ADT0)
RM*PAX-ADT0
PASSENGER ANNA SMITH (ADT1)
RM*PAX-ADT1

The PASSENGER … heading is a form aid only — it is shown to the agent so they can see which passenger each row belongs to, and it is not written to the exported remark.

Implicit passenger loop

A line containing a psg-index field is treated as a passenger loop even without the {{#passengers}} markers:

RM*PAX{Idx:psg-index}

This is the older form. Prefer the explicit markers in new templates.

Rules for passenger loops

  1. One line per loop. A loop repeats a single line. Multi-line passenger blocks are not supported — use one loop line per piece of per-passenger data, or several separate loops.
  2. One loop per template. Only the first passenger loop in a template is expanded.
  3. The passenger-identifying field must be last on its line. psg-index, travelerReference and number advance the passenger counter only when they are the final element of the line. A line such as RM*{Idx:psg-index}-{Amount:float} will repeat the first passenger’s values on every row. Write RM*{Amount:float}-{Idx:psg-index} instead.
  4. psg-sales-price never advances the counter on its own — pair it with one of the three fields above.

5. System-filled remarks (system autocompletes)

These fields are pre-populated by BookingPad. The agent sees the value in the form but does not type it.

Booking and itinerary

Token Value Example Agent can edit
origin IATA code of the first flight’s departure airport MAD No
destination IATA code of the first flight’s arrival airport LHR No
order-id AirGateway order ID A1B2C3 No

> destination is the arrival airport of the first flight, not the final point of the itinerary. On a connecting or return itinerary it is the first leg’s arrival. Take this into account when specifying the template.
>
> order-id has no value during the booking flow (the order does not exist yet) and resolves only in Post Booking Remarks.

Passenger

Token Value Example Agent can edit
psg-index Sequential passenger number, zero-padded to 3 digits 001, 002 No
number Short passenger identifier P1, P2 No
travelerReference Traveler reference used by the airline ADT0, ADT1 No
psg-sales-price Total price for that passenger (base fare + taxes), 2 decimals, no currency symbol 412.35 No

All four are intended for use inside a passenger loop (§4). Outside a loop they resolve to the first passenger.

The passenger heading described in §4 (PASSENGER JOHN SMITH (ADT0)) is generated automatically by the loop; there is no token for it.

Agent, agency and corporate

Token Value Example Agent can edit
agent-id The signed-in agent, taken as the part of their email before the @ j.diaz No
agent-custom-id The agent’s agency-assigned ID, as configured in AirGateway AG-0042 No
agency-id The agency identifier of the signed-in user travelco No
account-id Account number of the corporate profile selected on the booking ACC-889 Yes — see below

account-id is empty unless a corporate profile is attached to the booking.

Ticket

Token Value Example Agent can edit
ticketnumber Full ticket number of the first ticket 0751234567890 Yes — see below
ticketserialnumber Ticket number without the first 5 characters 34567890 Yes — see below
airlinecodeticket First 5 characters of the ticket number (airline code + form code) 07512 Yes — see below

> Current limitation. Ticket values only exist once the order has been ticketed, while the remarks form is only editable while the order is still unticketed. In practice these three tokens will be blank in an editable remark. Do not rely on them in a new template — contact AirGateway if you need ticket data in a remark.
>
> Editable system fields. account-id and the three ticket tokens are pre-filled but, unlike the other system tokens, are not locked — an agent can overwrite them. Treat their values as agent-supplied for auditing purposes.

Naming convention

For a system-filled field, use the token as the label as well:

{origin:origin}
{travelerReference:travelerReference}

This keeps the field reliably locked when the agent re-opens a saved remark for editing.

Documented but not available

Attachments is listed as an auto field in some older material. It is not implemented in BookingPad and has no token.


6. Agency remarks and Corporate remarks

BookingPad supports two independent remark blocks on the same booking:

Source Shown
Agency remarks Templates configured for the agency Always, when templates exist
Corporate remarks Templates configured on the corporate profile selected for the booking Only when a corporate profile with remark templates is attached

Each block has its own template dropdown and its own mandatory setting. When both are present the saved remark contains the agency block first, then a fixed separator line, then the corporate block:

RM*AC-INV/123456
#------- CORPORATE REMARKS --------
RM*CORP-ACC889

Editing a saved remark that contains both blocks resets both — BookingPad warns before doing so.


7. Free-text remarks

If an agency has no remark templates configured at all, the Remarks tab of an order shows a plain free-text box instead of a form. The agent types whatever they need and saves it. There is no validation, no system-filled data and no structure.

Once templates are configured, the free-text box is replaced by the template form.


8. Authoring rules and known limitations

Rules

  1. One remark line per template line. Line breaks in the template are line breaks in the output.
  2. Labels must be unique within a template.
  3. Use an explicit data type whenever you use ! or ?.
  4. Put each optional (?) field on its own line.
  5. In a passenger loop, end the line with psg-index, travelerReference or number.
  6. Never start hardcoded text with the word passenger.

Limitations

  • Blank lines are collapsed. Consecutive newlines in the output are reduced to a single newline; a template cannot produce an empty spacer line.
  • One passenger loop per template, one line per loop.
  • List values cannot contain commas or parentheses.
  • Length constraints on a list are ignored as intended — list(10,20) is read as a two-value list and as a 10–20 length rule. Avoid purely numeric two-value lists.
  • float with two numbers (float(2,5)) is interpreted as a min/max length, not precision. Use float(2) for precision.
  • An optional field on the first line of a template does not trigger line removal; it is exported blank, like a regular field.

9. Worked example

Template

#--- INVOICE ---
RM*AC-INV/{Invoice no:str(6,12)!}
RM*AC-CC/{Cost centre:int(6)!}
RM*AC-PRJ/{Project:str(20)?}
RM*AC-CH/{Channel:list(ONLINE,OFFLINE,GROUP)!}
RM*AC-RTE/{origin:origin}-{destination:destination}
RM*AC-AGT/{agent-custom-id:agent-custom-id}
{{#passengers}}
RM*AC-PAX/{Fare:float(2)}/{travelerReference:travelerReference}
{{/passengers}}

What the agent sees — bold heading, four fields to complete, route and agent ID greyed out and pre-filled, and one fare row per passenger, each under its own passenger heading.

Saved remark for a 2-passenger booking where Project was left empty:

#--- INVOICE ---
RM*AC-INV/INV0099231
RM*AC-CC/440210
RM*AC-CH/ONLINE
RM*AC-RTE/MAD-LHR
RM*AC-AGT/AG-0042
RM*AC-PAX/412.35/ADT0
RM*AC-PAX/389.10/ADT1

The RM*AC-PRJ/ line is absent because Project is optional and was left empty. The PASSENGER … headings shown in the form are not exported.


Need a template?

Remark templates are configured by AirGateway. Send your desired layout — using the syntax above — to your AirGateway contact, stating for each field whether it is mandatory, optional or regular, and whether the template should be mandatory on order creation.

Access denied
Access denied