Checkouts

ScopeDescription
read_checkoutsRequired to retrieve a checkout.
write_checkoutsRequired to modify or update checkout.

What is a Checkout?

You can use the Checkouts resource when creating subscription orders via our Custom integration to compile and send an order to Recharge for processing. Using this resource, you can also process a checkout via your own application only using the Checkouts resource to finalize payment. Normally, each of the separate API resources are updated as a customer goes through the out-of-the-box Recharge checkout workflow (customers, addresses, subscriptions, etc), but you can use the Checkouts resource to send all of this data to Recharge in one call.

Creating a Checkout and redirecting to Recharge

The main function of the Checkouts resource is sending the customer's order data to Recharge for processing. You'd do this by collecting customer order information from a front-end, then compiling the JSON and sending it in a POST to Checkouts. You will then receive a token in the callback request and can use this token to create a URL that lets the customer complete payment on Recharge's Hosted Checkout.

Creating a Checkout and processing checkout externally

You can also process a checkout externally from Recharge and send a payment token to the Checkouts resource to finalize the order. Bear in mind that you are responsible for securing the customer's payment information and PCI compliance. For more information on this, see Self-Hosted Checkout.

FAQ

How to use Checkout resource

Checkout resource is usually used when you have a custom built storefront from which you want to redirect customers to the checkout so they can complete their purchase. It gives you a full control over the checkout object so you can improve your customers experience.

Please note that in order to communicate with our API you will need a middleware application that will use some back-end language to handle communication between our API and your front-end.

We will provide steps on how to use Checkout resource for the two most common use cases. The main difference between these two use cases is that in the first one you are redirecting the customer to ReCharge UI checkout billing page where they will complete their purchase, while in the second one you need custom-built UI checkout to which you will redirect customers and you can process the checkout via the API.

Redirecting to Recharge UI checkout billing page

  1. Create checkout
  2. Update checkout
  3. Retrieve checkout
  4. Redirect to Recharge UI Checkout

📘

Recharge-hosted checkout redirection

You can use the token you received on checkout creation to redirect your customers to our ReCharge checkout, where they can complete the process by entering their info. This is what the link would look like:
https://checkout.rechargeapps.com/r/checkout/<token>?myshopify_domain=<your_shopify_domain>

Your Shopify domain should look something like this: <name specific to your shop>.myshopify.com. You can easily spot it in the root URL of your Shopify admin.

Using a custom built UI checkout

  1. Create checkout
  2. Update checkout
  3. Retrieve checkout
  4. Retrieve shipping rates for a checkout
  5. Update the checkout with shipping rates
  6. Process checkout

Mobile payments with Checkout

When using mobile payment apps with checkout, the full shipping address is not available until after the checkout is processed. If a partial shipping address is provided when creating or updating a checkout then it will result in validation errors.
To temporarily bypass shipping address validations for a Mobile Payment checkout pass the 'partial_shipping' URL parameter when creating or updating a checkout. See more details below.

Supported mobile payment types are Apple Pay and Google Pay.

How-to add partial shipping parameters to a checkout

Standard shipping_address validation may be bypassed for Mobile Payment checkouts, where address data is not yet available. To bypass certain shipping_address validations, pass the partial_shipping query parameter in the URL when updating the checkout.

HTTP Example URL

Checkout create:

PUT /checkouts/<token>?partial_shipping=1

Checkout update:

POST /checkouts/?partial_shipping=1

Need Help? Contact Us