amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
597 stars 730 forks source link

Can't get labels if Shipment has more than 1000 "cartons" #387

Closed johnkw closed 4 months ago

johnkw commented 3 years ago

As noted in bug amzn/selling-partner-api-models#371 the current label printing is not well-documented, and as also noted in bug amzn/selling-partner-api-models#1114 the system crashes with no error message if you try to print too many at once. However it is possible normally to work around those issues and get the labels for a shipment.

There is a new issue though that seems to prevent getting labels entirely. If there are more than 1000 "cartons" in the shipment, no label can be downloaded for any of the cartons.

In Seller Central, the Shipment is in a strange state as well. The carrier information only shows 1000 under "# of boxes" even though the "1. Review shipment contents" section at the top of the page correctly shows 1092 units or whatever.

Also weirdly the "# of boxes" under the "Box labels" section is pre-selected with 1000 as well, meaning if you click "Generate box labels", you'll actually only get the first 1000 boxes, and the remainder are left off. You can edit it manually to get all the boxes, but it prints them in groups of 1000.

There seems to be some sort of undocumented magic 1000 number that impacts several different things here. It would be good to document that, or just fix it so the limit is no longer there. However, there's also a bug it seems for label downloading that means that API can't create orders over 1000 units without manually getting the labels via Seller Central's awkward interface.

johnkw commented 3 years ago

(Edited the title to clarify. 1000 works. 1001 fails.)

charliecode commented 3 years ago

@johnkw Have you tried using the PageStartIndex? If you set the PageStartIndex to 1001 and the PageSize to 1000 I believe you'll get the next 1000 labels starting at label index 1001.

johnkw commented 3 years ago

Thanks, however, note that as per bug amzn/selling-partner-api-models#371, the carton ids are not optional. Also note that as per bug amzn/selling-partner-api-models#1114, you can't print anywhere near 1000 labels at once.

In this case it fails even if you only try to print 1 label at a time.

I did try that specifically with a >1000 carton shipment though, just to see if perhaps it magically changed the behavior of those earlier bugs. It did not.

If you don't provide the IDs, you get this error: "message": "1 validation error detected: Value null at \u0027cartonIdList\u0027 failed to satisfy constraint: Member must not be null",

If you do provide the IDs, it fails with Provided SellerCartonIds are not valid (which looks similar to bug amzn/selling-partner-api-models#371, but unlike bug amzn/selling-partner-api-models#371 there's no fix here it seems).

charliecode commented 3 years ago

@johnkw Interesting. I've printed well over 1000 labels, many times. I've also never given a single carton id as they are optional, as shown here. Carton ids are only necessary if you use the feeds api to upload box contents. Of course, you'll also need to set the LabelType to BARCODE_2D in order for these things to work. Maybe I'm misunderstanding something but I can 100% vouch for the fact that what you're saying isn't possible, is. If it's not working for you I would recommend creating a support case as it may be unique to your account. I do agree that Amazon should make their documentation more clear in these regards, really with the whole label process in general. There is old data attached to the old MWS API docs in these regards but that doesn't help new SP-API developers who never worked with the MWS API in the past.

charliecode commented 3 years ago

@johnkw Your reference to the docs mentioning Amazon strongly recommends not using BARCODE_2D is not anything new. It was the same for the MWS API docs which were created years ago. They offered the GetPackageLabels operation and yet still encouraged use of the GetUniquePackageLabels operation. When the SP-API was launched the param for 2D barcodes was not functional on the getLabels endpoint. When pressed on the matter Amazon indicated the functionality may no longer be supported, you can read up on that in amzn/selling-partner-api-models#754. Long story short, it was fixed and the functionality was added and will continue to be supported because it makes total sense once you understand how all of this actually works.

That's about as far as I'll go. You're right, your last question is off topic. Helping the community understand and tap into the SP-API is something I've willingly done since before it was even launched. However, merging functionality into how to use the API in a proprietary way to make money, is another thing all together. I'm a SP-API consultant and work with companies to help them understand and build things related to this api out, so I'm very careful there's never any overlap.

What I will say is this, the docs recommendation about the 2D barcodes is just that, a recommendation. And your reference to the 2D barcodes being awful, with all due respect, is not an accurate portrayal of the situation.

johnkw commented 3 years ago

In this bug (and in bug amzn/selling-partner-api-models#371) FEED is assumed to be used correctly. (The behavior for BARCODE_2D is different, and does not apply here. I've deleted an off-topic above comment on BARCODE_2D that confused the issue.)

johnkw commented 3 years ago

Note this is not the same as the now-fixed bug amzn/selling-partner-api-models#1114.

johnkw commented 2 years ago

Seller Support has confirmed this is a known limitation.

We have been able to confirm from our back end that, at the moment, the 999 limit is for the total number of cartons in the Shipment, however, we are working on releasing a new version of the API that will resolve this inconsistency.

github-actions[bot] commented 2 years ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.

johnkw commented 2 years ago

This is still an enormous problem which causes Amazon Partner Carrier trucks to make multiple pickups because we can't fit the entire pickup into one Shipment due to this API bug.

github-actions[bot] commented 1 year ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.

johnkw commented 1 year ago

Please turn this harmful bot off, and only resolve the github tickets as the actual issues are fixed. @adrian-amz @amazon-auto @chapmanjw @amvreddy-amazon @jenilew

johnkw commented 1 year ago

Here is the error message you get when hitting this bug, when specifying fewer than 1000 PackageLabelsToPrint entries. Please note the error message itself (which is a bug) also contains an additional bug which is that it references SellerCartonIds, which is not the name of the field in question.

  "errors": [
    {
      "code": "InvalidInput",
      "message": "Provided SellerCartonIds are not valid: [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]] for Shipment: [FBAxxxxxxxxx]",
      "details": ""
    }
  ]
}
johnkw commented 1 year ago

I just was looking in to using the https://github.com/amzn/selling-partner-api-models/issues/371 'SELLER_LABEL' undocumented workaround. It's worth noting that it won't work for inbound shipment with an "Exp" date, because 'SELLER_LABEL' PDfs are missing that line (and also the SKU line). For any products that are required to have production dates on them (such as food and vitamins), the "Exp" is a required part of the label. I'm not sure if the SKU line is also required, but FBA has specifically confirmed the "Exp" line must be there.

(It's possible it could be added manually on top of Amazon's label, but now we're dealing with multiple levels of hacks upon hacks to workaround the bug https://github.com/amzn/selling-partner-api-models/issues/387 issue.)

github-actions[bot] commented 1 year ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.

johnkw commented 1 year ago

Please turn this horrible bot off and only close the github tickets as the actual issues are fixed. @adrian-amz @amazon-auto @chapmanjw @amvreddy-amazon @jenilew @parvathm

github-actions[bot] commented 9 months ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.

johnkw commented 9 months ago

Please turn this horrible bot off and only close the github tickets as the actual issues are fixed. @adrian-amz @amazon-auto @chapmanjw @amvreddy-amazon @jenilew @parvathm

shreeharsh-a commented 4 months ago

Thank you for bringing this up. We have noted & forwarded this to the relevant team for review & action.

Note: SP API or docs related issues / troubleshooting support is managed by a different team. We can help if the issue is related to the content published on this repo.