Reputation: 3
I am creating a new transaction object and purchasing the shipping label with one API call using shippo.transaction.create({...}). My user can request 1 or more of the same label at the same time. How can I include the number of labels they requested in the same PDF? I really don't want to do it in a batch since this is much quicker and straight-forward.
I have tried looping through
shippo.transaction.create(
{
shipment: shipment,
carrier_account: carrierAccount.object_id,
servicelevel_token: shipDetails.shippingMethod,
label_file_type: 'PDF',
})
but only ever get 1 back in return. This PDF will be either emailed or printed directly by the user.
Upvotes: 0
Views: 151
Reputation: 92
As far as I understand, we don't have an option to download/aggregate multiple labels into one PDF file via API/SDK.
Batch API can be used to group the purchased labels. This API will aggregate the label into one single PDF as well.
Once your purchases are complete, you will be able to download a merged PDF file with the labels. Each PDF file will contain up to 100 labels, the label_url field will contain an array of PDF files.
You can read about this further here: https://goshippo.com/docs/batch/
I am checking with my team as well. I will edit/add a comment if I find a workaround or an alternate solution.
Upvotes: 0