Taking payment
Three ways for a person to pay for an order you built, and which one to pick.
The short version.
- Card link: the person adds a card and goes back to your app. You place the order, with
POST /v1/carts/:id/confirm. - Checkout link: the person adds a card and taps Pay on Layout’s page, and Layout places the order right there. You call nothing; you are told it happened. Use it for a person’s first order, then use the saved card for later orders.
- Card Handoff: no Layout page. You send Layout a card you already hold, then place orders yourself, as with a card link.
Card links and checkout links never let your servers see a card. With Card Handoff the person types the card into your form and your server sends it on, so it does pass through your server. A card number must never pass through a model: not in a prompt, a tool call, a transcript, a log or analytics.
Card links
What the person sees. Layout’s card page, with no Layout sign-in and no order on it: who sent them and one Add card button, which opens Apple Pay or a card form. The card is saved to their Layout account, then they land back in your app.
Who confirms. You. Show the cart in your own screen, then call POST /v1/carts/:id/confirm and handle code_required yourself.
What it costs you. Nothing. The person pays the order total, which includes Layout’s service fee unless your application covers it or they have Layout One. See Fees and Layout One.
What you need first. A person you provisioned and verified, and a registered return URL if you want one.
Pick it when you already have your own confirm screen and want the card saved once for many orders. See Card links.
Checkout links
What the person sees. Layout’s confirm screen for one cart: the restaurant, the items, the total and one Pay button. They pay with Apple Pay or a new card, which is saved to their Layout account for next time, and type their code there if Layout needs one. Use it for the person’s first payment method; after that, confirm their carts yourself. A person who already has a card can pay with it there too; in live, Layout texts them a code first, because a link can be forwarded.
Who places the order. Layout, the moment the person taps Pay on its page. You mint the link, send the person to it and wait for the return or the webhooks. You do not call confirm.
What it costs you. Nothing. The person pays the order total, with the same service fee rules as a card link.
What you need first. A person you provisioned and verified, and a ready cart you built for them.
Pick it when you want Layout to handle the whole payment step, including the first order. It has the fewest steps on your side. See Checkout links.
Card Handoff
What the person sees. Your own card form and Layout’s consent text. No Layout page and no redirect.
Who confirms. You, as with card links: build the cart, show it, and call confirm.
What it costs you. US$0.50 for each card saved in live. Sandbox is free.
What you need first. Approval for live, Layout’s consent text in your flow, and card handling on your server that fits the rules for card numbers. Your server sends the card to secure.layout.link. See Going live and Pricing.
Pick it when the card form has to be your own and the person must never leave your product. See Card Handoff API.
Compared
| Card links | Checkout links | Card Handoff | |
|---|---|---|---|
| Friction for the person | One Layout page to add a card, then your own confirm | One Layout page that pays | Your own form, no redirect |
| Who places the order | You, with confirm | Layout, when the person taps Pay | You, with confirm |
| Card touches your servers | Never | Never | Yes, in transit to secure.layout.link |
| Approval needed | No | No | Yes, for live |
| Cost to you | Free | Free | US$0.50 per live card |
| Sandbox | Yes. A test card button | Yes. A test card button, no charge | Yes. Test card numbers |
Which one?
- Layout should take the payment and confirm the order: a checkout link.
- You have your own confirm screen and want the card kept for later orders: a card link.
- The card must be typed into your own form, and you can meet the approval and card handling it needs: Card Handoff.
- Not sure: start with a checkout link.
Changing a card
- To change a person’s card, send a card link. It is free and needs no approval. Most people hold one card, so the page replaces it: it shows the card on file and asks before it saves. Their next orders bill the new card. A Layout One member can hold three; there the link adds the card and makes it their default.
- Listing or removing cards by API (
GETandDELETE /v1/users/:id/cards) comes with Card Handoff. You do not need it to change a card. - Card added on a checkout link, but never paid. The card stays on their account and you get
card.added. No order is placed, and the cart closes after 15 minutes. For their next order, confirm a cart yourself, or send a checkout link for a new cart: it shows the saved card and Pay, and in live Layout texts them a code first. - All of this works for any person you provisioned and verified, whether or not they have ordered.