Call it
curl https://api.peume.com/v1/call/refund-flight \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"run_id": "your run id",
"quote_id": "your quote id"
}
}'const res = await fetch("https://api.peume.com/v1/call/refund-flight", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"run_id": "your run id",
"quote_id": "your quote id"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/refund-flight",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"run_id": "your run id",
"quote_id": "your quote id"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: refund-flight.
Parameters
run_idRequiredstringrunId of one of YOUR OWN completed /trips/save runs for the trip.
booked_item_idstringThe booked item, from /bookings/get items[].booked_item_id. Preserved across exchanges. Omit only when the booking has exactly one item of the requested domain; otherwise a 409 returns items to choose from.
quote_idRequiredstringThe `quote_id` from a preceding `/flights/refund-preview`. Binds this commit to the figures that quote reported.
acknowledgedobjectThe refund the customer was shown — copy the preview's `refund.amount_money` across. Copying the whole `refund` object is also accepted. REQUIRED whenever the preview carried a `refund`, which is every quote that names a figure. It may be omitted in exactly one case: a MANUAL_REQUIRED quote that carries no `refund` at all because the penalty is unknown (`penalty.fee_known: false`), submitted with `manual_ok: true` — there is no figure to acknowledge, and inventing one would have the customer agree to a number nobody computed. Omitting it anywhere else is refused by the platform, not here. When
manual_okbooleanSend `true` to submit a quote whose `support_level` is MANUAL_REQUIRED. The operation is then raised for a agent and answers `state: attention_required` with `reason: manual_required` — NOTHING is sent to the airline by this call, and the agent settles or fails it. Without the flag such a commit is refused 409 `manual_required`, so a customer is never put in an agent queue unasked. On an AUTO or AUTO_VOID quote the flag changes nothing. This is also the one submission that may carry no `acknowledged` figure — when the quote itself named none, because the penalty is unknown.
