Skip to content

Releases: jlevers/selling-partner-api

v6.0.0

22 Mar 06:59
92365fc
Compare
Choose a tag to compare

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 of crescat-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 the SellingPartnerApi 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 in v5. For an example of how to use a DTO to make a POST 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, and getOrderItems), pass an additional dataElements parameter to SellingPartnerApi::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

26 Jul 05:08
Compare
Choose a tag to compare

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

03 Jul 18:31
Compare
Choose a tag to compare

Fixed

  • Remove length limitation from district_or_county field in FBA Inbound API address model (#557, I forgot to include this in the v5.10.0 minor release)

Full Changelog: v5.10.0...v5.10.1

v5.10.0

03 Jul 18:21
Compare
Choose a tag to compare

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

08 Jun 21:02
Compare
Choose a tag to compare

Changed

  • Remove dependency on aws/aws-sdk-php by making calls to STS manually
  • Switch from Guzzle Request type to more general PSR RequestInterface type for AuthorizationSigner and RequestSigner contracts

Full Changelog: v5.8.4...v5.9.0

v5.8.4

05 Jun 03:33
Compare
Choose a tag to compare

Fixed

  • Don't auto-generate RDTs for sandbox calls (#548)

Full Changelog: v5.8.3...v5.8.4

v5.8.3

17 May 16:28
Compare
Choose a tag to compare

#Fixed

  • Remove message length requirement error in no message exception in APlus Content API (#541, thanks @hnassr!)
  • Add missing enum values to Orders API tax information model (#540)

Full Changelog: v5.8.2...v5.8.3

v5.8.2

11 May 18:16
Compare
Choose a tag to compare

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

11 Apr 16:40
71c8836
Compare
Choose a tag to compare

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

06 Mar 02:34
Compare
Choose a tag to compare

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