@experimental to each one.
Reads need the payments_read scope and writes need payments_write. HSA/FSA
payments must be on for the store, which fails with PAYMENTS_NOT_ENABLED
otherwise, and links need a Shopify store: a store without one has no links,
and a write fails with HSA_PAYMENT_LINKS_REQUIRE_SHOPIFY.
1. Find the products to sell
A line takes aProduct id. Read them with products (products_read): a line
needs a live Shopify variant priced in USD whose HSA/FSA eligibility Redo knows.
2. Create a link
Amounts areMoneyInput values in USD. Fields you leave out take the merchant
app’s defaults: a single-use link expires 15 days after it is created, and a
reusable one never expires and lets the shopper change quantities.
INVALID_HSA_PAYMENT_LINK, its message
naming the field: for example a discount larger than the items, or a total
below $2.00.
3. Share its url
Send the shopper the link’surl as given. While its state is ACTIVE,
shoppers can pay it.
4. Read its payments
hsaPaymentLink returns paidCount and paidAmount for the whole link.
5. Turn it off
6. Delete it
Only a link that is off or expired, took no payment, and has no checkout a shopper may still pay can be deleted. ReaddeleteBlockedReason first: it is
null when the link can be deleted. hsaPaymentLinkDelete returns true once
the link is gone, and fails with HSA_PAYMENT_LINK_DELETE_BLOCKED when it
can’t be deleted. A link that took a payment keeps the record of it, so turn it
off instead.