Site icon Hip-Hop Website Design and Development

How to add a PW Gift Card to a Woocommerce Order request API?

I’ve been trying to make an order with a Gift Card that I generated
with the PW Gift Card Pro plugin, on our staging website.

I’m able to get the GiftCard, to change it, to
deactivate and all that with the PW Gift Card API, but then I try to integrate with our
solution, through the Order API of WooCommerce and it doesnt work. All the orders are made with the full price and woocommerce just ignores the pw_gift_card field.

How should I proceed? How should be the gift card field on the Order API?
It is something like:

"line_items": [{...}],
"shipping": [{...}],
"pw_gift_card": {
"card_number": gift_card["code"],
"amount": gift_card["amount"],
}

How do i add it? I just need to add to the Order call and to woocommerce recognize it.

We have a custom solution that i cant add their cart plugin, but we do have a basic wordpress website running alongside our solution, that is not accessed by the customers, that has the woocommerce cart with the PW Gift Card installed and if i make an order there, it is successful.
The order is processed and in the response, the field pw_gift_cards_redeemed is populated with the card number and the amount, and the final price is with the discount.

All the rest of the system is working, all orders are made without issues, coupons work with no issues and all that.

I even tried to name the field differently, with instead of pw_gift_cards be gift_card, pw_woocommerce_gift_cards and nothing seemed to work it too.