Reintroducing Checkout API

A simpler and faster way to integrate Square payments into any workflow with minimal coding

Reddit
LinkedIn

We’re excited to announce an updated version of Checkout API, now available in our early-access program. This updated version delivers a number of new robust features. Now, you can integrate payments into any workflow and any channel with minimal coding through a conversion-optimized, Square-hosted checkout page.

What’s New

In addition to prebuilt hosted checkout, mobile wallets, shipping address, Square orders, and pre-populated fields offered in our first version of Checkout API, the now-available early access program also provides:

Quick Pay

A quick payment structure where developers can provide a name, amount_money, and location to create their checkout, making it even easier to integrate payments.

curl --location --request POST 'https://connect.squareup.com/v2/online-checkout/payment-links' \
--header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "idempotency_key": "df7e78f6-14ad-4304-9179-dcd7453cf9e6",
    "quick_pay": {        
       "name": "Custom Design & Printing",
       "price_money": {
            "amount": 10000,
            "currency": "USD"
        },
        "location_id": "{{LOCATION_ID}}"
    },
}'

New Payment Methods

Based on your location, you can now enable various automatically configured payment methods such as – mobile wallets, Cash App Pay, Afterpay, and Cards on File with Square Pay. As we release localized payment methods in the future, you will be able to access them directly in the API and configure them seamlessly into your checkout form.

 curl --location --request POST 'https://connect.squareup.com/v2/online-checkout/payment-links' \
--header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "idempotency_key": "df7e78f6-14ad-4304-9179-dcd7453cf9e6",
    "quick_pay": {        
       "name": "Custom Design & Printing",
       "price_money": {
            "amount": 10000,
            "currency": "USD"
        },
        "location_id": "{{LOCATION_ID}}"
    },
    "checkout_options": {
       "accepted_payment_methods":{
            "afterpay_clearpay": true,
            "cash_app_pay": true,
    }
}'

Tipping

You can now enable tipping at checkout. This feature automatically sets to Square POS tip defaults with smart amounts enabled.

curl --location --request POST 'https://connect.squareup.com/v2/online-checkout/payment-links' \
--header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "idempotency_key": "df7e78f6-14ad-4304-9179-dcd7453cf9e6",
    "quick_pay": {        
       "name": "Custom Design & Printing",
       "price_money": {
            "amount": 1000,
            "currency": "USD"
        },
        "location_id": "{{LOCATION_ID}}"
    },
    "checkout_options": {
        "allow_tipping": true,
    }
}'

Custom Fields

Businesses can now capture important or bespoke information from their customers at checkout by adding up to two custom fields to their checkout form.

curl --location --request POST 'https://connect.squareup.com/v2/online-checkout/payment-links' \
--header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "idempotency_key": "df7e78f6-14ad-4304-9179-dcd7453cf9e6",
    "quick_pay": {        
       "name": "Custom Design & Printing",
       "price_money": {
            "amount": 10000,
            "currency": "USD"
        },
        "location_id": "{{LOCATION_ID}}"
    },
    "checkout_options": {
        "custom_fields": [
            {
                "title": "Account Number"
            }
        ]
    }
}'

Subscription Plans

Tap into the power of a subscription. Developers can now include subscription plan offers at checkout. Subsequent plan payments will be charged automatically to the card on file.

curl --location --request POST 'https://connect.squareup.com/v2/online-checkout/payment-links' \
--header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "idempotency_key": "df7e78f6-14ad-4304-9179-dcd7453cf9e6",
    "quick_pay": {        
       "name": "Monthly Wine Box",
       "price_money": {
            "amount": 6000,
            "currency": "USD"
        },
        "location_id": "{{LOCATION_ID}}"
    },
    "checkout_options": {
        "subscription_plan_id": "{{SUBSCRIPTION_PLAN_ID}}",
        "custom_fields": [
            {
                "title": "Wine club membership number"
            },            
            {
                "title": "Birthdate"
            }                        
        ]

    }
}'

A few other notable optimizations include:

  • A mobile-first design flow
  • Improved branding via logo placement and item image support
  • Expanded API accessibility to all Square-operated markets (U.S., AU, CA, UK, JP, IE, FR, ES)
  • Enhanced language support in French, Spanish, and Japanese

Checkout API Checkout GIF

How the New Checkout API Works

This example shows you how to use the new quick-pay checkout feature to create a payment link using just a name and the price.

First, call the Create checkout endpoint to generate a quick-pay checkout page. We’ll go ahead and add the following checkout_options:

  • Allow tipping
  • Request shipping address
  • Accept Afterpay and Cash App Pay payments

We will also include a required custom form field to request an account number from customers as they complete payment.

curl --location --request POST 'https://connect.squareup.com/v2/online-checkout/payment-links' \
--header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "idempotency_key": "df7e78f6-14ad-4304-9179-dcd7453cf9e6",
    "quick_pay": {        
       "name": "Custom Design & Printing",
       "price_money": {
            "amount": 10000,
            "currency": "USD"
        },
        "location_id": "{{LOCATION_ID}}"
    },
    "checkout_options": {
        "allow_tipping": true,
        "ask_for_shipping_address": true,
        "accepted_payment_methods":{
            "afterpay_clearpay": true,
            "cash_app_pay": true,
        },
        "custom_fields": [
            {
                "title": "Account Number"
            }
        ]
    }
}'

Once the request is received, Square prebuilds the checkout page and returns the page link to your server. The prebuilt checkout page is hosted on Square servers, and an SMS-friendly short URL is provided.

{
    "payment_link": {
        "id": "4LPGPTQQTMMWE5EJ",
        "version": 1,
        "description": "",
        "order_id": "ASONemTE0zwnRDkLFq6WdH02kd4F",
        "checkout_options": {
            "allow_tipping": true,
            "ask_for_shipping_address": true,
            "accepted_payment_methods":{
                "afterpay_clearpay": true,
                "cash_app_pay": true,
            }
            "custom_fields": [
                {
                    "title": "Account Number",
                    "uid": "WGY5XAUXCWNUV4HJVW4IIL2A"
                }
            ]
        },
        "url": "https://square.link/u/79E5X7Lv",
        "created_at": "2022-06-16T22:25:35Z"
    }
}

The checkout page URL can now be shared with customers via text, your website, dashboard, QR code, and more. They’ll see a simple payment page with the checkout options and payment methods you configured.

Join the Early Access Program 🎉

This new release brings the best of the Square Checkout experience with no fuss and no frontend needed. Review the Checkout API documentation and technical reference guides to start building flexible, secure, and frictionless payments today.

We’d love to hear from you! Please share your feedback on our community Slack channel or Square Developer Forums, and stay connected with the developer community by following us on Twitter for the latest updates.