Hello Everyone, I’m trying to create a shipment using the shipment_create mutation but I’m getting the error, address is invalid. I also tried different addresses but all time I have the same error. Following is the link that I’m following to create a shipment.
https://developer.shiphero.com/order-fulfillment/
my mutation looks like below
mutation($data: CreateShipmentInput!) {
shipment_create(data: $data) {
request_id
complexity
shipment{
id
}
}
}
and the variables are as follows
{
"data": {
"customer_account_id": "QWNj........",
"order_id": "T3JkZX.............",
"warehouse_id": "V2FyZWhvd......",
"address": {
"name": "John",
"address1": "2543 Johnson St.",
"address2": "",
"city": "Oklahoma",
"country": "US",
"phone": "5555555555"
},
"line_items": [{ "line_item_id": "TGluZUl0ZW06NDA5MjA2ODkw", "quantity": 1 }],
"labels": {
"address": {
"name": "John",
"address1": "2545 Johnson St.",
"address2": "",
"city": "lo",
"country": "US",
"phone": "5555555555"
},
"carrier": "Generic",
"shipping_name": "Generic",
"shipping_method": "Generic",
"cost": "0.00",
"dimensions": { "weight": "0", "height": "0", "width": "0", "length": "0" },
"label": {
"paper_pdf_location": "https://ws.aramex.net/content/rpt_cache/b2878efbeb6c48bd8c9bdc364cff5882.pdf"
},
"line_item_ids": ["TGluZUl0ZW06NDA5MjA2ODkw"],
"tracking_number": "1234434242444444434"
},
"notify_customer_via_shiphero": true,
"notify_customer_via_store": true
}
}
I’m getting the following error
{
"errors": [
{
"message": "Variable \"$data\" got invalid value {\"address\": {\"address1\": \"2543 Johnson St.\", \"address2\": \"\", \"city\": \"Oklahoma\", \"country\": \"US\", \"name\": \"John\", \"phone\": \"5555555555\"}, \"customer_account_id\": \"QWNjb3VudDo2MjczMQ==\", \"labels\": {\"address\": {\"address1\": \"2543 Johnson St.\", \"address2\": \"\", \"city\": \"Oklahoma\", \"country\": \"US\", \"name\": \"John\", \"phone\": \"5555555555\"}, \"carrier\": \"Generic\", \"cost\": \"0.00\", \"dimensions\": {\"height\": \"0\", \"length\": \"0\", \"weight\": \"0\", \"width\": \"0\"}, \"label\": {\"paper_pdf_location\": \"https://ws.aramex.net/content/rpt_cache/b2878efbeb6c48bd8c9bdc364cff5882.pdf\"}, \"line_item_ids\": [\"TGluZUl0ZW06NDA5MjA2ODkw\"], \"shipping_method\": \"Generic\", \"shipping_name\": \"Generic\", \"tracking_number\": \"1234434242444444434\"}, \"line_items\": [{\"line_item_id\": \"TGluZUl0ZW06NDA5MjA2ODkw\", \"quantity\": 1}], \"notify_customer_via_shiphero\": true, \"notify_customer_via_store\": true, \"order_id\": \"T3JkZXI6MjAxNTYyNDEz\", \"warehouse_id\": \"V2FyZWhvdXNlOjc0NTUw\"}.\nIn field \"labels\": In element #0: Expected \"CreateShipmentShippingLabelInput\", found not an object.\nIn field \"labels\": In element #1: Expected \"CreateShipmentShippingLabelInput\", found not an object.\nIn field \"labels\": In element #2: Expected \"CreateShipmentShippingLabelInput\", found not an object.\nIn field \"labels\": In element #3: Expected \"CreateShipmentShippingLabelInput\", found not an object.\nIn field \"labels\": In element #4: Expected \"CreateShipmentShippingLabelInput\", found not an object.\nIn field \"labels\": In element #5: Expected \"CreateShipmentShippingLabelInput\", found not an object.\nIn field \"labels\": In element #6: Expected \"CreateShipmentShippingLabelInput\", found not an object.\nIn field \"labels\": In element #7: Expected \"CreateShipmentShippingLabelInput\", found not an object.\nIn field \"labels\": In element #8: Expected \"CreateShipmentShippingLabelInput\", found not an object.",
"locations": [
{
"line": 1,
"column": 10
}
]
}
]
}