Skip to content

Conversation

@sanjjaymahalingam
Copy link
Contributor

@sanjjaymahalingam sanjjaymahalingam commented Sep 2, 2025

This pull request introduces a new restrictive data token (RDT) requirement for the Vendor Direct Fulfillment Shipping API's createShippingLabels endpoint, updates the API client to support this, and bumps the gem version to 2.5.0. The changes ensure that requests to this endpoint use the appropriate access token for sensitive data and clarify the method's required parameters.

Vendor Direct Fulfillment Shipping API changes:

  • The create_shipping_labels method in lib/muffin_man/vendor_direct_fulfillment_shipping/v20211228.rb now requires the containers parameter and always includes it in the request body. It also sets @requires_rdt = true to ensure the restrictive data token is used.
  • The corresponding spec in spec/muffin_man/vendor_direct_fulfillment_shipping/v20211228_spec.rb is updated to stub the RDT token and pass an empty array for containers.

SP API Client enhancements:

  • The SpApiClient class now has a requires_rdt attribute, initialized to false, and the headers method checks this flag to determine if an RDT token is needed for requests. [1] [2] [3]

Versioning and documentation:

  • The gem version is bumped to 2.5.0 in lib/muffin_man/version.rb.
  • The CHANGELOG.md documents the new restrictive data token requirement for the Vendor Direct Fulfillment Shipping API.

Copilot AI review requested due to automatic review settings September 2, 2025 17:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces support for Restricted Data Token (RDT) requirements in Amazon Vendor Direct Fulfillment API client methods. The changes centralize RDT handling in the base SpApiClient class and ensure RDT is requested for specific endpoints that require it.

  • Centralized RDT support in the base SpApiClient class with a new requires_rdt attribute
  • Updated vendor direct fulfillment endpoints to enable RDT for order retrieval, shipping labels, invoices, and packing slips
  • Modified API parameter structures for consistency with Amazon's API expectations

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
lib/muffin_man/sp_api_client.rb Added requires_rdt attribute and updated headers method to use RDT when flag is set
lib/muffin_man/vendor_direct_fulfillment_orders/v20211228.rb Enabled RDT for order retrieval methods
lib/muffin_man/vendor_direct_fulfillment_shipping/v20211228.rb Enabled RDT for shipping-related methods and made containers parameter required
lib/muffin_man/vendor_direct_fulfillment_inventory/v1.rb Updated parameter structure to accept selling_party_id and wrap it in proper hash format

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

end

def create_shipping_labels(purchase_order_number, selling_party, ship_from_party, containers: nil)
def create_shipping_labels(purchase_order_number, selling_party, ship_from_party, containers)
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making the containers parameter required is a breaking change. Consider adding a deprecation warning or making it optional with a default empty array to maintain backward compatibility.

Suggested change
def create_shipping_labels(purchase_order_number, selling_party, ship_from_party, containers)
def create_shipping_labels(purchase_order_number, selling_party, ship_from_party, containers = [])

Copilot uses AI. Check for mistakes.
@sanjjaymahalingam sanjjaymahalingam merged commit fe6571f into master Sep 10, 2025
8 checks passed
@sanjjaymahalingam sanjjaymahalingam deleted the rdt-for-vdf branch September 10, 2025 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants