This method selects vouchers that are suitable for publication, adds a publish entry and returns the publication.
A voucher is suitable for publication when it's active and hasn't been published yet.
Limited access
Access to this endpoint is limited. This endpoint is designed for specific integrations and the API keys need to be configured to access this endpoint. Navigate to the Dashboard → Project Settings → General → Integration Keys to set up a pair of API keys and use them to send the request.
Clearly define the source of the voucher
You must clearly define which source you want to publish the voucher code from. It can either be a code from a campaign or a specific voucher identified by a code.
Publish multiple vouchers
This endpoint does not support the publishing of multiple vouchers from a single campaign. In case you want to publish multiple vouchers within a single publication, you need to use a dedicated endpoint.
Specifying the voucher to be published
- In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use an auto-update campaign and in the query parameters specify the
campaign
without specifying the voucher.- If you would like to publish a specific code from a specific campaign, then you need to provide the
campaign
and thevoucher
parameters.- If you would like to publish a standalone voucher, then omit the campaign parameter and simply provide the
voucher
parameter.
Example Request
/publications/create?campaign=camp_T0bUgWGCAV6S0X3smH4MEboG&metadata[year]=2&metadata[Date]=2023-03-03&metadata[DateTime]=2023-03-03T14:06:08.311Z&metadata[Flag]=true&metadata[Number]=222&metadata[String]=stringy&metadata[ImageURL]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&metadata[Object][payment][payment_tax]=9&metadata[Object][payment][payment_method]=Visa&metadata[Object][payment][payment_date]=2023-03-03&metadata[Object][payment][payment_datetime]=2023-03-03T14:06:08.311Z&metadata[Object][payment][payment_completed]=true&metadata[Object][payment][payment_url]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&customer[source_id]=try-new-12&customer[name]=John%20Jimmy&customer[description]=This is testing the publication endpoint.&customer[email]=johnjimy2%40email.com&customer[phone]=%2B48%20123%20333%20333&customer[address][city]=Warsaw&customer[address][state]=Mazowieckie&customer[address][line_1]=4499%20Main%20St.&customer[address][line_2]=Blg%202%20APT%204&customer[address][country]=Poland&customer[address][postal_code]=122333&customer[birthday]=2222-01-22&customer[metadata][paid_bill]=true&customer[metadata][age]=22&customer[metadata][location]=Poland&customer[metadata][acquisition_date]=2022-09-09&customer[metadata][birth_date]=2023-03-20T18:44:19.215Z&customer[metadata][ImageURL]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&customer[metadata][location-unknown][city]=Katowice&customer[metadata][location-unknown][state]=slask&customer[metadata][location-unknown][number]=2&customer[metadata][location-unknown][date]=2034-09-11&customer[metadata][location-unknown][dateTime]=2023-03-20T18:44:19.215Z&customer[metadata][Object][payment][payment_date]=2023-03-03&customer[metadata][Object][payment][payment_datetime]=2023-03-03T14:06:08.311Z&customer[metadata][Object][payment][payment_completed]=true&customer[metadata][Object][payment][payment_url]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&customer[metadata][Object][payment][payment_tax]=9&customer[metadata][Object][payment][payment_method]=Visa```