Request
| Field | Type | Required | Description |
|---|---|---|---|
session_id | string | Yes | Session ID to terminate |
reason | string | Yes | Why the session is ending |
termination_context | object | No | Additional context for the termination |
Termination Reasons
| Reason | Meaning | Typical Initiator |
|---|---|---|
handoff_transaction | User wants to complete a purchase | Brand agent (via pending_handoff) |
handoff_complete | Conversation naturally concluded | Brand agent |
user_exit | User explicitly ended the conversation | Host |
session_timeout | Inactivity timeout reached | Host |
host_terminated | Host ended for policy/error reasons | Host |
Termination Context Object
Additional details vary by reason: Forhandoff_transaction:
user_exit:
session_timeout:
Response
| Field | Type | Description |
|---|---|---|
session_id | string | Confirms which session was terminated |
terminated | boolean | Always true on success |
acp_handoff | object | Present for transaction handoffs |
follow_up | object | Optional actions for future engagement |
ACP Handoff Object
For transaction terminations, includes data needed for ACP checkout:| Field | Type | Description |
|---|---|---|
checkout_url | uri | Brand’s ACP checkout endpoint. Hosts MUST validate this is HTTPS. |
checkout_token | string | Opaque token to pass to the checkout endpoint |
payload | object | Rich checkout context (product details, applied offers, pricing). Alternative to checkout_token for structured data. |
expires_at | datetime | When this handoff data expires |
Follow-Up Object
Suggestions for future engagement:| Field | Type | Description |
|---|---|---|
suggested_action | string | What the host might do next |
data | object | Relevant data for the action |
message | string | Optional message to display |
Examples
Transaction Handoff
After receivingpending_handoff with type: "transaction":
Request:
Conversation Complete (No Purchase)
When the conversation naturally ends without a transaction: Request:User Exit
When the user changes topic or explicitly leaves: Request:Session Timeout
When the session times out due to inactivity: Request:Host Terminated
When the host ends the session for policy or error reasons: Request:ACP Integration Flow
When the reason ishandoff_transaction:
- Host receives
acp_handoffin the termination response - Host initiates ACP checkout using the provided
checkout_urlandcheckout_tokenorpayload - ACP handles the transaction while maintaining the user’s trust with the host
- Brand is not the merchant of record - ACP handles payment
Key Points
- Always terminate sessions - Even if the conversation seems done, call terminate to clean up resources and get follow-up suggestions.
-
ACP handoff data has expiration - The
expires_atfield indicates how long the checkout context is valid. - Follow-up enables re-engagement - Even non-transaction terminations can include suggestions for future engagement.
- Host maintains trust - Transactions go through ACP, keeping the user’s relationship with the host intact.