Quantcast
Channel: Square Developer Forums - Latest topics
Viewing all articles
Browse latest Browse all 1325

The token obtained from Oauth cannot create customer card

$
0
0

Hi,

We want to create card for our customer by below API and it was succeeded with the Application Access Token. However, if we pass the token obtained from Oauth procedure, it would return 400 error. Please help to figure out the root issue.

curl https://connect.squareup.com/v2/cards \
  -X POST \
  -H 'Square-Version: 2023-12-13' \
  -H 'Authorization: Bearer token' \
  -H 'Content-Type: application/json' \
  -d '{
    "idempotency_key": "9f140950-1310-4587-98de-556b7f9181c0",
    "card": {
      "billing_address": {
        "postal_code": "60616"
      },
      "customer_id": "899f74ef-2e23-4413-a5f9-9c4ee0906f5a"
    },
    "source_id": "cnon:CBESEK8K2-fake-source-id"
  }'
{
  "errors": [
    {
      "category": "INVALID_REQUEST_ERROR",
      "code": "INVALID_CARD_DATA",
      "detail": "Invalid card data.",
      "field": "source_id"
    }
  ]
}

Note: For the safety, I provide the fake ids instead of real source id and bearer token, you can check the API log on this application: sq0idp-4M6ZTXS5LE0N7qOV163dgg. Please let me know if you want to check the details.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 1325

Trending Articles