Issue creating label for shipment

I am trying to create a label for a shipment, but whenever I do there is an issue where the shipment line items show as None, and there are no label line items.

I have the following shipment:

"shipment": {
			"data": {
				"id": "U2hpcG1lbnQ6NDYxODAwMzc3",
				"completed": true,
				"warehouse_id": "V2FyZWhvdXNlOjk2ODc5",
				"created_date": "2024-06-05T21:14:25",
				"address": {
					"name": "Jane Doe None",
					"address1": "123 Main St",
					"address2": "Apt 4",
					"city": "San Francisco",
					"state": "CA",
					"country": "US",
					"zip": null
				},
				"line_items": {
					"edges": [
						{
							"node": {
								"line_item_id": "TGluZUl0ZW06MTE4MTQ4NzM4MQ==",
								"line_item": {
									"sku": "sku12345",
									"quantity": 5
								}
							}
						}
					]
				},
				"shipping_labels": []
			}
		}
	},

I perform the following mutation:

mutation {
    shipment_create_shipping_label(
        data: {
            shipment_id: "U2hpcG1lbnQ6NDYxODAwMzc3"
            customer_account_id: "QWNjb3VudDo3NDE0OQ=="
            address: {
                name: "Jane Doe"
                address1: "123 Main St"
                address2: "Apt 4"
                city: "San Francisco"
                state: "CA"
                zip: "94105"
                country: "US"
            }
            carrier: "test_carrier"
            shipping_name: "shipping_name"
            shipping_method: "shipping_method"
            cost: "1.1"
            dimensions: {
                length: "1.0"
                width: "2.0"
                height: "3.0"
                weight: "4.0"
            }
            line_item_ids: "TGluZUl0ZW06MTE4MTQ4NzM4MQ=="
            label: {
                pdf_location: "pdf_location"
            }
            tracking_number: "tracking_number"
        }
    ) {
        request_id
    }
}

After both of these actions, the shipment looks as follows:

		"shipment": {
			"data": {
				"id": "U2hpcG1lbnQ6NDYxODAwMzc3",
				"completed": true,
				"warehouse_id": "V2FyZWhvdXNlOjk2ODc5",
				"created_date": "2024-06-05T21:14:25",
				"address": {
					"name": "Jane Doe None",
					"address1": "123 Main St",
					"address2": "Apt 4",
					"city": "San Francisco",
					"state": "CA",
					"country": "US",
					"zip": null
				},
				"line_items": {
					"edges": [
						{
							"node": {
								"line_item_id": null,
								"line_item": null
							}
						}
					]
				},
				"shipping_labels": [
					{
						"box_id": null,
						"tracking_number": "tracking_number",
						"carrier": "test_carrier",
						"cost": "1.10",
						"tracking_url": "https://www.google.com/search?q=tracking_number",
						"dimensions": {
							"weight": "4.0000 oz",
							"height": "3.0000 inch",
							"width": "2.00 inch",
							"length": "1.00 inch"
						},
						"shipment_line_items": {
							"pageInfo": {
								"hasNextPage": false
							},
							"edges": []
						}
					}
				]
			}
		}
	}

Can you please assist with this issue? Is there anything wrong with my mutation query (please note I tried passing line_item_ids as a list also and the same behavior occurred).

Thanks!

Hi @rypaul12

Where are you getting the "line_item_id": "TGluZUl0ZW06MTE4MTQ4NzM4MQ==", ?
I could not find that ID anywhere in our DB

I understand that you are not creating the label within the shipment_create mutation. Is this correct?

Try passing the order line_item_id to the shipment_create_shipping_label mutation to see if that works.

Here is an example of the shipment_create mutation in our docs Examples-mutation – Developer Resources | ShipHero

Have a nice day!

Yes our goal is to create a label for an existing shipment.

That line_item_id was grabbed from the existing shipment (as shown in the beginning of my initial question) we wanted to update with a new label. However once we ran the shipment_create_shipping_label mutation it got changed to None, so that is the reason you can’t find the ID in your DB anywhere.

We’ve also tried using the order_line_item_id but saw the same behavior.

@Luisperrone any thoughts on this? it’s a blocker for us

@daniellanger

I just replied to the ticket 187549 you created about this issue. Let’s follow up there!