API - what is the minimal data to post to generate a label?
I can successfully generate an order using the Click&Drop API. But for the label generation, I think that I need to also specify the shipping method.
However, each time I post a new order with the field postage_details and add a carrierName, then I get a 400 Bad Request.
The downloaded specification does include:
PostageDetailsRequest:
type: object
properties:
serviceCode:
type: string
maxLength: 10
carrierName:
type: string
maxLength: 50
However when I look at the https://api.parcel.royalmail.com/#tag/Orders/operation/CreateOrdersAsync endpoint,
I see no carrierName in the example. That seemed to be a problem when posting.
Could you clarify which information is needed to successfully generate a label?
I think that is:
- Feedback that the API spec does not match the example
- A question on what is required as guidance.
Thank you.
-
Ics19
commented
I have never used 'carrierName' but then again only have one royal mail account so no need to target a specific one - I suspect you can leave this out too. The minimum you need is:
'sendNotificationsTo' => 'recipient'
'serviceCode' => 'MP7' [replace code as required]
'receiveEmailNotification' => 1 [needed for tracked services or set to 0]
You may also need these depending on service:
'IOSSNumber'
'recipientEoriNumber'Hope that helps.