Retailer Agent
The Retailer API Agent is an AI Agent whose spurpose is to help users find trips and explore alternatives in a natural language interface. It guides the user throughout the booking flow, from search suggestions, trip searches, vacancy confirmation, and finally checkout page generation.
Authentication
The Retailer Agent endpoints expect an API key in the headers (api-key: <your-api-key>), specific to the Retailer Agent and the MCP Server, not the regular key for the API. Contact your Partnership Manager to get access to your Retailer Agent API key.
How to Use
The Retailer Agent API has two endpoints for the same purpose, which is the chat functionality. The only difference is the response type. The base URL for the Retailer Agent API is https://api.distribusion.com/agent.
POST /chat
Request Query
retailer_cd
Request Body
{
"user_id": "<unique user id>",
"conversation_id": "<unique conversation id>",
"text": "<text input>"
}Response
POST /chat/stream
Request Query
retailer_cd
Request Body
{
"user_id": "<unique user id>",
"conversation_id": "<unique conversation id>",
"text": "<text input>"
}Response
{
"event_type": "final_output | partial_output | function_call | function_response | unknown",
"text_chunk": "<response from agent>" | null,
"function_calls": [{"function_called": "<function_called>"}] | null,
"function_responses": [{"function_response": "<function_response>"}] | null
}(Streaming response of media type application/x-ndjson)
Suggested UI
These endpoints are meant to be integrated in a chat-like UI, as showcased below (streaming response displaying function calls).
What made this section unhelpful for you?
On this page
- Retailer Agent