API

Sections

Theme switcher

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.

Please note that this is an enterprise API feature. Reach out to your Partnership Manager for more information about unlocking this and other advanced features.

We are actively developing the Retailer Agent, and we are aware that bugs may occur occasionnaly. If an error persists, please contact us.

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

JSON
{ "user_id": "<unique user id>", "conversation_id": "<unique conversation id>", "text": "<text input>" }

Response

Plain text

POST /chat/stream

Request Query

retailer_cd

Request Body

JSON
{ "user_id": "<unique user id>", "conversation_id": "<unique conversation id>", "text": "<text input>" }

Response

JSON
{ "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).

Was this section helpful?

What made this section unhelpful for you?

On this page
  • Retailer Agent
View as Markdown

Ask an AI

Open in ChatGPTOpen in ClaudeOpen in Perplexity

Code with AI

Open in Copilot