08-26-2021 11:13 PM - edited 08-26-2021 11:14 PM
Hi All,
I was trying out Create Card APIs and it is failing for me. PFA the error response that we are getting.
{ "error_message": "query did not return a unique result: 2" }
Thanks and Regards,
Arvind
08-27-2021 09:52 AM
Hey @Arvind - thanks for letting us know. Mind sharing the full API request? That way we can troubleshoot things quicker on our end.
08-28-2021 01:17 AM - edited 08-28-2021 01:22 AM
Hi @Ricardo ,
I tried with the recent payload that Marqeta Docs have.
Our System's APIs also started failing too, which were working fine earlier.
08-28-2021 01:21 AM
Request
{
"token": "jit_funding_card",
"user_token": "183c92ec-3de1-41e9-9235-58c3bdbc3cf5",
"fulfillment": {
"card_personalization": {
"text": {
"name_line_1": {
"value": "Jane Doe"
},
"name_line_2": {
"value": "My card personalization line 2"
}
},
"images": {
"card": {
"name": "my_card_logo.png",
"thermal_color": "Black"
},
"signature": {
"name": "my_signature.png"
},
"carrier_return_window": {
"name": "my_return_address_image.png"
}
}
}
},
"card_product_token": "jit_funding_card_product",
"metadata": {
"key1": "value1",
"key2": "value2"
}
}
Response
{
"error_message": "query did not return a unique result: 2"
}
08-30-2021 09:45 AM
@Arvind Just taking a stab at it here...
It looks like you are providing a token `jit_funding_card` for the card you are attempting to create. The card token is a unique identifier for the card (see documentation), which means this request will only work one time. After that, a card with the `jit_funding_card` token will already exist. Is it possible that you've already had a successful creation of a card with this token? You can try to list cards for user to see if a card with this token already exists for this user.
An alternative (and possibly preferable) approach is *not* to provide a token when you make the create card request. This way, the system will generate one for you automatically, ensuring that it is unique and you don't have token collisions.
08-30-2021 12:06 PM
Hi @alvinlee ,
Thanks for the suggestion.
Yes, we have tried all the permutations for that, but was not able to get through.
Now, I guess it's working for us
08-30-2021 08:24 PM
Thanks for sharing
08-31-2021 02:13 PM
@Arvind - the card team has resolved the issue. Can you confirm?
08-31-2021 10:31 PM
Hi @Ricardo ,
Yeah, we are now able to create new cards. Thanks for the Update.
Can you please let us now, what was the issue ?
09-01-2021 11:38 AM
@Arvind - Great to hear it's been resolved. The team is actively investigating and could use your help. Would you be able to share your log of what was run after you received the error? Were you making any additional API calls?
09-01-2021 12:00 PM - edited 09-01-2021 12:00 PM
Hi @Ricardo
I got this error first in one of the sandbox that we are using in our project and after a little debugging, we got to know its an error from marqeta. To cross-check that, when we tried it in our personal sandboxes, it has returned with same error.
So, effectively nothing as such we did before and after this Create Card APIs. And we tried this manually too, so I don't think it was making additional API calls.
09-07-2021 12:37 PM
Thanks for sharing @Arvind, that was helpful. The team believes it is a configuration issue with the crypto key table though can’t be certain without the logs. We’ll be monitoring but happy it has been resolved, please let us know if you have any issues.