index

createStripeSession JSON


Instructions

Post JSON data here to create a Stripe Checkout session.

See here for information about using the JSON API.

The Stripe checkout session can be used to create a Stripe checkout page for receiving payments into the properties Stripe account.

Pass the line_items, success_url and cancel_url in the format required by the Stripe API to create a checkout session.

If the booking already exists, pass it's booking ID and any payments to this checkout session will be added to the bookings invoice

The Stripe session will be returned, the session id can be used to create the Stripe checkout in your App.

When initializing Stripe in your App, use this pk_live key and the stripe_acccont value (acct_) from the session reponse as follows:

var stripe = Stripe('pk_live_zWSW2ykzZoq4mYcKg9c8jmHS', {
  stripeAccount: 'acct_stripe_acccont-value-from-response'
});

See here for more information https://stripe.com/docs/payments/checkout

Example Data

{
    "authentication": {
        "apiKey": "apiKeyAsSetInAccountSettings",
        "propKey": "propKeyAsSetForTheProperty"
    },
    "line_items": [
        {
            "price_data": {
                "currency": "eur",
                "product_data": {
                    "name": "Accomodation"
                },
                "unit_amount": 20000
            },
            "quantity": 1
        }
    ],
    "success_url": "https:\/\/example.com\/success?session_id={CHECKOUT_SESSION_ID}",
    "cancel_url": "https:\/\/example.com\/cancel",
    "bookId": "12345678"
}