How codes reach people
- Upload the codes in the campaign builder (campaign settings → More → codes): paste them or upload a CSV or text file.
- Put the merge tag
{{code}}into a message of the campaign. When the message is sent, the recipient’s code is written into it — the stored message, its price and every retry carry exactly that code. - The same person always gets the same code: in a later step and in a later run of the campaign.
- When the codes run out, nothing is sent to the people without one: that step ends for them with the reason, nothing is charged or held, and the rest of the flow goes on. The launch dialog says beforehand how many people would get no code.
- A code given to a message that was refused before it left goes back into the pool.
{{code}} works in campaign messages. POST /v1/messages does not hand out codes.
POST /v1/codes/redeemed
Marks codes as redeemed — call it from your shop when a code was used, so the builder shows how many were redeemed. Needs the campaigns:write permission.
How many of the codes sent (duplicates count once) are in this workspace’s pools — all of them are marked as redeemed after the call, also those that already were. A code that is in two pools is marked in both and counts once.
How many of the codes sent (duplicates count once) no pool of the workspace has.
marked + not_found is the number of different codes sent.