question

rey avatar image
rey asked ·

{"message":"['name' is required to be non-null, 'price' is required to be non-null]"}

I keep receiving this message when creating an inventory item using FileMaker 19's "Insert from URL" script step. I've been successfully in the following:

  1. GET all items from clover
  2. POST (update) an already existing item
  3. POST (update) stock quantity
  4. GET all customer info

I'm stuck at CREATING an item.

I'm using this (replacing MID with merchent ID and authorization token with my actual token)

cURL options:

--location --request POST 'https://api.clover.com/v3/merchants/MID/items' \

--header 'Authorization: Bearer {access token}' \

--header 'Content-Type: application/json' \

--data-raw '{

"hidden": "false",

"defaultTaxRates": "true",

"isRevenue": true,

"name": "Test",

"price": 2500,

"priceType": "FIXED",

"code": "222222",

"sku": "ACC-TE-TEST222",

"cost": 5000

}'

The funny thing is, it works when I use "postman.com". I've copied everything perfectly.

Any help would be greatly appreciated.

Inventory
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

rey avatar image
rey answered ·

Thank you for responding David. I read through many posts on the filemaker (Claris) community and nothing helped. So I decided to simplify the cURL as much as possible and was able to get it to work. Here is what FileMaker sends over:


https://api.clover.com/v3/merchants/{mid}/items


-H Content-Type: application/json
-d {"hidden":"false","defaultTaxRates":"true","isRevenue":true,"name":"Test2","price":2500,"priceType":"FIXED","code":"222222","sku":"ACC-TE-TEST222","cost":5000}
-H "Authorization: Bearer {access token}" --show-error --dump-header $dump


I found that the authorization line needs to be last. It was not authenticating if it was above the -d (data)

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image
David Marginian answered ·

That looks like a valid request to me and as you said it is working from Postman. Sorry, we can't help you with using external tools (FileMaker 19). That being said a very quick Google search revealed this - https://community.claris.com/en/s/question/0D50H00006ezDnR/sending-post-data, which may be helpful.

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community