Permanent Cart Links

A permanent cart link is a channel that allows you to pre-add products to the shopping cart and take customers directly to the checkout page. You can select products, checkout options, and discounts to apply.

When customers click on the link, they will be redirected to the checkout page that contains the corresponding product, checkout options, and discount information, allowing them to proceed directly to the checkout.

As the name suggests, permanent cart links are persistent, and remain effective once generated.

You can insert the link into emails or use it in various marketing campaigns, providing flexibility and convenience while driving higher store conversions.

This article covers the following:

  • Creating permanent cart links
  • Customizing permanent cart links
  • Examples of permanent cart links

Creating

To create a permanent cart link, you can manually construct it by appending the shopping cart page link of your store with one or more product sku_ids.

To see the complete examples check the examples section below.

Customizing

You can customize the link with product, checkout, and discount information:

Product information

  • When using permanent cart links, it is essential to ensure that the links include product information.
  • Add product information to your cart link using this format: http://{handle}.myshopline.com/cart/{sku1_id}:{quantity},{sku2_id}:{quantity},...

The product sku_id can be obtained from the corresponding product detail page URL.

image.png

  • You can optionally add Properties, also known as custom line item properties, to products for scenarios such as engraving, notes, and gift wrapping. Add Properties using the properties[n] query parameter. n is the product position index in the link, starting from 0:
    • properties[0] applies to the first product in the link.
    • properties[1] applies to the second product in the link.
    • And so on.
  • Each properties[n] value must be a Base64 URL encoded JSON array. The supported property fields are:
FieldTypeDescription
nameStringThe property name.
valueStringThe property value.
typeStringThe property value type. Valid values:
  • text: Some text.
  • picture: An image.
  • link: A link.
showBooleanWhether the property is visible.
  • true: The property is visible.
  • false: The property is not visible.
extInfoStringExtension fields of the property.
additionalStringFields about additional information on the property.
For example, if this property defines information on text, you can add fields for font size, style, and color here.
Example: Additional fields
urlsString[]A list of URLs, available only when type is picture or link.
  • If type is picture, urls enables rendering a thumbnail.
  • If type is link, urls allows redirect to the page corresponding to the first URL in the list.
Example: ["https://www.url.com"]
roleVisibilityStringTo whom the property is visible. Valid values:
  • customer: Visible to customers only.
  • merchant: Visible to merchants only.
  • all: Visible to both customers and merchants.
  • none: Invisible.

Checkout information

  • You can optionally add desired checkout information to the link, following this format, where multiple checkout information needs to be concatenated using the & symbol: http://{handle}.myshopline.com/cart/{sku1_id}:{quantity},{sku2_id}:{quantity}?checkout[email]=example@example.com&checkout[shipping_address][city]=NewYork
  • All supported checkout fields are listed in the table below:
Format for addingCorresponding checkout page fieldsField description
checkout[email]emailThe email attached to this checkout.
checkout[phone]phoneThe customer's phone number, in the E.164 format. Example: +16135551111.
checkout[shipping_address][name]nameThe full name of the customer.
checkout[shipping_address][first_name]firstNameThe first name of the customer.
checkout[shipping_address][last_name]lastNameThe last name of the customer.
checkout[shipping_address][address1]address1The address line 1, which typically contains the street address or the P.O. Box number.
checkout[shipping_address][address2]address2The address line 2, which typically contains the apartment, suite, or unit number.
checkout[shipping_address][district]receiverAreaThe region of the address.
checkout[shipping_address][city]cityThe city, county, town, or village.
checkout[shipping_address][province]provinceThe province, state, or district.
checkout[shipping_address][country]countryThe country or region.
checkout[shipping_address][zip]zipThe shipping address where the line items will be shipped.

Discount information

  • You can optionally add discount codes to your cart URL by appending them after the product information. If you have multiple discount codes, separate them with commas. Here's an example format: http://{handle}.myshopline.com/cart/{sku1_id}:{quantity},{sku2_id}:{quantity}?discount={discount_code1},{discount_code2}
FieldRequiredScenarioExample
Product InformationRequiredAdding SKU and quantityhttp://{handle}.myshopline.com/cart/{sku1_id}:{quantity},{sku2_id}:{quantity},...
PropertiesOptionalAdding custom line item propertieshttp://{handle}.myshopline.com/cart/{sku1_id}:{quantity}?properties[0]=W3sibmFtZSI6ImVuZ3JhdmluZyIsInZhbHVlIjoiSGVsbG8gd29ybGQiLCJ0eXBlIjoidGV4dCIsInNob3ciOiJ0cnVlIiwiZXh0SW5mbyI6IiJ9XQ
Checkout InformationOptionalAdding checkout informationhttp://{handle}.myshopline.com/cart/{sku1_id}:{quantity},{sku2_id}:{quantity}?checkout[email]=example@example.com&checkout[shipping_address][city]=NewYork
Discount InformationOptionalAdding discount code informationhttp://{handle}.myshopline.com/cart/{sku1_id}:{quantity},{sku2_id}:{quantity}?discount={discount_code1},{discount_code2}
Tips
  • Spaces are not supported in the links.
  • For checkout information, if there is a mismatch in the standard address data (for example, the city field should be Sydney, but it is mistakenly set as Melbourne in the link), that data will not be processed.
  • All supported symbols in the link should be in half-width format.
Was this article helpful to you?