I need to add custom text to some of labels generated with shippo batch API. How can I achive this?
Asked
Active
Viewed 90 times
1 Answers
0
You can achive this by adding extra data to batch shipment object. There are multiple keys for extra map but we interested in "reference_1" and "reference_2". Here is example of kotlin code to create shipment with custom text on label:
val shipment = Shipment.createForBatch(fromAddress, toAddress, listOf(parcel))
val extraMap = HashMap<String, Any>()
extraMap["reference_1"] = "Line 1 of custom text"
extraMap["reference_2"] = "Line 2 of custom text"
shipment.extra = extraMap

Zufar Muhamadeev
- 3,085
- 5
- 23
- 51