MONEI / Shopify-api-node

Node Shopify connector sponsored by MONEI
https://monei.com/shopify-payment-gateway/
MIT License
946 stars 277 forks source link

FulfillmentService Create doesn't work with 422 response #416

Closed cedriclajato closed 3 years ago

cedriclajato commented 3 years ago

Even though I have the correct params fulfillmentService.create doesn't work with response of HTTPError: Response code 422 (Unprocessable Entity) others are okay except .create

RoudaniMED commented 3 years ago

check your callback_url in your request if it is correct maybe that's the problem

cedriclajato commented 3 years ago

I actually tried using postman and it's working fine but not when using .create node here's my data

const fulfillment_params = { "fulfillment_service": { "name": "Test Twozzz", "callback_url": "http://google.com", "inventory_management": true, "tracking_support": true, "requires_shipping_method": true, "format": "json" } };

lpinca commented 3 years ago
console.log(error.response.body);

should give you more details.

cedriclajato commented 3 years ago

Yes, the error

{ errors: { response_format: [ 'response format must be xml or json', "can't convert nil to String" ], name: [ 'may not be empty' ] } }

But the name parameter is clearly not empty at all.

cedriclajato commented 3 years ago

No worries, I figured it out. Look like this one doesn't need at all

cedriclajato commented 3 years ago

fulfillment_service