Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Multiple Tracking Numbers with Fulfillment.TrackingNumbers #1050

Open
donaldrainwater opened this issue Apr 3, 2024 · 3 comments
Open
Labels

Comments

@donaldrainwater
Copy link

Hi, I hope you can help me. I am trying to find a code sample that shows how to add multiple tracking numbers to one Fulfillment Order in ShopifySharp. I cannot find the code to make this happen.

@nozzlegear
Copy link
Owner

Hey @donaldrainwater! I'm looking into this now, I'll update as soon as I can. Feel free to ping me if it seems like I've forgotten it.

@mbaugus
Copy link

mbaugus commented Apr 12, 2024

@donaldrainwater I don't use ShopifySharp, but I checked the generated schema class with the fulfillment object against their documentation.

https://shopify.dev/docs/api/admin-graphql/2024-04/mutations/fulfillmentCreateV2?example=Fulfill+a+fulfillment+order+with+two+tracking+numbers+and+tracking+urls+from+different+tracking+tracking+providers

The documentation on the website is as-per-usual inconsistent and confusing.

In the API documentation, (you have to check the examples on the right side for the real expected input), it will expect a single trackingInfo object with an array of tracking numbers, but will convert this into an array of trackingInfo[] objects in the returned response.

the input for multiple tracking numbers according to their documentation

    "trackingInfo": {
      "company": "UPS",
      "numbers": [
        "1Z001985YW99744790",
        "1Z001985YW99744791"
      ]
    }

versus the response

      "trackingInfo": [
        {
          "company": "UPS",
          "number": "1Z001985YW99744790",
          "url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z001985YW99744790"
        },
        {
          "company": "UPS",
          "number": "1Z001985YW99744791",
          "url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z001985YW99744791"
        }
      ]

I've only ever fulfilled single tracking numbers, so you'll need to test if their provided example outline works,

I pasted it below.

mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {
  fulfillmentCreateV2(fulfillment: $fulfillment) {
    fulfillment {
      id
      status
      trackingInfo(first: 10) {
        company
        number
        url
      }
    }
    userErrors {
      field
      message
    }
  }
}

variables
{
  "fulfillment": {
    "lineItemsByFulfillmentOrder": {
      "fulfillmentOrderId": "gid://shopify/FulfillmentOrder/940656279"
    },
    "trackingInfo": {
      "numbers": [
        "1Z001985YW99744790",
        "MS123"
      ],
      "urls": [
        "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z001985YW99744790",
        "http://shopify-unsupported-tracking-company.com?tracking_number=MS123"
      ]
    }
  }
}

@timlaughlin
Copy link

I am interested in this as well.

If I'm reading the most up to date information it seems that the GraphQL supports multiple tracking numbers for a fulfillment but the rest api doesn't? Is that still correct?

Any updates on this would be appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants