Hi,
While testing https://developer.squareup.com/explorer/square/cards-api/create-card API, I’ve noticed that the firstName
and lastName
field are completely ignored when creating a new card on file.
I want to rely on this data to avoid saving any kind of personal information into our database, but Square ignores it. I can somehow workaround this by using the cardholderName
field instead.
This is either a bad documentation or a bug.
Cheers.
I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
Additional Documentation
Test in the Sandbox
Square Developer
Create a Card on File and a Payment
If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.
The firstName
and lastName
fields are indeed not currently supported in the CreateCard endpoint of the Cards API. This is not a bug, but a limitation of the current API design. As a workaround, you can use the cardholderName
field to store the full name of the cardholder. However, please remember to always ask customers for permission before saving their card information.
This answer was reviewed by @Bryan-Square.