Skip to content

Fix: Convert marketplaceIds and sellerSkus arrays to comma-separated …#890

Open
Sgroove wants to merge 12 commits intojlevers:mainfrom
Sgroove:fix-fba-inventory-marketplace-encoding-v6.0.1
Open

Fix: Convert marketplaceIds and sellerSkus arrays to comma-separated …#890
Sgroove wants to merge 12 commits intojlevers:mainfrom
Sgroove:fix-fba-inventory-marketplace-encoding-v6.0.1

Conversation

@Sgroove
Copy link

@Sgroove Sgroove commented Oct 7, 2025

Fix: FBA Inventory API marketplaceIds array encoding

Amazon's FBA Inventory API rejects array-encoded query parameters
(marketplaceIds[0]=VALUE). This PR converts marketplaceIds and
sellerSkus arrays to comma-separated strings as required by Amazon's API.

Fixes "Bad Request (400) Invalid Input" error when calling getInventorySummaries.

Tested in production with Laravel 9 + PHP 8.3.

Sgroove added 12 commits October 6, 2025 20:29
…strings for FBA Inventory API (v6.0.1)

Amazon's FBA Inventory API expects marketplaceIds and sellerSkus as comma-separated strings,
not as array-encoded query parameters (marketplaceIds[0]=VALUE). This fixes the 'Bad Request
(400) Invalid Input' error when calling getInventorySummaries.

Fixes issue where Saloon HTTP client was encoding arrays as bracket notation which Amazon rejects.

Based on v6.0.1 for Laravel 9 compatibility.
Amazon's FBA Inventory API expects boolean parameters as strings ('true'/'false'),
not integers (1/0). This was causing 'Invalid Input' errors even after the
marketplaceIds fix was applied.

Both fixes are now included:
1. marketplaceIds array -> comma-separated string
2. details boolean -> 'true'/'false' string

Tested and working with Laravel 9 + PHP 8.3.
The v6.0.1 branch should use Saloon\Http\Request instead of
SellingPartnerApi\Request (which doesn't exist in v6). This was causing a
'Class not found' error when using the library.
BaseResponse was introduced in v7.0.0 but is required by all response
classes in the library. This implementation matches BaseDto pattern
for consistency.

Fixes: Class 'Crescat\SaloonSdkGenerator\BaseResponse' not found error
when using any API response classes (235+ classes depend on this base class).
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.

1 participant