Skip to Content
Docs

Customize Commerce checkout

Match the checkout to your brand with design profiles you edit, preview, and publish, within fixed limits that keep the payment parts intact.

Make the checkout look like the rest of your product, on every surface, without building it yourself. You change the design in the Commerce tab or with the API, and every form of the checkout follows.

Design profiles

A design profile sets how the checkout looks and what it asks for, and applies it on every surface: the hosted page, inline, the overlay, and the native drop-ins. Each profile has an ID that starts with dprof_, and you manage profiles in the Commerce tab or with the design profiles API.

A profile's values set these parts of the checkout:

ValuesWhat they set
display_nameThe business name customers see.
flowOne page or steps. See One page or steps.
layout, summary_positionThe layout, two_panes, one_column, or compact, and whether the order summary sits on the left, on the right, or at the top.
blocks, header_image_urlWhether the shipping section shows when an order has items that ship, and whether a header image shows, from header_image_url.
colors, themeThe accent, background, and text colors as #RRGGBB, and a light, dark, or system theme. Without colors, the checkout has Pay.com's default look in light and dark.
font, corner_radiusThe font, system, google_sans, or serif, and how round the corners are.
express_methodsWhere express methods show. See Express methods and billing details.
collectionThe details the checkout asks for, such as the customer's name, phone number, billing address, and tax ID. Pay.com adds any detail a payment method or tax needs.
submit_labelThe word on the button before the total: pay, buy, book, or donate.

A checkout session or payment link can override the profile's flow, collection, and express_methods.

Edit, preview, and publish

Each profile has a draft and published versions. Customers see the published version, so nothing you change shows until you publish it.

  1. 1

    Save the draft

    Create a profile with POST /v1/design_profiles, or save a profile's draft with PATCH /v1/design_profiles/{design_profile_id}. The draft you send replaces the whole draft. A new profile has a draft and nothing published.

  2. 2

    Preview it

    Send the values to POST /v1/design_profile_previews. It returns a url that shows the checkout with those values and sample items, and expires about 10 minutes after it's made. Set sample to physical to add an item that ships, so the preview shows shipping, and width to phone to see the phone layout. Nothing is published, no session is created, and nothing on the preview can be paid.

  3. 3

    Publish it

    POST /v1/design_profiles/{design_profile_id}/publish publishes the draft as a new version. Sessions created from then on use it, and open sessions keep the version they started with. A publish with no unpublished changes returns the profile as it is and adds no version. In the Commerce tab, publishing asks you to confirm it's you.

A publish returns 422 in these cases:

  • display_name_required: the draft has no display_name.
  • low_contrast: white text on colors.accent, or colors.text on colors.background, has less than 4.5:1 contrast.
  • custom_css_not_approved: the draft's changed custom CSS isn't approved yet.

To drop the unpublished changes, discard the draft, and the draft equals the published version again. A profile with nothing published has nothing to go back to, so the request returns 422 with profile_not_published.

Versions and rollback

GET /v1/design_profiles/{design_profile_id}/versions lists every published version, newest first, and pages by version number. Each version has its values, published_at, and published_by, which is the person who published it or api for an API key. Its changes lists the groups that changed from the version before, as the Commerce tab names them, such as Colors and Flow. The first version's changes is empty.

To go back to an earlier version, roll back with its version. Pay.com publishes that version's values again as a new version, and leaves the draft as it was. In the Commerce tab, a rollback asks you to confirm it's you, as publishing does.

To start a profile from another, duplicate it. The copy's draft is the original's published values, or its draft when nothing is published, and nothing is published on the copy.

Your default profile

Sessions and payment links that name no profile use your default profile. Set is_default to true on a profile to make it your default, and the others stop being default. The profile must be published and not archived, or the request returns 422 with profile_not_published or profile_archived.

Archive a profile to stop new sessions from using it. A checkout session or payment link that names it from then on returns 422 with profile_archived. Open sessions keep it, and payment links that named it before keep opening sessions with it. Your default profile can't be archived, so the request returns 422 with default_profile.

One page or steps

The checkout renders on one page or as a multi-step flow. Set a design profile's flow in its flow, or in the checkout builder under Layout → Flow. For one session or payment link, send flow:

  • one_page: everything on one page.
  • steps: Details, then Shipping, then Payment, with no review step. Shipping appears only when something ships and there's more than one rate. Details asks for the country when tax needs it, so the total is final before Payment, and billing details sit in Payment.

A session or payment link without flow takes its design profile's.

Choose a profile for a session

Every session uses your default design profile unless you pass a different profile ID in design_profile when you create the session. The profile must be published and not archived, or the request returns 422 with profile_not_published or profile_archived. The response returns the profile ID, and the published version the session shows in design_profile_version. Amounts are in the smallest currency unit, so 2000 is $20.00 USD.

curl https://api.sandbox.pay.com/v1/checkout \
  -u ':sk-pay-com-sandbox-…' \
  -H "Content-Type: application/json" \
  -H "idempotency-key: $(uuidgen)" \
  -d '{
    "mode": "payment",
    "customer_reference_id": "cust-jane-doe-001",
    "line_items": [{ "price": "prc_691180255557328896", "quantity": 1 }],
    "design_profile": "dprof_690011254180941824"
  }'

A payment link takes design_profile the same way, and a link whose design_profile is null uses your default profile. See Create a checkout session in the Commerce API reference for every field.

Custom CSS

On hosted pages, you can add your own CSS to a profile's draft, in custom_css, up to 20,000 characters:

  • CSS only, with no scripts.
  • Remote assets, such as fonts and images, only from allowed hosts.
  • It can't change the parts that stay locked.

Pay.com reviews and sanitizes custom CSS before it applies. Submit the draft's CSS with POST /v1/design_profiles/{design_profile_id}/custom_css_review, and follow custom_css_review.status on the profile, which moves from in_review to approved or not_approved. A profile whose CSS isn't approved lists why in custom_css_review.reasons, and you can publish changed CSS only once it's approved.

What stays locked

Some parts can't be hidden or restyled, by a profile or by CSS:

  • The seller line.
  • The totals.
  • The consents.
  • The words on buttons that commit the customer to pay.
  • The card fields.

When Pay.com sells

When Pay.com sells as the merchant of record, it reviews changes to your name and logo, and the checkout always displays "Powered by Pay.com".

In your app

The native drop-ins follow your profile too, and they can use fonts your app ships, inside the drop-in only.

Was this page helpful?