Commerce
setupGiftCardRail
Set Up Gift Cards
Set a shop up to sell gift cards, in one call: find or create its gift card product, then say which amounts it sells and whether a buyer may name their own.
Arguments
appIdstringrequiredThe Studio app ID whose shop to set up.customAmountobject | nulloptionalThe band a buyer's OWN amount may land inside. Omit to leave the shop's current choice alone; pass null to close the band so only the set amounts sell; pass both bounds to open it.denominationsMinorinteger[]optionalThe face values this shop sells, in minor units (cents), e.g. [2500, 5000, 10000]. Omit to leave the current amounts alone.
Returns
IDEMPOTENT: run it twice and the second run returns the SAME product rather than a second one, so a retried call is safe.
Ask for it
The Cloud routes these requests to this verb.
- let us sell gift cards
- set up gift cards for this shop
- offer $20 and $40 gift cards
- let customers choose their own gift card amount
Pair it with
The verbs that finish the job.