{"section":"known-issues","requestedLocale":"en","requestedSlug":"gift-cards-not-returned-in-checkout-when-both-cpf-and-cnpj-are-sent-gift-card-search-prioritizes-corporatedocument","locale":"en","slug":"gift-cards-not-returned-in-checkout-when-both-cpf-and-cnpj-are-sent-gift-card-search-prioritizes-corporatedocument","path":"docs/en/known-issues/Payments/gift-cards-not-returned-in-checkout-when-both-cpf-and-cnpj-are-sent-gift-card-search-prioritizes-corporatedocument.md","branch":"main","content":"## Summary\n\n\nWhen a shopper profile includes both personal (CPF) and corporate (CNPJ) documents, the Gift Card Search (/giftcards/_search) prioritizes the corporateDocument (CNPJ) and ignores gift cards issued to the personal document (CPF).\nThe visible symptom is that valid gift cards associated with the shopper’s CPF are not returned to Checkout, resulting in “invalid gift code” or empty `ListAllGiftCards` responses. This affects shoppers who previously received gift cards tied to their CPF and later proceed at checkout with both CPF and CNPJ populated in their profile or request payload.\n\n\n#### Simulation\n\n\n\n- Prerequisites:\n  - Account with VTEX Gift Card provider (VtexGiftCard) active.\n  - Shopper profile where both fields are present in the checkout context: document (CPF) and corporateDocument (CNPJ).\n  -\n\nA gift card created/associated with the shopper’s CPF (ownerId = document/CPF).\n\n\n\n\n\nSteps:\n\n1. In Checkout, proceed with the shopper who has both CPF and CNPJ filled (isCorporate may be true, but the search route only receives document and corporateDocument).\n2. Trigger the gift card retrieval flow (`ListAllGiftCards` or during payment attachment). Observe that the response is empty when both documents are sent; if the corporateDocument is omitted, the CPF-tied gift card is returned.\n\n\n#### Workaround\n\n\nEnsure only the intended document is sent in the gift card search context:\n\n- If the gift card was created for the CPF, avoid sending corporateDocument in the request (or in the shopper’s active profile context at checkout) so the search uses document (CPF).\n- Alternatively, reissue/register a mirror gift card with the same balance but associated with the CNPJ (corporateDocument) for that shopper, so the search returning corporateDocument will find it."}