Migrate from CreateCheckout to CreatePaymentLink

Learn how to migrate an application from using the CreateCheckout endpoint to using the CreatePaymentLink endpoint.

Link to section

Migration overview

The CreatePaymentLink endpoint provides all the functionality of the CreateCheckout endpoint and adds the following checkout options:

  • Shipping fees - You can add a shipping fee. The buyer sees the shipping fees during checkout on their order confirmation pages and receipts.
  • Application fee money - You can add an application fee. This amount is deposited to the Square developer account.
  • Custom fields - You can add up to two custom form fields to collect more information from buyers during checkout.
  • Accepted payment methods - You can add support for payment methods such as credit cards, debit cards, Google Pay, Apple Pay, Afterpay, and Cash App.
  • Allow tipping - You can add support for tipping.
  • Subscription plans (recurring payments) - You can specify a subscription plan ID in the checkout request and charge the buyer for recurring payments.
Link to section

Important dates

  • Deprecation: 2022-08-17
  • Retirement: TBD
Link to section

Get help

If you need help migrating to Square APIs or need more time to complete your migration, contact Developer Support, join our Discord community, or reach out to your Square account manager.

Link to section

Endpoints

The CreatePaymentLink endpoint replaces the CreateCheckout endpoint in the Checkout API.

Deprecated Checkout API endpointReplacement Checkout API endpoint
CreateCheckoutCreatePaymentLink
Link to section

Field mappings

With the exception of the additional_recipients field, all fields in the CreateCheckout endpoint are also available in the CreatePaymentLink endpoint. As a result, most code only needs to update the endpoint reference and field names to work properly.

The following sections provide mapping information about the path parameters, query parameters, and response fields.

Link to section

Path parameter mappings

The following table shows how the CreateCheckout path parameters map to the CreatePaymentLink endpoint:

CreateCheckout path parameterCreatePaymentLink path parameterNote
location_idN/Alocation_id is changed to a query parameter.
Link to section

Query parameter mappings

The following table shows how the CreateCheckout query parameters map to the CreatePaymentLink endpoint:

CreateCheckout query parameterCreatePaymentLink query parameterNote
idempotency_keyidempotency_key
N/AdescriptionAdd a description of the payment link. For more information, see description.
N/Aquick_payGenerate a quick pay checkout link. For more information, see QuickPay.
orderorder
N/Acheckout_optionsAdd optional fields to the resulting checkout page. For more information about all the available options, see CheckoutOptions.
N/Acheckout_options.accepted_payment_methodsAccept various methods for payment. For more information, see AcceptedPaymentMethods.
N/Acheckout_options.allow_tippingEnable tipping on the checkout page. For more information, see allow_tipping.
ask_for_shipping_addresscheckout_options.ask_for_shipping_addressSee ask_for_shipping_address.
N/Acheckout_options.custom_fieldsAdd custom fields to request information from the buyer. For more information, see CustomFields.
merchant_support_emailcheckout_options.merchant_support_emailSee merchant_support_email.
redirect_url checkout_options.redirect_url See redirect_url.
N/Acheckout_options.subscription_plan_idAllow the buyer to pay and subscribe. For more information, see Subscription Plan Checkout.
N/Acheckout_options.shipping_feeAdd a shipping fee to the checkout page. For more information, see Shipping Fee.
N/Acheckout_options.app_fee_moneyAdd an application fee to the checkout page. For more information, see app_fee_money.
N/Apre_populated_dataAdd fields to prepopulate in the resulting checkout page. For more information, see PrePopulatedData.
pre_populate_shipping_addresspre_populated_data.buyer_addressSee buyer_address.
pre_populate_buyer_emailpre_populated_data.buyer_emailSee buyer_email.
N/Apre_populated_data.buyer_phone_numberPrepopulate the payment form with the buyer phone number. For more information, see buyer_phone_number.
N/AsourceProvide the application that created the payment link. For more information, see source.
notepayment_noteSee payment_note.
additional_recipientsN/AThis field is no longer supported. For more information, see additional_recipients.
Link to section

Response field mappings

The CreateCheckout endpoint returns checkout information as a Checkout object in the response body, whereas the CreatePaymentLink endpoint returns a PaymentLink object.

CreateCheckout fieldCreatePaymentLink fieldNote
idid
N/AversionThe Square-assigned version number, which is incremented each time an update is made to the payment link. For more information, see version.
N/Acheckout_optionsThe checkout options configured for the payment link. For more information, see CheckoutOptions.
ask_for_shipping_addresscheckout_options.ask_for_shipping_addressSee ask_for_shipping_address.
merchant_support_emailcheckout_options.merchant_support_emailSee merchant_support_email.
redirect_urlcheckout_options.redirect_urlSee redirect_url.
N/Acheckout_options.accepted_payment_methodsSee accepted_payment_method.
N/Acheckout_options.allow_tippingSee allow_tipping.
N/Acheckout_options.app_fee_moneySee app_fee_money.
N/Acheckout_options.custom_fieldsSee CustomFields.
N/Acheckout_options.shipping_feeSee ShippingFee.
N/Acheckout_options.subscription_plan_idSee Subscription Plan Checkout.
created_atcreated_atSee created_at.
N/AdescriptionThe optional description of the payment_link object. For more information, see description.
N/Aorder_idThe ID of the order associated with the payment link. For more information, see order_id.
N/Apayment_noteThe optional note for the payment link. For more information, see payment_note.
N/Apre_populated_dataThe buyer data to prepopulate on the checkout page. For more information, see pre_populated_data.
pre_populate_buyer_emailpre_populated_data.buyer_emailSee buyer_email.
pre_populate_shipping_addresspre_populated_data.buyer_addressSee buyer_address.
N/Apre_populated_data.buyer_phone_numberThe buyer phone number to prepopulate in the payment form. For more information, see buyer_phone_number.
N/Aupdated_atThe timestamp when the payment link was last updated, in RFC 3339 format. For more information, see updated_at.
checkout_page_urlurlSee url.
N/Arelated_resourcesThe list of related objects. For more information, see Related Resources.
orderrelated_resources.ordersThe order to be checked out. For more information, see orders.
N/Arelated_resources.subscription_plansThe subscription plan that is associated with the payment link. For more information, see subscription_plans.
additional_recipientsN/A
Link to section

Migrate to the CreatePaymentLink endpoint

CreateCheckout to CreatePaymentLink

The following example shows a request to create a Square-hosted checkout page with the CreateCheckout endpoint:

The following shows the CreateCheckout response:

Example CreatePaymentLink request

The following example shows a request to create a Square-hosted checkout page with the CreatePaymentLink endpoint:

The following shows the CreatePaymentLink response:

The following example shows a CreatePaymentLink request with an Order object:

The following is an example response: