Skip to main content
POST
/
bookings
Create a new Booking.
curl --request POST \
  --url https://b2b-api.markoub.dev/bookings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "journeyId": "<string>",
  "searchId": "<string>",
  "name": "<string>",
  "phone": "<string>",
  "email": "[email protected]",
  "seats": []
}
'
{
  "id": 123,
  "externalId": "<string>",
  "paymentToken": "<string>",
  "paymentTokenExpiresAtMinutes": 123,
  "code": "<string>",
  "type": "<string>",
  "inventory": "<string>",
  "paidPrice": 123,
  "status": "<string>",
  "totalPrice": 123,
  "paymentType": "<string>",
  "email": "<string>",
  "name": "<string>",
  "phone": "<string>",
  "cancellationReason": "<string>",
  "isCancelled": true,
  "cancellationType": "<string>",
  "cancelledAt": "<string>",
  "paidAt": "<string>",
  "createdAt": "<string>",
  "updatedAt": "<string>",
  "routes": [
    {
      "id": 123,
      "routeId": 123,
      "departureTime": "<string>",
      "departureCityId": 123,
      "departureStationId": 123,
      "departureMarkerId": 123,
      "departureCityName": "<string>",
      "departureStationName": "<string>",
      "arrivalTime": "<string>",
      "arrivalCityId": 123,
      "arrivalStationId": 123,
      "arrivalMarkerId": 123,
      "arrivalCityName": "<string>",
      "arrivalStationName": "<string>",
      "price": 123,
      "date": "<string>",
      "daysElapsed": 123,
      "seats": 123,
      "type": "<string>",
      "cancellationReason": "<string>",
      "isCancelled": true,
      "cancellationType": "<string>",
      "cancelledAt": "<string>",
      "createdAt": "<string>",
      "updatedAt": "<string>",
      "roadType": "<string>",
      "seatMapShown": true,
      "departureLat": 123,
      "departureLng": 123,
      "arrivalLat": 123,
      "arrivalLng": 123
    }
  ],
  "tickets": [
    {
      "id": 123,
      "code": "<string>",
      "bookingId": 123,
      "routeId": 123,
      "companyId": 123,
      "date": "<string>",
      "time": "<string>",
      "seat": 123,
      "price": 123,
      "status": "<string>",
      "cancelledAt": "<string>",
      "createdAt": "<string>",
      "updatedAt": "<string>"
    }
  ],
  "data": "<unknown>"
}
Seats are not required when the inventory is ctm or when showSeatMap is false.

Authorizations

Authorization
string
header
required

Default authentication mechanism

Body

application/json
journeyId
string
required

The journey ID retreived from the search

searchId
string
required

The search ID retreived from the search

name
string
required

The name of the customer

Required string length: 2 - 255
phone
string
required

The phone number of the customer

Minimum string length: 1
email
string<email> | null

The email of the customer

seats
number[]

The seats to book, for CTM no need to provide this

Response

The created booking

id
number
required
externalId
string
required
paymentToken
string
required
paymentTokenExpiresAtMinutes
number
required
code
string
required
type
string
required
inventory
string
required
paidPrice
number
required
status
string
required
totalPrice
number
required
paymentType
string
required
email
string
required
name
string
required
phone
string
required
cancellationReason
string
required
isCancelled
boolean
required
cancellationType
string
required
cancelledAt
string
required
paidAt
string
required
createdAt
string
required
updatedAt
string
required
routes
object[]
required
tickets
object[]
required
data
any