Optional Checkout Configurations

The checkout_options field in the CreatePaymentLink request allows you to add optional fields to the resulting checkout page (see Checkout API Overview). These fields can be used, for example, for tipping options, requesting information from buyers through custom fields, and prepopulating buyer data (such as email address, phone number, and shipping address).

Link to section

Prepopulate the shipping address

By default, the checkout page doesn't include address fields. The CreatePaymentLink request must include checkout_options (see CheckoutOptions) with the ask_for_shipping_address field set to true for these fields to appear on the checkout page as shown. This also results in having SHIPMENT as the order fulfillment type.

Create payment link

The following is an example response:

When the buyer opens the checkout page, they must provide their name, phone number, and address. After the buyer provides the information, Square processes the payment and updates the order as follows:

  • Sets the state from DRAFT to OPEN.
  • Updates Order.fulfillments.shipment_details to include name, phone number, and address information.

Applications can also prepopulate the buyer's address on the checkout page by adding the pre_populated_data field in request body as shown:

Create payment link

Link to section

Prepopulate the email address and phone number

A checkout page always includes a CONTACT section showing empty UI fields for the buyer to provide an email address and phone number. You can prepopulate these fields by adding the pre_populated_data field in a CreatePaymentLink request as shown. The request specifies an ad hoc item name and price to create a quick pay checkout and the optional pre_populated_data field.

Create payment link

After receiving the request, Square creates an order, creates a checkout page, and returns a response. An example response is shown:

When the buyer opens the checkout page, their email address and phone number are prepopulated. The buyer has the option to update the information. After the buyer pays, the email address and phone number are added to the order fulfillment (recipient field).

Link to section

Specify checkout options

Applications can include checkout_options in a CreatePaymentLink request to specify optional checkout page configurations. This includes enabling the buyer to add a tip, providing a shipping address, provide support email for buyer to contact the merchant, and adding up to two additional custom fields. An example request is shown:

Create payment link

The following is an example response:

You can also include a shipping fee and an application fee as a checkout option.

The following is an example response:

A checkout page always includes a COUPON section showing an empty UI field for the buyer to provide a Square Marketing Coupon. You can show or hide the COUPON section using the enable_coupon field as a checkout option.

The following is an example response:

If the seller has enabled Square Loyalty, the checkout page includes a REWARDS section that allows the buyer to sign up for a Loyalty program, accrue points, or redeem rewards. You can show or hide the REWARDS section using the enable_loyalty field as a checkout option.

The following is an example response:

Link to section

See also