curl --request POST \
--url https://staging.api.prexsell.com/v2/tickets/{id}/cancel \
--header 'x-api-key: <api-key>'import requests
url = "https://staging.api.prexsell.com/v2/tickets/{id}/cancel"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://staging.api.prexsell.com/v2/tickets/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.prexsell.com/v2/tickets/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://staging.api.prexsell.com/v2/tickets/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://staging.api.prexsell.com/v2/tickets/{id}/cancel")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.prexsell.com/v2/tickets/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"ticket": {
"id": "ord_abc",
"bookingId": "bkg_1",
"note": null,
"status": "Canceled",
"paymentStatus": "Unpaid",
"departureDate": "2026-06-15T00:00:00.000Z",
"source": "PrexSell",
"refundAmount": null,
"passenger": {
"id": "pass_1",
"firstName": "Іван",
"lastName": "Петренко",
"email": "ivan@example.com",
"phones": [
{
"id": "ph_1",
"phone": "+380501234567",
"messengers": [
"Viber"
]
}
]
},
"price": {
"id": "price-1",
"amount": 1450,
"currency": "UAH"
},
"discount": {
"id": "disc-1",
"name": "Студентська знижка",
"rule": "Percent",
"amount": 100,
"startDate": "2026-06-01T00:00:00.000Z",
"endDate": "2026-12-31T23:59:59.000Z"
},
"slices": [
{
"id": "sl_abc"
}
]
}
}
}{
"errors": [
{
"message": "AUTH_INVALID_CREDENTIALS",
"errorCode": "UNAUTHORIZED"
}
]
}{
"errors": [
{
"message": "RESOURCE_NOT_FOUND",
"errorCode": "NOT_FOUND"
}
]
}{
"errors": [
{
"message": "Orders already paid",
"errorCode": "CONFLICT",
"details": {
"ordersIds": [
"ord_1"
]
}
}
]
}Cancel ticket
Cancels a single ticket (order) by its ID, independent of the booking it currently belongs to — the ticket id is stable across a transfer to a new booking, unlike the booking id. (status → Canceled; Paid PrexSell orders → Refund + refundAmount). Authenticated via the api-key header; data scoped to the caller’s partner. 409 Conflict when the ticket is already Canceled or Refund. Unpaid/booked orders and external-operator orders cancel at any time with no refund; a paid PrexSell order is refunded per its refund rules. Returns 404 when the ticket does not exist or does not belong to the actor’s partner (foreign and unknown are indistinguishable — ADR-0033 §1). Response carries the refreshed ticket, including its current bookingId and any just-persisted refundAmount.
curl --request POST \
--url https://staging.api.prexsell.com/v2/tickets/{id}/cancel \
--header 'x-api-key: <api-key>'import requests
url = "https://staging.api.prexsell.com/v2/tickets/{id}/cancel"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://staging.api.prexsell.com/v2/tickets/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.prexsell.com/v2/tickets/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://staging.api.prexsell.com/v2/tickets/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://staging.api.prexsell.com/v2/tickets/{id}/cancel")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.prexsell.com/v2/tickets/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"ticket": {
"id": "ord_abc",
"bookingId": "bkg_1",
"note": null,
"status": "Canceled",
"paymentStatus": "Unpaid",
"departureDate": "2026-06-15T00:00:00.000Z",
"source": "PrexSell",
"refundAmount": null,
"passenger": {
"id": "pass_1",
"firstName": "Іван",
"lastName": "Петренко",
"email": "ivan@example.com",
"phones": [
{
"id": "ph_1",
"phone": "+380501234567",
"messengers": [
"Viber"
]
}
]
},
"price": {
"id": "price-1",
"amount": 1450,
"currency": "UAH"
},
"discount": {
"id": "disc-1",
"name": "Студентська знижка",
"rule": "Percent",
"amount": 100,
"startDate": "2026-06-01T00:00:00.000Z",
"endDate": "2026-12-31T23:59:59.000Z"
},
"slices": [
{
"id": "sl_abc"
}
]
}
}
}{
"errors": [
{
"message": "AUTH_INVALID_CREDENTIALS",
"errorCode": "UNAUTHORIZED"
}
]
}{
"errors": [
{
"message": "RESOURCE_NOT_FOUND",
"errorCode": "NOT_FOUND"
}
]
}{
"errors": [
{
"message": "Orders already paid",
"errorCode": "CONFLICT",
"details": {
"ordersIds": [
"ord_1"
]
}
}
]
}Authorizations
Partner API key, sent in the x-api-key request header. Required for bookable offer search and all booking operations. To obtain a key, register as a PREXSELL partner in the backoffice (backoffice.prexsell.com, or staging.backoffice.prexsell.com for staging) and contact support if you need help.
Path Parameters
Ticket (order) identifier.
"ord_abc"
Response
Ticket canceled.
Cancel ticket result (refreshed ticket).
Show child attributes
Show child attributes
