Manage waybills
A waybill is a shipping document that contains essential information about the transported shipment. It tells the carrier what is being shipped, who it's from, where it's going, and how it should be handled.
Create a waybill
A waybill on Delivery Gateway requires the following information:
- A provider: the company transporting the shipment.
- A reference ID: an automatically generated ID assigned by your system.
- One or more shipment IDs. You don't have to assign the ID when creating a waybill: you can do so later with the
assignShipmentToWaybillmutation.
First, create at least one shipment. Each shipment will have an autogenerated id: you will need to pass this ID to the waybill.
Create the waybill with the createWaybill mutation. Add the reference ID as a string:
mutation {
createWaybill(
input: {
referenceId: "123abc",
}
)
{
id
}
}
Set a provider from the list of available providers:
mutation {
createWaybill(
input: {
provider: GLS,
referenceId: "123abc",
}
)
{
id
}
}
Optionally, you can assign a shipment ID during creation:
mutation {
createWaybill(
input: {
provider: BestEx,
referenceId: "123abc",
shipments: ["24e8ff69-2889-4fbb-9868-b576ac21b95c"]
}
)
{
id
}
}
Assign a waybill to a shipment
If you didn't add a shipment ID when you created a waybill, you can assign it later with the assignShipmentToWaybill mutation.
It requires two input fields: the waybill ID and the shipment ID.
mutation {
assignShipmentToWaybill(
input: {
waybillId: "123abc",
shipmentId: "456def",
}
)
{
id
}
}
If you successfully assigned a waybill, you can always query it for the shipment:
query {
shipment(id: "456def") {
waybill {
id
}
}
}