Gift card or VTEX gift voucher

I need to create a gift card or store credit via the VTEX API, but I need it to show up in the checkout — something like a label showing what it is and a button that says “Use Credit”. However, from what I’ve seen, via the API we create the gift card without a value and then add a transaction, but when I go to checkout the “Use Credit” option doesn’t appear. How do I create a gift card via the API so that these things mentioned above work properly? If anyone can help, please do.

@wanderson good afternoon, how are you?
I think this topic might help you: Gerar vale compras via API

Hey @wanderson, how’s it going?

From what I understood, you already know how to create a voucher and how to add values to it, right?

If I understood your scenario correctly, after those two steps, all that’s left would be to configure the Gift Card as a payment method so it becomes available at checkout.

Configurar Vale-presente

Cheers!

Yes, creating the voucher and adding value is fine, the problem is that I need it to appear at checkout with the message “use credits” and not “use with voucher code”. That’s what I couldn’t replicate. Like, my voucher is already a payment method and already shows up at checkout. The only real issue is that I wanted it to have an option to use the credit directly without needing to enter the code.

Hey @wanderson, how’s it going?

Yesterday I was taking part in this other thread about payment methods and I think I understood what you’re looking for.

Take a look and see if the solution suggested in the other post, which I’m also sharing here, helps you out.

PS: If you have any trouble with the Spanish, feel free to send me a private message.

Awesome, thanks buddy, appreciate the help!

Hey @wanderson, how’s it going?
Did you manage to sort it out?

When a customer reaches the VTEX checkout, the payment system makes a call to all Gift Card providers registered in the store, including the native VTEX one.
In this call, the providers receive the customer’s email and can respond with any gift cards that customer may have.
If they respond, those gift cards show up as available for use at checkout without the customer needing to enter any code.

What happens is that VTEX’s native Gift Card provider only responds to this call automatically with the customer’s gift card if it was created with the relationName field set to loyalty_program. On top of that, only one gift card per customer can be used this way — meaning it’s not possible to have different balances loaded automatically.

In short, if you create a gift card for a customer via API using the relationName field set to loyalty_program, it will be loaded automatically at checkout.

If you need to have different balances for the same customer, you’ll need to implement an external gift card provider: https://help.vtex.com/pt/tutorial/como-integrar-um-provedor-de-gift-card-externo-a-vtex--tutorials_450

Hope that helps!