### Example: Install AA JAR with Dependencies Source: https://developer-docs.amazon/sp-api/docs/automate-your-sp-api-calls-using-java-sdk An example command for installing the AA JAR file that includes all dependencies. Adjust the file path and version ('x.x') as necessary. ```bash mvn install:install-file -Dfile=C:\\SwaggerToCL\\sellingpartner-api-aa-java\\target\\sellingpartnerapi-aa-java-x.x-jar-with-dependencies.jar -DgroupId=com.amazon.sellingpartnerapi -DartifactId=sellingpartnerapi-aa-java -Dversion=x.x -Dpackaging=jar ``` -------------------------------- ### Example: Install AA JAR File Source: https://developer-docs.amazon/sp-api/docs/automate-your-sp-api-calls-using-java-sdk An example command for installing the AA JAR file, specifying a local path to the JAR. Ensure 'x.x' matches the version in your pom.xml. ```bash mvn install:install-file -Dfile=C:\\SwaggerToCL\\sellingpartner-api-aa-java\\target\\sellingpartnerapi-aa-java-x.x.jar -DgroupId=com.amazon.sellingpartnerapi -DartifactId=sellingpartnerapi-aa-java -Dversion=x.x -Dpackaging=jar ``` -------------------------------- ### Get Listings Item Example Source: https://developer-docs.amazon/sp-api/docs/manage-product-listings-guide Use this example to request an Item from a seller with specific marketplace IDs and include various data points in the response. Ensure you replace placeholder values with your actual seller ID and SKU. ```http GET https://sellingpartnerapi-na.amazon.com/listings/2021-08-01/items/AXXXXXXXXXXXX/example-sku ?marketplaceIds=ATVPDKIKX0DER &issueLocale=en_US &includedData=summaries,attributes,issues,offers,fulfillmentAvailability ``` -------------------------------- ### Example SP-API Request with Headers Source: https://developer-docs.amazon/sp-api/docs/connecting-to-the-selling-partner-api This example demonstrates a GET request to the SP-API, including essential headers like 'host', 'user-agent', 'x-amz-access-token', and 'x-amz-date'. Ensure your user-agent string follows the specified format. ```http GET /catalog/2022-04-01/items/EXAMPLEASIN?marketplaceIds=ATVPDKIKX0DER HTTP/1.1 host: sellingpartnerapi-na.amazon.com user-agent: My Selling Tool/2.0 (Language=Java/1.8.0.221; Platform=Windows/10) x-amz-access-token=Atza|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSREXAMPLE x-amz-date: 20190430T123600Z ``` -------------------------------- ### Connect JavaScript SDK to SP-API and Get Marketplace Participations Source: https://developer-docs.amazon/sp-api/docs/automate-your-sp-api-calls-using-a-prebuilt-javascript-sdk This example shows how to configure the Sellers API client, enable automatic access token retrieval, and call the `getMarketplaceParticipations` operation. Ensure you replace placeholders like `` with your actual credentials. ```javascript import { SellersSpApi } from '@amazon-sp-api-release/amazon-sp-api-sdk-js'; async function getMarketplaceParticipations() { try { //Configure the Sellers ApiClient const sellersApiClient = new SellersSpApi.ApiClient(AppConfig.spApiNAEndpoint); sellersApiClient.enableAutoRetrievalAccessToken('','', '' null); const sellersApi = new SellersSpApi.SellersApi(sellersApiClient); //Call the GetMarketplaceParticipations operation const participations = await sellersApi.getMarketplaceParticipations(); console.log( JSON.stringify(participations, null, ' ') + '\n**********************************' ) } catch (error) { console.error('Exception when calling getMarketplaceParticipations API', error.message); } } getMarketplaceParticipations(); ``` -------------------------------- ### Signature Base String Example Source: https://developer-docs.amazon/sp-api/docs/tpp-registration-signature-guidance This example shows the components of a signature base string, including headers and method. Ensure all required components are present. ```http "x-amz-access-token": Atza|IgEBIN... "x-amzn-content-digest": sha-256=:fadf3qr3TAFASEG3234gADA+krdzMzYayg4YFig=: "@method": POST "@query": ?key2=value2&key1=value1 "@signature-params": ("x-amz-access-token" "x-amzn-content-digest" "@method" "@query");created=1720137600;alg="PS512"; ``` -------------------------------- ### Signature-Input Header Example Source: https://developer-docs.amazon/sp-api/docs/tpp-registration-signature-guidance This example demonstrates the format of the Signature-Input header, which includes parameters for signature verification. It specifies the signed headers and algorithm. ```http Signature-Input: x-amzn-psd2=("x-amz-access-token" "x-amzn-content-digest" "@method" "@query");created=1720137600;alg="PS512" ``` -------------------------------- ### Example Log-in URI Source: https://developer-docs.amazon/sp-api/docs/selling-partner-appstore-authorization-workflow This is an example of a log-in URI that Amazon sends to your website. It includes parameters like amazon_callback_uri, amazon_state, and selling_partner_id. ```http https://example.com/index.html?amazon_callback_uri=https://amazon.com/apps/authorize/confirm/amzn1.sellerapps.app.2eca283f-9f5a-4d13-b16c-474EXAMPLE57&amazon_state=amazonstateexample&selling_partner_id=A3FHEXAMPLEYWS ``` -------------------------------- ### Catalog Item Response Example Source: https://developer-docs.amazon/sp-api/docs/manage-product-listings-guide This is an example of a response from the `getCatalogItem` operation, containing various product attributes such as HDMI ports, resolution, and item weight. ```json { "asin": "XXXXXXXXXX", "attributes": { "total_hdmi_ports": [ { "value": 4, "marketplace_id": "ATVPDKIKX0DER" } ], "resolution": [ { "language_tag": "en_US", "value": "4K", "marketplace_id": "ATVPDKIKX0DER" } ], "item_weight": [ { "unit": "pounds", "value": 107.6, "marketplace_id": "ATVPDKIKX0DER" } ], "product_subcategory": [ { "value": "50400150", "marketplace_id": "ATVPDKIKX0DER" } ] } } ``` -------------------------------- ### GET Reports API Request Example Source: https://developer-docs.amazon/sp-api/docs/verify-that-report-processing-is-complete This example shows how to make a GET request to the Reports API to retrieve report details. Pass the reportId to check its processing status. ```http GET https://sellingpartnerapi-na.amazon.com/reports/2021-06-30/reports/ID323 ``` -------------------------------- ### Example: Generate Java SDK for Sellers API Source: https://developer-docs.amazon/sp-api/docs/automate-your-sp-api-calls-using-java-sdk This is an example command to generate the Java SDK specifically for the 'sellers.json' model. It demonstrates how to fill in the parameters for a concrete use case. ```bash java -jar C:\SwaggerToCL\swagger-codegen-cli.jar generate \ -i C:\SwaggerToCL\Sellers.json \ -l java -t [path to selling-partner-api-models\clients\sellingpartner-api-aa-java folder]\resources\swagger-codegen\templates\ \ -o C:\SwaggerToCL\Sellers_JavaCL \ -c [path to selling-partner-api-models\clients\sellingpartner-api-aa-java folder]\resources\java\config.json ``` -------------------------------- ### Create setup.py for Python SDK Package Source: https://developer-docs.amazon/sp-api/docs/tutorial-automate-your-sp-api-calls-using-python-sdk This Python code creates a setup.py file, essential for packaging your generated SDK. Remember to customize the package name, version, and other details to match your specific project and dependencies. ```python from setuptools import setup, find_packages setup( name='SellingPartnerAPIAuthAndAuthPython', # Replace with your package's name version='1.0.0', # Replace with your package's version package_dir={'': 'src'}, # Replace 'src' as necessary packages=find_packages(where='src'), install_requires=[line.strip() for line in open("requirements.txt", "r")], description='A Python SDK for Amazon Selling Partner API', long_description=open('README.md').read(), long_description_content_type='text/markdown', url='TBD' ) ``` -------------------------------- ### GET Reports API Response Example Source: https://developer-docs.amazon/sp-api/docs/verify-that-report-processing-is-complete This is an example of a successful response from the getReport operation. It includes the reportId, processingStatus, and reportDocumentId if processing is complete. ```json { "payload": { "reportId": "ID323", "reportType": "GET_MERCHANT_LISTINGS_ALL_DATA", "dataStartTime": "2019-12-11T13:47:20.677Z", "dataEndTime": "2019-12-12T13:47:20.677Z", "createdTime": "2019-12-10T13:47:20.677Z", "processingStatus": "DONE", "processingStartTime": "2019-12-10T13:47:20.677Z", "processingEndTime": "2019-12-12T13:47:20.677Z", "reportDocumentId": "DOC-b8b0-4226-b4b9-0ee058ea5760" } } ``` -------------------------------- ### cURL GET Request Format for SP-API Sandbox Source: https://developer-docs.amazon/sp-api/docs/onboarding-step-5-make-your-first-call-to-the-sp-api-sandbox Use this format to construct GET requests to the SP-API sandbox. Ensure all example placeholders are replaced with actual values. ```curl curl.exe --location --request GET 'EXAMPLE_ENDPOINT/EXAMPLE_PATH?queryParam1=value1&queryParam2=value2' --header 'x-amz-access-token: EXAMPLE_ACCESS_TOKEN' --header 'Content-Type: application/json' --header 'User-Agent: My-Testing-App/1.0' ``` -------------------------------- ### Create and Navigate to Project Directory Source: https://developer-docs.amazon/sp-api/docs/tutorial-automate-your-sp-api-calls-using-javascript-sdk-for-node-js Use these bash commands to create a new directory for your project and change into it. ```bash mkdir SPAPI_JavaScript_SDK cd SPAPI_JavaScript_SDK ``` -------------------------------- ### Initialize Node.js Project Source: https://developer-docs.amazon/sp-api/docs/tutorial-automate-your-sp-api-calls-using-javascript-sdk-for-node-js Initialize a new Node.js project with default settings using npm. This sets up the basic structure for your project. ```bash npm init -y ``` -------------------------------- ### Create Local npm Package Source: https://developer-docs.amazon/sp-api/docs/tutorial-automate-your-sp-api-calls-using-javascript-sdk-for-node-js Navigate to the SDK's root directory and run 'npm pack' to create a tarball (TGZ file) for local installation. ```bash npm pack ``` -------------------------------- ### Get Restricted Data Token Response Example Source: https://developer-docs.amazon/sp-api/docs/tutorial-test-selling-partner-api-endpoints This example shows a typical response when requesting a Restricted Data Token (RDT) and its expiration time. The RDT can be used for restricted operations that require customer PII. ```json { "restrictedDataToken": "Atz.sprdt|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSR", "expiresIn": 3600 } ``` -------------------------------- ### Create Report Request - JSON Example Source: https://developer-docs.amazon/sp-api/docs/request-a-report Use this JSON payload to call the createReport operation. Specify the report type, data start and end times, and marketplace IDs. ```json POST https://sellingpartnerapi-na.amazon.com/reports/2021-06-30/reports { "reportType": "GET_MERCHANT_LISTINGS_ALL_DATA", "dataStartTime": "2019-12-10T20:11:24.000Z", "marketplaceIds": [ "A1PA6795UKMFR9", "ATVPDKIKX0DER" ] } ``` -------------------------------- ### Get Inbound Order Response Example Source: https://developer-docs.amazon/sp-api/docs/awd_2024-05-09-reference This JSON object represents a successful response when retrieving an AWD inbound order. It includes details about the order, destination, origin, packages, and timestamps. ```json { "destinationDetails" : { "destinationAddress" : { "addressLine1" : "address_1", "addressLine2" : "address_2", "addressLine3" : "address_3", "city" : "Seattle", "countryCode" : "US", "county" : "Washington", "district" : "District1", "name" : "address_name", "phoneNumber" : "+14155552671", "postalCode" : "123456", "stateOrRegion" : "Washington" }, "destinationRegion" : "us-east", "shipmentId" : "TestShipmentId" }, "createdAt" : "2023-06-07T12:12:09.061Z", "externalReferenceId" : "TestReferenceId", "orderId" : "TestOrderId", "orderStatus" : "DRAFT", "originAddress" : { "addressLine1" : "address_1", "addressLine2" : "address_2", "addressLine3" : "address_3", "city" : "Seattle", "countryCode" : "US", "county" : "Washington", "district" : "District1", "name" : "address_name", "phoneNumber" : "+14155552671", "postalCode" : "123456", "stateOrRegion" : "Washington" }, "packagesToInbound" : [ { "count" : 1, "distributionPackage" : { "contents" : { "packages" : [ ], "products" : [ { "quantity" : 1, "sku" : "testPen", "expiration" : "2025-06-07T12:12:09.061Z", "prepDetails" : { "prepCategory" : "PERFORATED", "prepOwner" : "AMAZON", "labelOwner" : "SELF", "prepInstructions" : [ { "prepType" : "ITEM_POLYBAGGING", "prepOwner" : "AMAZON" } ] } } ] }, "measurements" : { "dimensions" : { "height" : 2.54, "length" : 2.54, "unitOfMeasurement" : "CENTIMETERS", "width" : 2.54 }, "weight" : { "unitOfMeasurement" : "KILOGRAMS", "weight" : 0.453592 } }, "type" : "CASE" } } ], "updatedAt" : "2023-06-07T12:12:09.061Z", "preferences" : { "destinationRegion" : "us-west" } } ``` -------------------------------- ### Connect to SP-API and Get Marketplace Participations Source: https://developer-docs.amazon/sp-api/docs/tutorial-automate-your-sp-api-calls-using-javascript-sdk-for-node-js This script initializes the LWA authentication client and the Sellers API client, then fetches and logs marketplace participation data. Ensure you have the necessary SDK libraries installed. ```javascript import { AppConfig } from './app.config.mjs'; import { LwaAuthClient } from '@amzn/testsellingpartnerjavascriptapilwalib/src/helper/LwaAuthClient.mjs'; import { SellersApi, ApiClient as SellersApiClient, } from '@amzn/testsellingpartnerjavascriptapilwalib/sdk/src/sellers/index.js'; (async () => { const lwaClient = new LwaAuthClient( AppConfig.lwaClientId, AppConfig.lwaClientSecret, AppConfig.lwaRefreshToken ); const sellerApiClient = new SellersApiClient( 'https://sellingpartnerapi-fe.amazon.com' ); const sellerApi = new SellersApi(sellerApiClient); sellerApiClient.applyXAmzAccessTokenToRequest( await lwaClient.getAccessToken() ); const participations = await sellerApi.getMarketplaceParticipations(); console.log( JSON.stringify(participations, null, ' ') + '\n**********************************' ); })(); ``` -------------------------------- ### getPrepInstructions Source: https://developer-docs.amazon/sp-api/docs/fulfillment-inbound-api-rate-limits Retrieves preparation instructions for inbound shipments. Rate limit is 2 requests per account-application pair with a burst of 30 requests. ```APIDOC ## GET /fba/inbound/v0/prepInstructions ### Description Retrieves preparation instructions for inbound shipments. ### Method GET ### Endpoint /fba/inbound/v0/prepInstructions ### Rate Limits - **Rate limit per account-application pair**: 2 - **Burst (requests)**: 30 ``` -------------------------------- ### Start Selling Partner API Guard Scan Source: https://developer-docs.amazon/sp-api/docs/sp-api-guard-automated-deployment Run this command to initiate a security scan using the Selling Partner API Guard CLI. ```bash sudo ./guardcli start_scan ``` -------------------------------- ### Get Order Regulated Info Response Example Source: https://developer-docs.amazon/sp-api/docs/provide-additional-verification-details-about-a-regulated-order This JSON response shows the details of a regulated order, including its status, valid rejection reasons, and the types of verification details that can be provided along with their valid statuses. Use this to determine when to submit verification details. ```json { "payload": { "AmazonOrderId": "902-2592119-3531015", "RequiresDosageLabel": false, "RegulatedInformation": { "Fields": [ { "FieldId": "pets_rx_scName", "FieldLabel": "Pet name", "FieldType": "Text", "FieldValue": "Woofer" } ] }, "RegulatedOrderVerificationStatus": { "Status": "Pending", "RequiresMerchantAction": true, "ValidRejectionReasons": [ { "RejectionReasonId": "pets_rx_sc_incorrect_product", "RejectionReasonDescription": "Canceled order due to veterinarian indicating wrong product ordered" } ], "ValidVerificationDetails": [ { "VerificationDetailType": "prescriptionDetail", "ValidVerificationStatuses": [ "Approved" ] }, { "VerificationDetailType": "approvedAlternativeDetails", "ValidVerificationStatuses": [ "Rejected" ] }, { "VerificationDetailType": "interimStatusDetail", "ValidVerificationStatuses": [ "Pending" ] } ] } } } ``` -------------------------------- ### Success Response Example Source: https://developer-docs.amazon/sp-api/docs/response-format An example of a successful response from the SP-API, containing the requested data. ```APIDOC ## Success Response Example ### Description This is an example of a successful response from the SP-API, which returns the data requested by the client. ### Response Example ```json { "payload": { "ConfirmedNeedByDate": "2020-04-23", "ConfirmedFulfillableDate": "2020-04-23" } } ``` ``` -------------------------------- ### Get Product Type Schema for Variation Child Listings Source: https://developer-docs.amazon/sp-api/docs/building-listings-management-workflows-guide Use this GET request to retrieve the JSON Schema for variation child listings. Include `parentageLevel=CHILD` to get a schema applicable to child items. ```http GET /definitions/2020-09-01/productTypes/SHIRT ?marketplaceIds=ATVPDKIKX0DER &requirements=LISTING &parentageLevel=CHILD ``` -------------------------------- ### Initialize LWA Credentials in C# Source: https://developer-docs.amazon/sp-api/docs/automate-your-sp-api-calls-using-the-c-sdk Demonstrates how to set up LWA (Login With Amazon) authorization credentials for the Selling Partner API using the C# SDK. Ensure you have the correct Client ID, Client Secret, and desired scopes. ```csharp using Amazon.SellingPartnerAPIAA; LWAAuthorizationCredentials lwaAuthorizationCredentials = new LWAAuthorizationCredentials { ClientId = "myClientId", ClientSecret = "myClientSecret", Scopes = new List() { ScopeConstants.ScopeNotificationsAPI, ScopeConstants.ScopeMigrationAPI } Endpoint = new Uri("https://api.amazon.com/auth/o2/token") }; ``` -------------------------------- ### Get Product Type Schema for Variation Parent Listings Source: https://developer-docs.amazon/sp-api/docs/building-listings-management-workflows-guide Use this GET request to retrieve the JSON Schema for variation parent listings. Include `parentageLevel=PARENT` to get a schema applicable to parent items. ```http GET /definitions/2020-09-01/productTypes/SHIRT ?marketplaceIds=ATVPDKIKX0DER &requirements=LISTING &parentageLevel=PARENT ``` -------------------------------- ### Install Python SDK Source: https://developer-docs.amazon/sp-api/docs/tutorial-automate-your-sp-api-calls-using-python-sdk Installs the generated Python SDK package locally using pip. Replace '{YourPackageName}' with the actual name of your SDK package. ```bash pip install dist/{YourPackageName}-1.0.0-py3-none-any.whl ``` -------------------------------- ### FulfillmentOrderStatusNotification Example Source: https://developer-docs.amazon/sp-api/docs/notification-type-values This JSON example demonstrates a FulfillmentOrderStatusNotification payload, showcasing the structure of the FulfillmentShipmentPackage object with its associated properties. ```json { "NotificationVersion": "1.0", "NotificationType": "FULFILLMENT_ORDER_STATUS", "PayloadVersion": "1.0", "EventTime": "2020-01-11T00:09:53.109Z", "Payload": { "FulfillmentOrderStatusNotification": { "SellerId": "merchantId", "EventType": "Shipment", "StatusUpdatedDateTime": "2020-01-11T00:09:53.109Z", "SellerFulfillmentOrderId": "OrderId", "FulfillmentOrderStatus": "Complete", "FulfillmentShipment": { "FulfillmentShipmentStatus": "Shipped", "AmazonShipmentId": "DZRSmwG2N", "EstimatedArrivalDateTime": "2014-12-19T22:59:59Z", "FulfillmentShipmentPackages": [ { "PackageNumber": 1, "CarrierCode": "HERMESIT", "TrackingNumber": "&0113838XXXXXX8300169397" } ] } } }, "NotificationMetadata": { "ApplicationId": "amzn1.sellerapps.app.f1234566-aaec-55a6-b123-bcb752069ec5", "SubscriptionId": "7d78cc50-95c8-4641-add7-10af4b1fedc9", "PublishTime": "2020-01-11T00:02:50.501Z", "NotificationId": " 2012e8e5-b365-4cb1-9fd8-be9dfc6d5eaf" } } ``` -------------------------------- ### Create Sellers API Instance in C# Source: https://developer-docs.amazon/sp-api/docs/connect-to-the-selling-partner-api-using-a-generated-c-sharp-sdk Instantiate the Sellers API client after configuring LWAAuthorizationCredentials. Ensure LWAAuthorizationCredentials are set up before building the API instance. ```csharp SellersApi sellersApi = new SellersApi.Builder() .SetLWAAuthorizationCredentials(lwaAuthorizationCredentials) .Build(); ``` -------------------------------- ### Test Authorization URI Example (Draft State) Source: https://developer-docs.amazon/sp-api/docs/website-authorization-workflow Construct an authorization URI for testing an application in the 'Draft' state. Include the 'version=beta' parameter. ```http https://sellercentral.amazon.com/apps/authorize/consent?application_id=amzn1.sellerapps.app.2eca283f-9f5a-4d13-b16c-474EXAMPLE57&state=ourStateToken&version=beta ``` -------------------------------- ### Error Response Structure and Example Source: https://developer-docs.amazon/sp-api/docs/response-format Details on the structure of error responses from the SP-API, including common elements and an example. ```APIDOC ## Error Response Structure ### Description If your request is unsuccessful, the SP-API returns an error response. The response message contains the following elements: ### Response Message Elements | Element | Description | | :------ | :---------------------------------- | | code | HTTP status code. | | message | Explanation of the error condition. | | details | Link to additional information. | ### Error Response Example ```json { "errors": [ { "message": "Access to requested resource is denied.", "code": "Unauthorized", "details": "Access token is missing in the request header." } ] } ``` ``` -------------------------------- ### Example SP-API Sandbox Response Source: https://developer-docs.amazon/sp-api/docs/onboarding-step-5-make-your-first-call-to-the-sp-api-sandbox This is an example of a successful response from the SP-API sandbox, typically containing order details. ```json {"payload":{"CreatedBefore":"1.569521782042E9","Orders":[{"AmazonOrderId":"902-1845936-5435065","PurchaseDate":"1970-01-19T03:58:30Z","LastUpdateDate":"1970-01-19T03:58:32Z","OrderStatus":"Unshipped","FulfillmentChannel":"MFN","SalesChannel":"Amazon.com","ShipServiceLevel":"Std US D2D Dom","OrderTotal":{"CurrencyCode":"USD","Amount":"11.01"},"NumberOfItemsShipped":0,"NumberOfItemsUnshipped":1,"PaymentMethod":"Other","PaymentMethodDetails":["Standard"],"IsReplacementOrder":false,"MarketplaceId":"ATVPDKIKX0DER","ShipmentServiceLevelCategory":"Standard","OrderType":"StandardOrder","EarliestShipDate":"1970-01-19T03:59:27Z","LatestShipDate":"1970-01-19T04:05:13Z","EarliestDeliveryDate":"1970-01-19T04:06:39Z","LatestDeliveryDate":"1970-01-19T04:15:17Z","IsBusinessOrder":false,"IsPrime":false,"IsGlobalExpressEnabled":false,"IsPremiumOrder":false,"IsSoldByAB":false,"IsIBA":false,"DefaultShipFromLocationAddress":{"Name":"MFNIntegrationTestMerchant","AddressLine1":"2201 WESTLAKE AVE","City":"SEATTLE","StateOrRegion":"WA","PostalCode":"98121-2778","CountryCode":"US","Phone":"+1 480-386-0930 ext. 73824","AddressType":"Commercial"},"FulfillmentInstruction":{"FulfillmentSupplySourceId":"sampleSupplySourceId"},"IsISPU":false,"IsAccessPointOrder":false,"AutomatedShippingSettings":{"HasAutomatedShippingSettings":false},"EasyShipShipmentStatus":"PendingPickUp","ElectronicInvoiceStatus":"NotRequired"},{"AmazonOrderId":"902-8745147-1934268","PurchaseDate":"1970-01-19T03:58:30Z","LastUpdateDate":"1970-01-19T03:58:32Z","OrderStatus":"Unshipped","FulfillmentChannel":"MFN","SalesChannel":"Amazon.com","ShipServiceLevel":"Std US D2D Dom","OrderTotal":{"CurrencyCode":"USD","Amount":"11.01"},"NumberOfItemsShipped":0,"NumberOfItemsUnshipped":1,"PaymentMethod":"Other","PaymentMethodDetails":["Standard"],"IsReplacementOrder":false,"MarketplaceId":"ATVPDKIKX0DER","ShipmentServiceLevelCategory":"Standard","OrderType":"StandardOrder","EarliestShipDate":"1970-01-19T03:59:27Z","LatestShipDate":"1970-01-19T04:05:13Z","EarliestDeliveryDate":"1970-01-19T04:06:39Z","LatestDeliveryDate":"1970-01-19T04:15:17Z","IsBusinessOrder":false,"IsPrime":false,"IsAccessPointOrder":false,"IsGlobalExpressEnabled":false,"IsPremiumOrder":false,"IsSoldByAB":false,"IsIBA":false,"EasyShipShipmentStatus":"PendingPickUp","ElectronicInvoiceStatus":"NotRequired"}]}} ``` -------------------------------- ### Connect to Sellers API using Java SDK Source: https://developer-docs.amazon/sp-api/docs/automate-your-sp-api-calls-using-java-sdk Configure LWA credentials and instantiate the Sellers API client to make calls to the Selling Partner API. Ensure JAR files are added to the classpath if classes are not recognized. Use the sandbox URL for testing. ```java import io.swagger.client.*; import io.swagger.client.auth.*; import io.swagger.client.model.*; import io.swagger.client.api.SellersApi; import java.io.File; import java.util.*; import com.amazon.SellingPartnerAPIAA.LWAAuthorizationCredentials; import com.amazon.SellingPartnerAPIAA.LWAException; import static com.amazon.SellingPartnerAPIAA.ScopeConstants.SCOPE_NOTIFICATIONS_API; // for grantless operations (Notifications API) import static com.amazon.SellingPartnerAPIAA.ScopeConstants.SCOPE_MIGRATION_API; // for grantless operations (Authorization API) public class SellersApiDemo { public static void main(String[] args) { //Configure your LWA credentials : LWAAuthorizationCredentials lwaAuthorizationCredentials = LWAAuthorizationCredentials.builder() .clientId("amzn1.application-*********************") .clientSecret("***********************************") .refreshToken("Atzr|******************************") .endpoint("https://api.amazon.com/auth/o2/token") .build(); //For Grantless operations (Authorization API and Notifications API), use following code : /* LWAAuthorizationCredentials lwaAuthorizationCredentials = LWAAuthorizationCredentials.builder() .clientId("amzn1.application-*********************") .clientSecret("***********************************") .withScopes(SCOPE_NOTIFICATIONS_API, SCOPE_MIGRATION_API) .endpoint("https://api.amazon.com/auth/o2/token") .build(); */ //Create an instance of the Sellers API and call an operation : SellersApi sellersApi = new SellersApi.Builder() .lwaAuthorizationCredentials(lwaAuthorizationCredentials) .endpoint("https://sellingpartnerapi-na.amazon.com") // use Sandbox URL here if you would like to test your applications without affecting production data. .build(); try { GetMarketplaceParticipationsResponse result = sellersApi.getMarketplaceParticipations(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling SellersApi#getMarketplaceParticipations"); e.printStackTrace(); } catch (LWAException e) { System.err.println("LWA Exception when calling SellersApi#getMarketplaceParticipations"); System.err.println(e.getErrorCode()); System.err.println(e.getErrorMessage()); e.printStackTrace(); } } } ```