I am trying to test your transactions endpoint to purchase a label, however it keeps returning that my data was not valid.
Which is strange, because when I fetch the shipment by ID, I can clearly see that it contains the rate that I am trying to purchase.
Is there something I am missing?
This is what I am sending:
{ rate: 'a56493b1f836482e94b89fb9d6261267', label_file_type: 'PDF', async: false }
This is my implementation:
shippo_instance.transaction.create({
rate: rate_id,
label_file_type: "PDF",
async: false
}, async (error, transaction) => {
if (error) return res.send(create_api_message("danger", error.message))
try {
const label = await shippo_instance.transaction.retrieve(transaction.object_id);
res.send(label)
} catch ({ message }) {
res.send(create_api_message("danger", message))
}
});