> For the complete documentation index, see [llms.txt](https://doc.bodinat.de/doc/train-travel/llms.txt)

# Pay for a Booking

> POST /bookings/{bookingId}/payment
> 
> A payment is an attempt to pay for the booking, which will confirm the booking for the user and enable them to get their tickets.



## Servers
- Mock Server: https://try.microcks.io/rest/Train+Travel+API/1.0.0 (Mock Server)
- Production: https://api.example.com (Production)


## Authentication methods
- O auth2


## Parameters

### Path parameters

- **bookingId** (string(uuid))
  The ID of the booking to pay for.



### Body: application/json (object)
Payment details
- **amount** (number)
  Amount intended to be collected by this payment. A positive decimal figure describing the amount to be collected.

- **currency** (string)
  Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.

- **source** (object)
  The payment source to take the payment from. This can be a card or a bank account. Some of these properties will be hidden on read to protect PII leaking.



## Responses
### 200
Payment successful
#### Headers

- **Cache-Control** ()

- **RateLimit** ()


#### Body: application/json (object)
- **id** (string(uuid))
  Unique identifier for the payment. This will be a unique identifier for the payment, and is used to reference the payment in other objects.

- **amount** (number)
  Amount intended to be collected by this payment. A positive decimal figure describing the amount to be collected.

- **currency** (string)
  Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.

- **source** (object)
  The payment source to take the payment from. This can be a card or a bank account. Some of these properties will be hidden on read to protect PII leaking.

- **status** (string)
  The status of the payment, one of `pending`, `succeeded`, or `failed`.

- **links** (object)
  The link to the booking resource.


### 400
Bad Request
#### Headers

- **RateLimit** ()


#### Body: application/problem+json (object)
- **type** (string)
  A URI reference that identifies the problem type

- **title** (string)
  A short, human-readable summary of the problem type

- **detail** (string)
  A human-readable explanation specific to this occurrence of the problem

- **instance** (string)
  A URI reference that identifies the specific occurrence of the problem

- **status** (integer)
  The HTTP status code


### 401
Unauthorized
#### Headers

- **RateLimit** ()


#### Body: application/problem+json (object)
- **type** (string)
  A URI reference that identifies the problem type

- **title** (string)
  A short, human-readable summary of the problem type

- **detail** (string)
  A human-readable explanation specific to this occurrence of the problem

- **instance** (string)
  A URI reference that identifies the specific occurrence of the problem

- **status** (integer)
  The HTTP status code


### 403
Forbidden
#### Headers

- **RateLimit** ()


#### Body: application/problem+json (object)
- **type** (string)
  A URI reference that identifies the problem type

- **title** (string)
  A short, human-readable summary of the problem type

- **detail** (string)
  A human-readable explanation specific to this occurrence of the problem

- **instance** (string)
  A URI reference that identifies the specific occurrence of the problem

- **status** (integer)
  The HTTP status code


### 429
Too Many Requests
#### Headers

- **RateLimit** ()

- **Retry-After** ()
  The Retry-After header indicates how long the user agent should wait before making a follow-up request. 
  The value is in seconds and can be an integer or a date in the future. 
  If the value is an integer, it indicates the number of seconds to wait. 
  If the value is a date, it indicates the time at which the user agent should make a follow-up request. 


#### Body: application/problem+json (object)
- **type** (string)
  A URI reference that identifies the problem type

- **title** (string)
  A short, human-readable summary of the problem type

- **detail** (string)
  A human-readable explanation specific to this occurrence of the problem

- **instance** (string)
  A URI reference that identifies the specific occurrence of the problem

- **status** (integer)
  The HTTP status code


### 500
Internal Server Error
#### Headers

- **RateLimit** ()


#### Body: application/problem+json (object)
- **type** (string)
  A URI reference that identifies the problem type

- **title** (string)
  A short, human-readable summary of the problem type

- **detail** (string)
  A human-readable explanation specific to this occurrence of the problem

- **instance** (string)
  A URI reference that identifies the specific occurrence of the problem

- **status** (integer)
  The HTTP status code



[Powered by Bump.sh](https://bump.sh)
