Closed lassesteffen closed 2 years ago
Hi. I've just created a shipment just by using the following code with API v3.
let shipment = await client.ShopReceipt.createReceiptShipment(
88888888,
99999999,
{
carrier_name: "ups",
send_bcc: false,
tracking_code: "555015043132"
},
tokens
);
Axios request headers contained "Content-Type": "application/x-www-form-urlencoded"
. The data sent was: {"carrier_name":"ups","send_bcc":false,"tracking_code":"555015043132"}
.
Do you get an error when running your code?
It does not throw any errors, it looks like it works fine.
But when I run the createReceiptShipment
and check the shipments
that are returned as a response
, tracking_code
and carrier_name
aren't set for them (I also checked the Etsy UI to see that the tracking code was not added). Only after applying the changes mentioned above it works for me
You are right. I just checked, the tracking number was not recorded on Etsy.
I've applied a fix that utilizes the stringify
method from query-string. It pretty much does what you suggested, with addition that it will work for all requests of this type.
"etsy-ts": "3.5.5"
contains the fix.
Awesome, thanks for your help!
The code currently works with a JSON encoded body. The body should actually use
application/x-www-form-urlencoded
. Maybe it can be changed here.Working code for
createReceiptShipment
:Solution