Pass Stripe tokens to Cloudbeds

Those who made the effort of implementing Stripe into their software can now pass the payment token to Cloudbeds in order to enable subsequent charges, lessen the guest and staff effort, wave goodbye to manual entry mistakes and send payment data without compromising PCI compliance.

Use case example

A custom-built booking engine takes a deposit during the booking process and stores the card securely in Stripe account.

Reservation is posted into Cloudbeds together with the Stripe token. Cloudbeds account is connected to the same Stripe account.

Guest can now pay for the rest of the stay during the check-in without presenting the card again.

Pass the tokens with postReservation

It’s possible to use Stripe Tokens (Customer ID or Charge ID) as parameters on postReservation.

If a property is connected to Stripe, the parameters cardToken and paymentAuthorizationCode can be sent as part of the postReservation body. The cardToken must be filled with a Stripe Customer ID, and the paymentAuthorizationCode must be filled with a Stripe Charge ID. The paymentAuthorizationCode can’t be sent without the cardToken, and the cardToken parameter requires the value on the paymentMethod parameter to be credit.

If the cardToken field is sent, we’ll validate the customer on Stripe and, if it’s valid, save it as a credit card internally, so that the hotel staff can use it to make following charges or authorizations on this Customer’s card.

If the paymentAuthorizationCode field is sent, we’ll validate the payment on Stripe and, if it’s valid, consider this payment good for the reservation deposit.

Customer token

To save a credit card for further reuse, you must, before anything else, tokenize a credit card. This can be done on Stripe backend API itself, but using Stripe JavaScript SDK (or iOS SDK or Android SDK) to tokenize the credit card directly without submitting the credit card data to your backend is most recommended.

After tokenization, you can use it to create a customer or attach it to an existing customer. This guide covers this approach.

If the Stripe customer does not have a Payment Method attached, the credit card integration will fail.

Charge token

A charge represents the final object generated by a payment. There are many ways to create a charge, such as the old Charge API itself, but currently using a Payment Intent is the most recommended approach as it’ll allow you to deal with authenticated payment flows (3D Secure, for example).

In the case of a Payment Intent usage, the Charge is created after the payment is confirmed and the authentication is either dismissed or fulfilled.

Important: Deposit rules

The rules described on Manage > Payment Options > Processing Methods > Mybooking Reservations are NOT APPLIED to reservations created via the API.

It means that if a cardToken is sent, the deposit won't be charged. The payment needs to be added manually in the reservation.