Post to /payments.json endpoint returns credit_card invalid

Highlighted
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
Highlighted
Shopify Expert
10006 116 1819

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?

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Highlighted
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
Highlighted
New Member
2 0 0

@Gelingitendo Did you ever figure this issue out?

0 Likes