Post to /payments.json endpoint returns credit_card invalid

Gelingitendo
Shopify Partner
5 0 0

Hey!

When I do a post request with data to the /pamynets.json endpoint, it keeps returning 422 and this:

{
    "errors": {
      "credit_card": [{
        "code": "invalid",
        "message": "is invalid",
        "options": {}
      }]
     }
}

This is the body of the request:

{
"payment": {
"request_details": {
"ip_address": IP,
"accept_language": COUNTRY,
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36"
},
"amount": 250.00,
"unique_token": "my-client-generated-idempotency-token",
"session_id": SESSION_ID,
}
}

Does anyone have a solution for this?
0 Likes
Jason
Shopify Expert
10254 142 1940

You have access to the API in the first place right? It's for sales channels so assume that's what you're building.
What gateway are you using?

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.


★ http://freakdesign.com.au ★
0 Likes
Gelingitendo
Shopify Partner
5 0 0

I'm not using any gateway,

I'm trying to follow the endpoints and examples on this page:
https://help.shopify.com/en/api/reference/sales-channels/payment

And it doesn't specify anything about gateways? I assume it is the direct Shopify payment then?

0 Likes
Aar
New Member
3 0 0

@Gelingitendo Did you ever figure this issue out?

0 Likes