How to use voucher codes on Connect.
Since voucher codes are only created for new eSIM activation orders, the first step to start using voucher codes is to place an order through Connect's order API.
Order fulfilment is not synchronous, so after placing an order, the order status needs to be periodically checked until completion using a polling mechanism. For this your code can use the order API or just use the metadata links available in the response from order creation. Once the order status is COMPLETED and the voucher service is enabled, an extra field called
code is returned.
The voucher code is designed to provide a new easy way to install an eSIM, being a secure way to share order information between different systems. For example, this would allow you to have a stand-alone system that creates orders and shares the codes with your customers via email or receipt. Your customers can then install the eSIM in a mobile application by providing the voucher code received.
The voucher code details can be fetched using the get voucher code details endpoint. Check the example request/response bellow.
Whenever a voucher code is used to install a new eSIM, the voucher should be marked as redeemed. The redeem voucher endpoint must be used for this, as shown in the example request/response shown below. Note that this step is not mandatory and It will only serve to identify vouchers that have already been redeemed.
When the voucher is redeemed, the field
redeemed_on is added to the voucher code details. This field has the date and time when the code was redeemed. In the example below is shown the details of a voucher already redeemed.