Closed johnnyman727 closed 10 years ago
You gotta remove these properties from realJSON
.
"method" : "POST",
"url":"orders/",
"Content-Type" : "application/json"
And here's the request:
whiplash.request({
"method": "POST",
"url": "orders",
"body": realJSON
}, function(err, body, status) {
if (err) throw err;
console.log('Response body:', body);
console.log(status)
});
I was getting { error: 'record could not be found' }
But that's because the item_id
within order_items
wasn't a real product. I just created an order using my actual key / actual product and it worked.
Great, thanks @reggi! I'll give this a try today.
I'm testing out this module with Whiplash's servers. I'm trying to do an order creation using the JSON from the example order creation on the Whiplash API Documentation page.
My code looks like:
In the request, all of the fields are falsy except the Date fields,
id
, anddays_in_transit
:Additionally, when I check the order status on the Whiplash Dashboard, the order couldn't be created because the address couldn't be verified. I've also tried sending the POST with a legitimate address with the same results. I think it's because the data is being corrupted somehow before it hits the server.