<- Checkout API

Checkout API

All versions ->

Create checkout

DEPRECATED

 /v2/locations/{location_id}/checkouts

Links a checkoutId to a checkout_page_url that customers are directed to in order to provide their payment information using a payment processing workflow hosted on connect.squareup.com.

Permissions:ORDERS_WRITE, PAYMENTS_WRITE

Deprecation date

2022-08-17

Retirement date

TBD

Migration guide
Link to section

Path parameters

Example code

Link to section

location_id

string

Required

The ID of the business location to associate the checkout with.

Link to section

Request body

Link to section

idempotency_key

string

Required

A unique string that identifies this checkout among others you have created. It can be any valid string but must be unique for every order sent to Square Checkout for a given location ID.

The idempotency key is used to avoid processing the same order more than once. If you are unsure whether a particular checkout was created successfully, you can attempt it again with the same idempotency key and all the same other parameters without worrying about creating duplicates.

You should use a random number/string generator native to the language you are working in to generate strings for your idempotency keys.

For more information, see Idempotency.

Link to section

order

Required

The order including line items to be checked out.

Link to section

ask_for_shipping_address

boolean

If true, Square Checkout collects shipping information on your behalf and stores that information with the transaction information in the Square Seller Dashboard.

Default: false.

Link to section

merchant_support_email

string

The email address to display on the Square Checkout confirmation page and confirmation email that the buyer can use to contact the seller.

If this value is not set, the confirmation page and email display the primary email address associated with the seller's Square account.

Default: none; only exists if explicitly set.

Link to section

pre_populate_buyer_email

string

If provided, the buyer's email is prepopulated on the checkout page as an editable text field.

Default: none; only exists if explicitly set.

Link to section

pre_populate_shipping_address

If provided, the buyer's shipping information is prepopulated on the checkout page as editable text fields.

Default: none; only exists if explicitly set.

Link to section

redirect_url

string

The URL to redirect to after the checkout is completed with checkoutId, transactionId, and referenceId appended as URL parameters. For example, if the provided redirect URL is http://www.example.com/order-complete, a successful transaction redirects the customer to:

http://www.example.com/order-complete?checkoutId=xxxxxx&amp;referenceId=xxxxxx&amp;transactionId=xxxxxx

If you do not provide a redirect URL, Square Checkout displays an order confirmation page on your behalf; however, it is strongly recommended that you provide a redirect URL so you can verify the transaction results and finalize the order through your existing/normal confirmation workflow.

Default: none; only exists if explicitly set.

Link to section

additional_recipients

The basic primitive of a multi-party transaction. The value is optional. The transaction facilitated by you can be split from here.

If you provide this value, the amount_money value in your additional_recipients field cannot be more than 90% of the total_money calculated by Square for your order. The location_id must be a valid seller location where the checkout is occurring.

This field requires PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS OAuth permission.

This field is currently not supported in the Square Sandbox.

Link to section

note

string

An optional note to associate with the checkout object.

This value cannot exceed 60 characters.

Link to section

Response fields

Link to section

checkout

The newly created checkout object associated with the provided idempotency key.

Link to section

errors

Any errors that occurred during the request.

Error descriptions