Create a program
Creates a one-time program in the key’s company and returns it. The permissions and account settings that apply in the dashboard apply here too.
The key’s owner must be an admin who is allowed to create programs.
amount is in cents (2500 means $25.00). startDate and endDate are Unix timestamps in milliseconds, sent as numbers.- Check before you retry. This endpoint takes no
Idempotency-Key. If a request times out or fails with a5xx, look for the program withGET /programsbefore you send it again, or you may create it twice. - Card type. An account that isn’t verified for Visa cards gets a
gift_cardprogram, whatever you send. The response’sprogramTypesays which one you got. - Address. Leave out
addressIdto use your account’s default address (isDefaultinGET /addresses). An account that isn’t verified for Visa cards and has no address yet can leave it out too: its programs give gift cards only, which don’t use an address, so Hoppier fills in its own. An account verified for Visa cards needs an address of its own first: save one. - Merchants. Look up merchant ids with
GET /merchants. Leave outmerchantIdsto start from your company template’s merchants, as the dashboard does. If the template locks its merchants, you can’t choose them here. A program with no merchants allows every merchant. - Invite email. The program gets Hoppier’s standard invite email unless you send
inviteEmail:falsefor none, or your own subject and body. Hoppier sends it only when you add someone withsendEmailAsUsersAreAdded: true.inviteEmailCreatedin the response says whether it was saved. - Account settings. A custom
endDateneeds custom end dates turned on for your account, andisFixedAmount: falseneeds individual amounts turned on. Without them, the request gets403 feature_not_enabled. - Not available here: recurring programs, and a program’s colours and logo. Those come from the dashboard and your company’s program template.
Authorizations
Send your key in the Authorization header: Authorization: Bearer hk_live.…. The word Bearer is case-sensitive.
Keys are shown once. Treat them like passwords and never put one in code that runs in a browser or an app.
Body
The program's name, as admins and participants see it.
1 - 100"Team lunch"
hoppier_card: a prepaid Visa card. gift_card: each person picks a gift card. An account that isn't verified for Visa cards gets gift_card whatever you send.
hoppier_card, gift_card The amount each person gets, in cents (2500 means $25.00). Required for a fixed-amount program, and at least 100. Leave it out when isFixedAmount is false.
x >= 02500
usd One of your company's addresses (ad_…), from GET /addresses. Leave it out to use your account's default address. An account that isn't verified for Visa cards and has no address can leave it out too, and Hoppier fills in its own: that account's programs give gift cards only, which don't use an address.
"ad_7Ym2p0Lx3Q"
When the program starts, as a Unix timestamp in milliseconds. Defaults to now.
1000000000000 <= x <= 41024448000001793491200000
When the program ends, as a Unix timestamp in milliseconds, after startDate. Needs custom end dates turned on for your account. Not with dynamicEndDate.
1000000000000 <= x <= 41024448000001795996800000
true ends each person's card timeFrame days (or hours) after they're added, instead of on one date for everyone.
How long each person's card lasts, in period units. Required with dynamicEndDate, and only allowed with it.
x >= 130
The unit of timeFrame.
days, hours The merchants the program allows: Visa merchants for a hoppier_card program, gift-card brands for a gift_card program. Look ids up with GET /merchants. Leave it out to start from your company template's merchants.
1 - 100 elementsx >= 1The program's invite email, sent when you add someone with sendEmailAsUsersAreAdded: true. Leave it out (or send true) for Hoppier's standard invite email, send false for none, or send your own. You can change it later in the dashboard.
Response
The new program.
The new program, and whether its invite email was saved.
The program's id. Starts with prg_.
"prg_Z8q3NnW2xK"
"program""Team lunch"
The amount each person gets, in cents (2500 means $25.00). 0 on a program where each person has their own amount.
2500
Lowercase currency code. usd is the only value today.
"usd"
active: running. inactive: archived. pending: not active yet.
active, inactive, pending When the program starts: a Unix timestamp in milliseconds, as a string. A program with no start date returns the string "undefined", so treat anything that isn't 13 digits as "no start date".
"1793491200000"
Unix milliseconds, as a string.
"1792504992000"
Unix milliseconds, as a string.
"1792504992000"
true: everyone gets the program's amount. false: each person has their own amount, set when they're added.
hoppier_card: a prepaid Visa card. gift_card: each person picks a gift card. wire_transfer: a money transfer to each person's bank.
hoppier_card, gift_card, wire_transfer true when the program's invite email was saved. false when you sent inviteEmail: false, or if saving it failed: then the program still exists, and the first add that asks for the email creates Hoppier's standard one.
When the program ends (Unix milliseconds, as a string). Left out when the program has no end date.
"1795996800000"
Id of the program's address, one of your saved addresses. Starts with ad_. Left out when the program's address isn't one of yours, such as the address Hoppier fills in for a gift-card program in an account that hasn't saved one.
"ad_7Ym2p0Lx3Q"
The program's main colour in the Hoppier app.
"#FF6161"
The program's second colour in the Hoppier app.
"#FFFFFF"
URL of the program's logo, if it has one.