Meta Business Agent Platform

Post-purchase support agent

Updated: Sep 18, 2026
Copy for LLM
Rail, coach, ferry, and airline operators can use Meta Business Agent to handle the conversation that starts after a ticket is bought — pulling up the traveller’s itinerary, explaining what their fare allows, moving them to a different departure, and telling them where a refund has got to. This page covers the agent instructions, knowledge sources, and connector configuration for that scenario. At minimum you must add one agent instruction and create a connector with a get_booking tool; the fare conditions, FAQs, and website crawl improve the conversation but the agent cannot see a traveller’s journey without the connector.
The agent handles:
  • Itinerary lookups scoped to the traveller’s own bookings
  • Fare condition explanations, drawn from the documents you upload
  • Journey changes, with confirmation of any fare difference before the change is made
  • Refund status for a refund already requested
  • Disruption and complaints — cancellations, missed connections, compensation claims — handed to your team rather than answered

Who this guide is for

The examples use an intercity rail operator, but the configuration pattern fits any business whose customers come back after paying, about a thing that already exists in your system: the purchase is done, and every question is about a record the traveller already holds.
Organization typeWhat the traveller asks aboutWhat the agent changes
Rail and coach operators
Departure times, platform, seat, ticket conditions
The departure on a flexible fare
Airlines
Flight times, baggage allowance, seat selection
The flight date, within fare rules
Ferry and cruise operators
Sailing times, vehicle space, cabin grade
The sailing date
Ride-hailing and mobility services
A completed trip, receipt, lost property
Rarely anything; mostly reads and escalations
Travel agencies and resellers
A multi-leg itinerary sold on behalf of operators
Usually nothing directly; escalates to the operator
This flow differs from selling the ticket in the first place. There is no discovery, no catalog to browse, and no new customer — the traveller is identified, often stressed, and asking about something with a date attached. The risks are also different: the expensive failure is not a lost sale but a wrong answer about whether a ticket can be changed, or a change made to the wrong leg of a journey. If your conversation ends in a new dated booking, see Booking and reservation agent. If you are handling general pre-sale questions and ticket creation, see Customer support agent.
Each step below notes how the API is used in other scenarios, then applies it to the rail example.

Prerequisites

Have the following in place before you configure the agent for post-purchase support. The first three come from Meta Business Agent onboarding; the fourth is your own system.
  • An onboarded and enabled Meta Business Agent (rollout.enabled: true) — see End-to-end setup
  • A valid system user access token (SUAT) or Business Integration System User (BISU) token with the whatsapp_business_messaging and whatsapp_business_management permissions — see Generate an access token. whatsapp_business_messaging authenticates your requests; whatsapp_business_management is required to read agent data, such as connector logs
  • Your WhatsApp Business phone number ID ({entity_id}) — the phone number the agent is enabled on, not the WhatsApp Business account ID. Find it in WhatsApp Manager⁠ under Account tools > Phone numbers
  • A publicly accessible HTTPS endpoint for your reservation or ticketing system, required by Create a bookings connector

Add agent instructions

Agent instructions shape how the agent responds. The title is a short identifier, description tells the agent when to apply the instruction, and skill contains the actual instructions.
Note: An instruction title can be up to 64 characters — lowercase letters, numbers, and dashes only, and cannot start or end with a dash.
curl -X POST "https://api.facebook.com/{entity_id}/agent_config/skills" \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -H "X-API-Version: 2.0.0" \
  -d '{
  "title": "existing-bookings",
  "description": "Applied when a traveller asks about a journey they have already booked, including departure times, ticket conditions, changes, and refunds.",
  "skill": "Look up the booking before answering any question about a specific journey, and never describe a departure time, platform, or fare condition from memory. State what the fare actually allows before discussing a change, and quote any fare difference returned by the tool rather than estimating it. Confirm the exact leg being changed, including the date and the direction of travel, before making any change. Never promise a refund, a compensation amount, or a timescale for either. When a service is canceled or severely delayed, when the traveller has missed a connection, or when they are claiming compensation, do not attempt to resolve it: acknowledge the situation, say a colleague is picking it up, and hand the conversation over."
}'
Each POST call creates one instruction. The instruction never to promise a refund matters more in post-purchase support than anywhere else, because a traveller who has been told they will be refunded treats it as a commitment, and walking that back costs more than the refund would have.
Where else this applies. An agent instruction is scoped, so the same call shapes very different agents. An airline can require the agent to state baggage allowance from the fare rather than the general policy, and a ferry operator can require vehicle details before a sailing change. For post-purchase support, keep the instruction focused on looking up before answering, quoting fare differences from the tool, and handing off anything involving disruption or money owed.

Add travel policy FAQs

FAQs give the agent reliable answers to common questions. Each entry takes a question and an answer, both required. Focus on policies that change only when you change them.
curl -X POST "https://api.facebook.com/{entity_id}/agent_config/faq" \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -H "X-API-Version: 2.0.0" \
  -d '{
  "question": "How long does a refund take?",
  "answer": "Once a refund is approved it reaches the original payment method within 10 working days for cards and up to 20 working days for bank transfers. Approval itself usually happens within 3 working days of the request. You can check where a specific refund has got to by giving the booking reference."
}'
Manage existing entries with the following calls:
To do thisCall
Retrieve all entries
GET /{entity_id}/agent_config/faq
Replace one entry
PUT /{entity_id}/agent_config/faq/{faq_id}
Remove one entry
DELETE /{entity_id}/agent_config/faq/{faq_id}
A PUT replaces the whole entry, so send both question and answer even when only one changed.
Suggested FAQs for a post-purchase travel scenario:
QuestionNotes
How long does a refund take?
Approval time and settlement time, stated separately
Can I change my ticket?
The general answer by fare type, with the booking lookup as the precise one
What happens if I miss my train?
Whether the ticket has any residual value, and on which fares
How much luggage can I bring?
Allowance, oversized items, and bicycles
Can I take a bicycle or a pet?
Reservation requirements and any charge
What assistance is available if I need it?
How to arrange it and how much notice is needed
How do I claim compensation for a delay?
The threshold, the route to claim, and what evidence is needed
Where do I find my ticket?
Where the confirmation was sent and how to get it resent
Where else this applies. FAQs suit any question whose answer changes only when a policy changes: an airline is asked about baggage allowance, a ferry operator about vehicle dimensions. Anything specific to one traveller’s ticket — whether their fare is changeable, what their departure time is — belongs in a connector tool instead, because the FAQ cannot know which fare they hold.

Upload your conditions of carriage

The Files knowledge source takes documents that are too long and too varied to express as FAQ entries. Fare rules and conditions of carriage are the clearest case: they run to many pages, they are written once and cited often, and the agent needs to draw on them rather than reproduce them.
curl -X POST "https://api.facebook.com/{entity_id}/agent_config/files" \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  -H "X-API-Version: 2.0.0" \
  -F "file_name=conditions-of-carriage.pdf" \
  -F "file=@./conditions-of-carriage.pdf"
The upload uses multipart form data rather than JSON. See the Files reference for the supported formats and the maximum file size.
Manage uploaded documents with the following calls:
To do thisCall
List uploaded files
GET /{entity_id}/agent_config/files
Retrieve one file entry
GET /{entity_id}/agent_config/files/{file_id}
Remove one file
DELETE /{entity_id}/agent_config/files/{file_id}
There is no update call. To replace a document, delete the old entry and upload the new one, otherwise the agent draws on both versions and can cite a rule you have already withdrawn.
Where else this applies. Files suit reference material that is authored elsewhere and changes on its own cycle: fare rules, a warranty booklet, a specification sheet. For post-purchase travel support, upload the conditions of carriage and the fare rules, but keep the traveller’s own entitlements in the connector — the document says what a flexible fare allows, and only your system knows which fare they bought.

Crawl your help center

The Websites knowledge source crawls your public website so the agent can answer from pages that are neither policy documents nor traveller-specific — station facilities, accessibility information, and how to contact the team.
curl -X POST "https://api.facebook.com/{entity_id}/agent_config/websites" \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -H "X-API-Version: 2.0.0" \
  -d '{
  "url": "https://www.calderrail.com/help"
}'
Website knowledge is a snapshot taken at crawl time. Poll GET /{entity_id}/agent_config/websites/{website_id} until crawl_status reports the crawl finished, and re-crawl whenever those pages change materially.
Where else this applies. Crawling suits content that already exists on your public site and changes on a predictable cycle. For a travel operator, be deliberate about excluding live-status pages from the crawl. A snapshot of yesterday’s service updates is worse than no answer, because the traveller cannot tell it is stale.

Create a bookings connector

A connector is the bridge to your reservation or ticketing system. Supported auth_type values are API_KEY, OAUTH2_CLIENT_CREDENTIALS, and NONE.
curl -X POST "https://api.facebook.com/{entity_id}/agent_connectors" \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -H "X-API-Version: 2.0.0" \
  -d '{
  "name": "calder_rail_bookings_api",
  "description": "Retrieves a traveller booking and its fare conditions, changes a journey where the fare allows it, and returns refund status for Calder Rail.",
  "base_url": "https://api.calderrail.com/bookings/v1",
  "auth_type": "API_KEY",
  "auth_config": {
    "api_key": {
      "headers": [
        {
          "field_name": "X-API-Key",
          "value": "{YOUR_BOOKINGS_API_KEY}"
        }
      ]
    }
  }
}'
A successful response returns the id of the new connector. Save it — the tools in Define connector tools are created under it, where it becomes the {connector_id} path parameter.
Where else this applies. The connector call is identical whichever system holds the traveller’s record. Only base_url, auth_type, and the credentials change. For post-purchase support, point it at the system that owns the booking rather than a reporting copy, because a traveller asking “has my change gone through” needs the authoritative answer.

Define connector tools

Connector tools define the operations the agent can invoke. Each tool needs a name, a description, user_auth_required, and a request_definition describing the outbound HTTP call. Inside request_definition, set method and path, then declare inputs in the section that matches where they belong: path_parameters for {placeholder} segments in the path, query_parameters, headers, or body.
A name can contain only letters, numbers, and underscores. Spaces, hyphens, and other punctuation are rejected. It also cannot start or end with an underscore, or contain two underscores in a row, so check_order_status is accepted while _check_order, check_order_, and check__order are not. The same rules apply to a connector’s name.
A post-purchase flow needs three tools: one to retrieve the booking, one to change it, and one to report on a refund.

Retrieve a booking

Scope the lookup to the traveller who is messaging. Binding their phone number with the WHATSAPP_PHONE_NUMBER macro means your endpoint can reject a reference that belongs to somebody else, rather than trusting whatever reference is typed into the chat.
curl -X POST "https://api.facebook.com/{entity_id}/agent_connectors/{connector_id}/tools" \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -H "X-API-Version: 2.0.0" \
  -d '{
  "name": "get_booking",
  "description": "Returns the journey, including each leg with its date, departure time, origin, destination, seat, fare type, and whether that fare can be changed or refunded. Call this before answering any question about a specific journey. Ask for the booking reference first if the traveller did not give one.",
  "user_auth_required": false,
  "request_definition": {
    "method": "GET",
    "path": "/bookings/{booking_reference}",
    "path_parameters": {
      "booking_reference": {
        "type": "string",
        "description": "The booking reference as the traveller provided it, for example CR-4T29XB."
      }
    },
    "query_parameters": {
      "traveller_phone": {
        "type": "string",
        "description": "The traveller WhatsApp phone number, used to confirm the booking belongs to them.",
        "required": true,
        "binding": {
          "kind": "macro",
          "macro": "WHATSAPP_PHONE_NUMBER"
        }
      }
    }
  }
}'
Return the fare conditions alongside the journey. If the agent has to ask a second question to find out whether the ticket is changeable, it will often answer from the general policy instead, which is right on average and wrong for the traveller in front of it.

Change a journey

The tools below let the agent move a leg the traveller names, and report the fare difference your system charged once the change is applied. They do not let it search for alternative departures or price a change in advance — nothing here returns either, so the agent must not offer a departure or quote a difference before the change goes through. If you want it to, add a read tool against your own system that takes a booking reference and a proposed departure and returns the times and the difference, and the agent will use it the same way it uses get_booking.
curl -X POST "https://api.facebook.com/{entity_id}/agent_connectors/{connector_id}/tools" \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -H "X-API-Version: 2.0.0" \
  -d '{
  "name": "change_booking",
  "description": "Moves one leg of a booking to a different departure and returns the updated journey with any fare difference charged. Call this only after get_booking has confirmed the fare is changeable, and only after the traveller has named which leg and the new date and time and agreed to the change. Do not call it to check whether a change is possible.",
  "user_auth_required": false,
  "request_definition": {
    "method": "POST",
    "path": "/bookings/{booking_reference}/changes",
    "path_parameters": {
      "booking_reference": {
        "type": "string",
        "description": "The booking reference, as confirmed by get_booking."
      }
    },
    "body": {
      "content_type": "application/json",
      "params": {
        "leg_id": {
          "type": "string",
          "description": "The identifier of the leg being changed, as returned by get_booking. Never guess this when a booking has more than one leg."
        },
        "new_departure": {
          "type": "string",
          "description": "The new departure date and time in ISO 8601 format, exactly as confirmed with the traveller."
        },
        "accepted_fare_difference": {
          "type": "string",
          "description": "The fare difference the traveller accepted, for example 12.50."
        },
        "traveller_phone": {
          "type": "string",
          "description": "The traveller WhatsApp phone number, used to confirm the booking belongs to them.",
          "binding": {
            "kind": "macro",
            "macro": "WHATSAPP_PHONE_NUMBER"
          }
        }
      },
      "required": ["leg_id", "new_departure", "traveller_phone"]
    }
  }
}'

Check a refund

curl -X POST "https://api.facebook.com/{entity_id}/agent_connectors/{connector_id}/tools" \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -H "X-API-Version: 2.0.0" \
  -d '{
  "name": "get_refund_status",
  "description": "Returns the stage a refund has reached, the amount, and the date it was approved or settled. Call this when a traveller asks where their refund is. This tool only reports on a refund that already exists; it does not create one.",
  "user_auth_required": false,
  "request_definition": {
    "method": "GET",
    "path": "/bookings/{booking_reference}/refund",
    "path_parameters": {
      "booking_reference": {
        "type": "string",
        "description": "The booking reference as the traveller provided it, for example CR-4T29XB."
      }
    },
    "query_parameters": {
      "traveller_phone": {
        "type": "string",
        "description": "The traveller WhatsApp phone number, used to confirm the booking belongs to them.",
        "required": true,
        "binding": {
          "kind": "macro",
          "macro": "WHATSAPP_PHONE_NUMBER"
        }
      }
    }
  }
}'
Scope this lookup to the messaging phone number exactly as get_booking does. A refund record carries an amount and a settlement date, so a booking reference guessed or overheard would otherwise return another traveller’s financial detail.
Path parameters are always required, so they take no required flag. Body fields list their required keys in body.required.
Where else this applies. Post-purchase flows share this look up, explain, act shape: find the record, tell the customer what their specific entitlement is, then make one bounded change. An airline swaps the leg for a flight segment, a ferry operator for a sailing. Keep the read and the write as separate tools in every case, because the read is safe to call often and the write is not.

Hand off during disruption

Disruption is the scenario where an agent does the most damage. A canceled service, a missed connection, or a compensation claim needs a person, and the traveller usually knows more about what happened than your systems do yet.
Configure the handoff policy on the agent with Agent settings, and transfer the conversation with Thread control (Cloud API). Thread control decides who owns the thread: while your app holds control, the agent stops responding and your team answers directly.

Take control when a journey is disrupted

Thread control is a single POST with an action. take acquires control from the current owner, which stops the agent responding so your team can answer in the same conversation. It is restricted to the escalation partner configured on the phone number.
Note the path parameter is named phone_number_id here rather than entity_id. It is the same WhatsApp Business phone number ID used everywhere else in this guide.
curl -X POST "https://api.facebook.com/business/whatsapp/phone_numbers/{phone_number_id}/thread_control" \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "messaging_product": "whatsapp",
  "action": "take",
  "to": "{TRAVELLER_PHONE_NUMBER}",
  "metadata": "Delay claim on booking CR-4T29XB"
}'
metadata is a free-form string forwarded verbatim to the receiving app in the resulting messaging_handovers webhook. Use it to carry the booking reference, so the colleague picking the conversation up does not have to ask for it again.

Hand the conversation back

When the case is closed, release relinquishes control and makes Meta Business Agent the automatic responder again. You must currently hold thread control for this to succeed.
curl -X POST "https://api.facebook.com/business/whatsapp/phone_numbers/{phone_number_id}/thread_control" \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "messaging_product": "whatsapp",
  "action": "release",
  "to": "{TRAVELLER_PHONE_NUMBER}"
}'
The three actions differ in who ends up holding the thread:
ActionEffectWho can call it
take
Acquires control from the current owner. The agent stops responding
The configured escalation partner
release
Relinquishes control and restores the agent as automatic responder
Whoever currently holds control
pass
Transfers control to the agent when control_pass.target_role is ai_agent, or to the configured escalation partner when control_pass is omitted
Whoever currently holds control
These calls take X-API-Version: 1.0.0 if you send it, not the 2.0.0 used by every other call on this page, and the header is optional — the examples omit it. Thread control belongs to the Cloud API rather than the agent configuration API: its version header is optional and accepts only 1.0.0, so the 2.0.0 value used elsewhere in this guide does not apply here.
This endpoint needs the whatsapp_business_messaging permission, the same one used for the rest of this guide.
The existing-bookings instruction above already tells the agent to hand off rather than attempt these cases. Pair that instruction with an actual route to a human, or the agent will acknowledge the problem and then leave the traveller waiting.
Where else this applies. Any scenario with an emotional or legal dimension deserves an explicit handoff path rather than a best-effort answer. For travel, the test is simple: if the traveller is currently stranded, a person should be answering.

Test the agent

Use Agent test to simulate traveller conversations before going live. Pass conversation_id from a previous response to continue a multi-turn exchange.
curl -X POST "https://api.facebook.com/{entity_id}/agent_test" \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  -H "Content-Type: application/json" \
  -H "X-API-Version: 2.0.0" \
  -d '{
  "user_msg": "Can I move my return to Sunday instead? Booking CR-4T29XB"
}'
Cover these scenarios in your test plan:
ScenarioSample message
Itinerary lookup
“What time is my train on Friday?”
Missing reference
“Can you check my booking?”
Non-changeable fare
“I want to move my advance ticket”
Multi-leg ambiguity
“Change my ticket to Sunday” on a return booking
Fare difference
“How much to move it to the 18:05?”
Refund status
“Where is my refund for CR-4T29XB?”
Compensation claim
“My train was 90 minutes late, I want compensation”
Live disruption
“My train has just been canceled, what do I do?”
Someone else’s reference
A reference not associated with the messaging number
Where else this applies. Test the failure modes rather than the happy path. The multi-leg ambiguity case is the one most worth automating: a traveller who says “change my ticket to Sunday” on a return booking has not said which direction, and an agent that picks one has a 50 percent chance of moving the wrong leg.

Example conversation

This exchange shows the configuration above in use: the agent looks up before answering, states the fare condition specific to that ticket, confirms the leg and the departure the traveller names, and hands off when the traveller raises a delay claim.
Traveller: Can I move my return to Sunday? Booking CR-4T29XB.
Agent:(calls get_booking)
I can see that booking — Leeds to London on Friday 12 September at 07:42, returning Saturday 13 September at 17:20. The return is on a Flexible fare, so it can be changed. Which Sunday departure would suit you?
Traveller: The 18:05, if that one runs.
Agent: I can move the return to the 18:05. Your Flexible fare allows the change, and I will confirm the fare difference once the change goes through. Shall I make it?
Traveller: Yes please.
Agent:(calls change_booking)
Done — your return is now Sunday 14 September, 18:05 from London. The £12.50 difference has been charged to the card on the booking. Your outbound on Friday is unchanged.
Traveller: Thanks. Also my train last month was 90 minutes late, can I claim for that?
Agent: Sorry about that journey. Delay compensation is handled by our customer relations team rather than by me — I am passing this conversation to a colleague now, and they will pick it up with your booking details.

Monitor connector health

The connector logs endpoint, GET /{entity_id}/agent_connectors/{connector_id}/logs, reports how your ticketing system is answering the agent. It returns individual error entries by default, or aggregated failure patterns when summary_only is true. Add include_stats=true for success rate and latency.
Reading these logs requires the whatsapp_business_management permission in addition to whatsapp_business_messaging. A token with only whatsapp_business_messaging receives a 200 response with an empty body.
curl -X GET "https://api.facebook.com/{entity_id}/agent_connectors/{connector_id}/logs?summary_only=true&top_n=5&include_stats=true" \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  -H "X-API-Version: 2.0.0"
Logs cover the last seven days, and the requested time range cannot exceed seven days. Each entry in data is one error event by default, or one failure pattern when you pass summary_only=true, and stats summarizes the whole window. For the fields each mode returns, see the Connectors reference.
Filter to one operation with tool_id when you want a single tool’s health rather than the connector’s overall rate.
Where else this applies. Watch get_booking availability as closely as the write tool. In post-purchase support the read is not a convenience, it is the precondition for every answer: when the lookup fails the agent has nothing to say, and it fails at exactly the moment volume spikes, because disruption drives both the traffic and the load on your ticketing system.

Tips for this use case

These are the post-purchase specific decisions that most often go wrong once the agent is live.
Scope every lookup to the messaging phone number. A booking reference typed into a chat is not proof of ownership. Binding WHATSAPP_PHONE_NUMBER and validating it server-side means a reference guessed or overheard returns nothing.
Return fare conditions with the booking, not separately. What a specific ticket allows is the single most consequential fact in these conversations. If the agent has to make a second call to learn it, it will sometimes answer from the general policy instead.
Name the leg explicitly on multi-leg bookings. “Change my ticket” is ambiguous on a return, and the cost of guessing is a traveller stranded at the wrong end of the country. Require leg_id on the write and have the agent confirm the direction in words.
Never let the agent promise money. Refunds and compensation are commitments. The agent can report the status of a refund that exists, and should route everything else to a person.
Keep live status out of the crawl. A crawled snapshot of a service-updates page will be wrong within the hour and reads as authoritative. If travellers need live status, put it behind a connector tool or leave it to the humans.
Pair the handoff instruction with a real handoff. Telling the agent to escalate does nothing on its own. Configure the handoff policy in agent settings and implement thread control, or the traveller is acknowledged and then abandoned.
Expect volume to correlate with your worst days. Post-purchase support traffic spikes exactly when your operation is struggling. Load-test the booking lookup at several times normal volume, and decide in advance what the agent says when the connector is down.

Summary checklist

Confirm each of the following before you enable the agent on a production phone number.
  • Added an existing-bookings agent instruction scoped to lookup-first, tool-sourced fare differences, and handoff
  • Added FAQs for stable policies (refund timescales, luggage, assistance, compensation route)
  • Uploaded conditions of carriage and fare rules as files
  • Crawled the help pages of your website, excluding live service status
  • Created a bookings connector with API key authentication
  • Defined get_booking, change_booking, and get_refund_status connector tools
  • Bound the traveller phone number with the WHATSAPP_PHONE_NUMBER macro and validated it server-side
  • Configured a handoff policy in agent settings and implemented thread control for disruption
  • Tested itinerary lookup, missing references, non-changeable fares, multi-leg ambiguity, refunds, and compensation claims
  • Tested a booking reference that does not belong to the messaging number
  • Set up connector health monitoring with alerting on both the write tool and booking lookup availability