Skip to main content

Create a shipment

Create shipments to and then update it when necessary during its lifecycle.

Create a shipment

When an order is ready to be shipped, create a shipment with the createShipment mutation. It creates a Shipment object that contains all the relevant information about the shipment.

mutation {
createShipment(input: {...})
{
id
}
}

The createShipmentInput type requires the following fields as a minimum:

  • provider: Specifies a provider with a ProviderEnum!.
  • referenceId: The ID of the shipment.
  • recipient: The name and the selected language of the customer who will receive the shipment.
  • destination: The address to where the shipment will be delivered. Depending on the order, this can be home delivery, a pick-up point, or a store pickup.

In the example, we're creating a shipment that will be delivered using the provider RIV to a pick-up point for Fictitious Customer:

mutation {
createShipment(
input: {
provider: "RIV",
referenceId: "12345",
recipient: {
firstName: "Fictitious",
lastName: "Customer",
language: HU
},
destination: {
pickupPointId: "12345"
}
}
) {
id
}
}

Update the shipment information

Use the updateShipment mutation to modify an existing shipment.

When updating a shipment, you must set the shipment mode in the mode field. It can be one of three options:

  • Sender to recipient: The shipment is sent from the merchant to the customer.
  • Recipient to sender: The shipment is sent from the customer to the merchant. For example, the customer returns a previously ordered item.
  • Third-party to third-party: For example, a fulfillment center shipping to a logistics provider.
mutation {
updateShipment(
input: {
id: "12345"
referenceId: "12345",
recipient: {
firstName: "Fictitious",
lastName: "Customer",
language: HU
},
destination: {
pickupPointId: "12345"
},
mode: SENDER_TO_RECIPIENT
}
) {
id
status {
status
}
}
}