Skip to content

Commit 4378804

Browse files
author
rubensanchez
committed
Make idempotency token optional in External Fulfillment API requests
1 parent 3c6cf60 commit 4378804

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sp_api/api/external_fulfillment/external_fulfillment.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,10 @@ def process_return_item(self, returnId, **kwargs) -> ApiResponse:
565565
"""
566566

567567
headers = self.headers.copy()
568-
headers["x-amzn-idempotency-token"] = str(uuid.uuid4())
568+
if "x-amzn-idempotency-token" in kwargs:
569+
headers["x-amzn-idempotency-token"] = kwargs.pop("x-amzn-idempotency-token")
570+
else:
571+
headers["x-amzn-idempotency-token"] = str(uuid.uuid4())
569572

570573
return self._request(
571574
fill_query_params(kwargs.pop("path"), returnId),

0 commit comments

Comments
 (0)