SmartGare
API referenceEndpoints

Start a sale

Prices a sale for passengers travelling on a departure from one of our stations to a station it calls at afterwards, at the fare in force for its line, against the caller's open register. The sale awaits payment, holding its passengers' seats until hold_expires_at. **Required permission:** `ticketing.sale:write`

POST/ticketing/v1/sales

Prices a sale for passengers travelling on a departure from one of our stations to a station it calls at afterwards, at the fare in force for its line, against the caller's open register. The sale awaits payment, holding its passengers' seats until hold_expires_at.

Required permission: ticketing.sale:write

AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body*StartSaleRequest

Response Body

*/*

*/*

*/*

*/*

curl -X POST "https://example.com/ticketing/v1/sales" \  -H "Content-Type: application/json" \  -d '{    "departure_id": "string",    "from_station_id": "string",    "passengers": [],    "reference": "string",    "to_station_id": "string"  }'
{  "currency": "string",  "departure_id": "string",  "from_station_id": "string",  "hold_expires_at": "2019-08-24T14:15:22Z",  "id": "string",  "lines": [    {      "amount": 0,      "category": "string",      "currency": "string",      "fare": {        "content_hash": "string",        "inputs": {          "carrier_id": "string",          "category": "string",          "days_ahead": 0,          "departure_date": "2019-08-24",          "departure_time": "string",          "distance_metres": 0,          "from_locality_id": "string",          "from_station_id": "string",          "line_id": "string",          "service_type": "string",          "to_locality_id": "string",          "to_station_id": "string"        },        "row_id": "string",        "steps": [          {            "amount": 0,            "kind": "string",            "row_id": "string"          }        ],        "tariff_release_id": "string"      },      "ordinal": 0,      "seat": "string"    }  ],  "luggage": {    "charge": 0,    "parcel_charge": 0,    "parcels": 0,    "suitcases": 0  },  "passengers": 0,  "recommendation": {    "followed": true,    "id": "string",    "override_reason": "string",    "override_reason_code": "string",    "recommended_departure_id": "string"  },  "reference": "string",  "started_at": "2019-08-24T14:15:22Z",  "status": "string",  "to_station_id": "string",  "total": 0,  "widening": {    "relaxation": "string",    "rule_version_id": "string"  }}