0
votes

I am getting a 422 error while trying to add items to my square account using the API (POST). Please let me know what is wrong.

Here is what I am sending URL: https://connect.squareup.com/v1/me/items

Header:

      Authorization: Bearer {Personal Token}
      Accept: application/json
      Content-Type: application/json

Body:

    [{
       "visibility": "PRIVATE",
       "available_online": false,
       "available_for_pickup": false,
       "name": "New Item",
       "variations": [{
        "pricing_type": "FIXED_PRICING",
        "name": "Regular",
        "price_money": {
         "currency_code": "USD",
         "amount": 6000
        },
        "sku": "new_item"
       }]
      }]
1

1 Answers

0
votes

The Item object being provided in the above example is inside an array, which is incorrect. If you delete the outermost square brackets from the above example, the request should succeed.