Skip to main content

payments

Overview

This resource represents the Payments for Bookings, which can be either recorded manually (via API or manually) or be automated (with instant-booking and bookingsync kind).

Payments can also drive the lifecycle of the Bookings - creating a paid Payment (the ones that have paid_at timestamp assigned) with instant-booking kind ensures that the Booking is booked (especially useful for confirming tentative Bookings).

If you are interested in implementing your own payment flow, check out this Secure payments by BookingSync guide.

Parameters

NameTypeRead/WriteDescriptionConstraints
accountIntegerReadAccount's ID related to the Payment
payment_gatewayIntegerRead (requires preferences_payments_read scope)Payment Gateway's ID related to the Payment
bookingsArrayReadBookings' IDs related to the Payment
bookings_paymentsArrayReadBooking Payments' IDs related to the Payment
idIntegerReadPayment's id.
order_idStringReadID of order (only for internal Payments managed by BookingSync)
gateway_idIntegerWriteID of the Payment Gateway of Paypal Express GatewayRequired for instant-booking or bookingsync kind
gateway_typeStringWriteType of the entity representing the gateway (this is a polymorphic relationship)PaymentGateway or PaypalExpressGateway, Required for instant-booking or bookingsync kind
gateway_nameStringWritePayment Gateway's name, available values are described in enums sectionRequired for instant-booking or bookingsync kind
transaction_idStringRead/WriteID of transaction coming from the Payment Gateway.
address1StringRead/WritePayer's first address.Maximum length: 100
address2StringRead/WritePayer's second address.Maximum length: 100
amount_in_centsIntegerRead/WritePayment's amount in cents.Required
cardStringRead/WritePayment's card number, only the last 4 digits are visible. (example: "XXXX-XXXX-XXXX-1234").
cityStringRead/WritePayer's city.Maximum length: 100
country_codeStringRead/WritePayer's country code, list of codes is available at wikipedia.Must be one of the country codes if present
currencyStringRead/WritePayment's currency code, list of codes described in enums section.Required, must be one of the currencies
descriptionStringReadAuto-generated description based on Rental's name and related Booking's start_at/end_at timestamps
kindStringRead/WritePayment's kind, list of kinds described in enums section.Required, must be one of the payment kinds
emailStringRead/WritePayer's email.Must be of email format if present
fullnameStringRead/WritePayer's fullname.Cannot contain non-printing characters
ipStringReadPayer's ip.
localeStringRead/WritePayer's preferred locale, list of locales described in enums section.Must be one of the Account's available locales if present
notesTextRead/WritePayment's additional information.
stateStringRead/WritePayer's state.Maximum length: 100, required if country_code set to US
testBooleanReadPayment's test status.
zipStringRead/WritePayer's zip code.Maximum length: 10
credit_card_tokenStringRead/WriteToken derived from the Credit Card
offsite_paymentBooleanRead/WriteWhether Payment is an offsite one or not
lockedStringReadPayment's locked status.
chargeableBooleanReadWhether Payment is chargeable or not (e.g. if the related Booking is canceled or fully paid, it's going to return false)
created_atTimeReadPayment's create time.
updated_atTimeReadPayment's update time.
rejected_atTimeReadPayment's reject time.
canceled_atTimeReadPayment's cancel time.
paid_atTimeRead/WritePayment's paid time.Required unless kind is bookingsync or instant-booking, must be in the past
forget_me_atTimeReadRefer to GDPR guide.
processing_restricted_atTimeReadRefer to GDPR guide.
capturable_fromDateRead/WriteA date from which Payment is capturable
authorized_atTimeRead/WritePayment's authorization time
escrow_dateDateReadPayment's escrow date (applicable for BookingPay Payment Gateway)

List payments

List all payments for a given account.

GET /payments

Search payments

Search parameters allow to filter payments by specified fields.

Example:

GET /payments?order_id=BS-abc-123

Search Parameters

NameTypeDescription
order_idStringList of comma separated IDs. Returns only payments with this order_id(s)

Get a single payment

Returns a single payment identified by ID.

GET /payments/:payment_id

Create a new payment

Returns a newly created payment.

POST /bookings/:booking_id/payments

Update a payment

Returns an updated payment identified by ID.

PUT /payments/:payment_id

Cancel a payment

Required OAuth scope: :payments_write_owned or :payments_write

Returns an empty response with 204 No Content status code on success.

DELETE /payments/:payment_id