This resource represents a payment made on a booking.

XML Schema:

GET: get-payment


Name Type Description
id read-only String  
href read-only Field  
status read-only String

A list of codes that represent the current status af a transaction.

  • PENDING: The transaction is pending processing.
  • FAILED: The transaction has been been processed and failed to be approved.
  • PROCESSED: The transaction has been been processed and was approved.
error read-only Nested Object Details for failed transactions.
date_created read-only Datetime The time when the resource was created, in the standard dates-time.
date_last_modified read-only Datetime The time when the resource was last modified, in the standard dates-time.
transaction_type read-only Nested Object Information about the type of transaction.
  • name required
String A brief description of the transaction type.
  • code required
String The unique code for this transaction type.
booking required Reference Object The related booking resource.
amount required Decimal The currency-specific amount of rhe transaction, in the standard currencies.
customer required Reference Object The related customer resource.
capture Boolean If false, authorize but do not capture payment (optional; default: true)
details required Nested Object  
  • transaction_type_code required
String Transaction type. Currently, only CREDIT_CARD is supported.
  • number required
String Credit card number
  • expiry_month required
String Card expiry month (2 digits)
  • expiry_year required
String Card expiry year (4 digits)
  • cvv required
String Card verification value (3-4 digits)
  • name_on_card required
String Booking note (optional)
note String Booking note (optional)

Get a Payment

GET /payments/(string: payment_id)/

Create a Payment

POST /payments/

Example response:

A successful response will return HTTP status code 201. The body of the response will contain the new payment object, exactly as returned by the GET method. Note that if the status field is FAILED, the error field contains details on the reason for failure.

A failed response will return an HTTP status code of 400 or greater. The response body will contain a standard error object describing the failure. In the example response below, "x" was passed as the value for the amount field:

HTTP/1.1 400 Bad Request
Content-Type: application/json

  "http_status_code": 400
  "time": "2013-08-16T11:20:18",
  "message": "Invalid payment amount",
  "errors": [
        "code": "INVALID_DATA",
        "detail": "required key not provided",
        "field": "amount",
        "value": "x"

Payment error codes:

Payments that are successfully created, but have status FAILED, will populate the error field with the following values:

code detail
PROCESSOR_UNAVAILABLE Our credit card processor is currently unavailable, please try back later.
TRANSACTION_DECLINED The transaction was declined, please use a different card.
INVALID_CARD_NUMBER Invalid card information. Please ensure the card number, expiry, and CVV are correct.
INVALID_CARD_EXPIRY Invalid card expiry date.
CREDIT_LIMIT_EXCEEDED The card limit has been exceeeded, please use a different card.
UNDEFINED_CARD_ERROR An error was encountered while processing your payment. Please check the information entered, and if all details have been entered correctly try again. If the problem persists, you will be contacted by a sales representative in the next 48 hours. Error code: n.