Releases: jlevers/selling-partner-api
v6.0.0
Warning
This version of the library is only compatible with PHP >=8.1.
This major release is a complete overhaul of the library. There is basically no code left at all from v5
.
A quick summary of the big changes:
- The code generation process is now contained inside this repository, which should make it much easier for people to contribute. Previously, all code generation happened in a separate, private repository, because it was messy, and publishing the codegen setup in that state would have done more harm than good. Now, anyone can easily generate the code for the library from scratch.
- The entire auth/request/response process is based on Saloon. The actual code generation uses
highsidelabs/saloon-sdk-generator
, which is a fork ofcrescat-io/saloon-sdk-generator
. - The structure and naming conventions of the classes and attributes in this library have been made as similar to the names in Amazon's documentation as possible. As a result, I've removed the
docs/
section entirely, because a) the old documentation was often incomplete and/or misleading, and b) once you have a basic grasp of how this library works now, Amazon's documentation will tell you everything you need to know.
All the functionality of v5
is still present: full API coverage, automatic RDT generation, document upload/download support. The syntax has changed somewhat, but the concepts are the same. It's now easier to access request and response internals, since all requests/responses have all the functionality of any other Saloon request or response.
Upgrade guide
-
The
Configuration
class has been replaced with theSellingPartnerApi
class. This:$config = new SellingPartnerApi\Configuration([ "lwaClientId" => "<LWA client ID>", "lwaClientSecret" => "<LWA client secret>", "lwaRefreshToken" => "<LWA refresh token>", "awsAccessKeyId" => "<AWS access key ID>", "awsSecretAccessKey" => "<AWS secret access key>", // If you're not working in the North American marketplace, change // this to another endpoint from lib/Endpoint.php "endpoint" => SellingPartnerApi\Endpoint::NA, ]);
Now looks like this:
$connector = SellingPartnerApi::make( clientId: 'amzn1.application-oa2-client.asdfqwertyuiop...', clientSecret: 'amzn1.oa2-cs.v1.1234567890asdfghjkl...', refreshToken: 'Atzr|IwEBIA...', endpoint: Endpoint::NA, // Or Endpoint::EU, Endpoint::FE, Endpoint::NA_SANDBOX, etc. );
-
To access a particular API, rather than directly instantiating an API class, like this:
$reportsApi = new ReportsV20210630Api($config); $dfOrdersApi = new VendorDirectFulfillmentOrdersV1Api($config);
Do this:
$reportsApi = $connector()->seller()->reports(); $dfOrdersApi = $connector()->vendor()->directFulfillmentOrders();
-
To call an endpoint:
$response = $reportsApi->getReports( reportTypes: ['GET_MERCHANT_ALL_LISTINGS'], marketplaceIds: ['ATVPDKIKX0DER'], createdAfter: new DateTime('2024-03-01'), ); $json = $response->json(); $reports = $response->dto(); // A structured DTO
What was previously referred to as models are now called DTOs. DTOs are required to make
POST
/PUT
/PATCH
requests, similarly to how models were required for those sorts of create/update operations inv5
. For an example of how to use a DTO to make aPOST
request, see the Working with DTOs section of the README. -
To specify which data elements you want to retrieve when calling restricted endpoints (
getOrder
,getOrders
, andgetOrderItems
), pass an additionaldataElements
parameter toSellingPartnerApi::make()
rather than passing the$data_elements
parameter to the restricted endpoint itself.
Any other questions about upgrading should be answerable using the README, but if you have any questions, feel free to open a discussion :)
v5.10.2
Fixed
- Made PHP Spreadsheet maximum version
1.25.2
to maintain PHP 7.3 compatibility (#554)
Changed
- Updated Notifications V1 and Vendor Direct Fulfillment Payments V1 APIs with upstream models
Added
EventCode
637 for Fulfillment Outbound API (#580)PrepInstruction
NONE
for Fulfillment Inbound API
Full Changelog: v5.10.1...v5.10.2
v5.10.1
v5.10.0
Added
- New Replenishment API
- Improved messages when errors are thrown during automatic RDT generation
Changed
- Updated the documentation for several APIs/models
- Removed unnecessary
ObjectSerializer
import from models - Improved Shipping V2 API documentation (#405)
- Removed Item Approval models from Orders API, since Amazon removed support for them
Fixed
- Added missing
JE_VOEC
Deemed Reseller Type to Orders API (#570)
Full Changelog: v5.9.0...v5.10.0
v5.9.0
Changed
- Remove dependency on
aws/aws-sdk-php
by making calls to STS manually - Switch from Guzzle
Request
type to more general PSRRequestInterface
type forAuthorizationSigner
andRequestSigner
contracts
Full Changelog: v5.8.4...v5.9.0
v5.8.4
v5.8.3
v5.8.2
Fixed
- Fix double quote parsing in Document class for GET_LEDGER_SUMMARY_VIEW_DATA by @armageddon-cat in #537
- Update HeaderSelector when configuration changes by @chrisribal in #538
--
Full Changelog: v5.8.1...v5.8.2
v5.8.1
Added
- Option to specify charset when uploading documents (#518, thanks @quazardous!)
- Documentation improvements (#510, #464, thanks @gmauro99 and @richardthepratt :)
FbaOutboundV20200701Api::submitFulfillmentOrderStatusUpdate
operation added
Fixed
- Tables breaking in documentation when parameter descriptions contain line breaks
- Missing deemed reseller type
CH_SUPPLIER_IMPORT
(#515) - Missing currency type
PLN
(#502, thanks @Inbasecom!)
--
Full Changelog: v5.7.0...v5.8.1
v5.7.0
Fixed
- Fix feed upload signature matching bug by reverting the PR that allows specifying the charset when creating feed documents (#486, fixed by #497)
- Added missing deemed reseller categories (#490, #492)
- Added "CREATING" FBA shipment status (#495)
Added
- New
shipmentConfirmation
endpoint for Orders API (#489) - New endpoints for Vendor Shipping API
- Updated VendorDirectFulfillmentOrdersV20211228Api with BuyerCustomizedInfoDetail attribute
Full Changelog: v5.6.0...v5.7.0