Amazon Partner
Amazon Partner
com/sp-api/docs/welcome:
# Summary of Amazon Selling Partner API (SP-API) Documentation
## Overview
The Selling Partner API (SP-API) is designed for developers to create applications
that interact with Amazon's selling partners (sellers and vendors). It facilitates
data retrieval and posting to a customer's selling account.
## Key Concepts
1. **SP-API Models**: Various models are available that align with specific selling
partner functionalities, categorized into seller and vendor applications.
2. **Authorization**: Applications must be authorized to access the SP-API, which
includes several workflows for authorization, including self-authorization and
token management.
3. **Endpoints and Requests**: SP-API utilizes RESTful services with specific
endpoints for different functionalities.
## Important Components
### APIs
The SP-API provides a wide range of services, including but not limited to:
- **Product Listings API**: Manage and update product listings.
- **Orders API**: Access order details and manage order workflows.
- **Finances API**: Retrieve finance-related data.
- **Reports API**: Generate and manage various sales and operational reports.
## Usage Guidelines
- **Notifications**: Subscribe to RSS feeds for updates on API announcements and
changes.
- **Rate Limits**: Understand the usage plans and adhere to rate limits to prevent
throttling of API requests.
- **Error Handling**: Familiarize yourself with common errors (e.g., authorization
errors, HTTP errors) and their troubleshooting steps.
## Important Notes
- **Versions**: Check for the latest version of API references as they may
deprecate old versions over time.
- **SDKs**: Download only Python SDK if specifically required for your project, as
various SDKs exist for different programming languages.
## Additional Resources
- **GitHub Repository**: Access artifacts like client libraries, JSON schemas, and
other development tools.
- **Frequently Asked Questions (FAQ)**: Addresses common development queries and
offers additional insights into the use of SP-API.
## Conclusion
This documentation serves as a comprehensive guide for leveraging Amazon's SP-API
is critical for integrating seller applications and vendor solutions effectively.
Ensure to follow coding best practices, particularly regarding authorization and
error management, to foster a robust application interface.
_____________________________
## Overview of SP-API
The Selling Partner API (SP-API) provides developers with access to Amazon's tools
and services for integrating their applications with selling partner accounts. This
API enables data retrieval and posting functionalities to manage various aspects of
selling on Amazon.
order_payload = {
"marketplaceId": "ATVPDKIKX0DER",
"orderId": "123-1234567-1234567"
}
response = make_api_request("/orders/v0/orders", order_payload)
print(response)
```
### Conclusion
The SP-API documentation provides extensive resources for developers to build and
integrate applications effectively. Pay attention to authorization requirements,
rate limits, and the provision of well-structured requests to ensure smooth
operation. Always consult the detailed models and code samples available for
clearer implementation strategies.
_____________________________
---
#### Overview
The Selling Partner API (SP-API) is designed for developers creating applications
to facilitate data exchange with Amazon's selling partners (sellers and vendors).
This documentation provides comprehensive resources for integrating and migrating
to SP-API.
---
1. **Authorization**:
- Applications must be authorized to access various resources. There are
multiple workflows including:
- **Self Authorization**
- **Application Authorization**
- Renewal procedures for authorization tokens.
2. **Integration**:
- Connecting to SP-API involves establishing a robust session through various
programming languages, notably Python (per user request).
- **Tutorials** available for integrating using different SDKs (Python SDK, Java
SDK, etc.).
3. **Error Handling**:
- Comprehensive guidelines for troubleshooting SP-API errors, including:
- **400 Errors**: How to diagnose and resolve.
- **Authorization Errors**: Common pitfalls and their resolutions.
4. **API Endpoints**:
- Information on various SP-API endpoints categorized into functional areas,
including but not limited to:
- Orders API
- Listings API
- Fulfillment API
5. **Response Format**:
- SP-API responses typically follow a JSON format. It's essential to include a
`User-Agent` header in all requests.
---
- **Data Handling**:
- **Data Kiosk API**: For processing and managing data queries.
- **Upload API**: Handles file uploads for documents related to various
operations (inventory, orders, etc.).
- **Reports API**:
- **RequestReport**: Initiates a report generation.
- **RetrieveReport**: Retrieves completed report data.
response = requests.post('https://sellingpartnerapi.com/authorization',
headers={'Authorization': 'Bearer <YourToken>'})
```
- **Caveats**:
- Ensure compliance with Amazon's Acceptable Use Policy and Developer Policy to
avoid service disruptions.
- Be aware of the **Rate Limits** associated with each API call to optimize
application usage.
- **Sandbox Environment**: Use the SP-API Sandbox for testing API calls before
going to production.
---
This summary captures essential information on using the Amazon Selling Partner
API, providing a foundational understanding and practical coding examples tailored
for developers. For detailed inquiries or further exploration, developers are
encouraged to refer to the respective sections of the API documentation.
_____________________________
## Overview
The Selling Partner API (SP-API) allows developers to create applications that
gather and post data from/to a customer's selling partner account on Amazon.
Designed for sellers and vendors, this documentation provides resources necessary
for integrating and migrating to SP-API.
- **Connecting to the API**: Applications can connect to the SP-API using SDKs like
Python, Java, C#, and JavaScript.
**Usage Example**:
```python
# Basic structure for making an API call using the Python SDK
from sp_api.api import Products
- **Submission and Update Protocols**: Follow specific protocols for submitting and
updating applications within the SP-API and understand the authorization workflows
to avoid errors or denied access.
## Additional Resources
- **GitHub Repository**: Contains client libraries, Swagger models, and JSON
schemas for developers.
- **FAQ and Support**: Frequently asked questions and support are available for
common issues faced during implementation.
## Conclusion
The Amazon Selling Partner API facilitates a wide range of functionalities for
managing seller and vendor data on Amazon, providing essential tools and
documentation for developers. By utilizing SDKs and understanding the key concepts
outlined in the documentation, developers can integrate Amazon's services into
their applications effectively.
_____________________________
**Overview**:
The Selling Partner API (SP-API) is a REST-based API that enables Amazon selling
partners to programmatically access their data related to orders, shipments,
payments, inventory, and more, thereby enhancing efficiency and customer response
time.
---
---
While the detailed API classes, functions, and methods were not explicitly stated
in the provided content, key concepts associated with them include:
1. **OAuth Workflow**:
- Implementing OAuth 2.0 to authorize applications.
- Use the Selling Partner Appstore detail page for authorization.
2. **SDK Usage**:
- Generate an SDK tailored for the desired programming language (e.g., Python).
- Use this SDK to facilitate interactions with the SP-API endpoints.
3. **Endpoints**:
The SP-API contains various endpoints for accessing different sets of data. For
example:
- Orders API
- Product Listing API
- Reports API
Each of these would include request and response formats, likely in JSON.
---
---
---
- **Language**: Focus on Python SDK for coding interactions with the SP-API.
- **API Documentation**: Refer to the specific API documentation for detailed
endpoint descriptions, request/response formats, and field specifications as they
relate to Python implementations.
---
This concise overview gives developers and system administrators essential insights
into using the Selling Partner API effectively. For more detailed code examples,
method implementations, and endpoint specifics, consult the full API documentation
at [Amazon SP API
Documentation](https://developer-docs.amazon.com/sp-api/docs/what-is-the-selling-
partner-api).
_____________________________
---
2. **SDK Generation:**
- The SP-API allows for the generation of SDKs to facilitate LWA (Login with
Amazon) token exchange and authentication.
3. **Sandbox Testing:**
- Applications can be tested in a sandbox environment before deployment.
4. **Global Applications:**
- Once registered as a developer in a specific region and marketplace, the
application can be authorized by selling partners globally across different regions
and marketplaces.
---
LOGIN_URL = 'https://api.amazon.com/auth/o2/token'
# Assuming client_id and client_secret are already defined
payload = {
'grant_type': 'client_credentials',
'client_id': client_id,
'client_secret': client_secret,
}
response = requests.post(LOGIN_URL, data=payload)
token = response.json().get('access_token')
```
- **Calling SP-API**:
```python
# Example of making a SP-API request
SP_API_URL = 'https://sellingpartnerapi-na.amazon.com/orders/v0/orders'
headers = {
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json'
}
response = requests.get(SP_API_URL, headers=headers)
orders = response.json()
```
---
### Important Concepts
- **OAuth 2.0 Authorization**:
Ensures secure access to user data. Developers must implement OAuth to
authenticate and authorize requests.
- **SDK Usage**:
The SDK provided by SP-API simplifies the calling of the API, handling token
exchange and endpoint calls.
---
- **Testing in Sandbox**:
Always use the sandbox environment for extensive testing to ensure that
applications behave as expected before live deployment.
- **Documentation Updates**:
The key features and usage may evolve over time; keep an eye on the release
notes for any significant changes.
---
This summarizes the critical components needed to utilize the Selling Partner API
effectively. Always refer to the official documentation for the most current
information and detailed guidance on specific features.
_____________________________
#### Overview
The Selling Partner API (SP-API) is a REST-based API that allows Amazon selling
partners to programmatically access their data, including orders, shipments,
payments, and other key business functions. This API is designed to enhance
efficiency, reduce labor, and improve customer response times.
3. **API Calls**:
- The structure of API calls includes a user-agent header, response formats, and
expected request formats.
orders_api = Orders(marketplace=Marketplaces.US)
response = orders_api.get_orders(CreatedAfter='2023-01-01')
print(response)
```
This summary provides essential information for developers looking to work with
Amazon's Selling Partner API effectively, highlighting its key features, important
concepts, and basic code usage.
_____________________________
#### Overview
The Selling Partner API (SP-API) is a REST-based API designed for Amazon selling
partners to programmatically access their data related to orders, shipments,
payments, and more. This API aims to enhance selling efficiency, reduce labor
requirements, and improve customer response times, thereby supporting business
growth.
#### Key Features
- **OAuth Authorization Workflow**: Selling partners can initiate the authorization
process from the Selling Partner Appstore or your website.
- **SDK Generation**: Generate an SDK to assist with LWA (Login with Amazon) token
exchange and authentication.
- **Sandbox Testing**: Test applications by making calls to a sandbox environment
before deploying.
2. **Token Exchange**:
- Use the captured authorization code with your client credentials to request an
access token from Amazon.
### Conclusion
The Selling Partner API provides a powerful set of tools for Amazon sellers to
automate and optimize their operations, but it requires careful implementation of
authorization, testing, and adherence to Amazon's policies to ensure successful
integration.
_____________________________
Summary of URL: https://developer-docs.amazon.com/sp-api/docs/sp-api-models:
# Summary of Amazon Selling Partner API (SP-API) Models Documentation
## Overview
The Amazon Selling Partner API (SP-API) provides various APIs, notifications, and
reports that allow users (sellers and vendors) to interact with Amazon's services.
This summary focuses on information relevant to gathering data from customers'
selling partners and posting data to their selling accounts, specifically for
Python SDK use.
## Key Concepts
- **SP-API Models**: Defines the available APIs for different use cases. Each API
comes with specific references, models, and descriptions of functionalities.
- **Authorization**: Before making API calls, developers must authorize their
applications to access specific data resources.
- **Rate Limits**: SP-API enforces rate limits on how often an API can be called.
Understanding these limits is crucial for robust application design.
Ensure you have the required credentials and appropriate authorizations before
using the APIs, and check the latest version of the API documentation for updates.
_____________________________
## Overview
The Amazon Selling Partner API (SP-API) provides various APIs that allow developers
to gather and post data related to their selling accounts. This API enables
intricate interactions with Amazon's services, such as listing products, managing
inventory, processing orders, and fetching financial data.
## Important Notes
- **Authorization**: SP-API requires OAuth 2.0 authentication. A valid token must
be included in the Authorization header for API requests.
- **Rate Limits**: Each API has defined usage limits; exceeding these limits may
result in access restriction. Developers should implement backoff strategies for
handling rate limits.
- **Error Handling**: Common errors include authorization errors, invalid inputs,
and rate limit exceeded issues. Properly handling these errors is essential for
robust application behavior.
## Caveats
- **Versioning**: Keeping track of API versioning is crucial. Always refer to the
most recent documentation for the specific version being used.
- **Marketplace Specifics**: Some APIs like the Inventory API may have
functionalities only for certain marketplaces, thus always double-check regional
dependencies.
This summary encapsulates crucial aspects of the SP-API, helpful for developers
aiming to implement and utilize the API effectively in their applications.
_____________________________
The Amazon Selling Partner API (SP-API) provides a set of APIs to gather data from
a seller's account and post data to a customer's selling account. Below are key
components and functionalities extracted from the SP-API documentation relevant for
integrating with seller accounts, particularly using Python.
- **Response Format**: Understand the standard response format when using the API.
Typically, responses will be in JSON format.
- **Sandbox Environment**: Familiarize yourself with the sandbox for testing API
calls before going live.
- **Rate Limits**: Each API has usage plans and limits that must be adhered to in
order to avoid throttling.
- **Deprecation Policies**: Stay updated with API release notes and deprecation
schedules to ensure your application runs with current supported methods.
- **Error Handling**: Pay attention to error codes and implement robust error
handling in your application to manage failed requests effectively.
- **Updates**: As of now, the SP-API has multiple version releases, which can
affect API contracts. Always refer to the latest documentation for any field
changes.
#### Overview
The Catalog Items API allows users to retrieve information about items in the
Amazon catalog, facilitating access to product details essential for sellers.
2. **SearchCatalogItems**
- **Description**: Searches for items in the Amazon catalog using various query
parameters.
- **Input Parameters**:
- `MarketplaceId`: The ID of the marketplace.
- `Query`: The search term.
- Additional filters (e.g., `ItemType`, `PageSize`, `SortOrder`).
- **Return**: A list of catalog items that match the search query.
# Constants
API_URL = "https://sellingpartnerapi-na.amazon.com/catalog/v2022-04-01/items"
MARKETPLACE_ID = '<your_marketplace_id>'
ASIN = '<your_item_asin>'
ACCESS_TOKEN = '<your_access_token>'
This summary captures essential information for developers looking to utilize the
Catalog Items API within Amazon SP-API while ensuring they are aware of key
functionalities and best practices.
_____________________________
The SP-API provides various APIs for Amazon Selling Partners to retrieve and post
data. Below are the important details and usage instructions for the Data Kiosk
API.
---
---
---
#### Usage
1. **Submit a GraphQL Query**: Developers can interact with the API by sending POST
requests with the GraphQL syntax in the body.
2. **Handle Responses**: The API will return structured data as per the schema
defined in the specific GraphQL query used.
{
"query": "<GraphQL query here>"
}
```
---
---
---
For further information on API updates, features, and detailed use cases, refer to
the official Amazon Selling Partner API documentation.
---
This summary provides a concise overview of the Data Kiosk API's functionality,
usage, and important considerations for developers working with the Amazon Selling
Partner API.
_____________________________
Summary of URL: https://developer-docs.amazon.com/sp-api/docs/sp-api-models#easy-
ship-api:
### Summary of Amazon Selling Partner API (SP-API) Models
3. **Feeds API**
- **Description**: Uploads data to Amazon for managing selling business
operations.
- **Current Version**: 2021-06-30
- **Key Fields**:
- `feedType`: Type of feed being uploaded (e.g., inventory, pricing).
- `marketplaceId`: The marketplace associated with the feed.
- **Use Case**: Submit inventory updates, pricing adjustments, and other data
modifications.
- **Documentation Link**: [Feeds API Documentation](https://developer-
docs.amazon.com/sp-api/docs/feeds-api-reference)
4. **Finances API**
- **Description**: Retrieves financial event data for specific orders or date
ranges.
- **Current Version**: 2024-06-19
- **Use Case**: Access financial performance data without waiting for statement
periods.
- **Documentation Link**: [Finances API Documentation](https://developer-
docs.amazon.com/sp-api/docs/finances-api-reference)
5. **Reports API**
- **Description**: Retrieves and manages reports to assist in business
management.
- **Current Version**: 2021-06-30
- **Use Case**: Generate sales performance reports, inventory reports, and
compliance reports.
- **Documentation Link**: [Reports API Documentation](https://developer-
docs.amazon.com/sp-api/docs/reports-api-reference)
This summary encapsulates the essential APIs and concepts associated with the
Amazon SP-API. For detailed implementation and code examples, refer to the specific
API documentation linked above.
_____________________________
#### Overview
The Amazon Selling Partner API (SP-API) enables developers to access information
related to a customer's selling partner account, facilitating data gathering and
managing operations on the seller's account. Targeted for use with Python SDKs.
---
3. **Feeds API**
- **Description:** Upload data to Amazon to manage the selling business.
- **Version:** v2021-06-30
- **Common Functionality:**
- **Upload Feed:**
```python
response = feeds_api.upload_feed(feed_data)
```
- **Feed Data:** Can include product listings, pricing updates, etc.
4. **Finances API**
- **Description:** Fetch financial events for a given order or date range
without waiting for statement closure.
- **Current Version:** v2024-06-19
- **Usage Example:**
```python
response = finances_api.get_financial_events(date_range)
```
- **Key Fields:**
- `date_range`: Specifies the period for financial events retrieval.
---
---
This organized summary provides developers with essential information and practical
usage details for working with the Amazon SP-API effectively.
_____________________________
The Amazon Selling Partner API (SP-API) allows developers to interact with Amazon's
selling platform. It facilitates the retrieval and posting of data related to
customer selling accounts through various APIs.
- **Authorization**:
- Applications must be authorized to access SP-API resources.
- Use tokens for authorization through the Tokens API, obtaining Restricted Data
Tokens (RDT).
- **Rate Limits**:
- Be aware of the usage limits set for each API to avoid throttling.
- **Error Handling**:
- Common errors include authorization issues and rate limit exceedances.
Implement robust error handling in your application.
- **API Versions**:
- Always check for the latest version of the APIs as older versions might be
deprecated. Document releases and changes can be found in the SP-API Release Notes.
- **Data Sensitivity**:
- Be cautious when handling sensitive data, especially with the Restricted Data
Token.
- **Documentation Updates**:
- Regularly check the documentation for any updates or changes to methods,
fields, and API capabilities to keep your integration current.
- **Sandbox Environment**:
- Utilize the SP-API Sandbox for testing your applications without affecting
production data.
### References
- [SP-API Models and
Documentation](https://developer-docs.amazon.com/sp-api/docs/sp-api-models#fba-
inventory-api)
- [Amazon SP-API GitHub Repository](https://github.com/amzn/selling-partner-api-
sdk) for detailed examples and contributions.
## Overview
The **Feeds API** allows developers to upload data to Amazon to manage selling
activities. This API is crucial for tasks such as product listings, inventory
updates, and pricing adjustments.
## Key Features
- Upload various types of feed data to manage your selling business.
- Supports multiple feed types, including product updates, pricing, and fulfillment
details.
1. **Submit Feed**
- **Usage**: Used to upload a feed to Amazon.
- **Parameters**:
- `feedType` (string): The type of feed to submit.
- `feedContent` (stream): The content of the feed as a stream.
- `marketplaceIds` (array): The list of marketplace IDs where the feed is
applicable.
```python
import requests
payload = {
"feedType": feed_type,
"feedContent": feed_content,
"marketplaceIds": marketplace_ids
}
# Example usage
response = submit_feed(
api_url='https://sellingpartnerapi-na.amazon.com',
access_token='YOUR_ACCESS_TOKEN',
feed_type='POST_PRODUCT_DATA',
feed_content='YOUR_FEED_CONTENT',
marketplace_ids=['ATVPDKIKX0DER']
)
print(response)
```
## Key Concepts
- **Authorization**: Ensure you have a valid access token to call the API.
- **Marketplaces**: Understand the different marketplace IDs that Amazon uses, as
feeds must be specified for applicable marketplaces.
- **Rate Limits**: Follow API rate limits to avoid throttling. Make sure to check
your usage and handle errors gracefully.
- **JSON Schema**: Familiarize yourself with the JSON schemas for the different
feed types to ensure your data structure is correct.
## Important Notes
- **Documentation**: Regularly refer to the [SP-API Release
Notes](https://developer-docs.amazon.com/sp-api/docs/sp-api-release-notes) for
updates and changes.
- **Error Handling**: Implement error handling for cases when feed submissions fail
due to invalid content or authorization issues.
- **Best Practices**: Follow the provided [Feeds API Best
Practices](https://developer-docs.amazon.com/sp-api/docs/feeds-api-best-practices)
for optimal performance and reliability of your API usage.
- **Limited Access**: Ensure to handle permissions and limitations set by Amazon
when accessing restricted data fields.
This summary provides an overview of the Feeds API along with relevant methods,
usage examples, and important considerations for developers looking to integrate
with the Amazon SP-API.
_____________________________
---
1. **Finances API**
- **Purpose:** Retrieve financial events related to orders or date ranges
without waiting for statement periods to close.
- **Current Version:** v2024-06-19 (Model and Reference available).
- **Usage:**
- **Request Example:**
```json
{
"orderId": "string",
"dateRangeStart": "YYYY-MM-DD",
"dateRangeEnd": "YYYY-MM-DD"
}
```
- **Fields:**
- `orderId`: Unique identifier for the order.
- `dateRangeStart`: The start date for the financial events.
- `dateRangeEnd`: The end date for the financial events.
2. **Feeds API**
- **Purpose:** Upload data to Amazon to manage your selling business, including
updating product listings and inventory.
- **Current Version:** v2021-06-30 (Model and Reference available).
- **Usage:**
- **Request Example:**
```json
{
"feedType": "string",
"marketplaceIds": ["string"],
"inputFeed": "base64-encoded-string"
}
```
- **Fields:**
- `feedType`: Type of feed to be uploaded (e.g., product listings).
- `marketplaceIds`: Array of marketplace identifiers where the feed is
applicable.
- `inputFeed`: The actual data (base64 encoded) being uploaded.
3. **Orders API**
- **Purpose:** Retrieve order information related to your selling business.
- **Current Version:** v0 (Model and Reference available).
- **Usage:**
- **Request Example:**
```json
{
"orderId": "string"
}
```
- **Fields:**
- `orderId`: Unique identifier for the order you want to query.
---
---
### Important Notes and Caveats
- **Versioning:** APIs may have multiple versions. Always use the latest version
unless there’s a specific requirement to use an older version.
- **Deprecation:** Be aware of deprecation schedules for APIs to prevent issues in
your application as older APIs get phased out.
- **Data Format:** Ensure that the data sent in requests is correctly formatted
(e.g., JSON structure).
---
To retrieve financial events, you would first authenticate your API application,
and then use the Finances API with the required parameters like `orderId`,
`dateRangeStart`, and `dateRangeEnd` to obtain the relevant information about
financial transactions relevant to that order.
---
This summary provides the essential information necessary for utilizing the Amazon
SP-API effectively, tailored to developers looking to integrate these
functionalities into their applications. For further details, always refer to each
API's specific documentation on the Amazon Developer website.
_____________________________
## Overview of SP-API
The Selling Partner API (SP-API) allows developers to integrate with Amazon's
Selling Partner program to gather data and perform actions on behalf of their
clients. This includes capabilities like uploading inventory data, retrieving order
details, and managing listings, among others.
```python
import requests
url = "https://sellingpartnerapi-na.amazon.com/feeds/2021-06-30/feeds"
headers = {
"Authorization": "Bearer <YOUR_ACCESS_TOKEN>",
"x-amz-access-token": "<YOUR_ACCESS_TOKEN>",
"x-amz-date": "<CURRENT_DATE>",
"Content-Type": "application/json"
}
data = {
"feedType": "POST_PRODUCT_DATA",
"marketplaceIds": ["A1PA6795UKMFR9"],
"inputStream": "<BASE64_ENCODED_CONTENT>"
}
This summary covers the key functionalities and usage of the Amazon SP-API,
offering guidance for effectively integrating and utilizing the API in your
applications.
_____________________________
## Overview
The Selling Partner API (SP-API) allows developers to gather data from Amazon's
marketplace and post data related to a customer's selling account. This
documentation provides information on the various API models available, their
functions, and practical use cases.
- **Error Handling**: Be aware of the various error codes and handling strategies,
such as rate-limiting and authorization errors.
## Important Notes
- Ensure SDK or libraries are kept updated as the APIs evolve regularly.
- Familiarize yourself with Amazon's policies regarding acceptable use and data
protection.
- Rate limits may apply to your API calls; implement strategies to handle these
limits gracefully in your application.
## Additional Resources
- For a comprehensive list of all available API models and their usage, consult the
[SP-API Reference](https://developer-docs.amazon.com/sp-api/docs/sp-api-models).
- Stay informed about updates and deprecations via the SP-API release notes.
This summary outlines the essential components and usage of Amazon's SP-API,
providing a quick reference to work effectively with the API and integrate it into
your applications.
_____________________________
#### Overview
The Selling Partner API (SP-API) provides a set of RESTful APIs that allow
developers to access and manage data related to their selling accounts on Amazon.
This documentation page pertains specifically to various APIs under SP-API,
including the Invoices API, which allows users to retrieve and manage invoices.
---
1. **Invoices API**
- **Current Version**: 2024-06-19
- **Usage**: Retrieve and manage invoices for your selling activities.
- **Reference**: [Invoices API Reference](https://developer-docs.amazon.com/sp-
api/docs/invoices-api-reference)
- **Use Case Guide**: [Invoices API Use Case Guide](https://developer-
docs.amazon.com/sp-api/docs/invoices-api-use-case-guide)
- **FAQ**: [Invoices API
FAQ](https://developer-docs.amazon.com/sp-api/docs/invoices-api-faq)
---
```python
import requests
# Fetch invoices
invoices = get_invoices()
print(invoices)
```
---
- **Authorization**:
- SP-API uses OAuth 2.0 for authorization. Developers must obtain a restricted
data token (RDT) to access certain resources.
- **Rate Limits**:
- Be aware of rate limits for each API to avoid throttling errors. Check the
documentation for specific limits applicable to your application.
- **Response Format**:
- The APIs generally return JSON responses. Always ensure to parse these
responses correctly in your application.
---
- **Versioning**: Always refer to the latest versions of APIs for any updates or
changes. The documentation maintains a changelog for significant updates.
- **Sandbox Testing**: Utilize the provided sandbox environment for testing your
API integrations without affecting live data.
- **Error Handling**: Implement robust error handling to manage API response errors
effectively. This includes handling HTTP status codes and checking for validation
errors in the response body.
---
### Conclusion
This summary provides a concise overview of essential SP-API models, focusing on
the Invoices API, relevant code examples, key methods and functions, and vital
concepts for effective implementation. For more detailed information, refer to the
specific API links provided above.
_____________________________
The **Listings Items API** allows developers to manage product listings on Amazon.
This API facilitates retrieving, creating, and updating listings, as well as
accessing information related to product attributes.
#### API Versions
- **Current Version**: 2021-08-01
- **Previous Version**: 2020-09-01
---
#### 1. **GetListingsItems**
- **Description**: Retrieves item information for a specified seller.
- **Parameters**:
- `sellerId` (string): The unique identifier for the seller.
- `sku` (string): SKU (Stock Keeping Unit) of the product for which listing
details are requested.
- **Response**: Returns listing information, including current price,
availability, and attributes.
#### 2. **PutListingsItem**
- **Description**: Creates or updates a listing item.
- **Parameters**:
- `sellerId` (string): The unique identifier for the seller.
- `sku` (string): SKU of the product.
- `itemData` (object): Details of the item being created/updated (includes
title, description, price, etc.).
- **Response**: Confirmation of successful creation or update.
#### 3. **DeleteListingsItem**
- **Description**: Deletes a specified listing item.
- **Parameters**:
- `sellerId` (string): The unique identifier for the seller.
- `sku` (string): SKU of the product to be deleted.
- **Response**: Confirmation of successful deletion.
#### 4. **GetListingsItemRestrictions**
- **Description**: Retrieves any restrictions that apply to a specific item
listing.
- **Parameters**:
- `sellerId` (string): The unique identifier for the seller.
- `sku` (string): SKU of the product.
- **Response**: Details of the restrictions applied to the item listing.
---
```python
import requests
# Get item
print(get_listings_item("SELLER_ID", "EXAMPLE_SKU"))
# Update item
print(update_listings_item("SELLER_ID", "EXAMPLE_SKU", item_data))
```
---
---
---
#### Overview
The Selling Partner API (SP-API) allows developers to gather data from Amazon
selling partners and to post data to their selling accounts. This documentation
contains information about various APIs that can be used for different
functionalities related to product listings, orders, finance, notifications, and
more.
3. **Finances API**
- **Description**: Retrieves financial events for orders within a specified date
range.
- **Current Version**: `v2024-06-19`, also available in `v0`
- **Available for**: Sellers
- **Usage**: Useful for reports on financial transactions related to orders.
- **Reference**: `[Finances
API](https://developer-docs.amazon.com/sp-api/docs/finances-api)`
5. **Orders API**
- **Description**: Access order information.
- **Current Version**: `v0`
- **Available for**: Sellers
- **Usage**: To read order details and implement order management operations
efficiently.
- **Reference**: `[Orders
API](https://developer-docs.amazon.com/sp-api/docs/orders-api)`
API_URL = "https://sellingpartnerapi-na.amazon.com/listings/restrictions"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
def get_listing_restrictions(sku):
response = requests.get(f"{API_URL}/{sku}", headers=headers)
return response.json()
# Usage
restrictions_info = get_listing_restrictions("example_sku")
print(restrictions_info)
```
#### Caveats
- Always check for API versioning as features may change between versions.
- Ensure to handle authorization and token management securely to protect your
selling partner account.
- Review the SP-API Release Notes for any updates regarding deprecated features or
functionalities before deploying your application.
### Resources
- **SP-API GitHub Repository**: For tracking announcements and release changes.
This summary provides a foundation for using the Selling Partner API effectively.
Further exploration of each specific API documentation is recommended for detailed
implementation.
_____________________________
The Amazon Selling Partner API (SP-API) allows developers to interact with a
customer’s selling partner account to collect and send relevant data using various
APIs.
## Key Concepts
- **SP-API Models**: A collection of APIs provided by Amazon to facilitate
different functions such as order management, product listing, fulfillment, and
finance.
- **Seller vs. Vendor Accounts**: Some APIs are exclusively for sellers, while
others may only be available to vendors or both.
- **Authorization**: Access to APIs requires proper authorization protocols,
including generating restricted data tokens and managing application credentials.
## Code Examples
```python
from sp_api.api import Orders
```json
{
"ShippingOption": {
"DeliveryExperience": "Delivery",
"ShipToAddress": {
"Name": "John Doe",
"AddressLine1": "123 Elm St",
"City": "Seattle",
"StateOrRegion": "WA",
"PostalCode": "98101",
"CountryCode": "US"
}
}
}
```
This summary provides essential information for developers looking to use the
Amazon Selling Partner API effectively while coding in Python. Always refer to the
official API documentation for the latest updates and more detailed function
definitions.
_____________________________
The Selling Partner API (SP-API) provides various APIs to interact with Amazon's
platform, allowing sellers to gather and post data. This summary focuses on key
aspects relevant to using the SP-API, particularly the Notifications API.
---
2. **Notifications API**:
- Subscribes to notifications related to a seller's business (e.g., order
changes).
- Helps in automating workflows based on events that occur on the seller's
account.
---
- **Notifications API**:
- Use: Subscribe to notifications relevant to your selling business.
- Current Version: 2024-06-19. Available for Sellers.
- **Example**: Subscribe to ORDER_CHANGE notification to react to customer order
changes.
- **Reports API**:
- Use: Manage and request various reports related to the selling operation.
- Current Version: 2021-06-30. Available for Sellers.
---
- **Subscription to Notifications**:
- To receive notifications, you must first grant permissions to your application
for the Amazon Simple Queue Service (SQS) to handle and process notification
messages.
---
- **Authorization**:
- Ensure the application is authorized correctly to access data. Use appropriate
OAuth workflows to manage access tokens.
- **Rate Limits**:
- Each API comes with its own usage limits. Monitor API usage to avoid hitting
these limits, especially when processing operations in bulk or high frequency.
- **Versioning**:
- Always check for the latest version of APIs before implementing to ensure
compatibility and access to the newest features.
---
This summary provides a structured overview of key elements related to the Amazon
SP-API and its models, ensuring developers have the essential information needed to
integrate with the system effectively. For practical implementation, developers
should refer to specific API documentation and examples on the Amazon developer
portal.
_____________________________
## Overview
The Selling Partner API (SP-API) provides various APIs to help developers gather
and post data associated with Amazon's selling partners. This resource is aimed at
enabling seamless integration with Amazon's services, specifically tailored to
automate interactions with seller accounts.
3. **Orders API**
- **Purpose**: Retrieve order information.
- **Current Version**: v0
4. **Finances API**
- **Purpose**: Get financial events for orders or date ranges without needing to
wait for statement periods.
- **Current Version**: v2024-06-19
5. **Feeds API**
- **Purpose**: Upload data to manage your selling business.
- **Current Version**: v2021-06-30
6. **Reports API**
- **Purpose**: Retrieve and manage reports for managing your selling activities.
- **Current Version**: v2021-06-30
def get_order_data(order_id):
url = f"https://sellingpartnerapi-na.amazon.com/orders/v0/orders/{order_id}"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"x-amz-region": "us-east-1"
}
response = requests.get(url, headers=headers)
return response.json()
# Usage
order_info = get_order_data("ORDER_ID_HERE")
print(order_info)
```
## Key Concepts
1. **Authorization**:
- Applications must be registered, and proper scopes must be granted for data
access using Restricted Data Tokens.
2. **Rate Limits**:
- Each API has specific limits on the number of requests per hour, which should
be adhered to prevent throttling.
3. **Notification Subscriptions**:
- Use the Notifications API to subscribe to events relevant to your selling
activities, such as ORDER_CHANGE.
## Important Notes
- **Versioning**: Always ensure you are working with the latest API version for
compatibility and features.
- **Deprecation Policy**: APIs may be deprecated and replaced; review the **SP-API
Release Notes** for announcements.
- **Caveats**: Care should be taken to handle HTTP errors (e.g., 400 errors)
appropriately to ensure application robustness.
By leveraging the SP-API, developers can automate data exchange and integrate their
applications with Amazon’s selling partner functionalities effectively. Use the
code snippets and guidelines provided to build your applications with the SP-API in
Python.
_____________________________
The Selling Partner API (SP-API) provides a way for developers to gather data from
a customer's selling partner and post data to a customer's selling account. This
technical summary focuses on essential information pertaining to the API and
relevant models.
- **APIs Available**: The SP-API has several APIs categorized under Seller and
Vendor accounts. Each API has a version and reference model associated with it,
along with specific use cases.
- **Versioning**: Each API has a version number, which indicates the API's release
level and helps developers ensure they are using the correct functionalities as
intended.
3. **Orders API**
- **Usage**: Retrieve order information from seller accounts.
- **Version**: v0
- **Reference**: [Orders API Reference](https://developer-docs.amazon.com/sp-
api/docs/orders-api)
4. **Listings Items API**
- **Usage**: Access and manage product listings on Amazon.
- **Version**: v2021-08-01 and v2020-09-01
- **Reference**: [Listings Items API Reference](https://developer-
docs.amazon.com/sp-api/docs/listings-items-api)
- **Rate Limits**: Be aware that each API comes with its own set of rate limits.
Exceeding these limits may result in throttling or access restrictions.
- **Sandbox Environment**: Utilize the SP-API Sandbox for testing API calls without
affecting live data. This environment simulates requests for development purposes.
- **Documentation Updates**: Keep an eye on API Release Notes for any updates or
changes to the API. Staying updated with the latest changes ensures that your
application continues to work seamlessly.
This summary covers the essentials needed to work with the SP-API effectively,
helping developers understand API functions, usage, and best practices while
building applications that integrate with Amazon's selling platform.
_____________________________
The Amazon Selling Partner API (SP-API) allows developers to gather and post data
related to a customer's selling partner account. This is particularly aimed at
integrating sales data and managing various aspects of a seller's business.
endpoint =
"https://sellingpartnerapi-na.amazon.com/pricing/v2022-05-01/pricing"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
"User-Agent": "YourApp/1.0"
}
response = requests.get(endpoint, headers=headers)
pricing_data = response.json()
```
3. **Orders API**
- **Purpose**: Retrieve order information from the seller's account.
- **Current Version**: v0
- **Usage**: To access order details for shipment and fulfillment processes.
4. **Inventory APIs**
- **FBA Inventory API**: For retrieving information about inventory in Amazon's
fulfillment centers.
- **Fulfillment Inbound API**: Manages inbound inventory to Amazon’s fulfillment
network.
- **Data Submission**: Use the Feeds API to upload data for inventory management
and listing updates.
- **API Contracts**: Each API has defined contracts specifying required fields and
response formats. It's essential to refer to the specific API documentation for
detailed specifications.
- **Rate Limits**: Be aware of the limitations imposed on how frequently you can
call certain APIs. Exceeding these limits may result in throttling or temporary
bans.
- **Versioning**: Always specify the correct version of the API you wish to
interact with. Monitor the release notes for updates or deprecations to stay
compliant.
- **Error Handling**: Implement robust error handling in your application to manage
authorization errors, API errors, and data format issues.
### Caveats
- APIs are region-specific; make sure to use the correct endpoint associated with
your Amazon seller account location.
- The APIs often require specific headers like `User-Agent` for compliance with
Amazon's requirements.
- Use SDKs available for different programming languages if applicable, to ease
integration and enhance functionality.
#### Overview
The Selling Partner API (SP-API) allows developers to access and manipulate data
related to Amazon sellers and vendors through various APIs. This documentation
provides a directory of available APIs, their purposes, and usage for building
applications that interact with Amazon's selling platform.
8. **Finances API**
- **Description**: Retrieve financial events for orders.
- **Current Version**: v2024-06-19
The Selling Partner API (SP-API) provides a set of RESTful APIs to help developers
gather data from customers' selling partners and post data to customers' selling
accounts. This summary focuses on the Replenishment API along with other relevant
aspects of the SP-API.
- **Connecting to the SP-API**: Developers can implement the API using various
SDKs, specifically focusing on Python as requested:
```python
from selling_partner_api import Client
```python
# Retrieving replenishment metrics
response = client.replenishment.get_replenishment_metrics(
marketplace_ids=['ATVPDKIKX0DER'],
sku='YOUR_PRODUCT_SKU'
)
# Process response
metrics = response['metrics']
```
- **Rate Limits**: The SP-API has usage plans and rate limits that should be
considered while developing applications. Ensure that your implementation adheres
to these limits to avoid request errors.
- **Versioning**: Regularly check for updates in the API versions and deprecations
to maintain compatibility with your applications.
- **Release Notes**: Stay updated with the latest changes via [SP-API Release
Notes](#).
- **GitHub Repository**: Contains announcements and update logs for previous
releases.
- **SP-API Documentation Hub**: Central source for all SP-API documentation and
code samples.
This succinctly summarizes the key aspects of using the Amazon Selling Partner API,
especially focusing on how developers can utilize the Replenishment API
effectively. For further detailed navigation of specific cases, refer to the
respective API documentation linked above.
_____________________________
#### Overview
The Reports API allows you to retrieve and manage reports for your selling business
on Amazon. You can request various types of reports, schedule reports, and retrieve
automatically generated reports.
- **Request a Report**
```python
import requests
from requests.auth import HTTPBasicAuth
url = "https://sellingpartnerapi-na.amazon.com/reports/2021-06-30/reports"
headers = {
"Content-Type": "application/json",
"x-amz-access-token": "Your_Access_Token"
}
body = {
"reportType": "GET_FLAT_FILE_ORDER_REPORT_DATA",
"marketplaceIds": ["Your_Marketplace_ID"],
"reportOptions": "{}"
}
report_id = "Your_Report_ID"
report_url =
f"https://sellingpartnerapi-na.amazon.com/reports/2021-06-30/reports/{report_id}"
- **Report Types:** Understand the various available report types based on your
business needs.
- **Status Tracking:** Use the reporting endpoint to monitor the status of report
generation.
- **Handling Asynchronous Processing:** Many report requests are processed
asynchronously; ensure to poll for the status if needed.
- **Rate Limits:** Be aware of API usage limits as described in the [SP-API Rate
Limits](https://developer-docs.amazon.com/sp-api/docs/sp-api-rate-limits).
- **Data Privacy:** When utilizing the API, adhere to Amazon's data protection
policies and acceptable use policies.
- **Marketplaces:** Ensure to use the correct Marketplace IDs relevant to your
account during report requests.
- **Authorization:** You must handle the authorization of SP-API requests
carefully; obtain your credentials and manage access tokens securely.
This summary provides essential information and functionality of the Reports API
within Amazon's SP-API, particularly focused on extracting, posting, and managing
data related to your selling operations.
_____________________________
## Introduction
The Amazon Selling Partner API (SP-API) allows developers to gather and post data
for selling partners. Specifically, it enables data retrieval from the selling
partner's account and updates to their selling account.
## Key Concepts
- **SP-API**: A comprehensive set of RESTful APIs that enable sellers to access and
manage their Amazon selling business.
- **APIs Availability**: APIs can be available for either seller accounts or vendor
accounts.
- **Endpoints**: Different APIs have distinct endpoints and may require
authorization for access.
- **Authorization**: Applications must be authorized to access SP-API data through
various workflows.
## Important APIs
1. **Sales API**
- **Purpose**: Retrieve information about sales performance.
- **Current Version**: v1
- **Usage Example**:
```python
# Example code to call Sales API (Hypothetical)
sales_data = call_sales_api(marketplace_id='example_marketplace', date='YYYY-
MM-DD')
```
2. **Sellers API**
- **Purpose**: Access essential information about the seller account, such as
available marketplaces and account status.
- **Current Version**: v1
- **Usage Example**:
```python
# Example code to call Sellers API (Hypothetical)
seller_info = call_sellers_api()
```
4. **Finances API**
- **Purpose**: Retrieve financial events for a specified order or date range.
- **Current Version**: v2024-06-19
- **Usage Example**:
```python
# Example code to call Finances API (Hypothetical)
financial_events = call_finances_api(order_id='example_order',
date_range='YYYY-MM-DD')
```
#### Overview
The Amazon Selling Partner API (SP-API) enables developers to integrate with
Amazon's selling services, providing access to various resources for managing
seller accounts and transactions. It allows applications to gather data from a
seller's account and post data back using APIs.
3. **Finances API**
- **Description**: Retrieves financial events related to orders or date ranges.
- **API Versions**: v0 and 2024-06-19
- **Available for Sellers**: Yes
- **Available for Vendors**: No
4. **Orders API**
- **Description**: Retrieves detailed order information.
- **API Version**: v0
- **Available for Sellers**: Yes
- **Available for Vendors**: No
5. **Sellers API**
- **Description**: Retrieves essential account information, such as available
marketplaces.
- **API Version**: v1
- **Available for Sellers**: Yes
- **Available for Vendors**: No
- **Auth**: Applications must be authorized to access the SP-API using OAuth 2.0.
Use the `Authorization` endpoint to authorize your application.
- **Rate Limits**: API calls are subject to rate limitations based on the plan and
type of API. Monitoring usage and handling errors effectively is crucial for
reliability.
```python
import requests
# Set up headers
headers = {
"Authorization": f"Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json",
"Host": "sellingpartnerapi-na.amazon.com"
}
if response.status_code == 200:
seller_data = response.json()
print(seller_data)
else:
print(f"Error: {response.status_code}, {response.text}")
```
- **Python SDK**: There are SDKs available for various languages. It's recommended
to use the Python SDK to simplify integration tasks.
- **Data Models**: Familiarize yourself with the data models of the APIs you plan
to use, as each API has specific request and response models that need to be
adhered to.
- **Restricted Data Token (RDT)**: For accessing certain data types, you will need
to obtain a Restricted Data Token (RDT) via the Tokens API.
- **Sandbox Testing**: Use the SP-API sandbox for testing and developing
integrations before moving to production.
- **Consistency with Deprecations**: Keep an eye on the SP-API Release Notes for
updates and deprecations that may affect your application.
This summary condenses crucial information about the Amazon Selling Partner API
models, important methods for accessing data, code examples, and notes for proper
implementation. For detailed references, consult the [Amazon SP-API Documentation]
(https://developer-docs.amazon.com/sp-api/docs).
_____________________________
Summary of URL: https://developer-docs.amazon.com/sp-api/docs/sp-api-
models#services-api:
### Summary of Amazon Selling Partner API (SP-API) Models
#### Overview
The Selling Partner API (SP-API) enables developers to build applications that
access various services and data related to selling on Amazon. It facilitates data
retrieval from a customer's selling partner account and allows for data submission
to the customer's selling account.
4. **Finances API**
- **Usage**: Get financial events for orders.
- **Version**: v2024-06-19
- **Available For**: Sellers only
5. **Feeds API**
- **Usage**: Upload data to Amazon to manage your selling business.
- **Version**: v2021-06-30
- **Available For**: Sellers and Vendors
6. **Orders API**
- **Usage**: Retrieve order information.
- **Version**: v0
- **Available For**: Sellers and Vendors
7. **Notifications API**
- **Usage**: Subscribe to notifications relevant to your selling business.
- **Version**: v1
- **Available For**: Sellers and Vendors
8. **Reports API**
- **Usage**: Retrieve and manage reports to help manage your selling business.
- **Version**: v2021-06-30
- **Available For**: Sellers and Vendors
- **Seller and Vendor Accounts**: SP-API functionalities may vary between seller
accounts (for individual sellers) and vendor accounts (for suppliers).
- **Versions and Release Notes**: Each API has a version that indicates the
capabilities and improvements. Check the release notes for updates and deprecated
features.
- **API Rate Limits**: Be aware of the usage limits imposed by Amazon's SP-API.
Exceeding these limits can lead to throttling or temporary service unavailability.
- **Sandbox Testing**: Use the SP-API Sandbox for testing your application in a
safe environment. This allows you to simulate API requests without affecting live
data.
- **Data Formats**: Understand the required data formats and schemas, especially
for JSON inputs and outputs, to ensure successful API interactions.
```python
import requests
data = {
"data": {
# Your feed data
}
}
if response.status_code == 200:
print("Feed uploaded successfully!")
else:
print(f"Error uploading feed: {response.json()}")
```
### Conclusion
This concise summary presents essential details about the SP-API models relevant
for developers. Ensure to follow Amazon's best practices and guidelines when
working with the API for efficient and secure application performance. For further
details, consult specific API references and release notes.
_____________________________
### Overview
The Shipment Invoicing API allows you to retrieve shipment invoice information
specifically for Fulfillment by Amazon (FBA) orders within the Brazil marketplace.
This API is designed for use by sellers and enables you to gather details related
to shipment invoices generated for orders fulfilled by Amazon.
```python
import requests
if response.status_code == 200:
invoice_data = response.json()
return invoice_data # Process or return your desired data
else:
print(f"Error: {response.status_code} - {response.text}")
# Example usage
invoice = get_shipment_invoice('123456', 'your_access_token_here')
print(invoice)
```
### Notes and Caveats
- **Region-Specific**: This API is only available for the Brazil marketplace. Be
aware that functionality and access may differ by region.
- **Authorization**: Ensure proper authorization is granted to your application for
accessing shipment invoice data; use the correct OAuth tokens.
- **Error Handling**: Handle potential errors gracefully. Common issues include
authorization errors, HTTP request failures, and incorrect or missing shipment
identifiers.
- **Documentation Reference**: Always consult the [Amazon SP-API documentation]
(https://developer-docs.amazon.com/sp-api/docs/sp-api-models#shipment-invoicing-
api) for the most up-to-date information on endpoints, request parameters, and
response formats.
### Conclusion
The Shipment Invoicing API plays an essential role in managing FBA invoices for
sellers operating in the Brazil marketplace. By understanding the key concepts,
leveraging the provided code snippets, and adhering to best practices for error
handling and authorization, developers can effectively integrate this API into
their applications. Always refer to the official documentation for the most
accurate and detailed information.
_____________________________
## Overview
The Amazon Selling Partner API (SP-API) provides a suite of APIs that allow
developers to retrieve and post data to a customer's selling account. The Shipping
API, in particular, offers functionality to request shipping rates, create
shipments, cancel shipments, and track shipments.
2. **Feeds API**
- **Current Version**: v2021-06-30
- **Functions**:
- Upload data to manage the selling business.
3. **Finances API**
- **Current Version**: v2024-06-19
- **Functions**:
- Retrieve financial events for orders within specified date ranges.
4. **Orders API**
- **Current Version**: v0
- **Functions**:
- Retrieve order information.
6. **Notifications API**
- **Current Version**: v1
- **Functions**:
- Subscribe to notifications relevant to the selling business.
print(response.json())
```
## Key Concepts
- **Authentication**: Requires specific headers and tokens to authorize requests.
Most operations need an **access token**.
- **Rate Limits**: The frequency of API calls is limited. Be sure to check the
documentation for specific limits.
- **Versioning**: Be aware of the API version you are using, as methods and
properties may change between versions.
## Important Notes
- Always ensure the access tokens are refreshed as necessary.
- Utilize the sandbox testing environment to verify your API requests before going
live.
- For detailed use cases and specific implementations, consult the related API
documentation on the Amazon developer portal and GitHub for the latest updates.
## Additional Resources
- **API Reference**: Comprehensive details can be found in the official SP-API
documentation.
- **Support and Community**: Engage with other developers through forums and the
Amazon Selling Partner Developer support for troubleshooting and best practices.
By following this structured approach, you can effectively utilize the Amazon
Selling Partner API to enhance selling operations on the Amazon platform.
_____________________________
#### Overview
The Solicitations API is part of the Selling Partner API (SP-API) that allows
developers to send non-critical solicitations to buyers. This functionality can be
utilized in various applications where communication with buyers is pertinent.
- **EndPoint:** `/solicitations/v1/solicitations`
- **Method:** POST
- **Description:** Sends a solicitation request to a buyer.
1. **Rate Limits**: Be mindful of the rate limits imposed by the API on the number
of requests to avoid throttling.
2. **Non-critical Solicitation**: This API is designed for non-critical
solicitations, meaning that it should not be used for urgent communications.
3. **Error Handling**: Ensure proper error handling is implemented in your
application to manage scenarios where the request might fail (e.g., invalid email,
rate limit exceeded).
```python
import requests
response = requests.post(f"{api_url}/solicitations/v1/solicitations",
headers=headers, json=data)
if response.status_code == 200:
print("Solicitation sent successfully.")
else:
print(f"Error: {response.json()}")
# Example usage
api_url = 'https://sellingpartnerapi-na.amazon.com'
access_token = 'YOUR_ACCESS_TOKEN'
send_solicitation(api_url, '[email protected]', 'ASK_REVIEW', access_token)
```
This code establishes a minimal way to construct and send a request using the
Solicitations API in a Python environment.
### Conclusion
The Solicitations API provides a vital way for sellers to interact with buyers
through non-critical communications. Developers should pay attention to proper
usage patterns, error handling, and compliance with Amazon's guidelines and
regulations.
_____________________________
The Supply Sources API allows developers to manage the configurations and
capabilities related to seller supply sources. Below is a structured summary
containing key information, including code examples, important classes, and
essential concepts.
2. **Key Methods** (not detailed in provided content; likely to include methods for
retrieving, updating, or deleting supply sources):
- `getSupplySources`
- `createSupplySource`
- `updateSupplySource`
```python
import requests
# Example usage
api_endpoint = "https://sellingpartnerapi-na.amazon.com"
headers = {
"Authorization": "Bearer <your_access_token>",
"x-amz-date": "<current_timestamp>",
"Content-Type": "application/json"
}
#### Caveats
- The specific method names and parameters are assumed based on standard REST API
practices, and the exact structure should be verified in the official
documentation.
- Access to certain API functionalities may vary based on account type (Seller vs.
Vendor).
### Conclusion
The Supply Sources API empowers sellers to effectively manage sources of their
products on Amazon. Developers should ensure they understand authentication, error
handling, and compliance with rate limits while integrating this API into their
applications. For detailed implementation specifics, always refer back to the
official SP-API documentation.
_____________________________
The Amazon Selling Partner API (SP-API) provides an extensive set of APIs that
allow developers to gather data from a customer's selling partner account, as well
as post data back to the selling account. Below is a summary of important aspects
of the SP-API, relevant for developers working with these APIs using Python.
---
- **Tokens API**: Used to obtain a Restricted Data Token (RDT) for accessing
restricted resources.
- **Version**: v2021-03-01
- **Usage**: `POST /tokens`
- **Contract Fields**:
- `grant_type`: The type of grant (e.g., "client_credentials").
- `client_id`: Your application’s client ID.
- `client_secret`: Your application's client secret.
---
- **Restricted Data Token (RDT)**: A token used for accessing sensitive data
securely. All requests that access restricted data require this token.
- **Rate Limits**: API calls are subject to rate limits. Ensure to implement error
handling for HTTP 429 responses indicating rate limit issues.
- **Versioning**: Each API has its versioning scheme. Developers must reference the
correct version of the API documentation for accurate usage.
---
```python
import requests
---
---
# Note: Replace `api_url` with the Uploads API endpoint and include necessary
headers.
```
# Important: Specify the correct feed type and content according to the API
reference.
```
### Authorization
- **General Authorization**: Use OAuth 2.0 for authenticating API calls.
- **Token Types**: Standard and Restricted Data Tokens (RDT) for accessing specific
resources.
## Usage Notes
- Ensure that the correct version of the API is being utilized.
- Check rate limits for API calls to avoid throttling.
- Be aware of data privacy regulations and compliance when handling customer data.
## Caveats
- Some APIs may have specific restrictions based on the seller account's
capabilities or the country of operation.
- Always refer to the SP-API Release Notes for updates or changes in functionality.
## Documentation Reference
For detailed API endpoints, parameters, and response formats, refer to the [Amazon
SP-API documentation](https://developer-docs.amazon.com/sp-api/docs/sp-api-
models#uploads-api).
## Overview
The Amazon SP-API provides a range of APIs that enable developers to gather data
from their selling partner accounts and post data to their selling accounts. This
documentation specifically details various APIs available for both seller and
vendor accounts, emphasizing the **Application Management API**, which is used to
manage application credentials and rotations.
## Key APIs
url = "https://sellingpartnerapi-na.amazon.com/application-management/v2023-11-30/
applications/YOUR_APPLICATION_ID/clientSecret"
headers = {"Authorization": "Bearer YOUR_ACCESS_TOKEN"}
if response.status_code == 200:
print("Client secret rotated successfully")
else:
print("Error:", response.content)
```
## Conclusion
The SP-API offers extensive functionalities for managing operations related to
selling on Amazon. Proper understanding and implementation of these APIs will
enhance automation and streamline inventory management, financial tracking, and
notifications for sellers and vendors. Always refer to the latest documentation for
updates on methods and usage contracts.
_____________________________
Summary of URL: https://developer-docs.amazon.com/sp-api/docs/sp-api-models#amazon-
warehousing-and-distribution-api:
# Summary of Amazon Selling Partner APIs Documentation
## Overview
The Amazon Selling Partner APIs (SP-API) allow developers to gather data from and
post data to Amazon selling accounts. This summary focuses on the APIs relevant to
the user's intent to retrieve and upload data using Python.
5. **Finances API**
- **Version**: v2024-06-19
- **Purpose**: Retrieve financial events for orders.
- **Usage**: Choose this API to track financial aspects without waiting for
statement periods.
- **RESTful API Design**: The APIs follow REST principles, meaning requests should
include appropriate HTTP methods (GET, POST, PUT, DELETE) and be structured
according to Amazon’s endpoint documentation.
- **Data Token**: To access sensitive data, a Restricted Data Token (RDT) may be
required. This token must be obtained prior to performing certain API operations.
- **Sandbox Testing**: Developers are encouraged to use the Selling Partner API
Sandbox for testing API requests before deploying to live environments.
- **Rate Limits**: Each API may have specific rate limits that developers must
adhere to in order to prevent throttling of requests. Consult the API documentation
for details specific to each API.
- **Versioning**: APIs evolve over time. Pay close attention to version updates and
deprecation schedules to maintain compatibility.
```python
import requests
This snippet demonstrates how to authenticate and make a request using the Amazon
Warehousing and Distribution API to retrieve shipment data.
## Conclusion
The Amazon Selling Partner API provides a robust framework for managing seller
accounts on Amazon. Understanding the key APIs, usage, and concepts will enable
developers to effectively integrate and utilize these APIs for various selling and
operational tasks. Always refer to the latest API documentation for updates and
additional details.
_____________________________
## Overview
The Selling Partner API (SP-API) facilitates data gathering and posting to a
customer's selling account on Amazon. This documentation covers the key APIs
related to Vendor Direct Fulfillment, focusing on necessary code samples, usage,
and critical concepts for effective implementation.
## Key Concepts
- **APIs Availability**: Understand that certain APIs are only available for vendor
accounts, hence sellers will not gain access.
- **Usage Context**: The APIs are designed for retrieve-and-post operations
specific to vendor accounts in a direct fulfillment scenario.
- **Rate Limits**: Be aware of rate limits for API calls to prevent application
throttling. Specific limits should be referenced in the API Reference
documentation.
## Important Notes
### Conclusion
This summary provides an essential overview of utilizing the Amazon Selling Partner
API for efficient inventory and order management. Follow the code snippets provided
for practical implementation, and always refer to the official documentation for
detailed information on methods, parameters, and best practices.
_____________________________
- **APIs:** SP-API includes various APIs, each for different functionalities, such
as creating and managing listings, shipping, notifications, reporting, and more.
- **Models:** Each API has a model that defines requests and responses, including
required and optional fields.
- **Authentication:** All applications must be authorized to access the API,
typically done using OAuth 2.0 and a Restricted Data Token for sensitive
information.
1. **Messaging API**
- **Description:** Used to send messages to buyers.
- **Current Version:** v1
- **Available for:** Sellers and Vendors
- **Usage Example:**
```python
response = messaging_api.send_message({
"buyer_id": "123456789",
"message_body": "Your order has been shipped!"
})
```
2. **Orders API**
- **Description:** Retrieves order information.
- **Current Version:** v0
- **Available for:** Sellers and Vendors
- **Usage Example:**
```python
response = orders_api.get_order("order_id_here")
```
4. **Finances API**
- **Description:** Retrieves financial events for orders.
- **Current Version:** v2024-06-19 for financial events
- **Available for:** Sellers only
- **Usage Example:**
```python
response = finances_api.get_financial_events(order_id="order_id_here")
```
5. **Reports API**
- **Description:** Manages and retrieves reports relevant to selling.
- **Current Version:** v2021-06-30
- **Available for:** Sellers and Vendors
- **Usage Example:**
```python
response = reports_api.create_report({
"report_type": "GET_FBA_FULFILLMENT_ORDER_REPORT",
"marketplace_ids": ["ATVPDKIKX0DER"]
})
```
By understanding and utilizing the above outlined APIs, methods, and best
practices, developers will be equipped to efficiently work with the Amazon Selling
Partner API.
_____________________________
The Vendor Direct Fulfillment Orders API is part of Amazon's Selling Partner API
(SP-API) and allows partners to interact with their fulfillment orders. This API
provides functions for accessing and managing vendor order data and is essential
for integrating fulfillment capabilities into applications.
1. **Vendor Direct Fulfillment**: This refers to the process where vendors fulfill
orders directly to customers without going through Amazon fulfillment centers.
2. **API Endpoints**: The API offers several endpoints that allow vendors to manage
their order fulfillment workflows.
3. **RESTful API**: The SP-API follows REST architecture, meaning developers can
use standard HTTP methods (GET, POST, etc.) to interact with the API.
```python
import requests
url = "https://sellingpartnerapi-na.amazon.com/vendor/directFulfillment/orders" #
Replace with the appropriate region-specific endpoint
headers = {
"Content-Type": "application/json",
"x-amz-access-token": "YOUR_ACCESS_TOKEN", # Use the correct token
}
data = {
"orderId": "123456",
"orderLines": [
{
"productId": "PRODUCT_ID",
"quantityOrdered": 1,
"shippingAddress": {
// Shipping details here
}
}
],
}
- **Sandbox Testing**: Leverage the Vendor Direct Fulfillment Sandbox API for
testing prior to deploying against the production API.
- **Documentation Reference**: For the most current and detailed information,
always refer back to the official API documentation on Amazon's developer hub.
This summary encapsulates the fundamental aspects of using the Vendor Direct
Fulfillment Orders API, enabling developers to effectively integrate order
management features into their applications. For further exploration of specific
usage scenarios or additional APIs, consult the SP-API documentation directly.
_____________________________
#### Overview
The Amazon Selling Partner API (SP-API) allows developers to access various
functionalities regarding vendor fulfillment operations. The Vendor Direct
Fulfillment Payments API specifically provides access to direct fulfillment vendor
invoice data.
2. **Authorization**
- Implement the necessary authorization mechanisms to access the APIs.
Applications may require Restricted Data Tokens (RDT) for certain APIs.
3. **Data Handling**
- Successful API calls will require handling various data structures including
JSON objects for requests and responses.
4. **Sandbox Environment**
- Utilize the Vendor Direct Fulfillment Sandbox Test Data API to conduct tests
without impacting live data.
# Usage
payments_data = get_payments("vendor-id-12345")
print(payments_data)
```
#### Important Notes
- **Authorization Token**: Ensure that you set up and refresh the authorization
tokens properly, as many API endpoints require valid tokens for access.
- **Vendor Account Requirements**: The SP-API is designed for both seller and
vendor accounts, with the vendor APIs providing functionalities tailored to
businesses that operate under Amazon's vendor framework.
- **Documentation and Resources**: Consult the detailed documentation and release
notes for updates, changes, and best practices relevant to each API model. The SP-
API Release Notes page offers insights on prior updates, deprecations, and
optimizations.
#### Conclusion
This summary provides a concise overview of the SP-API models with a focus on the
Vendor Direct Fulfillment Payments API. Developers should leverage the example code
and key concepts to efficiently integrate and interact with Amazon's selling
partner services tailored to vendor operations. Always stay updated with the latest
changes and best practices by referring to the official documentation.
_____________________________
2. **Feeds API**
- **Purpose**: Upload feeds to manage data for product listings and related
operations.
- **API Version**: v2021-06-30
- **Example Snippet**:
```python
import requests
url = "https://sellingpartnerapi-na.amazon.com/feeds/2021-06-30/documents"
headers = {
"Authorization": "Bearer <Your_Access_Token>",
"Content-Type": "application/json"
}
data = {
# Include necessary feed data fields here.
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
```
3. **Orders API**
- **Purpose**: Retrieve detailed information about orders.
- **API Version**: v0
- **Example Snippet**:
```python
url = "https://sellingpartnerapi-na.amazon.com/orders/v0/orders/<Order_ID>"
response = requests.get(url, headers=headers)
print(response.json())
```
This summary provides a condensed view of SP-API functionality and should assist
developers in utilizing the API effectively while adhering to best practices.
_____________________________
## Overview
The Amazon Selling Partner API (SP-API) provides various APIs to help sellers and
vendors manage their accounts, retrieve data, and execute actions related to their
selling activities on Amazon. This documentation outlines useful APIs, their
versions, and basic usage.
2. **Reporting APIs**
- **Reports API**
- **Description**: Retrieve and manage reports for business insights.
- **Current Version**: 2021-06-30
- **Usage**: Important for assessing sales performance, inventory status, and
financial events.
3. **Management APIs**
- **Application Management API**
- **Description**: Manage application registrations and keys.
- **Current Version**: 2023-11-30
- **Usage**: Essential for maintaining application security.
```python
# Python Example to Fetch Shipping Information using Vendor Direct Fulfillment
Shipping API
import requests
BASE_URL = "https://sellingpartnerapi-na.amazon.com/vendor/directFulfillment/
shipping/v1"
API_ENDPOINT = "/shipping/state" # Change as required
ACCESS_TOKEN = "YOUR_ACCESS_TOKEN"
headers = {
"Authorization": f"Bearer {ACCESS_TOKEN}",
"Content-Type": "application/json"
}
response = requests.get(BASE_URL + API_ENDPOINT, headers=headers)
if response.status_code == 200:
shipping_data = response.json()
print(shipping_data) # Process the shipping data
else:
print(f"Error: {response.status_code} - {response.text}")
```
#### Methods
- **getShippingDetails()**
- Retrieves shipping information for orders.
- **createReport()**
- Initiates generation of a new report based on specified criteria.
This summary provides an essential guide for developers aiming to integrate with
Amazon's Selling Partner API using Python to retrieve and post relevant data
through various API endpoints.
_____________________________
## Overview
The Amazon Selling Partner API (SP-API) provides endpoints for accessing and
managing various aspects of an Amazon seller account, which includes Vendor Direct
Fulfillment APIs. This documentation outlines the Vendor Direct Fulfillment
Transactions API, which specifically allows access to direct fulfillment vendor
invoice data.
## Important APIs Related to Vendor Direct Fulfillment
## Key Concepts
- **Vendor Account**: The Vendor Direct Fulfillment APIs are intended for use by
vendors, not sellers. Access to these APIs requires vendor account credentials.
- **Amazon SP-API Authentication**: Ensure that you have properly set up
authentication, including OAuth tokens, to access these APIs.
- **API Rate Limits**: Be mindful of API usage limits to avoid interruptions or
access denials.
## Important Notes
- **API Permissions**: Ensure that your application has the required permissions
and scopes authorized to access vendor-related data.
- **Sandbox Testing**: Before deploying any integration live, utilize sandbox
environments to test API calls and interactions.
- **API Updates**: Regularly check the [SP-API Release Notes](https://developer-
docs.amazon.com/sp-api/page/release-notes) for the latest updates and changes to
API functionality.
## Additional Resources
- Tutorials for specific SDKs (like Python and Java) can provide additional context
and examples on how to interact with the SP-API.
- For detailed code samples, review the provided documentation or related GitHub
repositories showcasing example implementations.
This summary provides a structured insight into accessing and using the Vendor
Direct Fulfillment Transactions API as part of the Amazon SP-API, focusing on
essential components necessary for effective integration and utilization.
_____________________________
The Selling Partner API (SP-API) allows developers to gather data from a selling
partner's account and post data to the selling partner's account using APIs.
---
url = "https://sellingpartnerapi-na.amazon.com/vendor/invoices"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"x-amz-date": "YYYYMMDDTHHMMSSZ",
"Content-Type": "application/json",
}
response = requests.get(url, headers=headers)
print(response.json())
```
**Usage Example**:
```python
response = requests.get("https://sellingpartnerapi-na.amazon.com/vendor/orders",
headers=headers)
```
#### 3. **Vendor Shipments API**
- **Purpose**: Access vendor retail shipping data.
- **API Version**: v1
---
---
- Ensure compliance with Amazon's **Acceptable Use Policy** and **Data Protection
Policy** when using the SP-API.
- Always check the **SP-API Release Notes** for updates to APIs and their
functionalities as new versions may incorporate significant changes that could
affect existing implementations.
- If experiencing errors, refer to the **SP-API Errors FAQ** for troubleshooting.
---
- Utilize the provided **tutorials** for automating SP-API calls (e.g., Automate
API calls using Python SDK).
- Regularly review **API deprecations** to remain informed about any functions or
endpoints that may become obsolete.
---
## Overview
The Amazon Selling Partner API (SP-API) provides developers the tools to access the
data and capabilities necessary for managing their selling partner's Amazon
accounts. This document focuses on the Vendor Orders API, which is part of the
larger SP-API framework.
```python
import requests
if response.status_code == 200:
return response.json()
else:
print(f"Error: {response.status_code}, {response.text}")
# Example invocation
orders = get_vendor_orders("your_access_token", "ATVPDKIKX0DER", "2023-01-
01T00:00:00Z", "2023-12-31T23:59:59Z")
print(orders)
```
### Key Concepts
- **OAuth 2.0 Authorization**: Accessing the API requires OAuth 2.0 tokens. Be sure
to have valid tokens before making API calls.
- **Rate Limits**: Ensure compliance with rate limits to avoid throttling. Check
the latest documentation for the specific limits on each API.
### Caveats
- Ensure that you understand the date format (ISO 8601) used for timestamps.
- Be aware that responses might be paginated if the results exceed the maximum
allowed in a single call. Handle pagination using the appropriate continuations.
- Regularly check for version updates as the API may evolve, introducing new fields
or deprecating older versions.
## Notes
For more detailed specifications, usage guidelines, and updates, refer to the
[Amazon Selling Partner API Documentation](https://developer-docs.amazon.com/sp-
api/docs/sp-api-models#vendor-orders-api).
## Conclusion
The Vendor Orders API provides a straightforward way to retrieve and manage vendor
order data in the Amazon ecosystem. By following the usage patterns outlined above
and maintaining attention to key concepts like authorization and rate limits,
developers can successfully integrate with this API.
_____________________________
## Overview
The Vendor Shipments API allows developers to access vendor retail shipping data,
enabling them to manage and monitor their shipments effectively. This API is part
of the Selling Partner API (SP-API) that provides tools for interacting with
Amazon's selling platform.
## Key Concepts
- **API Models:** Understanding the API models is crucial for effective
implementation as they define data structures and relationships.
- **OAuth Authorization:** All requests require OAuth credentials for access,
including a Restricted Data Token for sensitive operations.
- **Request Format:** JSON format is required for both requests and responses when
interacting with the API.
```python
import requests
# API endpoint
url = "https://sellingpartnerapi-na.amazon.com/vendor/shipments/{shipment_id}"
# Create a shipment
response = requests.post(url, headers=headers, json=payload)
# Check response
if response.status_code == 200:
print("Shipment created successfully:", response.json())
else:
print("Error:", response.status_code, response.text)
```
## Important Notes
- **Rate Limits:** Be aware of the API rate limits to avoid throttling. Follow best
practices such as handling 429 Too Many Requests errors gracefully.
- **Error Handling:** Implement robust error handling to manage API response
statuses, including validation errors (400), unauthorized access (401), and server
errors (500).
- **Versioning:** Pay attention to API versioning. Always refer to the
documentation for the latest updates and changes in the API structure.
## Conclusion
The Vendor Shipments API is a key tool for vendors looking to manage their shipping
operations effectively. Understanding the request formats, authentication methods,
and best practices is critical for successful integration. Always refer to the
official documentation for updates and detailed information.
_____________________________
#### Overview
The Selling Partner API (SP-API) provides developers with access to various
features and data relevant to Amazon’s retail and seller ecosystem. It enables
operations related to order management, product listings, invoicing, notifications,
financial information, and more for both sellers and vendors.
url = "https://sellingpartnerapi-na.amazon.com/vendor/transaction-status/v1"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())
```
### Conclusion
The SP-API offers a robust set of features for interacting with Amazon's selling
platform. Developers are encouraged to consult the API documentation for detailed
information on each API, including endpoints, request/response formats, and usage
scenarios.
_____________________________
#### Overview
The Amazon Selling Partner API (SP-API) provides a set of APIs that enable
developers to retrieve and post data to a seller's Amazon account. This summary
provides insights into several APIs, offering code samples, important methods, and
essential concepts for effective implementation.
This summary provides foundational knowledge for leveraging the Amazon SP-API
effectively, ensuring developers can access and implement the appropriate
functionalities to benefit their applications and services.
_____________________________
## Overview
The Selling Partner API (SP-API) allows developers to build applications that
enhance the capabilities of sellers on Amazon's platform. This document summarizes
key aspects of the SP-API focused on fulfilling orders, merchant fulfillment,
pricing, and vendor operations.
## Important Concepts
### Authentication
- Applications must be authorized to access the Selling Partner API.
- Various authorization workflows (Self Authorization, Website Authorization) are
detailed in the documentation.
## Conclusion
The Amazon SP-API provides comprehensive capabilities for inventory management,
order fulfillment, pricing, and vendor operations. Developers are advised to
familiarize themselves with the specific use cases and recommended practices
provided in the API documentation to optimize their implementation.
### Caveats
- Ensure compliance with the Acceptable Use Policy and relevant data protection
regulations.
- Regular updates on API versions and deprecations must be monitored to maintain
functionality in applications.
For complete code samples and detailed implementation guidelines, please refer to
the respective API documentation linked within each section.
_____________________________
Summary of URL: https://developer-docs.amazon.com/sp-api/docs/code-
samples#merchant-fulfillment-network:
### Summary of Amazon Selling Partner API (SP-API) Code Samples
#### Overview
The Amazon Selling Partner API (SP-API) provides programmatic access for sellers to
manage their selling operations on Amazon's platform. This documentation covers
several APIs with relevant code samples and guides for integration, focusing on
methods for gathering data and posting data to a customer's selling account.
#### Conclusion
The Amazon SP-API provides a range of functionalities through various APIs tailored
to help developers automate operations and integrate Amazon services into their
applications. It is advised to refer to the specific use case guides and libraries
on GitHub for hands-on examples and advanced implementations.
_____________________________
The Amazon Selling Partner API (SP-API) allows developers to access and manage data
related to selling partners on Amazon. This includes retrieving product
information, managing orders, and facilitating fulfillment operations.
---
---
1. **Authorization Roles**
- Roles are crucial for accessing the SP-API. Ensure your application has the
necessary permissions for operations (e.g., Seller, Inventory, Orders).
2. **Rate Limits**
- Be aware of the rate limiting policy to avoid API request failures.
3. **Error Handling**
- Understand the common errors (e.g., authorization errors, 400 errors) for
effective troubleshooting.
---
---
- **Security**: Follow best practices for securing credentials and sensitive data.
- **Documentation**: Regularly check the Amazon Developer Documentation for updates
and changes in API usage.
- **Testing**: Utilize the SP-API sandbox for testing your applications before
going live to avoid impacting production data.
#### Overview:
The Amazon Selling Partner API (SP-API) allows developers to interact
programmatically with Amazon's marketplace. It provides endpoints to gather data
from and post data to a selling partner's account through a variety of APIs.
### Resources
- [Amazon SP-API Documentation](https://developer-docs.amazon.com/sp-api/docs/code-
samples)
- [GitHub Samples](https://github.com/amzn/selling-partner-api-docs)
This summary provides essential insights and reference for developers looking to
utilize the Amazon SP-API effectively.
_____________________________
**User Intent**: The SP-API allows access to data for selling partners and enables
posting data to their selling accounts using Python.
2. **Authorization Required**: Most operations require OAuth token obtained via LWA
(Login with Amazon) credentials.
This summary encapsulates the crucial aspects of using the Amazon SP-API for
developers focusing on Python. Always refer to individual API use case guides for
in-depth explanations and updates.
_____________________________
## Overview
The Selling Partner API (SP-API) allows sellers to programmatically interact with
their data on Amazon. It supports gathering data from the customer's selling
partner and posting data to the customer’s selling account.
## Key Concepts
- **Authorization**: Proper authorization is required for making API calls through
the Selling Partner API.
- **Rate Limits**: Be aware of the rate limits; exceeding these can lead to errors
in API requests.
- **Response Format**: Descriptions of successful responses, errors, and data
models used in requests are provided in each API Guide.
## Important Notes
- **SDK Usage**: Ensure to use the provided SDKs for best practices in integrating
SP-API within your applications.
- **Versioning**: Each API has a version number indicating its release; always
check if you are using the most current documentation and samples.
- **Documentation**: Extensive documentation is available for all APIs, including
sample applications on GitHub.
Developers looking to start with the SP-API can follow the code snippets from the
tutorials provided and explore the full details in the respective API use case
guides linked within the documentation.
_____________________________
### Overview
The Selling Partner API (SP-API) enables developers to interact with Amazon’s
selling partner ecosystem. It facilitates access to various functionalities such as
creating, retrieving, updating, and deleting product listings (SKUs) on Amazon.
1. **Listings Items API**: A key component of the SP-API that provides programmatic
access to manage selling partner listings on Amazon. It allows the creation,
deletion, and modification of listings, as well as retrieval of listing details.
The Listings Items API provides several important actions (methods) for managing
product listings. Each action relates to specific endpoints and functionalities,
described as follows:
For Python, Amazon provides code samples that include functions to interact with
the Listings Items API. Below is a basic outline for submitting a listing:
```python
import requests
- **Rate Limits**: The API has specific rate limits; developers should implement
error handling for rate limit errors and retries.
- **Versioning**: Ensure you are using the correct version of the API (for example,
`Listings Items API v2021-08-01`) as it may affect the endpoint's availability and
functionality.
- **Documentation Links**: For additional details about specific API functions and
structures like request and response schemas, developers are encouraged to refer to
the respective API reference guides and use case documentation available on the SP-
API developer hub.
### Conclusion
The SP-API provides flexible options for managing product listings on Amazon. By
utilizing the Listings Items API, developers can build applications that help
sellers efficiently manage their offerings through streamlined integrations with
Amazon's backend systems. For complete implementation, reference the detailed
documentation and sample solutions provided by Amazon.
_____________________________
## Overview
The Selling Partner API (SP-API) allows developers to interact with Amazon’s
platform to retrieve and post data related to seller activities. This is primarily
useful for managing product listings, inventory, orders, and tax compliance.
## Important Notes
- **API Rate Limits**: Ensure to understand the rate limits to avoid hitting the
maximum calls allowed per time frame.
- **Error Handling**: Developers should implement robust error handling for API
responses, especially for authorization errors and processing issues.
- **Data Security**: Maintain strict security around API credentials and sensitive
data.
- **Fees**: Be aware of potential fees when using certain APIs or when handling
specific operations.
## Code Examples
# Set headers
headers = {
"Authorization": "Bearer <ACCESS_TOKEN>",
"Content-Type": "application/json",
"x-amz-access-token": "<ACCESS_TOKEN>"
}
# Check response
if response.status_code == 200:
listings_data = response.json()
print(listings_data)
else:
print(f"Error: {response.status_code}, {response.text}")
```
This concise summary provides the core concepts and usages of the SP-API, enabling
developers to effectively utilize Amazon's Selling Partner API for their
applications.
_____________________________
#### Overview
The Selling Partner API (SP-API) allows developers to access Amazon’s selling
partner data and manage their accounts programmatically. This includes gathering
data from customers and posting data to their selling accounts through various
APIs.
2. **Catalog Management**
- **APIs**:
- `Catalog Items`
- `Listings Items`
- `Listings Restrictions`
- `Product Type Definitions`
- **Notifications**:
- `ITEM_PRODUCT_TYPE_CHANGE`
- `LISTINGS_ITEM_MFN_QUANTITY_CHANGE`
- `REPORT_PROCESSING_FINISHED`
- **Reports**:
- Inventory Reports such as `GET_MERCHANT_LISTINGS_ALL_DATA` offer
comprehensive insights.
4. **Inventory Management**
- **APIs**:
- `Listings Items`
- **Notifications**:
- `REPORT_PROCESSING_FINISHED`
- **Reports**:
- `GET_FLAT_FILE_OPEN_LISTINGS_DATA` to get detailed listing data.
5. **Order Fulfillment**
- **APIs**:
- `Merchant Fulfillment API`
- `FBA Inbound Eligibility API`
- `FBA Inventory API`
- **Notifications**:
- `ORDER_CHANGE`
- **Reports**:
- Inventory-related reports for tracking fulfillment status.
6. **Order Management**
- **APIs**:
- `Orders`
- **Notifications**:
- `ORDER_STATUS_CHANGE`
- **Reports**:
- `GET_FLAT_FILE_ALL_ORDERS_DATA_BY_LAST_UPDATE_GENERAL`.
7. **Tax Reporting**
- **Reports**:
- `GET_ORDER_REPORT_DATA_TAX` for tax compliance.
9. **Seller Fulfillment**
- **APIs**:
- `Shipping`
- **Notifications**:
- `REPORT_PROCESSING_FINISHED`
- **Python SDK**: For Python developers, utilize the Python SDK for simplified
management of API interactions and ensure to download the relevant Python libraries
for software development.
- **Error Handling**: Implement robust error handling according to the SP-API
Errors FAQ to manage potential issues effectively.
- **Data Compliance**: Ensure compliance with Amazon's data protection policies and
acceptable use policy while developing applications using SP-API.
- **Real-time Updates**: Leverage notification capabilities to stay updated with
changes to inventory, prices, and orders rather than relying solely on batch
updates.
```python
# Example Python snippet for retrieving merchant listings data
import requests
### Conclusion
The SP-API provides a powerful suite of tools for managing selling partner accounts
on Amazon. Understanding the APIs, notifications, and reports available, alongside
key concepts and best practices, is crucial for successful integration and
application development. For additional information, reference the [SP-API
Documentation](https://developer-docs.amazon.com/sp-api/docs/sp-api-seller-use-
cases#overview).
_____________________________
#### Overview
The Selling Partner API (SP-API) provides a suite of APIs designed to enable Amazon
sellers to manage their businesses on Amazon accurately and effectively. It allows
the retrieval of customer data and posting data to the seller's account.
#### Key Use Cases
The documentation primarily covers:
- **Catalog Management**: Tools to manage product listings and optimize the product
catalog.
- **Pricing, Fees, and Promotions**: Tools to help sellers stay competitive with
automated pricing.
- **Inventory Management**: Automate management and synchronization across systems.
- **Order Fulfillment**: Fulfill orders efficiently via Amazon and external
channels.
- **Tax Reporting**: File taxes and manage VAT invoicing.
- **Fulfillment by Amazon (FBA)**: Outsourced order fulfillment.
- **Returns Management**: Manage and process returns effectively.
---
- **Notifications (Events)**:
- `ITEM_PRODUCT_TYPE_CHANGE`
- `LISTINGS_ITEM_MFN_QUANTITY_CHANGE`
- `LISTINGS_ITEM_STATUS_CHANGE`
- `LISTINGS_ITEM_ISSUES_CHANGE`
- Other notifications related to processing reports.
- **Notifications (Events)**:
- `PRICING_HEALTH`
- `FEE_PROMOTION`
- `ANY_OFFER_CHANGED`
url = "https://sellingpartnerapi-na.amazon.com/catalog/2022-04-01/items"
headers = {
"Authorization": "Bearer {token}",
"x-amz-access-token": "{access_token}",
"x-amz-date": "{date}",
"Content-Type": "application/json"
}
---
---
#### Resources
1. **SDKs**: Familiarize yourself with available SDKs for various programming
languages (e.g., Python, Java) to simplify integration.
2. **Best Practices**: Always refer to the best practices section in the
documentation for optimal API usage. This includes topics like error handling and
rate limit management.
---
#### Overview
The Selling Partner API (SP-API) facilitates the integration and management of data
associated with selling partners on Amazon, enabling developers to gather and post
data efficiently.
#### Important APIs for Use Cases
1. **A+ Content API**
- **Purpose**: Allows adding rich marketing content to product detail pages on
Amazon.
- **Usage**:
- Typically used to enhance product storytelling and brand visibility.
This summary encapsulates the critical APIs and their usage for developers looking
to integrate with the Amazon Selling Partner API effectively, with a focus on
marketing content management.
_____________________________
## Important Concepts
- **Pagination**: Many of the API responses are paginated. Use pagination tokens to
access subsequent pages of data.
- **Rate Limits**: Be aware of rate limits imposed on API calls to avoid
throttling.
- **Data Consistency**: Ensure that updates to listings or orders respect the
eventual consistency model of the API.
This summary provides essential API use cases, example code snippets, key methods,
and important considerations for developers utilizing the Amazon Selling Partner
API. Be sure to refer to the complete documentation for intricate details and
advanced usage scenarios.
_____________________________
## Overview
The Amazon Selling Partner API (SP-API) is designed to help developers
programmatically gather data from Amazon seller accounts as well as post data to
maintain sales activities. This documentation focuses specifically on the
functionalities related to inventory management.
## Key Concepts
- **Notifications:**
The SP-API supports Notifications (Events) that inform sellers of changes in
inventory, such as:
- `LISTINGS_ITEM_MFN_QUANTITY_CHANGE`: Notifies when there's a change in the
quantity of an item offered via Merchant Fulfilled Network.
- `REPORT_PROCESSING_FINISHED`: Indicates completion of any requests that may
have included report generation.
- **Reports:**
Several reports are available for inventory management:
- **Inventory Reports:**
- Examples:
- `GET_MERCHANT_LISTINGS_ALL_DATA`
- `GET_MERCHANT_LISTINGS_INACTIVE_DATA`
- Use cases include checking for inactive listings or monitoring overall
inventory status.
- **Authorization:**
Proper authorization is required before accessing or manipulating data via the
SP-API. Ensure that OAuth applications are registered and configured with the
necessary permissions.
- **Error Handling:**
It is important to implement error handling to capture and manage API errors
effectively. Common issues might include:
- `400 Errors`: Typically signifying that the request was malformed.
- `Authorization Errors`: Indicating issues with the provided credentials.
- **Compliance:**
Ensure that any data management and inventory practices comply with Amazon's
policies and legal requirements, especially concerning tax laws and product
representation.
This summary provides essential information for utilizing the Amazon Selling
Partner API specifically for inventory management, focusing on API structure, key
functions, key concepts, and important limitations developers should be aware of.
For further details, reference the official Amazon SP-API documentation.
_____________________________
2. **Order Fulfillment**:
- **APIs**: Merchant Fulfillment, FBA Inventory, Easy Ship.
- **Usage**: Fulfill Amazon orders using any of the available fulfillment
methods (FBA, Merchant Fulfillment, etc.).
3. **Order Management**:
- **APIs**: Orders API.
- **Reports**: Comprehensive order tracking and management reports.
- **Notifications**: Includes `ORDER_STATUS_CHANGE` and `ORDER_CHANGE`.
4. **Inventory Management**:
- **APIs**: Listings Items, Product Type Definitions.
- **Reports**: Various inventory reports specific to merchant listings and
fulfillment statuses.
## Conclusion
The Amazon Selling Partner API is an essential tool for sellers looking to automate
task processes and optimize their selling performance. Understanding the use cases,
key APIs, and compliance considerations is necessary for effective implementation.
The provided Python examples offer a starting point for utilizing the API.
For detailed information on specific APIs, refer to the Amazon API documentation
and developer resources.
_____________________________
The Amazon Selling Partner API (SP-API) enables selling partners to automate
various aspects of their selling activities on Amazon. The focus of this
documentation is on the order management use case, which allows developers to
retrieve data related to orders and post updates to the selling partner's account
via APIs.
2. **Authentication**: To use the SP-API, you must authenticate using the LWA
(Login with Amazon) credentials and manage permissions for each API.
4. **Reports**: Various report types are available to summarize data over specific
timeframes, such as order reports and inventory reports.
- **Orders API**: Retrieve order data, manage order status, and process order
changes.
# Fetch orders
response =
requests.get("https://sellingpartnerapi-na.amazon.com/orders/v0/orders",
headers={"Authorization": "Bearer YOUR_ACCESS_TOKEN"})
orders = response.json()
```
- **HTTP Client Class**: Contains methods for making API calls. Common methods
include:
- `GET(url)`: For fetching data.
- `POST(url, data)`: For posting data to the API.
- **Rate Limits**: Be aware of the API call limits to avoid excessive requests
leading to throttling.
- **Data Encoding**: Ensure correct encoding of URLs and payloads to avoid errors
such as 400 Bad Request.
- **Error Handling**: Implement proper error handling for API responses, and refer
to the SP-API Errors FAQ for common issues.
- **Sandbox Environment**: Utilize the SP-API Sandbox for testing API calls before
moving to production, ensuring your implementation is correct without affecting
live data.
### Conclusion
Utilizing Amazon's SP-API can enhance order management efficiency for selling
partners. Developers should familiarize themselves with the structure,
authentication methods, available APIs, notifications, and reporting tools to
leverage the full capabilities of the SP-API effectively. Always check for the
latest documentation updates and best practices to stay compliant with Amazon's
development guidelines.
_____________________________
Summary of URL: https://developer-docs.amazon.com/sp-api/docs/sp-api-seller-use-
cases#tax-reporting:
### Amazon Selling Partner API (SP-API) - Tax Reporting Use Cases
#### Overview
The Amazon Selling Partner API (SP-API) provides various endpoints and
functionalities that allow sellers to access and manage data related to their
selling accounts, including tax reporting.
1. **Order Reports**
- **GET_ORDER_REPORT_DATA_TAX**
- **GET_FLAT_FILE_ORDER_REPORT_DATA_TAX**
- **GET_AMAZON_FULFILLED_SHIPMENTS_DATA_TAX**
- **GET_FLAT_FILE_SALES_TAX_DATA**
2. **VAT Invoicing**
- **GET_ORDER_REPORT_DATA_INVOICING**
- **GET_FLAT_FILE_ORDER_REPORT_DATA_INVOICING**
- **GET_AMAZON_FULFILLED_SHIPMENTS_DATA_INVOICING**
- **GET_FLAT_FILE_VAT_INVOICE_DATA_REPORT**
- **GET_XML_VAT_INVOICE_DATA_REPORT**
- **GET_VAT_TRANSACTION_DATA**
- **Tax Remittance**: This functionality helps sellers calculate and remit sales
taxes as per regulations.
- **VAT Invoicing**: Allows sellers to generate tax invoices in compliance with EU
tax regulations.
- **FBA Invoicing**: Enables sellers to handle FBA orders and retrieve shipping
invoice information specifically for the Brazilian marketplace.
- **GST Reporting**: Directly related to the indirect tax system in India, this
provides a way to manage GST obligations.
### Notifications
- Some reports trigger processing notifications which can be tracked:
- **REPORT_PROCESSING_FINISHED**
- **FEED_PROCESSING_FINISHED**
While specific code snippets were not detailed in the content provided, the API can
be accessed using libraries such as the Python SDK. Below is a simplified example:
```python
import requests
if response.status_code == 200:
print("Order Tax Report data:", response.json())
else:
print("Failed to fetch data:", response.status_code, response.text)
```
### Conclusion
This summary encapsulates essential API endpoints and concepts for managing tax
reporting through the Amazon SP-API. Developers should ensure they are well-
acquainted with the associated permissions, notification systems, and appropriate
request formats while integrating these functionalities into their applications.
_____________________________
## Overview
The Selling Partner API (SP-API) provides a collection of APIs that help developers
integrate with Amazon’s seller services. This allows for the retrieval and posting
of data related to selling partners' accounts, inventory management, order
fulfillment, and financial reporting.
- **Notifications**:
- `ITEM_PRODUCT_TYPE_CHANGE`
- `LISTINGS_ITEM_MFN_QUANTITY_CHANGE`
- `PRODUCT_TYPE_DEFINITIONS_CHANGE`
### Inventory Management
- **APIs**:
- **Listings Items**
- **Product Type Definitions**
- **Reports**:
- Various inventory reports to track listings and stock.
- **Notifications**:
- `ORDER_STATUS_CHANGE`
- `ORDER_CHANGE`
- **Reports**:
- Includes detailed order reports for order tracking.
- **Notifications**:
- `REPORT_PROCESSING_FINISHED`
- `FEED_PROCESSING_FINISHED`
- **Reports**:
- `GET_ORDER_REPORT_DATA_INVOICING`
- `GET_VAT_TRANSACTION_DATA`
### Authentication
```python
import requests
def authenticate():
url = 'https://sellingpartnerapi-na.amazon.com/auth/o2/token'
headers = {'Content-Type': 'application/json'}
data = {
'grant_type': 'refresh_token',
'refresh_token': 'YOUR_REFRESH_TOKEN',
'client_id': 'YOUR_CLIENT_ID',
'client_secret': 'YOUR_CLIENT_SECRET'
}
## Important Notes
- Always handle errors and exceptions during API calls, as rate limits and other
API-specific restrictions may commonly occur.
- Be aware of the different authorization methods required for accessing various
API endpoints.
- Ensure compliance with all Amazon data protection policies when using the API.
This summary provides essential information needed for developers to get started
with the Amazon Selling Partner API, specifically for Python implementations.
_____________________________
#### Overview
The Selling Partner API (SP-API) provides a way for users to interact with Amazon's
system and manage their selling partners' accounts through various APIs,
notifications, and reports. This summary focuses on essential use cases relevant to
managing returns, inventory, orders, and finance.
---
- **Notifications (Events):**
- **REPORT_PROCESSING_FINISHED**
- **Reports:**
- `GET_XML_RETURNS_DATA_BY_RETURN_DATE`
- `GET_FLAT_FILE_RETURNS_DATA_BY_RETURN_DATE`
- `GET_XML_MFN_PRIME_RETURNS_REPORT`
- `GET_CSV_MFN_PRIME_RETURNS_REPORT`
- `GET_XML_MFN_SKU_RETURN_ATTRIBUTES_REPORT`
- `GET_FLAT_FILE_MFN_SKU_RETURN_ATTRIBUTES_REPORT`
**Description:** Used to get return request information for both Prime and non-
Prime orders, including attributes by SKU.
- **Notifications (Events):**
- **REPORT_PROCESSING_FINISHED**
- **LISTINGS_ITEM_MFN_QUANTITY_CHANGE**
- **Reports:**
- `GET_FLAT_FILE_OPEN_LISTINGS_DATA`
- `GET_MERCHANT_LISTINGS_ALL_DATA`
- `GET_MERCHANT_LISTINGS_DATA`
- `GET_MERCHANT_LISTINGS_INACTIVE_DATA`
- `GET_MERCHANT_CANCELLED_LISTINGS_DATA`
- `GET_PAN_EU_OFFER_STATUS`
- **Reports:**
- `GET_AMAZON_FULFILLED_SHIPMENTS_DATA_GENERAL`
- `GET_FLAT_FILE_ALL_ORDERS_DATA_BY_LAST_UPDATE_GENERAL`
---
---
### Key Concepts
1. **API Endpoints:** URLs that provide access to specific data or services related
to selling partner operations.
---
- **Contract Types:** Each API may have various contract fields that determine
input and output data, so review the API documentation before implementation.
---
This summary aims to equip developers with foundational knowledge and essential
details to effectively utilize the Amazon SP-API for managing selling partner
accounts. Familiarize yourself with the API's functions and best practices for
seamless integration. For Python SDK integration, refer to specific tutorials
highlighted in the full documentation.
_____________________________
---
#### Overview
The Amazon Selling Partner API (SP-API) provides developers with a framework to
interact with Amazon's selling partner platform programmatically. The SP-API
facilitates the retrieval and posting of data related to selling partners, which
includes catalog management, order fulfillment, pricing, inventory management, and
more.
---
---
---
---
### Conclusion
The Amazon SP-API offers robust endpoints for sellers looking to automate their
operations on the Amazon platform. Utilizing these APIs effectively requires a
solid understanding of the catalog, order management, inventory, and fulfillment
processes emphasized throughout the documentation. Developers must also be mindful
of security, rate limits, and system integration best practices.
_____________________________
## Overview
The Selling Partner API (SP-API) facilitates the integration of Amazon services for
sellers. This documentation outlines the APIs relevant for managing data,
fulfilling orders, handling tax reporting, and performing various seller
operations.
**Important Notifications**:
- `ITEM_PRODUCT_TYPE_CHANGE`
- `LISTINGS_ITEM_STATUS_CHANGE`
**Important Notifications**:
- `ORDER_STATUS_CHANGE`
**Important Notifications**:
- `PRICING_HEALTH`
By referencing this guide, developers can effectively utilize the SP-API to gather
and post data from a seller's Amazon account, offering automated management of
their selling activities.
_____________________________
- **Usage Scenarios**:
- VAT invoicing is essential for sellers operating in the European Union and
managing their tax compliance.
- **Error Handling**:
- Ensure to handle errors gracefully, particularly when dealing with VAT
invoices, as failure to comply with local tax laws can result in financial
penalties.
- **Compliance**:
- When using the VAT invoicing features, it is critical to ensure that all
generated invoices meet the specific legal requirements of the respective EU member
states.
# Usage
access_token = 'your_access_token_here' # Obtain via OAuth
seller_id = 'your_seller_id_here'
vat_data = get_vat_invoice_data(access_token, seller_id)
```
### Conclusion
The SP-API provides robust functionality for managing VAT invoicing, which is
crucial for compliance in the EU. Developers should familiarize themselves with the
specific endpoints, understand required reports, and comply with regulations while
testing any integrations thoroughly before going live.
_____________________________
The Amazon SP-API provides various APIs for sellers to gather and post data related
to their selling activities on Amazon. Below is a summary targeted at developers
interested in using Python for SP-API integration.
2. **Catalog Management**
- **APIs**:
- **Catalog Items**
- **Listings Items**
- **Listings Restrictions**
- **Product Type Definitions**
- **Notifications**:
- Various events including `ITEM_PRODUCT_TYPE_CHANGE`,
`LISTINGS_ITEM_MFN_QUANTITY_CHANGE`
- **Reports**:
- Inventory Reports
- Get Merchant Listings Data
- **Usage**: Manage Amazon listings, optimize catalog, and reduce errors.
4. **Inventory Management**
- **APIs**:
- **Listings Items**
- **Product Type Definitions**
- **Reports**:
- GET_FLAT_FILE_OPEN_LISTINGS_DATA
- **Usage**: Automate inventory management and synchronization.
5. **Order Management**
- **API**:
- **Orders API**
- **Notifications**:
- Reports status changes like `ORDER_CHANGE`
- **Reports**:
- GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE
- **Usage**: Automate order status synchronization across systems.
8. **Seller Fulfillment**
- **API**:
- **Merchant Fulfillment API**
- **Usage**: Facilitate direct shipping using the seller's own carrier.
- **SP-API SDK**: Utilizing the SDK in Python allows integration with various SP-
API endpoints.
- Common methods use HTTP actions like GET, POST, which adapt to each API segment:
- `get_order_report()`: Fetches order report data.
- `update_listing()`: Updates product information.
- **Authentication**: All requests must be authorized using the Amazon LWA (Login
with Amazon).
- **Rate Limits**: Understanding the limits on API calls is critical for smooth
integration.
- **Webhooks/Notifications**: The system allows developers to subscribe to changes
and updates in inventory, pricing, and listings.
- **Data Compliance**: Ensure compliance with Amazon's data protection policies and
acceptable use policy.
- **Versioning**: APIs may have multiple versions; always use the latest reference
to include up-to-date methods and data structures.
- **Error Handling**: Pay attention to API error responses and implement retry
logic for throttled requests.
Here’s a basic example of making a request to the Pricing API using Python:
```python
import requests
def get_product_pricing(sku):
"""Fetches product pricing for the given SKU."""
url =
f"https://sellingpartnerapi-na.amazon.com/products/pricing/v0/competitivePrice/
{sku}"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"x-amz-access-token": "YOUR_LWA_ACCESS_TOKEN",
"Host": "sellingpartnerapi-na.amazon.com"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
return response.json()
else:
raise Exception(f"Error fetching pricing data: {response.text}")
# Usage
sku = "example-sku"
pricing_info = get_product_pricing(sku)
print(pricing_info)
```
### Conclusion
2. **GET_FBA_SNS_FORECAST_DATA**
- **Description**: Provides forecast data to assist in inventory planning.
- **Usage**:
- Utilize this endpoint to obtain anticipated inventory needs based on sales
trends and other predictive metrics.
### Conclusion
This summary covers the essential aspects of interacting with the Amazon Selling
Partner API's Replenishment functionality. For practical implementation, ensure a
firm understanding of the authentication process, be vigilant regarding API rate
limits, and prepare for robust error handling in your application.
_____________________________
#### Overview
The Amazon Selling Partner API (SP-API) enables developers to integrate with Amazon
selling partner services to gather and post data relevant to a selling partner's
account. This document focuses on APIs and functionalities related to shipping and
fulfillment, particularly the **Buy Shipping** section for seller fulfillment.
---
#### API:
- **Shipping API**
#### Reports:
- None specified for this API.
#### API:
- None specified.
#### Reports:
- **Order Reports:**
- `GET_FLAT_FILE_ACTIONABLE_ORDER_DATA_SHIPPING`
- `GET_ORDER_REPORT_DATA_SHIPPING`
- `GET_FLAT_FILE_ORDER_REPORT_DATA_SHIPPING`
3. **Easy Ship**
- Manages and ships Amazon Easy Ship orders, suitable for designated
marketplaces.
#### API:
- **Easy Ship API**
#### Reports:
- `GET_EASYSHIP_DOCUMENTS`
- `GET_EASYSHIP_PICKEDUP`
- `GET_EASYSHIP_WAITING_FOR_PICKUP`
---
- **Rate Limits**: Developers should be aware of the usage limits on API calls to
avoid service interruptions.
- **Authorization**: Proper authorization is required for applications to access
the SP-API resources. Ensure that your app is properly registered and approved for
the required roles.
- **Data Accuracy**: It's critical to validate the accuracy of the shipping labels
and rate quotes returned by the API to avoid shipping issues.
---
Although the specific code samples are not present in the document, integration
might typically involve the following steps:
```python
import requests
# Usage
shipping_info = get_shipping_rates("YOUR_ORDER_ID")
```
---
This summary aims to provide developers a structured reference when working with
Amazon's SP-API related to shipping and fulfillment functionalities, specifically
focusing on buying shipping services and related automation processes.
_____________________________
## Purpose
The Selling Partner API (SP-API) provides functionalities that allow developers to
gather data from a customer's selling partner account and post data to the selling
account. This documentation focuses on integrating with the SP-API using Python.
headers = {
'Authorization': 'Bearer <access_token>',
'x-amz-access-token': '<access_token>',
'Content-Type': 'application/json'
}
response = requests.get('https://sellingpartnerapi-na.amazon.com/inventory/v1/
sku/<sku>/on_hand', headers=headers)
print(response.json())
```
- **Order Fulfillment**
```python
# Example: Get Order Details
order_id = '<order_id>'
response =
requests.get(f'https://sellingpartnerapi-na.amazon.com/orders/v0/orders/
{order_id}', headers=headers)
print(response.json())
```
### Notifications
Key notifications relevant when implementing SP-API are:
- `ORDER_CHANGE`: Updated order information
- `PRODUCT_TYPE_DEFINITIONS_CHANGE`: Changes in product types
For event notifications, you may subscribe to AWS SNS topics or similar mechanisms
depending on your application architecture.
## Key Concepts
1. **Client ID and Secret**: Required for authentication. Obtain these from the
Amazon Developer Console.
2. **Marketplace IDs**: Identify the marketplace for operations.
## Conclusion
This summary provides a foundational guide for developers looking to integrate with
the Amazon Selling Partner API using Python. For detailed implementation and
further exploration, refer to the full API documentation accessible through the
Amazon Developer Hub.
Ensure to keep up with any changes in API versions or usage policies by subscribing
to updates from Amazon.
_____________________________
### Overview
The Amazon Selling Partner API (SP-API) facilitates the integration of applications
with Amazon's services for sellers. The APIs in the Easy Ship section allow
developers to manage and ship orders through Amazon Easy Ship. These APIs and
methodologies can help sellers automate shipping processes and maintain order
management.
```python
import requests
def get_easy_ship_documents(seller_access_token):
url = "https://sellingpartnerapi-eu.amazon.com/easyship/v2022-03-23/documents"
headers = {
"Authorization": f"Bearer {seller_access_token}",
"Content-Type": "application/json"
}
if response.status_code == 200:
return response.json() # Process the JSON response
else:
return response.text # Handle errors appropriately
# Usage
# seller_access_token = 'your_token_here'
# documents = get_easy_ship_documents(seller_access_token)
# print(documents)
```
This summary serves as a quick reference guide for developers looking to integrate
Amazon's Easy Ship functionality into their applications using the SP-API.
_____________________________
## Overview
The Selling Partner API (SP-API) allows sellers to interact with Amazon’s services
via a set of APIs, notifications, and reports. This summary focuses on the Multi-
Channel Fulfillment Returns specific to SP-API.
### APIs
- **Fulfillment Outbound**
- Used to manage outbound shipments when fulfilling Multi-Channel Fulfillment
(MCF) orders using inventory in Amazon’s fulfillment network.
### Reports
1. **GET_XML_RETURNS_DATA_BY_RETURN_DATE**: Fetch returns data in XML format,
filtered by return date.
2. **GET_FLAT_FILE_RETURNS_DATA_BY_RETURN_DATE**: Retrieve returns data in a flat
file format, filtered by return date.
3. **GET_XML_MFN_PRIME_RETURNS_REPORT**: Obtain a report specifically for Prime
return requests.
4. **GET_CSV_MFN_PRIME_RETURNS_REPORT**: CSV format for Prime return requests.
5. **GET_XML_MFN_SKU_RETURN_ATTRIBUTES_REPORT**: Gather return attributes info for
specific SKUs in XML format.
6. **GET_FLAT_FILE_MFN_SKU_RETURN_ATTRIBUTES_REPORT**: Similar info as above, but
in a flat file format.
## Key Concepts
- **Multi-Channel Fulfillment (MCF)**: A service allowing businesses to outsource
order fulfillment to Amazon. Orders can be from various sales channels, but
fulfillment occurs through Amazon's logistics.
## Conclusion
The Amazon SP-API offers robust capabilities for sellers to manage their products
and returns effectively through various APIs and reports. Understanding the
structure and key functionalities outlined will help in utilizing the SP-API to its
full potential, especially in managing returns via the Multi-Channel Fulfillment
service. For additional code examples or in-depth API functionalities, refer to the
official Amazon SP-API documentation.
_____________________________
#### Overview
The Selling Partner API (SP-API) provides a set of APIs for sellers to manage their
Amazon selling accounts, retrieve data, and integrate with various applications.
---
1. **Finances API**
- **Endpoint:** `Finances`
- **Description:** Tracks finances and helps reconcile payments, or integrate
with accounting software.
- **Important Methods:**
- **GET V2 Settlement Report**
- **Contract:**
```http
GET /finances/v2/settlementReport
```
- **Parameters:** This call retrieves financial data regarding settlements.
2. **Reports API**
- **Description:** Provides access to various reports relevant to seller
finances.
- **Key Reports:**
- **GET V2 Settlement Report Data**
- **Contract:**
```http
GET /reports/v2/settlementData
```
- **Usage:** Developers can automate the retrieval of settlement reports to
ensure accurate financial tracking.
if response.status_code == 200:
print(response.json())
else:
print("Error:", response.status_code, response.text)
```
---
This summary provides the essential details for developers looking to implement
finance and settlement processes using the Amazon SP-API. Always refer to the
latest API documentation for updates and additional information.
_____________________________
The Selling Partner API (SP-API) enables developers to integrate seamlessly with
Amazon's selling services, allowing developers to gather data from a customer's
selling partner account and post data to the seller's account. Below is a
structured overview of key API use cases, functions, and concepts.
2. **Catalog Management**
- **APIs**: Catalog Items, Listings Items, Listings Restrictions, Product Type
Definitions
- **Notifications**:
- ITEM_PRODUCT_TYPE_CHANGE
- LISTINGS_ITEM_MFN_QUANTITY_CHANGE
- **Reports**:
- GET_MERCHANT_LISTINGS_ALL_DATA
- GET_MERCHANT_LISTINGS_DATA
4. **Inventory Management**
- **APIs**: Listings Items, Product Type Definitions
- **Reports**:
- GET_FLAT_FILE_OPEN_LISTINGS_DATA
- GET_MERCHANT_LISTINGS_DEFECT_DATA
5. **Order Management**
- **API**: Orders
- **Reports**:
- GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE
- Pending Orders Reports (JP Only)
6. **Sales Performance**
- **API**: Sales
- **Reports**: N/A
url = "https://sellingpartnerapi-na.amazon.com/listings/v2021-08-01/merchant-
listings-data"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
### Caveats
This concise summary should guide developers in understanding and utilizing the
Amazon SP-API for their selling partner needs.
_____________________________
### Overview
The Amazon Selling Partner API (SP-API) provides a set of RESTful APIs that allow
developers to integrate their applications with Amazon to manage seller accounts.
The SP-API encompasses various functionalities including Catalog Management, Order
Fulfillment, Inventory Management, and more.
6. **Tax Reporting**
- **Purpose**: Calculate and report sales taxes.
- **Reports**:
- `GET_ORDER_REPORT_DATA_TAX`
- `GET_FLAT_FILE_ORDER_REPORT_DATA_TAX`
7. **Retail Analytics**
- **Purpose**: Analyze profitability and product costs.
- **Reports**:
- `GET_SALES_AND_TRAFFIC_REPORT`
- **Notifications**:
- `REPORT_PROCESSING_FINISHED`
8. **Brand Analytics**
- **Purpose**: Provides insights for enhancing sales and customer loyalty.
- **Reports**:
- `GET_BRAND_ANALYTICS_SEARCH_TERMS_REPORT`
- **Notifications**: Events that trigger specific actions or updates within the SP-
API ecosystem. Developers can listen for these notifications to react accordingly.
- **Reports**: A mechanism to retrieve structured data periodically, which is
essential for analysis and business strategy adjustments.
- **Integrations**: Multiple APIs can work together; for example, inventory
management APIs can be combined with order fulfillment APIs to ensure product
availability aligns with customer orders.
- API Rate Limits: Be aware of the specified rate limits for API calls to avoid
service disruptions.
- Authorization: Ensure that proper permissions are granted to the SP-API
application for accessing vendor groups and other sensitive data.
- HTTPS Requirement: All API calls must be made over HTTPS for secure data
transmission.
```python
import requests
url = "https://sellingpartnerapi-na.amazon.com/catalog/v0/items"
headers = {
"x-amz-access-token": "<ACCESS_TOKEN>",
"Content-Type": "application/json",
}
### Conclusion
The SP-API offers comprehensive solutions for managing seller accounts on Amazon,
with various APIs suited for marketing, inventory management, order processing, and
analytics. Understanding the integrations between these components and adhering to
the specified guidelines will enable effective utilization of the SP-API.
Developers focusing on Python can leverage SDKs to simplify API calls and responses
in their applications.
_____________________________
---
2. **Catalog Management**
- **APIs**:
- **Catalog Items**
- **Listings Items**
- **Listings Restrictions**
- **Product Type Definitions**
- **Notifications (Events)**:
- ITEM_PRODUCT_TYPE_CHANGE
- LISTINGS_ITEM_STATUS_CHANGE
- etc.
- **Reports**: Various merchant listings reports for analysis.
3. **Pricing, Fees, and Promotions**
- **APIs**:
- Product Pricing
- Product Fees
- **Notifications (Events)**:
- PRICING_HEALTH
- FEE_PROMOTION
4. **Inventory Management**
- **APIs**: Listings Items, Product Type Definitions
- **Reports**: Include various merchant listings and inventory reports.
5. **Order Fulfillment**
- **APIs**: Merchant Fulfillment API
- **Usage**: Fulfill orders via Amazon or external sources.
6. **Order Management**
- **API**: Orders
- **Reports**: Various order tracking reports.
7. **Tax Reporting**
- **Reports**: Order Reports for tax compliance.
- **VAT Invoicing**: Generate tax invoices for EU regulations.
9. **Returns Management**
- **API**: N/A
- **Reports**: Information on returns by SKU.
---
- **Sellers API**
- **Purpose**: Retrieve and manage information about the Selling Partner account.
- **Notification**: ACCOUNT_STATUS_CHANGED.
- **Orders API**
- **Purpose**: Manage and track orders.
- **Important Reports**:
- GET_FLAT_FILE_ALL_ORDERS_DATA_BY_LAST_UPDATE_GENERAL
- GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL
---
- **API Limitations**: Be aware of usage plans and rate limits while making API
calls.
- **Data Protection Compliance**: Ensure adherence to Amazon's data policies and
regulations.
- **Authorization**: Properly authorize applications to access relevant vendor
groups and user accounts.
- **Error Handling**: Implement robust error-handling mechanisms to manage API
response failures.
---
- **Automating API Calls**: Python SDK tutorials are available for automating SP-
API calls, which will help you initiate and manage requests easily.
---
## Overview
The Amazon Selling Partner API (SP-API) provides a framework for managing seller
accounts, orders, inventory, and other related functionalities. It allows
developers to interact programmatically with Amazon's marketplace to gather data
and perform actions on behalf of selling partners.
## Important APIs
2. **Catalog Management**
- **APIs**:
- `Catalog Items`
- `Listings Items`
- `Listings Restrictions`
- `Product Type Definitions`
- **Notifications**:
- `ITEM_PRODUCT_TYPE_CHANGE`
- `LISTINGS_ITEM_MFN_QUANTITY_CHANGE`
- `LISTINGS_ITEM_STATUS_CHANGE`
- `REPORT_PROCESSING_FINISHED`
- **Reports**: Various listing data reports for merchants.
4. **Order Management**
- **APIs**: Orders API.
- **Notifications**:
- `ORDER_STATUS_CHANGE`
- `ORDER_CHANGE`
- **Reports**: Order tracking reports.
5. **Inventory Management**
- **APIs**:
- `Listings Items`
- `Product Type Definitions`
- **Reports**: Listings reports to manage inventories.
6. **Seller Performance**
- **APIs**: N/A
- **Reports**:
- `GET_SELLER_FEEDBACK_DATA`
- `GET_V1_SELLER_PERFORMANCE_REPORT`
## Conclusion
The SP-API facilitates comprehensive access to seller management functionalities,
enabling efficient operations for Amazon selling partners. Familiarize yourself
with these key APIs, reports, and best practices to maximize your application's
effectiveness on the platform. For further details, review specific API
documentation as necessary.
_____________________________
### Overview
The Selling Partner API (SP-API) enables developers to integrate with Amazon's
selling services, allowing them to gather data from a seller's account and post
information back. This includes various operations such as inventory management,
order fulfillment, and regulatory compliance reporting.
**Usage Example**:
```python
# Sample Python API request to retrieve monthly EPR reports
response = requests.get(
'https://sellingpartnerapi-na.amazon.com/reporting/v1/reports',
headers={
'x-amz-access-token': access_token,
'Content-Type': 'application/json'
},
params={'reportType': 'GET_EPR_MONTHLY_REPORTS'}
)
**Usage Example**:
```python
# Sample Python API call to get merchant listings data
response = requests.get(
'https://sellingpartnerapi-na.amazon.com/inventory/v1/merchants',
headers={
'x-amz-access-token': access_token
}
)
print(response.json())
```
### Conclusion
This summary extracts key APIs, their functionalities, and usage examples relevant
for developers looking to integrate with Amazon's Selling Partner API. Developers
should ensure proper authorization and consider reporting and compliance
requirements when using the API, especially concerning inventory and order
management functionalities.
_____________________________
- Ensure to handle API rate limits when making requests to avoid throttling. Each
endpoint can have different limits.
- Verify eligibility for each API call to reduce errors and improve efficiency.
- Read the documentation for specific endpoints carefully, as some require specific
header information or query parameters.
```python
import requests
if response.status_code == 200:
print("Eligibility Data:", response.json())
else:
print("Error:", response.status_code, response.json())
```
#### Conclusion
This documentation provided a concise overview of the main APIs related to
Fulfillment by Amazon (FBA) within the Selling Partner API. It included essential
functions, basic request structures, and key concepts to facilitate integration and
effective use of the SP-API. Always refer to the latest official documentation for
updates and detailed usage instructions.
_____________________________
#### Overview
The Amazon SP-API provides various APIs, notifications, and reports to assist
vendors in managing their direct fulfillment operations and marketing content. This
guide outlines essential APIs and their functionalities.
3. **Retail Analytics**
- **Reports**:
- GET_VENDOR_SALES_REPORT
- GET_VENDOR_NET_PURE_PRODUCT_MARGIN_REPORT
- GET_VENDOR_TRAFFIC_REPORT
- GET_VENDOR_FORECASTING_REPORT
- GET_VENDOR_INVENTORY_REPORT
- GET_VENDOR_REAL_TIME_SALES_REPORT
- GET_VENDOR_REAL_TIME_TRAFFIC_REPORT
- GET_VENDOR_REAL_TIME_INVENTORY_REPORT
4. **Brand Analytics**
- **Reports**:
- GET_BRAND_ANALYTICS_MARKET_BASKET_REPORT
- GET_BRAND_ANALYTICS_SEARCH_TERMS_REPORT
- GET_BRAND_ANALYTICS_REPEAT_PURCHASE_REPORT
5. **Performance Analytics**
- **Reports**:
- GET_PROMOTION_PERFORMANCE_REPORT
- GET_COUPON_PERFORMANCE_REPORT
6. **Catalog Management**
- **APIs**:
- Catalog Items
- Listing Items
- Product Type Definitions
- **Notifications**:
- LISTINGS_ITEM_ISSUES_CHANGE
- PRODUCT_TYPE_DEFINITIONS_CHANGE
- **Usage**: Manage Amazon catalog lists, optimize listings, and reduce errors.
### Conclusion
The SP-API offers a comprehensive suite of tools aimed at enhancing vendor
operations via systematic integration. Developers should leverage the provided APIs
and reports to maximize efficiency and capitalize on analytical insights for
decision-making.
_____________________________
## Overview
The SP-API supports vendors in managing their direct fulfillment operations and
marketing content programmatically. The APIs cover various functionalities such as
inventory management, order processing, marketing content management, and
analytics.
---
**Usage:**
These APIs help vendors in managing their direct fulfillment operations such as
tracking inventory levels, processing orders, and handling shipments.
---
**Description:**
This API allows vendors to enrich their product detail pages with rich marketing
content, including brand stories and product information.
---
## Retail Analytics
**Reports:**
1. **GET_VENDOR_SALES_REPORT**
2. **GET_VENDOR_NET_PURE_PRODUCT_MARGIN_REPORT**
3. **GET_VENDOR_TRAFFIC_REPORT**
4. **GET_VENDOR_FORECASTING_REPORT**
5. **GET_VENDOR_INVENTORY_REPORT**
6. **GET_VENDOR_REAL_TIME_SALES_REPORT**
7. **GET_VENDOR_REAL_TIME_TRAFFIC_REPORT**
8. **GET_VENDOR_REAL_TIME_INVENTORY_REPORT**
**Events:**
- **DETAIL_PAGE_TRAFFIC_EVENT**
- **ITEM_INVENTORY_EVENT_CHANGE**
- **ITEM_SALES_EVENT_CHANGE**
**Description:**
These resources allow vendors to analyze profitability and cost-per-product,
helping to direct business strategies effectively.
---
## Brand Analytics
**Reports:**
1. **GET_BRAND_ANALYTICS_MARKET_BASKET_REPORT**
2. **GET_BRAND_ANALYTICS_SEARCH_TERMS_REPORT**
3. **GET_BRAND_ANALYTICS_REPEAT_PURCHASE_REPORT**
**Description:**
These reports help vendors make data-driven decisions to increase sales and
customer loyalty.
---
## Performance
**Reports:**
1. **GET_PROMOTION_PERFORMANCE_REPORT**
2. **GET_COUPON_PERFORMANCE_REPORT**
**Description:**
These reports provide insights into the performance of coupons and promotions
offered by vendors.
---
## Catalog Management
**APIs:**
- **Catalog Items**
- **Listing Items**
- **Product Type Definitions**
**Events:**
- **LISTINGS_ITEM_ISSUES_CHANGE**
- **PRODUCT_TYPE_DEFINITIONS_CHANGE**
**Description:**
These tools assist vendors in managing Amazon listings, optimizing their catalogs,
and reducing errors in product listings.
---
**Description:**
This functionality allows vendors to manage their retail business operations
programmatically.
---
---
By utilizing these APIs, vendors can enhance their operations on the Amazon Selling
Partner platform, thus achieving better management and insights into their business
activities.
_____________________________
#### Overview
The Amazon Selling Partner API (SP-API) offers a set of APIs to help vendors manage
their operations programmatically. This documentation covers Vendor Direct
Fulfillment, Marketing Content Management, Retail Analytics, Brand Analytics,
Performance, Catalog Management, and Vendor Retail Procurement.
**Usage:** These APIs are used for managing the direct fulfillment program's
operations, allowing for programmatic interaction with Amazon's services.
**Usage:** APIs here are designed for enriching product pages with marketing
content.
**Notifications**:
- `DETAIL_PAGE_TRAFFIC_EVENT`
- `ITEM_INVENTORY_EVENT_CHANGE`
- `ITEM_SALES_EVENT_CHANGE`
#### Performance
**Reports**:
- `GET_PROMOTION_PERFORMANCE_REPORT`
- `GET_COUPON_PERFORMANCE_REPORT`
**Notifications**:
- `LISTINGS_ITEM_ISSUES_CHANGE`
- `PRODUCT_TYPE_DEFINITIONS_CHANGE`
This organized summary provides an accessible starting point for developers aiming
to implement the Amazon SP-API functionalities in their applications and manage
various vendor operations efficiently.
_____________________________
#### Overview
The SP-API provides a set of APIs to aid vendor management, marketing content
management, retail analytics, catalog management, and procurement operations. This
summary focuses on the relevant APIs and their key use cases, particularly for
managing data from the customer's selling partner account.
---
---
---
## Overview
The Amazon Selling Partner API (SP-API) provides integration for vendors to manage
their operations programmatically, analyze data, and enhance their marketing
efforts. Here, we outline the key APIs, notifications, and reports critical for
vendor use cases, particularly focusing on the **Retail Analytics** and **Brand
Analytics** sections.
- **APIs**:
- **Vendor Direct Fulfillment Inventory API v1**
- **Vendor Direct Fulfillment Orders API v2021-12-28**
- **Vendor Direct Fulfillment Shipping API v2021-12-28**
- **Vendor Direct Fulfillment Payments API v1**
- **Vendor Direct Fulfillment Transactions API v2021-12-28**
- **APIs**:
- **A+ Content**
- **Catalog Items**
- **Notifications**:
- `DETAIL_PAGE_TRAFFIC_EVENT`
- `ITEM_INVENTORY_EVENT_CHANGE`
- `ITEM_SALES_EVENT_CHANGE`
- **Reports**:
- `GET_VENDOR_SALES_REPORT`
- `GET_VENDOR_NET_PURE_PRODUCT_MARGIN_REPORT`
- `GET_VENDOR_TRAFFIC_REPORT`
- `GET_VENDOR_FORECASTING_REPORT`
- `GET_VENDOR_INVENTORY_REPORT`
- `GET_VENDOR_REAL_TIME_SALES_REPORT`
- `GET_VENDOR_REAL_TIME_TRAFFIC_REPORT`
- `GET_VENDOR_REAL_TIME_INVENTORY_REPORT`
- **Reports**:
- `GET_BRAND_ANALYTICS_MARKET_BASKET_REPORT`
- `GET_BRAND_ANALYTICS_SEARCH_TERMS_REPORT`
- `GET_BRAND_ANALYTICS_REPEAT_PURCHASE_REPORT`
### Performance
**Purpose**: Get performance data on coupons and promotions.
- **Reports**:
- `GET_PROMOTION_PERFORMANCE_REPORT`
- `GET_COUPON_PERFORMANCE_REPORT`
- **APIs**:
- **Catalog Items**
- **Listing Items**
- **Product Type Definitions**
- **Notifications**:
- `LISTINGS_ITEM_ISSUES_CHANGE`
- `PRODUCT_TYPE_DEFINITIONS_CHANGE`
- **APIs**:
- **Vendor Transaction Status**
- **Vendor Orders**
- **Vendor Shipments**
- **Vendor Invoices**
## Key Concepts
- **Notifications**: Events that trigger specific actions or alerts are crucial for
real-time data tracking and management.
- **Reports**: These provide analytical data to drive decision-making in sales and
inventory management.
## Important Notes
- Ensure you handle authorization properly when accessing the SP-API.
- Monitor API limits to avoid throttling and errors.
- Always validate the data returned from the API calls to ensure accuracy in your
applications.
- Regularly check for updates in the API documentation due to potential changes in
APIs or report structures.
This summary encapsulates the essential information required to leverage the Amazon
SP-API for vendor-related tasks, focusing on retail analytics and key operations.
For more detailed implementation, refer to the specific API documentation.
_____________________________
## Overview
The Amazon Selling Partner API (SP-API) allows developers to integrate with the
Amazon ecosystem to access and manage data related to their selling partner
accounts. It provides capabilities for retrieving and posting data to the seller’s
account using various API endpoints.
if response.status_code == 200:
return response.json() # return the report data
else:
raise Exception(f"Error: {response.status_code} - {response.text}")
# Usage
access_token = "YOUR_ACCESS_TOKEN_HERE"
report_data = fetch_brand_analytics_market_basket_report(access_token)
print(report_data)
```
This code snippet demonstrates a basic approach to extracting a report from the
Brand Analytics API endpoint using Python. Replace `YOUR_ACCESS_TOKEN_HERE` with a
valid token.
### Conclusion
This summary provides a clear understanding of the key functionalities available
through the SP-API for vendors and offers examples to facilitate integration.
Ensure to explore the respective documentation for each API to optimize your
implementation.
_____________________________
#### Overview
The Selling Partner API (SP-API) enables vendors to manage and analyze data related
to their Amazon selling partner accounts programmatically. The following use cases
outline the essential APIs, notifications, and reports relevant for vendor
operations.
3. **Retail Analytics**
- **Purpose**: Analyze profitability and cost-per-product to inform business
strategy.
- **Reports**:
- `GET_VENDOR_SALES_REPORT`
- `GET_VENDOR_NET_PURE_PRODUCT_MARGIN_REPORT`
- `GET_VENDOR_TRAFFIC_REPORT`
- `GET_VENDOR_FORECASTING_REPORT`
- `GET_VENDOR_INVENTORY_REPORT`
- `GET_VENDOR_REAL_TIME_SALES_REPORT`
- `GET_VENDOR_REAL_TIME_TRAFFIC_REPORT`
- `GET_VENDOR_REAL_TIME_INVENTORY_REPORT`
- **Notifications**:
- `DETAIL_PAGE_TRAFFIC_EVENT`
- `ITEM_INVENTORY_EVENT_CHANGE`
- `ITEM_SALES_EVENT_CHANGE`
4. **Brand Analytics**
- **Purpose**: Increase sales and customer loyalty through informed data-driven
decisions.
- **Reports**:
- `GET_BRAND_ANALYTICS_MARKET_BASKET_REPORT`
- `GET_BRAND_ANALYTICS_SEARCH_TERMS_REPORT`
- `GET_BRAND_ANALYTICS_REPEAT_PURCHASE_REPORT`
- **APIs**: None
5. **Performance**
- **Purpose**: Retrieve performance data related to coupons and promotions.
- **Reports**:
- `GET_PROMOTION_PERFORMANCE_REPORT`
- `GET_COUPON_PERFORMANCE_REPORT`
- **APIs**: None
6. **Catalog Management**
- **Purpose**: Manage Amazon listings, optimize catalogs, and reduce errors.
- **APIs**:
- `Catalog Items API`
- `Listings Items API`
- `Product Type Definitions API`
- **Notifications**:
- `LISTINGS_ITEM_ISSUES_CHANGE`
- `PRODUCT_TYPE_DEFINITIONS_CHANGE`
- **Reports**: None
### Conclusion
This summary encapsulates key vendor use cases, APIs, notifications, and reports
available through the SP-API. It is essential to follow documentation guidelines
and best practices provided in the specific API references for successful
integration and usage. Developers are advised to keep abreast of updates in API
releases to ensure compatibility and functionality.
The Amazon Selling Partner API (SP-API) offers various functionalities for managing
and gathering data from a customer's selling account. Below, I summarize the key
aspects from the available documentation regarding integration and usage focusing
on code snippets, API structures, and essential concepts.
To use SP-API effectively, here are some relevant APIs corresponding to the vendor
use cases along with their primary functions:
This summary provides a structured view of how to approach using the Amazon SP-API
focusing particularly on vendor use cases and catalog management. For more detailed
implementations, it is essential to refer to the specific API documentation linked
within the Amazon Developer Documentation.
_____________________________
---
---
- **Reports**: Specific reporting capabilities were not detailed for Vendor Retail
Procurement; consider utilizing other available report APIs for business insights.
---
While no explicit code samples were provided in the content, here are generic
examples to illustrate how interaction with the Vendor APIs would typically look in
Python:
---
- **Data Formatting**: Requests and responses are primarily in JSON format; ensure
correct formatting is adhered to as per API specifications.
---
- **No Notifications Available**: For Vendor Retail Procurement use cases, there
are currently no specific notifications available.
- **Python SDKs**: Use existing SDK tutorials for Python to streamline your API
integration process where applicable.
---
This structured summary should assist developers in effectively utilizing the SP-
API for Vendor Retail Procurement while providing an overview of essential
components and code snippets for practical implementation.
_____________________________
- **API Endpoints**: Examples include `GET /orders`, `POST /products`, etc. Each
endpoint allows specific operations like retrieving order details or updating
product listings.
# initial configuration
client = sp_api.SellingPartnerApi(
refresh_token='YOUR_REFRESH_TOKEN',
lwa_app_id='YOUR_LWA_APP_ID',
lwa_client_secret='YOUR_LWA_CLIENT_SECRET',
aws_access_key='YOUR_AWS_ACCESS_KEY',
aws_secret_key='YOUR_AWS_SECRET_KEY',
role_arn='YOUR_ROLE_ARN'
)
This structured summary provides essential information for understanding and using
the Amazon Selling Partner API effectively. Developers are encouraged to refer to
the official documentation for detailed API references, error codes, and additional
usage scenarios.
_____________________________
```python
import requests
# Example usage
endpoint = 'https://sellingpartnerapi-na.amazon.com/orders/v0/orders'
params = {'MarketplaceIds': 'ATVPDKIKX0DER'}
headers = {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
}
### Conclusion
The Selling Partner API provides a robust way to integrate with Amazon's selling
platform. This summary covers essential points for effective usage, focusing on
Python integration, authorization, error handling, and API usage limits. Developers
are encouraged to explore more detailed sections of the documentation for advanced
use cases and best practices.
_____________________________
This section provides the URLs to access Seller Central for different marketplaces.
These URLs are crucial for managing sales, orders, and inventory through the Seller
Central platform via the Selling Partner API (SP-API).
### Europe
- **Spain:** [https://sellercentral-europe.amazon.com](https://sellercentral-
europe.amazon.com)
- **United Kingdom:**
[https://sellercentral-europe.amazon.com](https://sellercentral-europe.amazon.com)
- **France:** [https://sellercentral-europe.amazon.com](https://sellercentral-
europe.amazon.com)
- **Netherlands:**
[https://sellercentral.amazon.nl](https://sellercentral.amazon.nl)
- **Germany:** [https://sellercentral-europe.amazon.com](https://sellercentral-
europe.amazon.com)
- **Italy:** [https://sellercentral-europe.amazon.com](https://sellercentral-
europe.amazon.com)
- **Sweden:** [https://sellercentral.amazon.se](https://sellercentral.amazon.se)
- **South Africa:**
[https://sellercentral.amazon.co.za](https://sellercentral.amazon.co.za)
- **Poland:** [https://sellercentral.amazon.pl](https://sellercentral.amazon.pl)
- **Egypt:** [https://sellercentral.amazon.eg](https://sellercentral.amazon.eg)
- **Turkey:**
[https://sellercentral.amazon.com.tr](https://sellercentral.amazon.com.tr)
- **Saudi Arabia:**
[https://sellercentral.amazon.sa](https://sellercentral.amazon.sa)
- **United Arab Emirates:**
[https://sellercentral.amazon.ae](https://sellercentral.amazon.ae)
- **India:** [https://sellercentral.amazon.in](https://sellercentral.amazon.in)
- **Belgium:**
[https://sellercentral.amazon.com.be](https://sellercentral.amazon.com.be)
## Conclusion
When working with the Amazon SP-API, proper use of these Seller Central URLs is
necessary for effective data management and interaction with the Amazon selling
platform. Always refer to the specific URLs aligned with your marketplace to ensure
seamless operations.
_____________________________
#### Overview
The Selling Partner API (SP-API) helps gather and post data to customers' selling
accounts through various endpoints designed specifically for vendors.
**North America:**
- **Canada:** [vendorcentral.amazon.ca](https://vendorcentral.amazon.ca)
- **United States:** [vendorcentral.amazon.com](https://vendorcentral.amazon.com)
- **Mexico:** [vendorcentral.amazon.com.mx](https://vendorcentral.amazon.com.mx)
- **Brazil:** [vendorcentral.amazon.com.br](https://vendorcentral.amazon.com.br)
**Europe:**
- **Spain:** [vendorcentral.amazon.es](https://vendorcentral.amazon.es)
- **United Kingdom:**
[vendorcentral.amazon.co.uk](https://vendorcentral.amazon.co.uk)
- **France:** [vendorcentral.amazon.fr](https://vendorcentral.amazon.fr)
- **Belgium:** [vendorcentral.amazon.com.be](https://vendorcentral.amazon.com.be)
- **Netherlands:** [vendorcentral.amazon.nl](https://vendorcentral.amazon.nl)
- **Germany:** [vendorcentral.amazon.de](https://vendorcentral.amazon.de)
- **Italy:** [vendorcentral.amazon.it](https://vendorcentral.amazon.it)
- **Sweden:** [vendorcentral.amazon.se](https://vendorcentral.amazon.se)
- **South Africa:**
[vendorcentral.amazon.co.za](https://vendorcentral.amazon.co.za)
- **Poland:** [vendorcentral.amazon.pl](https://vendorcentral.amazon.pl)
- **Egypt:** [vendorcentral.amazon.me](https://vendorcentral.amazon.me)
- **Saudi Arabia:** [vendorcentral.amazon.me](https://vendorcentral.amazon.me)
- **Turkey:** [vendorcentral.amazon.com.tr](https://vendorcentral.amazon.com.tr)
- **UAE:** [vendorcentral.amazon.me](https://vendorcentral.amazon.me)
- **India:** [vendorcentral.in](https://www.vendorcentral.in)
**Far East:**
- **Singapore:** [vendorcentral.amazon.com.sg](https://vendorcentral.amazon.com.sg)
- **Australia:** [vendorcentral.amazon.com.au](https://vendorcentral.amazon.com.au)
- **Japan:** [vendorcentral.amazon.co.jp](https://vendorcentral.amazon.co.jp)
This summary focuses on the main aspects needed by a developer utilizing the SP-API
related to vendor central. It provides the necessary URLs for each marketplace and
highlights the importance of correct usage based on the vendor's geographic market.
No specific code snippets or API functions were detailed as the primary content
revolved around vendor URLs.
_____________________________
**Overview:**
The Selling Partner Feeds API allows developers to submit various types of data for
processing. Each feedType value indicates the specific processing method for the
feed submitted.
**Key Points:**
- Each feed type is unique and designed for specific interactions with the SP-API,
providing flexibility for various use cases.
- **Retention Policy**: Feed result documents generated from all feed types are
retained for 28 days. This is important for compliance and auditing purposes but
requires users to manage and archive data accordingly.
**Important Notes:**
- Ensure to check for the **seller-only** restriction on several feed types, as not
all feed types will be available for all users or vendors.
- Proper error handling should be implemented as per SP-API best practices to
manage potential issues during API requests.
**Usage Considerations:**
- To implement feeds using this API, developers should familiarize themselves with
the structure, required fields, and data formats specific to each feed type.
- Make use of sample codes or API clients (e.g., Python SDK) to streamline
integration and reduce errors during implementation.
This summary provides insight into the Feed Type Values necessary for utilizing the
Selling Partner API effectively, focusing on practical implementation and relevant
considerations for developers.
_____________________________
#### Overview
The Selling Partner API (SP-API) allows public developers to build applications
that integrate with Amazon's selling platform. Public developers must follow
specific guidelines, register their applications, and ensure compliance with
Amazon’s policies.
#### Registration Process
1. **Eligibility**:
- Only Professional Selling Accounts can register for SP-API; individual
accounts are ineligible.
- You must be a primary account user to complete the registration.
4. **Review Process**:
- Applications will undergo a review based on the information provided, ensuring
compliance with Amazon’s Acceptable Use Policy and Data Protection Policy.
- Applications for Restricted (PII) Roles undergo a three-stage review process:
- **Stage 1**: Business criteria review.
- **Stage 2**: Information/security architecture questions.
- **Stage 3**: Security architecture review (includes a live meeting).
5. **Waiting Period**: Notifications will be sent to the admin email regarding the
status and any additional information required.
- **SP-API**: This handles both the retrieval and posting of data in the selling
partner’s account.
- **OAuth**: Authorization protocol used for public developers to allow sellers to
authorize their applications.
- **Public Developer**: A developer whose applications are available for use by
other sellers, requiring a public website.
- **Restricted Roles**: Certain API roles that require additional scrutiny and
justification due to the handling of sensitive data.
### Conclusion
#### Overview
To register as a Private Selling Partner API (SP-API) Developer, you must complete
the Developer Profile in Seller Central. This registration allows you to build
applications that integrate your company with Amazon Services APIs.
4. **Registration Confirmation**:
- Click **Register**.
- Await further communication from Amazon regarding the approval or additional
information requirements.
#### Caveats
- Registration is contingent on providing accurate information. Misleading or
incomplete entries could result in denial.
- Ensure that your use cases and security controls reflect actual practices to
maintain eligibility.
### Conclusion
This registration process lays the groundwork for using the SP-API to access and
manage data effectively. Adhering to the outlined steps and understanding the
critical elements should facilitate a smoother registration experience.
_____________________________
## Purpose
The Amazon SP-API allows developers to gather data from and post data to a
customer's selling account with various Amazon Services APIs. This summary outlines
the steps for registering as a private developer for the SP-API.
4. **Submit Registration**:
- Click **Register** to submit your profile.
5. **Post-Registration**:
- Await Amazon's evaluation and follow-up communication. If contacted for more
information, respond within five days to keep your case active.
## Important Notes
- If you have previous experience as an Amazon Marketplace Web Service developer,
you do not need separate Developer Profiles for each developer ID.
- Accurate and truthful completion of the Developer Profile is crucial for further
communication and approval.
This registration process is essential for accessing the Selling Partner API
features as a private developer and maintaining compliance with Amazon's security
measures.
_____________________________
### Overview
Private SP-API Developers create applications that integrate solely with their own
company's Amazon Services APIs. Only Professional Selling Accounts can register;
Individual accounts are ineligible. Registration must be completed by a primary
account user.
4. **Wait for Case Updates**: Notifications will be sent to the registered admin's
email. Respond to requests for additional information within five days to avoid
case closure.
> Developers should ensure all fields in the Developer Profile are filled out
truthfully and accurately to improve their chances of access approval.
_____________________________
#### Overview
The Selling Partner API (SP-API) allows developers to create applications that can
gather and post data to a customer's selling account. The process for registering
as a private vendor developer involves completing a Developer Profile on Vendor
Central.
3. **Await Feedback**:
- Amazon will evaluate the submitted information, which might require additional
documentation or information. Case updates will be communicated via the email
associated with the account.
#### Overview
To register as a private vendor for the SP-API, follow the instructions to complete
your Developer Profile. This profile collects essential information regarding your
organization, including contact details, data access requirements, and security
compliance with Amazon's policies.
- **Data Protection and Compliance**: Your eligibility for the Selling Partner API
is influenced by how well you comply with Amazon's Acceptable Use Policy and Data
Protection Policy. Security and data protection are prioritized in the review
process.
- **Roles**: Specific permissions that govern what your application can access
within the API. Understanding the roles available can help tailor your
application’s functionality while remaining compliant with Amazon’s policies.
#### Overview
To register as a Private SP-API Vendor, your application must be self-authorized
and intended for use solely within your organization. This process involves
completing a Developer Profile that collects essential information about your
organization, data requirements, and security compliance.
### Conclusion
This registration process is essential for developers looking to integrate their
services with Amazon’s platforms while ensuring that security and compliance with
Amazon’s policies are upheld. Following these guidelines will facilitate a smooth
registration experience.
_____________________________
## Overview
To register as a Private Selling Partner API (SP-API) Vendor, you need to complete
the Developer Profile that collects essential information regarding your
organization and the data you require from Amazon Services APIs. Private vendor
applications are self-authorized and are intended for internal use or by third-
party developers on behalf of your organization.
2. **Access API Integration**: From the Integration menu, select "API Integration".
## Important Notes
- **Authorization Limits**: Private vendor developers can authorize other vendor
groups if they have admin permissions on both accounts, capped at a maximum number.
For additional authorization, either remove existing authorizations or contact
Vendor Central Support.
- **Review Process**: The decision for granting access hinges on alignment with the
Acceptable Use Policy and Data Protection Policy. Incomplete or delayed responses
can lead to unresolved cases.
- **Restrictions on Direct Fulfillment**: Additional roles with restricted access
may apply if you're integrating Direct Fulfillment services. Be sure to refer to
the documentation for restricted data handling.
## Additional Resources
- **Documentation**: Consult the SP-API Registration overview for detailed
recommendations.
- **Terminology and Roles**: Refer to the definitions of developer types and roles
to understand your application's potential capabilities and limitations.
- **Policies**: Familiarize yourself with Amazon's Acceptable Use Policy and Data
Protection Policy to ensure compliance.
#### Overview
The Amazon Selling Partner API (SP-API) allows vendors to integrate their
applications with Amazon services, facilitating data access and updates for their
selling accounts. This document focuses on the registration process to become a
Private SP-API Vendor.
- **Private Vendor Applications**: These are applications used solely within your
organization and are self-authorized. Commonly, they are developed using in-house
IT resources or by a third-party agency for the vendor.
- **Developer Profile**: This profile collects necessary information such as
contact details, data access requirements, security measures, and agreement
compliance with Amazon policies.
2. **Sign In**:
- Use credentials for the Vendor Central account associated with the required
vendor group.
3. **API Integration**:
- From the Integration menu, select "API Integration."
- Choose to either proceed to the Developer Profile if you haven’t completed it,
or to view an existing profile.
- The approval or denial of API access is based primarily on the Developer Profile
information provided, specifically functionality compliance with Amazon’s
Acceptable Use Policy and Data Protection Policy.
- Vendors may grant authorization to other vendor groups, but there’s a limit on
the number of authorizations possible without remedial action such as removing an
existing authorization or contacting Vendor Central Support to increase limits.
- Communication regarding the application process will be directed to the admin
email associated with the Vendor account.
#### Conclusion
Understanding the registration process and correctly filling out the Developer
Profile is essential for gaining access to the SP-API for Private Vendors. Ensure
that all provided information is truthful and comprehensive to facilitate smooth
approval.
For more details, refer to the Amazon Services API Developer Agreement and related
policies.
_____________________________
**Types of Applications:**
1. **Public and Private Seller Applications:**
- Applications available to the public or self-authorized by a seller.
---
---
---
For developers interested in programming with the Amazon Selling Partner API (SP-
API) in Python, please ensure all required dependencies and setup procedures of the
specific APIs you wish to use are followed as per respective API documentation.
### Conclusion
This guide provides the necessary steps for developers to check their registration
status with Amazon SP-API effectively, along with defining the types of
applications that may be involved in the process. For further development
questions, refer to the comprehensive SP-API documentation available on Amazon’s
Developer Hub.
_____________________________
## Overview
The Amazon SP-API enables developers to integrate and interact with the Selling
Partner ecosystem, allowing for data gathering and posting to a customer's selling
account.
## Application Types
1. **Public Applications:** Available for authorization by sellers or vendors.
2. **Private Seller Applications:** Available only to the developer's organization
and self-authorized.
3. **Private Vendor Applications:** Available only to the developer's organization
and self-authorized.
## Registration Steps
## Key Concepts
- **Authorization Limits:** Understand the limitations and requirements for API
access when developing applications.
- **Seller Central vs. Vendor Central:** Be aware of the differences in
registration depending on the type of partnership (seller vs. vendor).
## Conclusion
This documentation outlines how to register applications for the Amazon SP-API
effectively, emphasizing the distinctions between application types and the
necessary steps for registration. Proper awareness of authorizations and roles is
crucial to ensure successful integration with the Selling Partner ecosystem.
_____________________________
#### Overview
This documentation provides guidance on how to update application information
within the Amazon Selling Partner API (SP-API) after registering your application.
There are different procedures for private vendor applications and all other types
of applications.
2. **For All Other Applications** (including public applications and private seller
applications):
- Sign in to **Seller Central** using your developer credentials.
- Go to **Develop Apps**.
- On the **Developer Central** page, locate the application to be updated and
click **Edit app**.
- On the **App registration page**, change the required values and click **Save
and exit**.
#### Conclusion
This guide focuses on updating application information in the Amazon SP-API,
including specific instructions for different application types, along with some
critical notes to ensure seamless updates. For detailed references regarding
authorization or error handling, users should review the general SP-API
documentation.
**Objective:**
Guide to update application information for Amazon Selling Partner API (SP-API)
applications.
---
---
- The steps for updating differ between private vendor applications and other
applications, which is crucial to follow based on the type of application being
used.
- Additional knowledge of terminology may be beneficial for understanding the
context and terms involved in the application process.
---
- [Amazon SP-API
Documentation](https://developer-docs.amazon.com/sp-api/docs/updating-your-
application-information#update-your-application-information)
This summary serves as a quick reference guide for developers looking to update
their application information in the Amazon Selling Partner API environment,
ensuring clarity and a streamlined process tailored for application types.
_____________________________
This page provides guidance on how to update application information for Amazon
Selling Partner API (SP-API) applications, specifically focusing on two types:
private vendor applications and other applications (public or private seller
applications).
### Notes
- It is important to have the correct credentials for signing into either Seller
Central or Vendor Central depending on your application type.
- Updating the application information can include adding or modifying URIs and
other data critical to the operation of your application within the Amazon
ecosystem.
- Changes can affect authorization and functionality, so ensure to keep credentials
and application settings secure.
This curated information should assist in navigating the update process while
ensuring compliance with the relevant policies outlined by Amazon for SP-API
applications.
_____________________________
#### Overview
This document outlines the steps required to update application information for
Amazon's Selling Partner API (SP-API) after registration. There are different
procedures for private vendor applications and other types of applications.
This summary serves as a consolidated guide for developers looking to manage their
Amazon SP-API application information effectively.
_____________________________
## Key Concepts
**Important Notes:**
- After generating a new LWA client secret, update it in your application
immediately. The old credentials will expire seven days after generating new ones.
- Refresh tokens do not need to be recreated, as they remain tied to the LWA client
identifier.
- Continuing to use old credentials after their expiration can result in:
```json
{
"error_description": "Client authentication failed",
"error": "invalid_client"
}
```
Follow the procedure to update to the new credentials.
## Important Notes/Caveats
- **No Impact on End Users**: Rotating credentials does not require end users to
re-authorize applications.
- **Timeliness**: Ensure that the rotation occurs before the expiration date to
maintain uninterrupted access to SP-API.
- **Security**: Regularly rotating credentials enhances application security and
limits risk exposure.
For further assistance, consult the SP-API Developer Support or access the specific
sections related to rotating LWA credentials in the API documentation.
_____________________________
#### Overview
This documentation outlines how to view your application information and
credentials for the Selling Partner API (SP-API). Two types of applications are
discussed: private seller applications and public applications, as well as private
vendor applications.
This guide provides essential insights for developers who need to manage and
operate their applications using the Amazon Selling Partner API. For further
assistance, please refer to relevant sections regarding authorization and API
usage.
_____________________________
Summary of URL: https://developer-docs.amazon.com/sp-api/docs/viewing-your-
application-information-and-credentials#to-view-your-application-information-and-
credentials-for-private-seller-applications-and-for-public-applications-for-any-
type-of-selling-partner:
### Amazon Selling Partner API (SP-API) - Application Information and Credentials
Overview
This document provides information on how to view your application information and
credentials related to the Amazon Selling Partner API (SP-API). The SP-API allows
developers to manage and access vendor and seller data through various APIs.
1. **Application Types**:
- **Public Applications**: These are available to any seller or vendor,
authorized by the respective party.
- **Private Seller Applications**: These applications are restricted to your
organization and are self-authorized.
- **Private Vendor Applications**: Similar to private seller applications, but
specifically for vendors.
- **Login with Amazon (LWA) Credentials**: These are necessary to request LWA
access tokens required to perform API operations.
### Conclusion
Understanding the structure of the SP-API and the viewing of application
credentials is critical for effectively utilizing the APIs offered by Amazon. The
documentation provides the necessary procedures and precautions to help developers
successfully integrate with the Selling Partner API.
For further details or specific API implementations, developers should refer to the
full documentation available at the provided URL.
_____________________________
2. **Product Listing**:
- **Description**: Manage product listings and catalog-related operations.
- **Example Operations**:
- `getCatalogItem`: Retrieves item information based on attributes.
- `createReport`: Requests reports like `GET_MERCHANT_LISTINGS_INACTIVE_DATA`.
3. **Pricing**:
- **Description**: Determine list prices and automate pricing strategies.
- **Example Operations**:
- `createFeed`: Submit pricing-related feeds, such as `RFQ_UPLOAD_FEED`.
- `getPricing`: Returns pricing information for seller offers.
4. **Amazon Fulfillment**:
- **Description**: Manage shipping related to Fulfillment by Amazon (FBA).
- **Example Operations**:
- `createReport`: Request estimates of FBA fees
(`GET_FBA_ESTIMATED_FBA_FEES_TXT_DATA`).
5. **Buyer Communication**:
- **Description**: Manage communications with buyers.
- **Example Operations**:
- `getMessagingActionsForOrder`: Lists message types for a specified order.
### Conclusion
Understanding and correctly implementing roles within the Selling Partner API is
crucial for managing permissions effectively while ensuring compliance with
Amazon's security protocols. Always refer to specific role documentation for a
comprehensive list of associated operations and their implications.
_____________________________
1. **Authorization Model**:
- The Selling Partner API (SP-API) authorization is based on **Login with
Amazon**, which implements **OAuth 2.0**.
- Applications interact with Amazon's pages and your website to authorize access
to the SP-API.
2. **Application Types**:
- **Public Applications for Sellers**: Authorized by sellers using:
- **Selling Partner Appstore Authorization Workflow**
- **Website Authorization Workflow**
- **Public Applications for Vendors**: Authorized by vendors using the **Website
Authorization Workflow**.
- **Private Applications**: Available only within your organization, authorized
using **Self Authorization**.
3. **Grantless Operations**:
- These operations can be called without explicit authorization from a selling
partner.
2. **Regional Authorizations**:
- Construct OAuth authorization URIs specific to the marketplace (e.g.,
**Mexico**):
```plaintext
https://sellercentral.amazon.com.mx/apps/authorize/consent?
application_id=amzn1.sellerapps.app.0bf296b5-36a6-4942-a13e-EXAMPLEfcd28
```
- Ensure you have the correct **Marketplace URL** for the specific region when
creating authorization URIs.
- Use the **GetMarketplaceParticipations API** to find active marketplaces for a
selling partner.
- For public applications, the authorization workflow is crucial to allow
applications to make calls to the SP-API.
Here is an example snippet for constructing the OAuth URI for authorization:
```python
def construct_oauth_uri(seller_central_url, application_id):
return f"{seller_central_url}/apps/authorize/consent?
application_id={application_id}"
- **Authorization Model**: The Selling Partner API (SP-API) uses OAuth 2.0 via
Login with Amazon to authorize applications. This involves user interactions
through Amazon's consent pages and your own website.
- **Application Types**:
1. **Public Applications for Sellers**: Authorized through:
- Selling Partner Appstore authorization workflow.
- Website authorization workflow (via your own website).
OAuth authorization URIs are essential for redirecting users to the Amazon consent
page to grant permissions for your SP-API application.
- Example:
```plaintext
https://sellercentral-europe.amazon.com/apps/authorize/consent?
application_id=amzn1.sellerapps.app.0bf296b5-36a6-4942-a13e-
EXAMPLEfcd28&version=beta
```
1. **Authorization Model**:
- The Selling Partner API (SP-API) authorization is implemented using OAuth 2.0
through Amazon's "Login with Amazon." Applications must handle interactions with
Amazon's pages and redirect browsers to authorize.
- Applications can be classified as **public** or **private**:
- **Public Applications**: Available to all sellers or vendors; they can be
authorized using either Selling Partner Appstore or website authorization
workflows.
- **Private Applications**: Only available to a specific organization,
authorized through self-authorization.
- **Regional Considerations**:
- Authorizations are regional. Make sure to construct URIs for specific regions
based on the seller's account.
- For example, for a seller in Mexico:
```
https://sellercentral.amazon.com.mx/apps/authorize/consent?
application_id=amzn1.sellerapps.app.0bf296b5-36a6-4942-a13e-EXAMPLEfcd28
```
- **Grantless Operations**:
- Grantless operations can be called without explicit authorization from a
selling partner.
- No specific code snippets or API fields were provided in the content, as the
documentation primarily described processes and URI structures without detailed
code examples.
### Conclusion
This summary provides essential insights into the authorization process for the
Selling Partner API applications, including how to construct OAuth authorization
URIs for both seller and vendor applications, along with important considerations
for testing and regional authorization. Developers should ensure they understand
the differences in application types and the implications of authorization flows
when integrating with the SP-API.
_____________________________
2. **Application Types**:
- **Public Applications for Sellers**: Can be authorized via the **Selling
Partner Appstore authorization workflow** or the **Website authorization
workflow**.
- **Public Applications for Vendors**: Authorized using the **Website
authorization workflow**.
- **Private Applications**: Restricted to a single organization and can self-
authorize.
- **Get Seller Central URL**: Obtain the Seller Central URL for the corresponding
marketplace. Example: `https://sellercentral.amazon.com`
- **Get Vendor Central URL**: Obtain the Vendor Central URL for the marketplace.
Example: `https://vendorcentral.amazon.com`
- All public and private seller applications need to be grouped correctly when
constructing the OAuth URI.
- Ensure correct handling of parameters during redirects between your application
and Amazon's OAuth endpoints.
- Utilize the **GetMarketplaceParticipations API** to discover active marketplaces
for a selling partner before constructing the OAuth authorization URI.
By understanding these models and correctly constructing OAuth URIs, developers can
effectively integrate with the Amazon SP-API and manage permissions for accessing
seller and vendor data.
_____________________________
## Key Concepts
- The **Selling Partner API (SP-API)** utilizes the **OAuth 2.0** authorization
framework through **Login with Amazon**.
- Applications can be categorized as **public** (accessible to all) or **private**
(limited to a specific organization).
- Different **authorization workflows** are applicable based on the type of
application:
- **Public applications for sellers** - Can be authorized via Selling Partner
Appstore or website authorization workflows.
- **Public applications for vendors** - Authorized via website authorization
workflow.
- **Private applications** - Authorized via self-authorization for either sellers
or vendors.
- **Grantless operations** can be performed without explicit authorization from a
selling partner.
## Important Notes
- Ensure that your application is capable of securely processing the parameters
passed by Amazon during OAuth interactions.
- Understanding the regional requirements for authorizations is critical for
managing accounts across multiple marketplaces.
- Familiarize yourself with the **GetMarketplaceParticipations API** for
discovering active marketplaces associated with a selling partner's account.
### Overview
The Amazon Selling Partner API (SP-API) enables developers to interact with
Amazon's selling partner data. This guide discusses authorization limits associated
with public and private applications.
1. **Types of Applications**:
- **Private Developer Applications**: Restricted to your organization with
**self-authorization** only. Limited to **10 self-authorizations**.
- **Public Developer Applications for Sellers**: Available for external
authorization by sellers, requiring OAuth. Initially limited to **25 OAuths** when
unlisted; unlimited when listed on the Selling Partner Appstore.
- **Public Developer Applications for Vendors**: Publicly authorized by vendors
without OAuth limits. Has a **default of 10 self-authorizations** for internal
testing.
2. **Authorization Workflows**:
- **Self-Authorization**: Used primarily for private applications and testing.
- **OAuth Authorization**: Requires seller or vendor authorization via the
Selling Partner Appstore or website authorization workflow.
3. **Authorization Limits**:
- The maximum number of authorizations is strictly enforced. If the limit is
reached, additional authorizations cannot be added without removing existing ones.
**Key Concepts:**
1. **Application Types:**
- **Private Developer Applications:**
- Limited to self-authorization.
- Maximum of 10 self-authorizations.
- **Public Developer Applications for Sellers:**
- Available publicly; authorized by sellers.
- Default limit of 25 OAuths when unlisted.
- Unlimited authorizations when listed on the Selling Partner Appstore.
- **Public Developer Applications for Vendors:**
- Available publicly; authorized by vendors.
- Unlimited vendor OAuths.
- Default max of 10 self-authorizations for internal testing.
2. **Authorization Workflows:**
- Private applications rely on internal resources; no OAuth required.
- Public applications must use OAuth via the Selling Partner Appstore or website
authorization workflow.
**Important Notes:**
- **Warning for Reaching Limits:** Developers will receive a warning if their
application's authorization usage approaches the limit.
- Once an application reaches the maximum authorization limit, no new
authorizations can be added unless existing ones are removed.
- Review current authorizations before trying to add new ones if limits are close.
```python
# Example pseudocode to demonstrate OAuth authorization
import requests
- **Application Types**:
1. **Private Developer Applications**:
- **Restrictions**: Only available to your organization.
- **Self-Authorization Limit**: 10 self-authorizations.
- After reaching the limit, you must update to public or revoke existing self-
authorizations.
Developers can monitor authorization limits and usage by visiting the respective
sections in Seller Central and Vendor Central:
- **Seller Central**:
- Sign in with developer credentials.
- Navigate to Develop Apps → Authorizations remaining → View.
- **Vendor Central**:
- Sign in with your developer registration credentials.
- Go to Integration → API Integration → Authorizations remaining → View.
```python
# Example of OAuth flow for authorization
import requests
# Usage
token_data = get_oauth_token('<CLIENT_ID>', '<CLIENT_SECRET>', '<REDIRECT_URI>')
print(token_data)
```
### Overview
This documentation covers the authorization limits for public and private
applications in the Amazon Selling Partner API (SP-API). It is essential for
developers to understand these limits to effectively manage their application's
authorizations.
- **For Vendors**:
- **Authorized for**: Other organizations.
- **Self-Authorization Limit**: 10 for internal testing.
- **OAuth Limit**: Unlimited.
### Conclusion
Understanding the authorization limits is crucial for effectively working with the
Amazon SP-API. Developers must keep track of OAuth and self-authorization usage to
ensure seamless operation of their applications in the Seller and Vendor Central
environments.
_____________________________
## Key Concepts
1. **Application Types**:
- **Private Developer Applications**: Available only within your organization
with a limit of **10 self-authorizations**.
- **Public Developer Applications for Sellers**: Available to other
organizations with a limit of **25 OAuths** when unlisted, and **unlimited** once
listed on the Selling Partner Appstore.
- **Public Developer Applications for Vendors**: Publicly available with
**unlimited vendor OAuths** and a default of **10 self-authorizations** for
testing.
2. **Authentication Mechanisms**:
- Self-authorization is restricted to private applications.
- OAuth is required for all public applications (both for sellers and vendors).
## Best Practices
- Always monitor the authorization limits to ensure consistent application
functionality and avoid service disruptions.
- Utilize the view limit features in both Seller and Vendor Central to manage
authorizations efficiently.
## Conclusion
Understand and manage your application's authorization limits according to the
Selling Partner type you are working with. Familiarity with OAuth requirements and
handling self-authorizations will aid in effective integration with the Selling
Partner API. Be proactive in monitoring your application's limits to ensure smooth
operation.
_____________________________
## Overview
This documentation explains how to revoke self-authorizations from applications
developed for Amazon's Selling Partner API (SP-API). It covers the steps necessary
for both public and private seller applications, as well as for private vendor
applications.
## Key Concepts
## Removing Self-Authorizations
## Important Notes
- If your application has a significant number of authorizations (OAuths and self-
authorizations), you may need to contact the **SP-API Developer Support team** for
assistance with removing self-authorizations.
- Make sure to have the relevant **Application ID** and appropriate authorizations
ready when seeking support:
- For sellers: **Merchant Customer ID**
- For vendors: **Vendor Group ID**
## Support
For additional assistance, reach out to the SP-API Developer Support team.
#### Overview
The document provides guidelines on how to revoke self-authorizations from seller
and vendor applications using the Amazon Selling Partner API (SP-API). There are
different procedures for public/seller applications and private vendor
applications.
### Caveats
- Ensure you are signed in with the correct credentials for either Seller Central
or Vendor Central, as the procedures vary slightly between the two platforms.
- Revocations are permanent and should be handled cautiously to avoid disrupting
access to necessary data.
For any further issues or complications, contacting the SP-API Developer Support
team is recommended.
The Selling Partner API (SP-API) provides methods to revoke self-authorizations for
applications. This is essential for maintaining control over the access your
application has to seller and vendor accounts.
#### Conclusion
Make sure to regularly check the SP-API documentation for any updates related to
revoking authorizations and best practices.
_____________________________
## Overview
The authorization process for integrating with the Amazon Selling Partner API (SP-
API) may lead to various errors. Understanding these errors and their resolutions
is crucial for developers to effectively troubleshoot issues in their applications.
This document covers common error codes, error messages, and guidance to resolve
them.
This summary provides crucial insights into handling authorization errors within
the Amazon Selling Partner API, ensuring developers can effectively troubleshoot
and maintain their integration projects.
_____________________________
## Overview
This document addresses common error codes and messages encountered during the
application authorization process for the Amazon Selling Partner API (SP-API).
Proper authorization is vital for integrating with the SP-API, and understanding
these errors will help developers troubleshoot effectively.
## Important Concepts
- **Credential should be scoped to a valid region**: Ensure your AWS Region in the
credentials matches the endpoint region.
## Important Notes
- Always ensure that application settings in Seller Central are up-to-date and
reflective of the expected configurations.
- For restricted roles, ensure permissions are requested and the Developer Profile
is updated accordingly.
- Thoroughly test OAuth workflow during application development to preemptively
identify and address authorization errors.
- For detailed guidance on error handling and API integrations, refer to the [SP-
API Errors FAQ](https://developer-docs.amazon.com/sp-api/docs/sp-api-errors-faq).
**Overview:**
The Selling Partner API (SP-API) requires application authorization for
integration. During this process, various errors can occur, which can hinder
successful interaction with the API.
---
1. **MD1000**
- **Cause:** Application is in draft state.
- **Resolution:** Add `version=beta` to the OAuth Authorization URI:
```
https://sellercentral.amazon.com/apps/authorize/consent?
application_id=appidexample&state=stateexample&version=beta
```
- **Note:** Remove `version=beta` after the application is published.
2. **MD5101**
- **Cause:** Mismatch of redirect URL.
- **Resolution:** Verify that the redirect URL matches the one registered in
Seller Central. Update as necessary.
3. **MD5110**
- **Cause:** Redirect URL contains fragments.
- **Resolution:** Ensure the redirect URL is syntactically valid and free of
fragment characters (`#`).
4. **MD9010**
- **Cause:** No valid MWS developer ID associated with the authorization region.
- **Resolution:** Confirm app status and MWS developer ID validity for the
region.
5. **MD9100**
- **Cause:** Missing Login URI and Redirect URI.
- **Resolution:** Update these details in Seller Central.
6. **500**
- **Cause:** Incorrect header configuration.
- **Resolution:** Ensure `Content-Type` is `application/x-www-form-urlencoded`
and parameters are in the body, not query parameters.
---
4. **MissingAuthenticationToken**
- Ensure requests are signed using valid AWS access keys.
---
---
This concise summary encapsulates the critical components from the authorization
errors page to assist developers in resolving common issues they'd face during the
integration of Amazon's SP-API.
_____________________________
Summary of URL: https://developer-docs.amazon.com/sp-api/docs/authorization-
errors#error-messages:
### Summary of Authorization Errors in Amazon Selling Partner API (SP-API)
#### Overview
This documentation covers common authorization errors that developers might
encounter when integrating with the Amazon Selling Partner API. It provides error
codes, messages, and troubleshooting steps to help resolve these issues.
1. **MD1000**:
- **Cause**: Application is in draft state during OAuth workflow.
- **Resolution**: Add `version=beta` parameter to OAuth Authorization URI.
```plaintext
https://sellercentral.amazon.com/apps/authorize/consent?
application_id=appidexample&state=stateexample&version=beta
```
- Once published, remove the `version=beta` parameter.
2. **MD5101**:
- **Cause**: Mismatch in redirect URL during OAuth.
- **Resolution**: Verify that the redirect URL in Seller Central matches the one
used.
- Check in Seller Central under Apps and Services → Develop Apps.
3. **MD5110**:
- **Cause**: Redirect URL contains fragments.
- **Resolution**: Ensure redirect URL is properly formed without fragment
characters (#).
4. **MD9010**:
- **Cause**: No MWS developer ID associated with the region.
- **Resolution**: Check if the app is published and has a valid MWS developer
ID.
5. **MD9100**:
- **Cause**: Missing Login URI and Redirect URI in SP-API application.
- **Resolution**: Update Login URI and Redirect URI in Seller Central.
6. **500**:
- **Cause**: Header errors.
- **Resolution**: Ensure Content-Type header is set to `application/x-www-form-
urlencoded`.
- **Credential should be scoped to a valid region**: Make sure AWS Region matches
the endpoint.
- **Access to requested resource is denied**: This could indicate unauthorized
errors or missing tokens.
- **Unauthorized (Status Code 403)**:
- **Possible Causes**:
- Account status: Ensure seller account is healthy.
- Region mismatch: Verify seller account and request endpoint are in the same
region.
- API access: Ensure the application has permissions for the API operation.
- Missing SP-API Role: Validate that the necessary roles are assigned in the
Developer Profile.
### Conclusion
This summary provides essential information about handling authorization errors
when using the Amazon Sp API. Developers should familiarize themselves with error
codes, messages, and resolutions to ensure a smooth integration process. For
further guidance, refer to the SP-API Errors FAQ and proper resources for OAuth and
AWS Signature processing.
_____________________________
## Overview
The Selling Partner API (SP-API) allows developers to connect and interact with
Amazon's Selling Partner accounts. This documentation provides the necessary steps
for connecting to the SP-API, including obtaining access tokens, constructing API
URIs, and adding required headers.
grant_type=refresh_token
&refresh_token=Aztr|...
&client_id=foodev
&client_secret=Y76SDl2F
```
**Response Example:**
```json
{
"access_token": "Atza|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSREXAMPLE",
"token_type": "bearer",
"expires_in": 3600,
"refresh_token": "Atzr|IQEBLzAtAhRPpMJxdwVz2Nn6f2y-tpJX2DeXEXAMPLE"
}
```
This summary provides the core elements required for developers to connect and
interact with the Selling Partner API effectively.
_____________________________
#### Overview
The Selling Partner API (SP-API) allows applications to interact with Amazon's
Selling Partner ecosystem, enabling sellers to gather data and manage their selling
accounts. This summary provides instructions for connecting to the SP-API, focusing
on authorization and making requests.
---
- **Token Expiration:** The LWA access token expires one hour after issuance.
- **Usage of Tokens:**
- Use the **LWA access token** for most calls.
- Use a **Restricted Data Token (RDT)** for operations that return Personally
Identifiable Information (PII).
- **Request Structure:** Make a secure HTTP POST to the LWA authentication server.
**Endpoint:**
```
https://api.amazon.com/auth/o2/token
```
- **Required Parameters:**
- `grant_type`:
- `refresh_token` for operations requiring authorization.
- `client_credentials` for grantless operations.
- `refresh_token`: The LWA refresh token received after authorization for
operations needing selling partner authorization.
- `scope`: The scope of the LWA authorization grant (optional, based on the
grant type).
- `client_id`: The application's client ID.
- `client_secret`: The application's client secret.
grant_type=refresh_token
&refresh_token=Aztr|...
&client_id=foodev
&client_secret=Y76SDl2F
```
- **Example Request for Grantless Operation:**
```http
POST /auth/o2/token HTTP/1.1
Host: api.amazon.com
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
grant_type=client_credentials
&scope=sellingpartnerapi::notifications
&client_id=foodev
&client_secret=Y76SDl2F
```
---
### Key Concepts
- **Access Tokens:** Essential for making authorized calls to the API.
- **Endpoints and URIs:** Understanding how to construct URIs based on HTTP
methods, paths, and parameters.
- **HTTP Headers:** Significance of including correct headers for API interaction.
This summary provides a clear guideline for developers looking to connect to the
Selling Partner API using Python.
_____________________________
### Conclusion
This setup allows developers to interact with various Selling Partner API endpoints
effectively, manage products, orders, and perform numerous tasks through well-
defined API calls. Proper handling of LWA credentials and understanding of
authorization flows are critical for successful integration.
_____________________________
To connect to the Selling Partner API (SP-API) using a generated Java SDK, follow
the instructions outlined below. This section focuses on setting up the necessary
LWA (Login with Amazon) credentials and making API calls using those credentials.
```java
import com.amazon.SellingPartnerAPIAA.LWAAuthorizationCredentials;
LWAAuthorizationCredentials lwaAuthorizationCredentials =
LWAAuthorizationCredentials.builder()
.clientId("myClientId")
.clientSecret("myClientSecret")
.refreshToken("Aztr|...") // Obtain this from the selling partner
.endpoint("https://api.amazon.com/auth/o2/token")
.build();
```
```java
import com.amazon.SellingPartnerAPIAA.LWAAuthorizationCredentials;
import static
com.amazon.SellingPartnerAPIAA.ScopeConstants.SCOPE_NOTIFICATIONS_API;
import static com.amazon.SellingPartnerAPIAA.ScopeConstants.SCOPE_MIGRATION_API;
LWAAuthorizationCredentials lwaAuthorizationCredentials =
LWAAuthorizationCredentials.builder()
.clientId("myClientId")
.clientSecret("myClientSecret")
.withScopes(SCOPE_NOTIFICATIONS_API, SCOPE_MIGRATION_API) // Use necessary scopes
based on your operations
.endpoint("https://api.amazon.com/auth/o2/token")
.build();
```
#### Step 2: Create an Instance of the Sellers API and Call an Operation
**Example:**
```java
import com.amazon.SellingPartnerAPIAA.SellersApi;
- Ensure that your application is registered and authorized by the selling partner
before proceeding with these steps.
- Operations that require authorization must include the `refreshToken` unless they
are classified as grantless.
- Permissions granted to applications define what data can be accessed. Always
limit scopes to only what is necessary for your application.
This concise summary provides a clear and organized reference for developers
looking to integrate with the Amazon Selling Partner API using Java SDK, focusing
on configuration and API usage.
_____________________________
3. **Sellers API**: A significant part of the SP-API used for interacting with
seller data.
- **SellersApi**:
- This class allows you to create an instance for interacting with the SP-API.
## Important Notes
- The LWA access token must be refreshed regularly since it expires after one hour.
- Ensure to update your trust store to avoid certificate authority errors when
making requests to the LWA authorization server.
- For operations requiring access to restricted data, it is crucial to use the RDT
properly as per the Tokens API guidelines.
#### Overview
The Selling Partner API (SP-API) allows developers to gather data from a customer's
selling partner account and post data. It requires registration and authorization.
---
---
**Endpoint**: `https://api.amazon.com/auth/o2/token`
**Request Fields**:
- `grant_type`:
- **Values**:
- `refresh_token`: For authorized operations.
- `client_credentials`: For grantless operations.
- `refresh_token`: Required for operations needing authorization.
- `scope`: Required for grantless operations.
- `client_id`: Application identifier.
- `client_secret`: Application secret.
**Example Request**:
```http
POST /auth/o2/token HTTP/1.1
Host: api.amazon.com
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
grant_type=refresh_token
&refresh_token=Aztr|...
&client_id=foodev
&client_secret=Y76SDl2F
```
**Successful Response**:
```json
{
"access_token": "Atza|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSREXAMPLE",
"token_type": "bearer",
"expires_in": 3600,
"refresh_token": "Atzr|IQEBLzAtAhRPpMJxdwVz2Nn6f2y-tpJX2DeXEXAMPLE"
}
```
**Headers to Include**:
- `host`: Marketplace endpoint.
- `x-amz-access-token`: Either LWA access token or RDT (for restricted operations).
- `x-amz-date`: Request date and time.
- `user-agent`: Your application name and version.
**Example Headers**:
```http
PUT /fba/inbound/v0/shipments/shipmentId1/preorder/confirm?
MarketplaceId=ATVPDKIKX0DER&NeedByDate=2020-10-10 HTTP/1.1
host: sellingpartnerapi-na.amazon.com
user-agent: My Selling Tool/2.0 (Java/1.8.0.221; Windows/10)
x-amz-access-token: Atza|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSREXAMPLE
x-amz-date: 20190430T123600Z
```
---
This summary provides a clear reference for developers to effectively connect and
interact with the Amazon Selling Partner API.
_____________________________
## Overview
The Selling Partner API (SP-API) enables developers to gather data from their
customer's selling accounts and post data to those accounts. It is crucial for
client applications to be robust and adaptable to unforeseen changes in SP-API
responses and report formats.
## Key Concepts
## Tutorials
- **Automate SP-API Calls**:
- **JavaScript SDK for Node.js**
- **Python SDK**
- **C# SDK**
- **Java SDK**
## Conclusion
To effectively use the Amazon Selling Partner API, developers need to anticipate
changes in report formats and response structures while implementing error handling
and logging to maintain robust applications. Following best practices ensures that
applications can adapt to the evolving API without breaking functionality.
_____________________________
1. **SP-API Overview**:
- The Selling Partner API (SP-API) is designed to help developers interact
programmatically with Amazon's selling systems to gather data and manage sellers'
accounts effectively.
2. **Changes to SP-API Reports**:
- **New Fields and Values**: Client applications should be able to handle new
fields and values added to reports. This includes:
- New columns in flat file reports.
- New elements in XML reports.
- **Error Handling**: If using report XSDs for validation, ensure error handling
for unrecognized response elements or values.
- **Dynamic Structure**: The structure of reports and responses can change at any
time. Applications must be built with this dynamism in mind.
- **Application Resilience**: Implement robust error handling and logging
mechanisms to gracefully manage unexpected changes or errors.
### Conclusion
Building robust applications with the Amazon Selling Partner API requires careful
planning to accommodate changes in report structures and response elements.
Following the listed best practices will enhance the resilience and adaptability of
applications in the face of evolving API conditions.
_____________________________
## Key Concepts
## Important Notes
- Client applications must be robust enough to avoid breaking with the introduction
of new response types or values.
- Implement logging to catch and adapt to unrecognized changes over time.
## Conclusion
Developers working with Amazon SP-API should prepare for adaptability in their
applications in response to ongoing changes from Amazon. This involves implementing
best practices for handling unrecognized elements and ensuring backward
compatibility as new features are introduced.
Ensure to reference the official API documentation for updates on models and
additional examples, particularly focusing on Python SDK tutorials for automation
in your applications.
_____________________________
## Key Concepts
### Overview
The Selling Partner API (SP-API) allows developers to interact with Amazon's
services for gathering data and posting updates to a seller's account. It is
crucial for applications to handle potential changes to responses and reports
seamlessly.
## Best Practices
1. **Expect Changes**:
- Do not hardcode expectations for response elements, fields, or values.
Applications should remain operational regardless of changes made by Amazon.
4. **Non-Order Dependency**:
- Ensure applications do not rely on the order of response elements, as Amazon
may return them in any order.
## Important Notes/Caveats
- Implement error handling while validating reports against XSDs provided by
Amazon.
- Client applications can benefit from dynamic updates to accommodate changes in
the API without breaking existing functionalities.
## Conclusion
Following these best practices ensures robust integration and application
resilience while using the Amazon SP-API. Developers must remain aware of potential
changes and design their applications to accommodate them seamlessly.
_____________________________
#### Overview
The Amazon Selling Partner API (SP-API) provides a suite of APIs designed to help
sellers access their selling partner data and manage their selling activity on
Amazon. This documentation specifically highlights the available Software
Development Kits (SDKs) for various programming languages to facilitate integration
with SP-API.
- **Java SDK**
- **Tutorial:** Automate your SP-API calls using Java SDK. This tutorial provides
guidance on using Java SDK with authentication via LWA token exchange.
- **Python SDK**
- **Tutorial:** Automate your SP-API calls using Python SDK. This tutorial
includes specific instructions for using the Python SDK with LWA authentication.
- **Control Over SDK:** The self-service approach provides developers with direct
control over SDK generation and versioning, which results in a more customized
integration experience.
- **Customization:** Since the SDKs are generated from models, developers can
customize the generated SDKs to better fit their specific requirements and ensure
they incorporate any new API changes promptly.
- **Irreversibility**:
- The deletion of an application and revocation of self-authorizations cannot be
undone. If you need to recreate the self-authorization, you must follow the set
workflow.
- **Revoking Authorizations**:
Self-authorizations must be revoked prior to deleting the application:
- Refer to the OAuth documentation to revoke an OAuth token.
- For revoking self-authorizations, see the respective workflows.
### Conclusion
Understanding the workflow for deleting applications, including managing
authorizations, is essential for maintaining your Amazon SP-API applications.
Always remember that deletions are permanent and ensure you are ready to proceed
with the deletion before confirming.
_____________________________
## Key Concept
- **Deleting Applications**: You can delete applications from your developer
account provided they meet certain conditions, ensuring unwanted applications and
permissions do not persist unnecessarily.
## Important Notes
- **Revoking is Irreversible**: Deletion of the application and revocation of self-
authorizations cannot be undone. Ensure that you are certain before proceeding.
- **Contact Support**: If your application does not meet the deletion conditions,
reach out to the SP-API Developer Support team with the appropriate identifiers
(Application ID, Merchant Customer ID for sellers, Vendor Group ID for vendors).
## Conclusion
Carefully follow the deletion process ensuring that the conditions are met for your
application. Always backup necessary application identifiers before proceeding with
deletions, as these actions cannot be reversed.
_____________________________
### Overview
This documentation provides guidance on how to delete applications from your Amazon
Selling Partner API (SP-API) developer account, specifically focusing on the
conditions and steps required for both public and private applications.
### Conclusion
Following these guidelines will help developers manage their applications
effectively within Amazon's Selling Partner API structure, ensuring compliance with
policies and administration protocols.
_____________________________
## Overview
The Selling Partner API (SP-API) Sandbox provides two environments for testing
applications without impacting production data: a static sandbox and a dynamic
sandbox.
2. **Dynamic Sandbox**:
- Proxies requests to a sandbox backend, allowing responses to be dynamic and
responsive to inputs.
- Useful for verifying stateful operations.
### Important Notes
- **Throttling Limits**: Calls to sandbox endpoints are limited to five requests
per second and a burst of up to 15 requests.
- **Restricted Data Token (RDT)**: If a sandbox call requires an RDT, it must be
fetched from the production environment.
- **Sandbox-Only Operations**: Some APIs are available only in the sandbox and
cannot be executed in the production environment. These will have the `"x-amzn-api-
sandbox-only": true` attribute.
## Sandbox Endpoints
| Region | Endpoint | AWS Region
|
|----------|---------------------------------------------------------|-------------
|
| North America | https://sandbox.sellingpartnerapi-na.amazon.com | us-east-1 |
| Europe | https://sandbox.sellingpartnerapi-eu.amazon.com | eu-west-1 |
| Far East | https://sandbox.sellingpartnerapi-fe.amazon.com | us-west-2 |
This summary captures essential information regarding the Selling Partner API
Sandbox for developers looking to test applications effectively and understand its
functionalities without affecting live systems.
_____________________________
## Overview
The Selling Partner API (SP-API) provides developers with two sandbox environments
for testing their applications without affecting production data. These are:
- **Static Sandbox**: Returns static, mocked responses based on pattern matching.
- **Dynamic Sandbox**: Routes requests to a sandbox backend, allowing for stateful
responses based on request parameters.
## Key Concepts
### Static Sandbox
- **Definition**: The static sandbox returns predefined responses based on specific
request parameters. It is designed to mimic the behavior of production without
causing side effects.
- **Response Structure**:
```json
{
"x-amzn-api-sandbox": {
"static": [
{
"request": { "parameters": { /* Specified parameters */ }},
"response": { /* Mocked response */ }
}
]
}
}
```
- **Usage Steps**:
1. Check the relevant API's Swagger model JSON file for static sandbox request
parameters.
2. Make calls by directing to the static sandbox endpoint and including the
specified parameters.
### Dynamic Sandbox
- **Definition**: The dynamic sandbox allows for a more flexible testing
environment where requests can generate variable and stateful responses.
- **Support Check**:
Look for the following JSON structure in the Swagger model:
```json
{
"x-amzn-api-sandbox": {
"dynamic": {}
}
}
```
- **Usage Steps**:
Similar to the static sandbox; however, responses vary based on request
parameters.
## Important Notes
- **Throttling Limits**: The sandbox calls are limited to:
- Rate: 5 requests per second
- Burst: 15 requests
This is crucial for developers to avoid exceeding the limits during testing.
## Example Usage
### Static Call Example
1. **Check Swagger JSON** for parameters:
```json
{
"x-amzn-api-sandbox": {
"static": [
{
"request": {
"parameters": {
"key": "value"
}
},
"response": {
"result": "mock response"
}
}
]
}
}
```
2. **Make request** to the static sandbox endpoint with required parameters.
This structured approach enables developers to efficiently test and validate their
integration with the Selling Partner API without impacting live environments.
_____________________________
## Overview
The Selling Partner API (SP-API) provides two sandbox environments to test
applications without affecting production data: the static sandbox and the dynamic
sandbox.
**Example**:
```json
"x-amzn-api-sandbox": {
"static": [
{
"request": {
"parameters": {
...
}
},
"response": {
...
}
}
]
}
```
#### B. Dynamic Sandbox
- **Functionality**: Routes requests to a sandbox backend that returns realistic
responses based on parameters, allowing for more complex interactions.
- **Usage**: Similar to production calls, but directed to sandbox endpoints.
**Example**:
```json
"x-amzn-api-sandbox": {
"dynamic": {}
}
```
### Conclusion
The SP-API sandbox is a crucial tool for developers to safely test API calls and
workflows. Use the static sandbox for predictable responses and the dynamic sandbox
for more complex scenario testing. Pay attention to throttling limits and ensure
the correct usage of RDT when necessary to maximize your testing efficiency.
_____________________________
Summary of URL: https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-
api-sandbox#the-selling-partner-api-dynamic-sandbox:
### Selling Partner API Sandbox Overview
The Selling Partner API (SP-API) Sandbox provides two environments to test
applications without affecting production data: **Static Sandbox** and **Dynamic
Sandbox**.
---
1. **Static Sandbox**:
- Returns static, mocked responses based on predefined patterns.
- Responses are generated via pattern matching and mimic real API responses.
- Ideal for testing the structure of API calls.
2. **Dynamic Sandbox**:
- Processes requests dynamically through a backend that generates responses
based on input.
- Allows for stateful interactions, useful for testing complex workflows (e.g.,
shipping charge calculations).
3. **Sandbox-Only Operations**:
- Certain API operations are limited to sandbox environments and can only
succeed when targeted to sandbox endpoints. These operations assist in creating
comprehensive test workflows.
4. **Endpoints**:
- Specific endpoints for testing based on selling regions.
- North America: `https://sandbox.sellingpartnerapi-na.amazon.com`
- Europe: `https://sandbox.sellingpartnerapi-eu.amazon.com`
- Far East: `https://sandbox.sellingpartnerapi-fe.amazon.com`
---
```json
"x-amzn-api-sandbox": {
"static": [
{
"request": {
"parameters": {
// Include required parameters here
}
},
"response": {
// Expected mocked response structure
}
}
]
}
```
#### Steps:
- **Step 1**: Review the JSON file in the documentation for parameters.
- **Step 2**: Make a call to the static endpoint with the necessary parameters.
```json
"x-amzn-api-sandbox": {
"dynamic": {}
}
```
#### Steps:
- **Step 1**: Inspect the Swagger model for dynamic support.
- **Step 2**: Issue a call to the dynamic endpoint.
---
- **Rate Limits**:
- Static/Dynamic sandbox calls are limited to **5 requests per second** with a
burst limit of **15**. For more details, refer to the **Usage Plans and Rate
Limits** section.
- **Restricted Data Token (RDT)**: If testing calls that require an RDT, it must be
obtained from the production environment and included in sandbox requests.
- **Mock Responses**: While using the static sandbox, ensure to refer to the
correct mock response structures in the Swagger model.
This summary provides a structured approach to utilizing the Selling Partner API
Sandbox for testing purposes. Use the defined methods and examples to effectively
integrate and experiment with the SP-API. For further details, consult the specific
API documentation available through Amazon’s developer resources.
_____________________________
#### Overview
The Selling Partner API (SP-API) offers two sandbox environments for testing
applications without affecting production data.
## Static Sandbox
### Making Static Sandbox Calls
1. **Check the JSON File for Request Parameters:**
- Go to the appropriate API documentation and locate the Swagger model JSON
file.
- Look for an object similar to:
```json
"x-amzn-api-sandbox": {
"static": [...]
}
```
2. **Make a Static Sandbox Call:**
- Call the API like a production call, directing to the sandbox endpoints and
including needed parameters.
- Example response structure:
```json
{
"static": [
{
"request": {
"parameters": { ... }
},
"response": { ... }
}
]
}
```
## Dynamic Sandbox
### Making Dynamic Sandbox Calls
1. **Check Supported Operations:**
- Review the Swagger model JSON for:
```json
"x-amzn-api-sandbox": {
"dynamic": {}
}
```
2. **Make a Dynamic Sandbox Call:**
- Similar to a production call, but directed to sandbox endpoints.
## Sandbox-Only Operations
- Some APIs are **sandbox-only** due to their specific functionalities, indicated
by:
```json
"x-amzn-api-sandbox-only": true
```
- Use cases may include creating data items that are not possible through
production APIs.
## Sandbox Endpoints
The SP-API offers sandbox endpoints for various regions:
## Key Concepts
- **Swagger Model JSON:** Key for determining the required parameters and formats
for requests and responses in both types of sandboxes.
- **Mocking Framework:** The static sandbox mimics functionality similar to mocking
frameworks, utilizing pattern matching to respond to specific parameters.
## Conclusion
The SP-API sandbox environment is essential for testing and developing applications
without affecting production data. Familiarity with the correct endpoints and
methods of making requests is crucial for successful interactions with the APIs.
Remember to adhere to rate limits and understand the necessity for RDTs when
required.
_____________________________
The Selling Partner API (SP-API) provides sandbox environments for testing
applications without affecting production data. This summary covers the important
aspects of the SP-API Sandbox, including how to make calls, types of sandboxes, and
endpoints.
## Key Concepts
## Sandbox Endpoints
The SP-API has specific endpoints for different regions. Here are the sandbox
endpoints:
## Conclusion
Utilizing the Selling Partner API Sandbox allows developers to test their
applications efficiently without impacting real-world data. Always refer to the
Swagger model for accurate parameters and environment specifications when making
sandbox calls.
_____________________________
## Key Concepts
## Important Caveats
- The sandbox environment is meant for functionality testing, not scalability.
- API calls requiring RDT should handle this accordingly, as production tokens are
required.
## Summary
The Selling Partner API Sandbox provides developers with a safe environment to test
SP-API calls. Understanding the distinction between static and dynamic sandboxes is
essential for effective development and testing. Pay attention to throttling
limits, and ensure compliance with RDT requirements when necessary. Use the
documented JSON structures to format requests and analyze responses effectively.
_____________________________
#### Overview
The Selling Partner API (SP-API) sandbox provides two environments for testing API
calls without affecting production data:
1. **Static Sandbox**: Returns static, mocked responses using pattern matching.
2. **Dynamic Sandbox**: Returns realistic responses based on request parameters,
allowing for more flexible testing.
1. **Static Sandbox**
- **Usage**: Make requests to sandbox endpoints to receive predefined responses.
- **Request Example**: Use the JSON format to specify parameters:
```json
"x-amzn-api-sandbox": {
"static": [
{
"request": {
"parameters": { ... }
},
"response": { ... }
}
]
}
```
- **How to Make a Call**:
1. Check the **Swagger model JSON** file for request parameters.
2. Direct your call to sandbox endpoints and include required parameters.
2. **Dynamic Sandbox**
- **Usage**: Similar to production calls but allows for stateful and realistic
interactions.
- **Check Support**: Look for the following object in the Swagger model:
```json
"x-amzn-api-sandbox": {
"dynamic": {}
}
```
- **How to Make a Call**:
1. Confirm that dynamic sandbox calls are supported by checking the API
documentation.
2. Direct calls to sandbox endpoints as you would in production.
3. **Sandbox-Only Operations**:
- Designed for testing APIs that do not exist in production.
- **Identification**: Look for:
```json
"x-amzn-api-sandbox-only": true
```
- **Restricted Data Token (RDT)**: If the API call requires an RDT, it must be
obtained from the production environment to be used in sandbox calls.
### Tutorials
- For using SDKs:
- Python tutorials for automating SP-API calls are available.
### Conclusion
This summary provides the fundamental knowledge and essential guidelines for using
the Selling Partner API Sandbox effectively, ensuring that developers can test
their APIs with both static and dynamic responses. Make sure to understand the
limitations and requirements for testing, especially concerning RDTs and endpoint
usage.
_____________________________
The **Selling Partner API (SP-API) Sandbox** provides a testing environment that
allows developers to make calls to the API without affecting production data. There
are two types of sandbox environments available: static and dynamic.
1. **Static Sandbox**:
- Returns predetermined, mocked responses based on request parameters.
- Implemented using **pattern matching** to match the API calls to defined
responses.
- Developers must refer to the **Swagger model JSON file** for the required
parameters for successful calls.
2. **Dynamic Sandbox**:
- Routes requests to a sandbox backend, returning responses based on input
parameters, allowing for more realistic testing.
- Supports stateful responses and may accommodate a wider range of operations
than the static sandbox.
3. **Sandbox-only Operations**:
- Some API operations are sandbox-only and can only function in the sandbox
environments. They can assist in creating test workflows that aren't possible
through production APIs.
- **North America**:
```
https://sandbox.sellingpartnerapi-na.amazon.com
```
- **Europe**:
```
https://sandbox.sellingpartnerapi-eu.amazon.com
```
- **Far East**:
```
https://sandbox.sellingpartnerapi-fe.amazon.com
```
2. **Example Structure**:
```json
{
"x-amzn-api-sandbox": {
"dynamic": {}
}
}
```
- Make a call to the sandbox endpoints, ensuring that endpoint matches the API
supported in the Swagger file.
#### Conclusion
The Selling Partner API Sandbox is a valuable tool for developers looking to
integrate with Amazon's API in a controlled environment. Differentiating between
static and dynamic calls is crucial, and the correct handling of JSON parameters
allows for successful interaction with the API endpoints. For Python-specific
development, use the tutorials provided in the developer hub for assistance in
making API calls.
_____________________________
## Overview
The Selling Partner API (SP-API) offers two sandbox environments for developers to
test their applications without affecting production data:
1. **Static Sandbox**: Offers mocked responses based on pattern matching.
2. **Dynamic Sandbox**: Provides more realistic, stateful responses based on
request parameters.
## Key Concepts
## Conclusion
The Selling Partner API Sandbox provides essential tools for developers to test
their applications in a safe environment. Understanding the differences between
static and dynamic sandboxes, as well as the appropriate usage of sandbox-only
operations, is vital for effective application development and testing. Always keep
the rate limits in mind when making calls.
_____________________________
### Overview
The Selling Partner API (SP-API) provides two sandbox environments for developers
to test their applications without impacting production data. There are two types
of sandboxes available:
### Conclusion
Utilizing the SP-API sandbox is essential for developers needing to validate their
implementations in a safe environment. Be mindful of the throttling limits and
specific configurations for operations in both the static and dynamic sandboxes.
For testing needs involving restricted data, ensure you acquire tokens from the
production environment.
_____________________________
## Overview
This documentation explains how to set up and utilize Postman for working with
Amazon's Selling Partner API (SP-API) models. It allows developers to generate
Login with Amazon (LWA) tokens, import SP-API models, and invoke both production
and sandbox endpoints.
2. **Add Headers**:
- Choose `No Auth` in the Authorization tab.
3. **Set Body**:
- Choose `x-www-form-urlencoded` in the Body tab and add the following key-value
pairs:
```
Key | Value
---------------------|--------------------------
grant_type | refresh_token
refresh_token | [your refresh token value]
client_id | [your client id value]
client_secret | [your client secret value]
```
4. **Send Request**:
- Click Send. The response will include an `access_token`:
```json
{
"access_token": "Atza|*****",
"refresh_token": "Atzr|*****",
"token_type": "bearer",
"expires_in": 3600
}
```
3. **Send Request**:
- Click Send and observe the response window for data returned from the call.
## Overview
This documentation explains how to set up Postman to interact with Amazon's Selling
Partner API (SP-API), including generating access tokens, importing API models, and
making requests to both production and sandbox environments.
## Key Concepts
### Steps:
1. Open Postman and sign in.
2. Create a new HTTP Request:
- **Method**: POST
- **URL**: `https://api.amazon.com/auth/o2/token`
3. Set up the request:
- **Authorization**: No Auth
- **Body Type**: x-www-form-urlencoded
4. Add the following key-value pairs in the Body:
| Key | Value |
|------------------|---------------------------|
| grant_type | refresh_token |
| refresh_token | `[your refresh token]` |
| client_id | `[your client id]` |
| client_secret | `[your client secret]` |
5. Send the request; the response includes the access token:
```json
{
"access_token": "Atza|*****",
"refresh_token": "Atzr|*****",
"token_type": "bearer",
"expires_in": 3600
}
```
### Steps:
1. Download the desired SP-API model JSON file from GitHub.
2. Open Postman, sign in, and choose your workspace.
3. Click **Import**, select your JSON file, and choose **Open**.
4. Select **Postman Collection** and click **Import**. A success message will
confirm importation.
### Steps:
1. Sign in to Postman and choose your workspace.
2. Select the imported API collection and the desired GET operation.
3. Add the access token to the request headers:
| Key | Value |
|-------------------------|--------------------------|
| x-amz-access-token | `[your access token]` |
4. Send the request. The response will populate in the Response window.
### Notes:
- The sandbox allows you to test applications without affecting production data.
- There are two sandbox environments: static (mocked responses) and dynamic
(realistic responses).
### Steps:
1. Import the Swagger model for the API you are testing.
2. Choose the GET operation for your desired API (e.g., Orders API).
3. Set the `{{baseUrl}}` as the Selling Partner API sandbox.
4. Include the required parameters specified in the Swagger model.
5. Add the access token to the request headers.
6. Send the request and verify that the response matches the Swagger model.
## Important Notes
- Ensure you have valid credentials to make API calls.
- Each API call may require specific parameters; refer to the associated Swagger
documentation.
- The success of operations should be verified against the expected responses
outlined in the API documentation.
### Caveats
- Be aware of rate limits and usage plans associated with the SP-API.
- Ensure safe handling of sensitive data, including client secrets and access
tokens.
This structured approach will help developers effectively utilize Amazon's SP-API
with Postman for various API operations and testing scenarios.
_____________________________
This guide details the process of setting up and using Postman to interact with the
Amazon Selling Partner API (SP-API). Below is a structured summary including key
concepts, required credentials, and procedural steps.
---
#### **Credentials Required to Make a Call**
1. **LWA Client Credentials**:
- `client_id`: Obtained after registering your application.
- `client_secret`: Obtained after registering your application.
3. **SP-API Endpoint**:
- Refer to the [SP-API
Endpoints](https://developer-docs.amazon.com/sp-api/docs/sp-api-endpoints) for more
information.
---
#### **Generating a Login with Amazon (LWA) Access Token Using Postman**
To authenticate to the SP-API, you must first generate an access token:
1. Open Postman and sign in.
2. Select your workspace.
3. Create a new HTTP request:
- **Request Type**: `POST`
- **URL**: `https://api.amazon.com/auth/o2/token`
4. Set the Authorization type to **No Auth**.
5. Switch to the **Body** tab and select `x-www-form-urlencoded`, adding the
following key-value pairs:
- `grant_type`: `refresh_token`
- `refresh_token`: `[your refresh token value]`
- `client_id`: `[your client id value]`
- `client_secret`: `[your client secret value]`
6. Click **Send** to receive a response containing the access token in the
following format:
```json
{
"access_token": "Atza|*****",
"refresh_token": "Atzr|*****",
"token_type": "bearer",
"expires_in": 3600
}
```
---
---
---
This structured guide should assist developers in effectively using Postman with
Amazon's Selling Partner API models.
_____________________________
### Overview
This document provides instructions for setting up and using Postman with Amazon's
Selling Partner API (SP-API) models. It covers generating Login with Amazon (LWA)
access tokens, importing SP-API models, and calling SP-API endpoints, including
sandbox testing.
2. **SP-API Endpoints**:
- The SP-API provides access to various APIs that interact with seller
information. Refer to the SP-API Endpoints for a detailed list.
#### Steps:
- Open Postman and sign in.
- Choose or create a workspace.
- Select **New** > **HTTP Request**.
- Set the request method to **POST**.
- Enter the URL: `https://api.amazon.com/auth/o2/token`.
- Set the following in the **Body** using `x-www-form-urlencoded`:
- `grant_type`: `refresh_token`
- `refresh_token`: `[your refresh token value]`
- `client_id`: `[your client id value]`
- `client_secret`: `[your client secret value]`
- Click **Send** to obtain the access token.
#### Steps:
- Access the [selling-partner-api-models](https://github.com) repository on GitHub.
- Select the API model you wish to use and download the corresponding JSON file.
- Open Postman, choose your workspace, and select **Import**. Upload the downloaded
JSON file.
- Wait for the success message indicating successful import.
#### Steps:
1. Sign in to Postman and select your workspace.
2. In the collections tab, locate the imported API model and select a `GET`
operation.
3. Ensure the LWA access token is generated and available.
4. Under the **Headers** tab, add:
- `x-amz-access-token`: `[your access token value]`
5. Click **Send** to execute the call and view the response in the response window.
#### Steps:
1. Import the Swagger model associated with the API you are testing.
2. Set the **base URL** to the SP-API sandbox.
3. Define necessary parameters using the Swagger model as reference.
4. Follow similar header and request procedures as outlined for production calls.
This concise guide encompasses essential steps and considerations for interacting
with Amazon's SP-API using Postman, tailored for Python developers.
_____________________________
Summary of URL: https://developer-docs.amazon.com/sp-api/docs/using-postman-for-
selling-partner-api-models#call-an-sp-api-endpoint:
# Summary of Using Postman for Selling Partner API Models
## Overview
This document outlines how to set up and use Postman for interacting with Amazon's
Selling Partner API (SP-API) models. Postman can be used to generate authentication
tokens, import API models, and call SP-API endpoints including sandbox environments
for testing.
## Key Concepts
## Important Components
- **Postman:** A popular tool for testing APIs, allowing easy setups for generating
tokens and sending requests.
- **SWAGGER Model:** A representation of your API that defines its endpoints,
request parameters, and expected responses.
This guide should help developers effectively use Postman with Amazon's Selling
Partner API for both production and testing scenarios, allowing seamless
integration and management of selling partner data.
_____________________________
#### Overview
Postman can be used to generate Login with Amazon (LWA) access tokens, import
Selling Partner API (SP-API) models, and make API calls (both production and
sandbox).
2. **API Models**: Define the structure for making API calls. Must be imported into
Postman before accessing API endpoints.
3. **Endpoints**:
- **Production Endpoints**: Used for live data operations.
- **Sandbox Endpoints**: Used for testing purposes without affecting real data.
Includes static and dynamic responses.
### Credentials Required
To make a call to the API, you need:
- `client_id`: From your registered application.
- `client_secret`: From your registered application.
- `refresh_token`: Obtained from Seller Central after authorizing your application.
**Response Example**:
```json
{
"access_token": "Atza|*****",
"refresh_token": "Atzr|*****",
"token_type": "bearer",
"expires_in": 3600
}
```
This summary captures all essential processes and requirements for using Postman
with Amazon's Selling Partner API, focusing on access tokens, importing models, and
making API calls effectively.
_____________________________
This document outlines how to effectively use Postman to interact with Amazon's
Selling Partner API (SP-API). It includes guidance for generating access tokens,
importing API models, and making calls to both SP-API production and sandbox
endpoints.
---
---
---
- **Authorization**:
- Set `Authorization` to `No Auth`.
- **Body Setup**:
- Select `x-www-form-urlencoded`.
- Add the following key-value pairs:
| Key | Value |
|------------------|------------------------------|
| grant_type | refresh_token |
| refresh_token | [your refresh token value] |
| client_id | [your client id value] |
| client_secret | [your client secret value] |
- **Add Headers**:
- In the Headers tab, insert:
| Key | Value |
|----------------------|----------------------------|
| x-amz-access-token | [your access token value] |
The process is similar to calling a production API but requires adjustments for
sandbox testing:
- **Use the Sandbox URL**: Replace the `baseUrl` with the sandbox endpoint.
- **Pass Required Parameters**: Ensure all required parameters from the Swagger
model are included in your request.
- **Add Headers**:
- Similar to production calls, use the generated access token in the headers.
---
#### Important Notes
This guide should provide you with the foundational understanding and steps
necessary to work effectively with the Amazon Selling Partner APIs using Postman.
_____________________________
#### Overview
When using the Amazon Selling Partner API (SP-API), every request made must include
a `User-Agent` header. This header is crucial for identifying the application,
managing issues, and facilitating better support from Amazon based on application
usage and environment details.
```
AppId/AppVersionId (Language=LanguageNameAndOptionallyVersion)
```
##### Example
```plaintext
My Selling Tool/2.0 (Language=Java/1.8.0.221; Platform=Windows/10)
```
```plaintext
MyCompanyName/build1611 (Language=Perl; Host=jane.desktop.example.com)
```
## Overview
The Selling Partner API (SP-API) provides a standardized format for responses to
HTTP requests. Each response includes standard HTTP headers, JSON response
messages, and potential error messages.
---
## Response Headers
SP-API returns several headers in response to requests. Important headers include:
```http
HTTP/1.1 200 OK
Content-Length: 368
Content-Type: application/json
Date: Thu, 01 Jun 2020 22:23:31 GMT
x-amzn-RequestId: 6875f61f-6aa1-11e8-98c6-9bExample
{
"payload": {
"ConfirmedNeedByDate": "2020-04-23",
"ConfirmedFulfillableDate": "2020-04-23"
}
}
```
```http
HTTP/1.1 400 Bad Request
Content-Length: 117
Content-Type: application/json
Date: Fri, 01 Jun 2020 21:48:02 GMT
x-amzn-ErrorType: ValidationException
x-amzn-RequestId: a8c8d99a-6ab5-11e8-b0f8-19363980175b
{
"errors": [
{
"message": "Access to requested resource is denied.",
"code": "Unauthorized",
"details": "Access token is missing in the request header."
}
]
}
```
---
## Key Concepts
1. **Response Headers**:
- The headers provide context about the response, including success/failure
indication and metadata about the request.
3. **Error Handling**:
- Developers should implement error handling based on the `HTTP status code`, as
well as utilize the `message` and `details` fields provided in error responses to
troubleshoot problems.
---
## Important Notes
- Be familiar with the types of headers returned, as they can inform you of various
request metrics, like rate limits or errors.
- Always check and handle the `x-amzn-RequestId` when seeking support, as it will
help Amazon's support team to track the specific request.
- Implement caching or handle retries where necessary, particularly when receiving
rate limit headers or errors relating to resource access.
- Ensure that your application correctly includes authorization tokens in request
headers to avoid `Unauthorized` errors.
This summary provides a concise guide for developers working with the Amazon SP-API
response format and should serve as a quick reference for coding and
troubleshooting.
_____________________________
The Selling Partner API (SP-API) returns response headers and a JSON response
message after processing an HTTP request. Understanding the response format is
essential for effective integration with the API.
## Response Headers
## Response Examples
### Successful Response
When a request is successful, the API returns data requested, with a response
structured as follows:
```http
HTTP/1.1 200 OK
Content-Length: 368
Content-Type: application/json
Date: Thu, 01 Jun 2020 22:23:31 GMT
x-amzn-RequestId: 6875f61f-6aa1-11e8-98c6-9bExample
{
"payload": {
"ConfirmedNeedByDate": "2020-04-23",
"ConfirmedFulfillableDate": "2020-04-23"
}
}
```
```http
HTTP/1.1 400 Bad Request
Content-Length: 117
Content-Type: application/json
Date: Fri, 01 Jun 2020 21:48:02 GMT
x-amzn-ErrorType: ValidationException
x-amzn-RequestId: a8c8d99a-6ab5-11e8-b0f8-19363980175b
{
"errors": [
{
"message": "Access to requested resource is denied.",
"code": "Unauthorized",
"details": "Access token is missing in the request header."
}
]
}
```
## Key Concepts
- **Response Headers**: These provide vital information about the request's status,
content type, and potential errors.
- **Success and Error Responses**: Differentiating between these helps identify
whether the requested operation was successful and what to do when an error occurs.
## Important Notes
- The response headers you receive may vary based on the specific API section and
operation.
- Always check response headers for rate limits to ensure compliance with usage
policies.
- Include the `x-amzn-RequestId` in support requests for faster service.
This summary serves as a reference for developers working with the Amazon Selling
Partner API, especially those needing clarity on how to interpret response formats
effectively.
_____________________________
---
When interacting with the SP-API, the following response headers may be included in
the HTTP response:
| **Name** | **Description**
| **Example** |
|-------------------------|--------------------------------------------------------
--------------------------------------------|--------------------------------------
----------|
| Connection | Persistent connection with the client.
| Connection: keep-alive |
| Content-Length | Standard HTTP response header indicating the size of
the response body. | Content-Length: 624
|
| Content-Type | The media type of the resource.
| Content-Type: application/json |
| Date | The date and time the response was generated.
| Date: Fri, 17 Feb 2023 20:13:55 GMT |
| x-amz-apigw-id | Optional extended request ID created by APIGateway.
| x-amz-apigw-id: Ac1E1EycvHcFyNw= |
| x-amzn-ErrorType | Populated with error type if the response status code is
4xx or 5xx. | x-amzn-ErrorType: AccessDeniedException
|
| x-amzn-RateLimit-Limit | Indicates rate limit applied to the request; provided on
a best-effort basis. | x-amzn-RateLimit-Limit: 2.0
|
| x-amzn-RequestId | Request identifier for support queries.
| x-amzn-RequestId: 6875f61f-6aa1-11e8-98c6-9bExample|
| X-Amzn-Trace-Id | Optional trace identifier generated by APIGateway.
| X-Amzn-Trace-Id: Root=1-63ee9bb8-52ea8e6d108209842abc2a4d|
---
##### Example:
```http
HTTP/1.1 200 OK
Content-Length: 368
Content-Type: application/json
Date: Thu, 01 Jun 2020 22:23:31 GMT
x-amzn-RequestId: 6875f61f-6aa1-11e8-98c6-9bExample
{
"payload": {
"ConfirmedNeedByDate": "2020-04-23",
"ConfirmedFulfillableDate": "2020-04-23"
}
}
```
---
##### Example:
```http
HTTP/1.1 400 Bad Request
Content-Length: 117
Content-Type: application/json
Date: Fri, 01 Jun 2020 21:48:02 GMT
x-amzn-ErrorType: ValidationException
x-amzn-RequestId: a8c8d99a-6ab5-11e8-b0f8-19363980175b
{
"errors": [
{
"message": "Access to requested resource is denied.",
"code": "Unauthorized",
"details": "Access token is missing in the request header."
}
]
}
```
---
- **HTTP Status Codes:** Understanding various status codes (e.g., 200 for success,
400 for bad request) is crucial for error handling.
---
Utilize the above content as a reference for effectively working with the Amazon
Selling Partner API's response formats.
_____________________________
The Selling Partner API provides mechanisms to gather and post data from/to a
customer's selling account. Below are key elements regarding response formats,
including successful and error responses.
1. **Response Headers**: When an API request is made, the SP-API returns various
response headers. The headers can differ across API sections and operations. Here
are important response headers you may receive:
|------------------------------|---------------------------------------------------
----------------------------------------------|------------------------------------
----------|
| `Connection` | Default value for persistent connection with
the client. | `Connection: keep-alive`
|
| `Content-Length` | Standard HTTP response header indicating the
length of the response body. | `Content-Length: 624`
|
| `Content-Type` | Standard HTTP response header that specifies
the media type of the resource. | `Content-Type:
application/json` |
| `Date` | Standard HTTP response header indicating the
date and time the response was sent. | `Date: Fri, 17 Feb 2023 20:13:55
GMT` |
| `x-amz-apigw-id` | Extended request ID created by APIGateway.
| `x-amz-apigw-id: Ac1E1EycvHcFyNw=` |
| `x-amzn-ErrorType` | Error type returned for responses with HTTP
status code 4xx or 5xx. | `x-amzn-ErrorType:
AccessDeniedException` |
| `x-amzn-RateLimit-Limit` | Returns the rate limit applied to the request
(optional). | `x-amzn-RateLimit-Limit: 2.0`
|
| `x-amzn-RequestId` | Unique identifier for the request. Needed when
contacting support. | `x-amzn-RequestId: 6875f61f-6aa1-
11e8-98c6-9bExample` |
{
"payload": {
"ConfirmedNeedByDate": "2020-04-23",
"ConfirmedFulfillableDate": "2020-04-23"
}
}
```
When an error occurs, the API provides an error response that includes important
information to diagnose the problem.
{
"errors": [
{
"message": "Access to requested resource is denied.",
"code": "Unauthorized",
"details": "Access token is missing in the request header."
}
]
}
```
- **HTTP Status Codes**: Understand common HTTP response codes (e.g., 200 for
success, 400 for bad requests, 401 for unauthorized).
- **Error Handling**: Be prepared to handle various exceptions, particularly
authorization errors related to access tokens.
- **Rate Limits**: Familiarize yourself with the rate limit headers to avoid
exceeding the limitations imposed by the API.
- **Authorization**: Ensure that the required authorization tokens are included in
the request headers, as missing tokens can lead to unauthorized responses.
This summary provides an overview of the SP-API response format and essential
guidelines for effective usage, helping developers integrate the API smoothly.
_____________________________
## Overview
Grantless operations in the Selling Partner API (SP-API) allow certain operations
to be executed without explicit authorization from the selling partner. When using
these operations, you can request a Login with Amazon access token without needing
to provide a refresh token, which simplifies the authorization process.
## Usage Instructions
- When utilizing a generated Java SDK, use the `withScopes` parameter to set one or
more scopes for the LWA authorization grant.
- Ensure that your application has appropriate permissions to make grantless
requests as defined in the scope.
## Important Notes
- Grantless operations are primarily intended for seller applications only.
- Always handle sensitive credentials securely and review Amazon policies related
to data protection and acceptable use.
- Be aware of rate limits and best practices when integrating with the SP-API to
avoid throttling or service interruptions.
## Overview
The Amazon Selling Partner API (SP-API) employs usage plans to control the number
of requests made to an operation within a given timeframe, ensuring reliability and
efficiency in application workloads. Understanding usage plans and rate limits is
crucial for optimizing interactions with the API.
## Key Concepts
### 1. Terminology
- **Rate Limit**: Maximum requests allowed per operation per second.
- **Burst Limit**: Maximum requests that can be submitted simultaneously beyond the
rate limit.
- **Usage Plan**: Defined by the combination of rate limit and burst limit for
specific operations.
- **Throttling**: Occurs when requests exceed rate limits, returning a 429 HTTP
error.
- **Grantless Operations**: Operations that do not require a sellerId, thus not
influenced by the selling partner's account.
**Example Scenario**:
- Operation with rate limit of 1 and burst limit of 2.
- Tokens can be depleted and filled based on request rates.
## Conclusion
Understanding the SP-API's usage plans and rate limits is fundamental for building
robust applications that efficiently interact with Amazon services. By following
best practices regarding request handling and awareness of limits, developers can
ensure their applications run smoothly and meet operational demands.
_____________________________
## Key Concepts
1. **Rate Limit**:
- Maximum number of requests allowed to a specific operation per second.
- To avoid throttling, requests must stay below this limit.
2. **Burst Limit**:
- Maximum number of requests to an operation that can be accumulated over time
and then submitted simultaneously.
3. **Usage Plan**:
- Combination of rate limit and burst limit applicable to a specific operation.
5. **Throttling**:
- Occurs when requests exceed the rate limit, resulting in a 429 HTTP error
response.
6. **Grantless Operations**:
- Operations that do not require a sellerId and therefore are not dependent on
the selling partner.
## Usage Plan Types
- **SP-API Documentation**: Rate and burst limits can be referenced in the API
documentation per operation.
- **Response Header**: The `x-amzn-RateLimit-Limit` header may specify rate limits
for the operation per account-application pair, though it's not guaranteed.
## Important Classes/Methods
Although specific classes or methods are not detailed in the page content,
developers should keep in mind:
- Each operation in the SP-API is governed by its corresponding usage plan, which
defines how many calls can be made.
## Important Notes/Caveats
- The API may not always include the `x-amzn-RateLimit-Limit` header, especially in
cases of unauthorized requests.
- It's important not to rely solely on the presence of this header; always validate
before using its value.
- Developers should implement a back-off strategy when receiving a 429 response to
handle throttling effectively.
- Dynamic usage plans aim to optimize throughput based on the metrics of business
behavior rather than solely request history.
- Ensure efficient call patterns to reduce throttling; utilize batch APIs where
applicable.
- Rely on push notifications over polling to stay within limits.
- Test your application with the Selling Partner API sandbox, but remember all
sandbox operations share the same rate limits.
By understanding these plans, limits, and key concepts, developers can effectively
utilize the Amazon SP-API without encountering excessive throttling and ensure
their applications run smoothly.
_____________________________
## Key Concepts
1. **Rate Limit**:
- Maximum number of requests allowed to a specific operation per second.
- Exceeding this limit leads to throttling, which results in a 429 HTTP error
response.
2. **Burst Limit**:
- Maximum number of requests that can be accumulated and submitted
simultaneously.
3. **Usage Plan**:
- A combination of rate limit and burst limit that applies to a specific
operation in the SP-API.
5. **Throttling**:
- Occurs when requests exceed the rate limit, resulting in temporary rejection.
6. **Grantless Operations**:
- Operations that do not require a `sellerId` as part of the request. These
operations are not dependent on seller accounts in usage plans.
## Usage Plans
3. **Avoiding Throttling**:
- While it's not possible to completely avoid throttling, optimizing call
frequency, relying on push notifications, and using batch APIs can help.
## Additional Notes
This summary highlights the critical aspects of the Amazon SP-API Usage Plans and
Rate Limits, essential for developers to effectively manage their API interactions.
_____________________________
1. **Usage Plans**: Define how many requests can be made to the SP-API within a
specific time period. They are determined based on:
- Selling partner account
- Application making the requests
- Marketplace
- API operation being called
2. **Rate Limit**: Maximum number of requests allowed per operation per second.
4. **Token Bucket Algorithm**: The SP-API uses this algorithm for rate-limiting. It
involves "tokens" that are consumed with each request. When the bucket (holding
tokens) is empty, further requests will be throttled (resulting in a 429 error).
- **Testing Rate Limits**: Testing in the SP-API sandbox does not reflect
production limitations and all test operations share the same rate.
- **Rate Adjustment Factors**: Rate limits may change based on selling partner
business metrics. If limits are consistently insufficient, optimize your API call
patterns rather than expecting an increase.
1. **Standard Plans**: Most operations have predetermined limits, listed in the API
reference.
2. **Dynamic Plans**: Certain operations have limits that automatically adjust
based on business needs but do not change simply due to frequency of API calls.
- **Will limits increase with more authorizations?**: No, limits are specific to
the application and the selling partner combination, scaling with client growth.
Here's a simplified example illustrating how the token bucket algorithm works in
practice:
Using this guide, developers can effectively interact with Amazon's Selling Partner
API while managing rate limits and usage plans efficiently.
_____________________________
Summary of URL: https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-
limits#how-to-find-your-usage-plan:
### Summary of Amazon Selling Partner API (SP-API) - Usage Plans and Rate Limits
1. **Usage Plans**: A usage plan defines the number of API requests you can make
within a specified time frame. Each operation in the SP-API has its own usage plan
determined by various factors, such as:
- API operation type
- Selling partner account and application pair
- Marketplace
2. **Rate Limit**: The maximum number of requests you can make to a specific
operation per second.
3. **Burst Limit**: The maximum number of requests you can send at once, which can
be accumulated over time and sent in a burst.
4. **Token Bucket Algorithm**: This algorithm is used for rate limiting whereby
each API request consumes a token from a bucket that is replenished at a set rate.
If the bucket is empty, requests will be throttled, yielding a 429 status code.
5. **Throttling**: Occurs when requests exceed the rate limit, resulting in a 429
error response. Requests can be retried after a delay.
- If you frequently face throttling (429 errors), consider optimizing your API call
patterns:
- Reduce the frequency of calls.
- Utilize push notifications instead of polling mechanisms.
- Use batch APIs where available to reduce the number of calls.
- Dynamic limits may change based on the performance and metrics of the selling
partner’s account.
- Always consider that usage plans may adjust based on performance, and different
operations have unique rate and burst limits.
- Ensure your application can gracefully handle rate limiting by adhering to best
practices for API call efficiency.
- Monitor the presence of `x-amzn-RateLimit-Limit` in responses but do not rely
solely on its availability; check for its presence before using its value for
limiting logic.
This summary encapsulates the essential aspects of implementing and working with
the Amazon SP-API's usage plans and rate limits, providing guidelines for
developers to effectively manage their API interactions.
_____________________________
This summary provides essential information regarding usage plans, rate limits, and
key concepts associated with the Amazon Selling Partner API (SP-API).
## Key Concepts
### 5. **Throttling**
- Occurs when requests exceed the defined rate limits. A throttled request results
in a 429 HTTP error response.
**Note:** Don't rely solely on the presence of this header; check it prior to
usage.
## Developer Recommendations
- **Dynamic Limits Handling:**
- Read the `x-amzn-RateLimit-Limit` header when available.
- Avoid hardcoding timers and use events to code against actions rather than
fixed intervals.
By understanding these concepts, developers can better manage API interactions and
optimize their applications under the constraints of the SP-API usage plans.
_____________________________
## Key Concepts
## Caveats
- Rate limits can change, and adjustments typically happen based on selling partner
performance metrics or business context.
- Avoid hardcoding timers; coding should be event-driven instead of relying on
continuous loops.
- Applications may still receive occasional throttling due to unpredictable usage
patterns.
This summary serves as a guide for developers to understand and effectively use the
Amazon SP-API, primarily focusing on managing usage plans and rate limits
effectively while ensuring compliance with best practices.
_____________________________
4. **Throttling**: When requests exceed rate limits, the SP-API temporarily rejects
them, resulting in a 429 HTTP error response. It is advisable to implement retry
mechanisms.
5. **Token Bucket Algorithm**: The method used for rate limiting. Tokens are added
to a 'bucket' at a set rate, and each request deducts a token. If the bucket is
empty, subsequent requests will be throttled.
```python
import requests
import time
if response.status_code == 200:
# Process the successful response
return response.json()
elif response.status_code == 429:
# Throttled; apply back-off strategy
backoff_duration = int(response.headers.get('x-amzn-RateLimit-Limit',
1))
time.sleep(backoff_duration)
continue
else:
response.raise_for_status()
# Example usage
api_endpoint = "https://sellingpartnerapi.amazon.com/path/to/operation"
headers = {
"Authorization": "Bearer your_access_token",
"Content-Type": "application/json",
}
try:
data = call_sp_api(api_endpoint, headers)
print(data)
except Exception as e:
print("Error occurred:", e)
```
### Conclusion
Understanding usage plans and rate limits is crucial for effectively using the
Amazon SP-API. Developers should implement error handling for throttling and
optimize API calls according to the mentioned guidelines to ensure better
performance and reliability of their applications.
_____________________________
1. **Rate Limit**: The maximum number of requests allowed per second for a specific
operation.
2. **Burst Limit**: The maximum number of requests that can be submitted
simultaneously after building up over time.
3. **Usage Plan**: A combination of the rate limit and burst limit that applies to
an operation.
4. **Token Bucket Algorithm**: The method used for rate limiting by controlling
tokens for requests in a "bucket".
- The SP-API utilizes a **token bucket algorithm** where tokens are added to a
bucket at a fixed rate. Each request depletes a token.
- Requests are throttled (receive a 429 error) when no tokens are available.
- Tokens are replenished based on the defined rate limit, which influences the
application's throughput.
1. **Standard Usage Plans**: Governed by static rate limits based on expected call
patterns.
2. **Dynamic Usage Plans**: Automatically adjusted based on each selling partner's
business needs, influenced by various metrics.
- **Throttling Handling**: A 429 response indicates that the request was throttled.
Implement a back-off strategy when retrying.
- **Testing in Sandbox**: You can test error handling for 429 responses using the
SP-API sandbox; however, rate limits for sandbox operations are uniform and do not
reflect production usage.
- **Dynamic Rate Changes**: While limits can be raised, they can also be reduced
with prior notice.
- **If Rate Limits Are Low**: Optimize call patterns or explore multi-request APIs.
- **Impact of More Authorizations**: Throttling does not increase with additional
authorizations; each application and selling partner pair has distinct limits.
- **Rate Change Communication**: Any reductions in rate limits are communicated in
advance.
- Refer to the **API Reference Documentation** for specific rate limits and usage
plans associated with API operations.
- Explore **Optimization Strategies** to align your application’s call patterns
with the available rate limits effectively.
By understanding the SP-API's usage plans and rate limits, developers can
efficiently manage their application’s requests while minimizing the risk of being
throttled.
_____________________________
Summary of URL: https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-
limits#will-rate-limits-change:
# Amazon Selling Partner API (SP-API) - Usage Plans and Rate Limits Summary
## Key Concepts
### 5. **Throttling**
- When requests exceed the rate limit, they are temporarily rejected, resulting in
a 429 error response.
## Conclusion
Understanding and effectively managing usage plans and rate limits is essential for
any developer integrating with the Amazon SP-API. By utilizing the correct
strategies and optimizing application workloads, you can ensure efficient use of
the API without recurring throttling issues.
_____________________________
This document provides essential details regarding how to manage usage plans and
rate limits while utilizing the Amazon Selling Partner API (SP-API).
1. **Rate Limit**:
- The maximum number of requests allowed to a specific operation per second.
- Exceeding this limit leads to throttling (HTTP error 429).
2. **Burst Limit**:
- The maximum number of requests that can be built up over time and submitted
simultaneously.
- It defines how many requests can be sent at once after brief periods of
inactivity.
3. **Usage Plans**:
- A combination of rate limit and burst limit specific to an API operation.
- It varies based on factors such as the selling partner account, application
calling the SP-API, and the marketplace.
5. **Throttling**:
- Occurs when requests exceed the set limits, resulting in a 429 HTTP error
response. Throttled requests can be retried later.
- **Documentation**: Usage plan details, including limits, can be found in the API
reference documentation.
- **Response Header**: The `x-amzn-RateLimit-Limit` response header specifies the
current rate limits per account-application pair, though its presence shouldn't be
relied upon.
While specific code examples or API snippets were not provided in the text,
developers should refer to the respective SP-API documentation related to the
operations they are using (like Orders API, Feeds API) to find appropriate code
samples that include respective fields and contract details.
- Dynamic limits can change based on the seller's business context, thus it is
essential to code applications that can adapt to changing limits.
- Rate limits can be increased or decreased by Amazon based on usage, but changes
will be communicated in advance.
## Overview
The Amazon Selling Partner API (SP-API) allows developers to interact with a
seller's account to gather and post data through various APIs. This document
outlines the usage plans and rate limits to help developers optimize their
application's API calls.
## Key Concepts
### Throttling
- Throttling occurs when requests exceed available tokens in the bucket, leading to
temporary rejection of requests.
Since the content did not provide any specific code examples or API snippets, below
is a hypothetical example illustrating how to check the rate limits on a request:
```python
import requests
# Usage
check_rate_limits("https://sellingpartnerapi-na.amazon.com/some-endpoint",
"your_access_token")
```
## Conclusion
Understanding usage plans and rate limits is crucial for effectively using the
Amazon SP-API. By implementing the token bucket strategy and dynamically adjusting
application behavior to respect these limits, developers can avoid throttling and
optimize their application workloads.
_____________________________
1. **Rate Limits**
- The maximum number of requests allowed to a specific operation per second.
- To avoid throttling, ensure your application stays below this limit.
2. **Burst Limits**
- The maximum number of requests that can be submitted simultaneously after
building up over time.
3. **Usage Plans**
- A combination of rate limit and burst limit specific to an operation.
- Plans can vary by selling partner account, marketplace, and the application
calling the API.
4. **Throttling**
- When requests exceed your rate limit, the API temporarily rejects them with an
HTTP 429 error.
- Implement a retry mechanism for throttled requests.
- **API Documentation**: Rate and burst limit details can be found in the API
reference documentation for each individual operation.
- **Response Header**: The `x-amzn-RateLimit-Limit` response header may provide the
operation's rate limits—though it should not be depended upon.
While specific classes and methods are not detailed in the provided content,
interaction with the SP-API generally involves:
- **Testing**: Use the SP-API sandbox to test your application, although be aware
that testing for rate limits is limited; production has different rates.
- **Handling 429 responses**: Always implement a back-off strategy when retrying
requests after receiving a throttled response.
- **Dynamic Limits**: Be wary of how dynamic limits can change based on business
metrics. Use provided headers to adapt to these adjustments in a live environment.
This summary provides a clear overview of key points necessary for developers to
effectively work with the Amazon SP-API regarding usage plans and rate limits. For
specific code implementations and examples, refer to detailed API documentation for
each operation.
_____________________________
## Key Concepts
1. **Usage Plans**: These define the rate limits (number of allowed requests) and
burst limits (maximum simultaneous requests) for each SP-API operation. They
control the number of requests based on:
- Selling partner account.
- Application calling the SP-API.
- Marketplace.
2. **Rate Limit**: The maximum number of requests allowed per second for a specific
operation. Exceeding this will trigger throttling.
4. **Throttling**: Occurs when the rate limit is exceeded, resulting in a 429 HTTP
error response. Retry after receiving this error.
6. **Token Bucket Algorithm**: This algorithm is used by SP-API for rate limiting,
where requests consume tokens. Tokens are replenished at a steady rate until the
burst limit is reached.
You can find the specific rate and burst limits for an SP-API operation by:
- Checking the API reference documentation for each operation.
- Looking at the `x-amzn-RateLimit-Limit` response header; however, do not rely
solely on this header as it may not always be present.
1. **Standard Usage Plans**: Fixed rate limits based on expected call patterns.
Each operation has predefined limits.
Each SP-API operation has an associated usage plan with quantifiable limits.
Example:
- **Operation**: `GET /orders/v0/orders`
- **Rate Limit**: 1 request per second
- **Burst Limit**: 2 requests
### Note
Dynamic usage plans apply specifically to operations within the Orders API and
Product Pricing operations.
- Efficient call patterns should minimize throttling; adjust call frequencies and
leverage push notifications where possible.
- If continuously throttled, optimize call patterns by batching requests or
reducing request frequency.
- Rate limits can be changed by Amazon, potentially impacting applications reliant
on specific thresholds.
- Do not hardcode timers; instead, code naturally against events to respond to
rate-limited operations efficiently.
- **Can my limits be increased**? Rate limits are designed for optimal application
operation, and consistent throttling indicates the need for optimizations rather
than limit adjustments.
- **How to handle a 429 response**: Implement a back-off strategy to manage
excessive requests gracefully.
- **Testing your application**: Use the Selling Partner API sandbox for error
handling testing but note that it does not simulate varied rate limits found in
production.
---
1. **Usage Plans**:
- Define how many requests can be made to an operation in a set time frame.
- Include two main components:
- **Rate Limit**: Maximum requests per second.
- **Burst Limit**: Maximum requests that can be dispatched simultaneously
after a buildup.
2. **Rate-limiting Algorithm**:
- **Token Bucket Algorithm**: Exchanging tokens for API requests. If the bucket
is empty, requests are throttled (resulting in a `429 HTTP error`).
- Tokens are added to the bucket at a defined rate until the burst limit is
reached.
3. **Throttling**:
- Occurs when a request exceeds the defined rate limit.
- Handled via retry logic — applications should implement a back-off strategy
upon receiving a `429` response.
4. **Grantless Operations**:
- Operations that do not require a seller ID, and usage plans for these
operations are independent of the selling partner.
---
- **Applications**:
- Represents the developer application calling the SP-API on behalf of the
selling partner and is identified with an application ID.
- **API Operations**:
- Each SP-API operation has specific rate and burst limits that can be viewed in
the API reference documentation.
---
---
- **API Documentation**: Review the SP-API documentation for operational rate and
burst limits.
- **Response Header**: Look for the `x-amzn-RateLimit-Limit` in the API response
header for the rate limits applicable to the request.
---
- **Avoiding Throttling**:
- Adjust call frequencies to stay within defined limits.
- Use push notifications to replace polling mechanisms.
- Utilize batch operations to reduce the number of API calls.
- **Handling Throttling**:
- Implement a back-off strategy when encountering a `429` status.
- Monitor the `x-amzn-RateLimit-Limit` header to adjust call patterns
dynamically.
- Rate limits can change; applicants are notified in advance of any reductions.
- Dynamic limits are influenced by selling partner business metrics and can adjust
automatically.
- Rates do not automatically increase based on historical API usage; they depend on
business metrics.
---
This overview provides essential guidance on understanding and leveraging the rate
limiting and usage plans associated with the Amazon Selling Partner API,
particularly tailored for developers using the API in Python.
_____________________________
## Key Concepts
### Terminology
- **Rate Limit**: Maximum number of requests allowed per second for a specific
operation.
- **Burst Limit**: Maximum number of requests that can be submitted simultaneously
after being built up.
- **Usage Plan**: A combination of rate limit and burst limit for a specific
operation.
- **Token Bucket Algorithm**: The algorithm used to manage rate limiting, allowing
requests as long as tokens (representing permissions) are available.
- **Throttling**: Occurs when requests exceed defined rate limits, resulting in a
429 HTTP status code.
## Optimization Strategies
- Optimize API call patterns to remain below the rate limits, consider alternate
approaches such as batch processing or using notifications to trigger actions
instead of polling.
- Monitor application behavior to detect and adjust for changes in usage patterns
leading to throttling.
1. **Usage Plans**:
- **Usage Plan**: A combination of rate and burst limits for a specific API
operation.
- **Rate Limit**: Maximum number of requests allowed per second for an
operation.
- **Burst Limit**: Maximum requests that can be accumulated over time and
submitted simultaneously.
2. **Rate-Limiting Algorithm**:
- **Token Bucket Algorithm**: The SP-API uses this algorithm to manage rate
limiting. Tokens are added to a "bucket" at a defined rate; each request consumes a
token. If the bucket is empty, requests are throttled, resulting in a 429 HTTP
error.
3. **Throttling**:
- When requests exceed limits, they are temporarily rejected, leading to a 429
error response. These requests can be retried after waiting.
4. **Grantless Operations**:
- Operations that do not require a seller ID or authorization, impacting how
usage plans are determined.
- **API operation**: Each operation has predefined rate and burst limits.
- **Selling partner and application pair**: Rates are specific to each client-app
interaction.
- **Regions and marketplaces**: Limits depend on the selling partner's operating
marketplace.
#### Conclusion
Understanding the usage plans and rate limits is crucial for developing efficient
applications with the SP-API. Proper management and optimization of API calls will
result in better performance and fewer throttling incidents.
_____________________________
2. **Burst Limit**: Maximum number of requests that can be sent in a burst after
building up over time.
3. **Usage Plan**: Combines the rate limit and burst limit for a specific
operation.
4. **Token Bucket Algorithm**: The SP-API utilizes this algorithm to manage rate
limiting. Each request consumes a token, and tokens are replenished at a
predetermined rate. Exceeding this limit results in a throttled request (HTTP 429
error).
6. **Grantless Operations**: These do not require `sellerId` and are not affected
by the same rate limiting rules.
```python
import time
import requests
def call_sp_api(url):
while True:
response = requests.get(url)
if response.status_code == 200:
return response.json()
elif response.status_code == 429:
# Throttled, back off
retry_after = int(response.headers.get("Retry-After", 1)) # default to
1 second
print(f'Throttled. Retrying after {retry_after} seconds...')
time.sleep(retry_after)
else:
# Handle other errors
response.raise_for_status()
```
### Conclusion
Understanding the usage plans and rate limits is essential for optimizing the
performance of applications using the Amazon SP-API. Developers must account for
the potential of being throttled and implement strategies for effective API calls.
_____________________________
1. **Usage Plans**:
- Define how the Selling Partner API (SP-API) controls request limits based on
various factors such as selling partner accounts, applications calling the API, and
marketplaces.
- Usage plans consist of a **rate limit** (max requests per second) and a
**burst limit** (max requests that can be accumulated and sent at once).
2. **Rate Limiting**:
- Achieved using a **token bucket algorithm**:
- Tokens are added to the "bucket" at a set rate.
- Each request consumes a token.
- If no tokens are available, requests are throttled with a 429 error
response.
3. **Throttling**:
- Occurs when requests exceed the defined rate limit. In this case, the API
returns a 429 HTTP error, and requests can be retried later.
4. **Grantless Operations**:
- Operations that do not require a seller ID, and thus are not impacted by the
selling partner's usage plan.
```python
import time
import requests
### Conclusion
Understanding and managing usage plans is crucial for successfully interacting with
the Amazon Selling Partner API. By adhering to rate limit guidelines and optimizing
application patterns, developers can maintain efficient and reliable application
performance.
_____________________________
1. **Rate Limit**: The maximum number of requests allowed to an API operation per
second. Staying below this limit prevents throttling.
3. **Usage Plan**: Defines the combination of rate limit and burst limit for a
specific operation, affected by various factors such as the selling partner account
and the application making the request.
4. **Token Bucket Algorithm**: The SP-API employs this algorithm to manage rate
limiting, where requests consume tokens from a bucket that fills at predefined
rates.
5. **Throttling**: When the rate limit is exceeded, the system may temporarily
reject requests, responding with a 429 HTTP status code.
- **Standard Usage Plans**: Static limits based on expected usage patterns for most
SP-API operations.
- **Dynamic Usage Plans**: Adjusted to meet real-time business needs based on
historical metrics for specific operations.
- Applications should implement proper handling for 429 responses, with strategies
for back-off and retry based on returned headers.
- To connect to the SP-API, use the applicable SDK in your programming language
(e.g., Python SDK).
```python
import requests
if response.status_code == 429:
print("Rate limit exceeded. Try again later.")
else:
return response.json()
```
- **Error Handling**: Implement retry logic for 429 responses, and track limits
using headers when available.
By adhering to these guidelines and understanding the core concepts outlined,
developers can effectively manage their API interactions while navigating the
constraints of Amazon's SP-API.
_____________________________
## Key Concepts
### Throttling
- Occurs when requests exceed the allowed rate limit, resulting in a 429 HTTP error
response. Throttled requests can be retried later.
## Important Notes
- The developers should not rely solely on the presence of the `x-amzn-RateLimit-
Limit` response header; ensure proper error handling strategies are implemented.
- Applications can be throttled due to uncontrollable factors; developers should
build resilience into their error handling.
- Usage plans influence resources across different operations; understanding these
can help optimize call patterns.
## Key Concepts
## Example Scenario
- For instance, consider an operation with a rate limit of 1 request per second and
a burst limit of 2 tokens:
- At `01:00:100`, an application calls the API, successfully using up 1 token
(tokens left: 1).
- At `01:00:200`, another successful call reduces tokens to 0.
- At `01:00:300`, a call is made, but the request is throttled due to an empty
bucket.
## FAQs
1. **Can rate limits be increased?**
- No direct increase; assess and optimize your application's call patterns
instead.
## Conclusion
Understanding the usage plans and rate limits of Amazon SP-API is crucial for
effective application performance and avoiding throttling. Adhering to the
recommendations laid out in the documentation will help developers optimize their
API interactions.
_____________________________
Summary of URL: https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-
limits-in-the-sp-api#the-rate-limits-for-one-operation-are-too-low-for-my-use-case-
can-the-limit-be-increased:
## Amazon Selling Partner API (SP-API) Usage Plans and Rate Limits Summary
**1. Rate Limit**: The maximum number of requests the SP-API allows per second for
a specific operation. Exceeding this limit leads to throttling.
**2. Burst Limit**: The maximum number of requests you can batch and send at once
that exceeds the rate limit.
**3. Usage Plan**: A combination of rate limit and burst limit that applies to a
specific operation.
**4. Token Bucket Algorithm**: The SP-API uses this algorithm to manage request
rates. Each request consumes a token from the “bucket,” refilled at a specific
rate. A request will be throttled (HTTP error 429) if there are no tokens
available.
**5. Throttling**: The condition when the SP-API rejects requests due to exceeding
rate limits, resulting in a 429 error.
- **API Operation**: Different operations have specific rate and burst limits
documented in the API reference.
- **Selling Partner and Application Pair**: Most operations’ limits are based on
the selling partner account and the associated application.
- **Regions and Marketplaces**: Different marketplace accounts may have distinct
rate limits and usage plans.
**1. Standard Usage Plans**: Fixed rate and burst limits for most operations as per
documented expectations.
**2. Dynamic Usage Plans**: Adjusted based on historical and current business
needs, applied to specific operations like:
- Orders V0
- Product Pricing v2022-05-01
- **SP-API Documentation**: Check the API reference for the respective operation
limits.
- **Response Header**: `x-amzn-RateLimit-Limit` header provides rate limit
information if available. However, do not rely on its presence.
Here is a hypothetical example that demonstrates how to check and handle rate
limits:
```python
import requests
def call_sp_api(api_endpoint):
response = requests.get(api_endpoint)
### Conclusion
Understanding and effectively managing usage plans and rate limits within the
Amazon SP-API allows for robust application performance. By adhering to the
outlined guidelines regarding request limits and the token bucket algorithm,
developers can minimize issues related to throttling and optimize their integration
with Amazon's systems.
_____________________________
1. **Usage Plans**: Define the number of requests allowed for specific operations
within a timeframe. They depend on factors like the selling partner account,
calling application, and marketplace.
2. **Rate Limit**: The maximum number of requests allowed per second for an
operation.
3. **Burst Limit**: The maximum number of requests that can be accumulated and
submitted simultaneously.
4. **Token Bucket Algorithm**: The method used for rate limiting, allowing requests
to be made as long as tokens are available. Tokens accumulate at a defined rate
until reaching the burst limit.
5. **Throttling**: When requests exceed the rate limit, the API responds with a 429
HTTP error, indicating that the request should be retried later.
- **API Call Structure**: Each API call checks usage plans and limits based on the
access token. Call examples include:
```python
response =
requests.get("https://sellingpartnerapi-na.amazon.com/orders/v0/orders", headers={
"Authorization": f"Bearer {access_token}",
"x-amzn-RateLimit-Limit": rate_limit
})
```
```python
if response.status_code == 429:
# Implement back-off strategy here
time.sleep(retry_after)
# Retry the request
```
- **Standard Usage Plans**: Fixed limits set based on the expected usage patterns
for operations (common for most SP-API operations).
- **Dynamic Usage Plans**: Adjust based on historical and current metrics of the
selling partner's business, leading to more tailored rate and burst limits.
- **Testing Rate Limits**: Use the SP-API sandbox to simulate API calls, but
remember that the sandbox has uniform rate limits compared to production.
This summary provides essential insights into navigating the rate limits and usage
plans of the Amazon Selling Partner API, crucial for developers working with the
library to optimize performance and manage API interactions effectively.
_____________________________
1. **Rate Limit**: Maximum number of requests allowed per second for a specific
operation.
2. **Burst Limit**: Maximum number of requests that can be built up and submitted
simultaneously.
3. **Usage Plan**: Combination of rate limit and burst limit for a specific API
operation.
4. **Throttling**: Occurs when requests exceed the rate limit, resulting in a 429
HTTP error response.
5. **Token Bucket Algorithm**: The algorithm used for rate limiting which allows
requests based on an available "token" bucket filled at a defined rate.
- This algorithm employs a "bucket" analogy where tokens are added at a defined
rate up until a maximum (burst limit). Requests consume these tokens:
- Once the tokens are depleted, subsequent requests result in throttling (429
error).
- Tokens replenish at the set rate.
- **API Operation**: Each SP-API operation has specific rate and burst limits.
- **Application and Selling Partner**: Usage limits are typically per application
and the selling partner account.
- **Marketplace and Region**: Different marketplaces and regions may have distinct
limits.
#### Caveats
While the documentation didn’t provide specific code snippets related to usage
plans and rate limits, developers are encouraged to implement proper error handling
based on the HTTP status codes.
```python
import requests
# Example usage
data = call_sp_api('https://sellingpartnerapi-na.amazon.com/some_endpoint',
{'param1': 'value1'})
```
This snippet demonstrates a basic pattern to communicate with the SP-API, handle
throttling appropriately, and process successful responses.
## Key Concepts
### Usage Plans and Rate Limits
- **Rate Limit**: Maximum number of requests allowed per operation per second.
- **Burst Limit**: Maximum number of requests that can be submitted simultaneously
after being accumulated over time.
- **Usage Plan**: Combines rate limit and burst limit for specific operations.
- **Token Bucket Algorithm**: The mechanism used to control the rate of requests.
Each request consumes a token; tokens are replenished based on the rate limit.
### Throttling
- If a request exceeds the allowed rate, it results in a `429 HTTP error` response.
Developers should implement retry logic to handle these cases.
```python
import requests
import time
if response.status_code == 200:
return response.json()
elif response.status_code == 429: # Throttled
rate_limit_info = response.headers.get('x-amzn-RateLimit-Limit')
print(f'Throttled! Rate Limit: {rate_limit_info}')
time.sleep(1) # Implement exponential back-off strategy
else:
response.raise_for_status() # Raise error for other status codes
```
```python
rate_limit = response.headers.get('x-amzn-RateLimit-Limit', 'Not Available')
print(f"Current Rate Limit: {rate_limit}")
```
## Important Notes
- Ensure to **not depend solely** on the presence of `x-amzn-RateLimit-Limit` in
the response, as it may not always be present.
- Dynamic limits can change based on the selling partner’s metrics. Your
application should be designed to adapt to these changes rather than hard-coding
limits.
- For grantless operations, the selling partner account is not a factor; usage
plans are defined based on other criteria.
## Caveats
- Throttling can happen due to various reasons; hence a robust error handling
strategy is essential.
- Periodic updates to rate limits may occur without prior notification from Amazon;
keep your implementation flexible.
## Best Practices
- Optimize call patterns to reduce the frequency of calls, use push notifications
instead of polling, and batch API calls where possible.
- Regularly check for updates regarding API documentation and changes in rate
limits.
## Conclusion
Understanding usage plans and rate limits is crucial for building efficient
applications with the Amazon SP-API. By leveraging the token bucket algorithm and
adhering to the defined limits, developers can enhance application reliability and
performance.
_____________________________
2. **Burst Limit**: Maximum requests that can be accumulated over time and sent
simultaneously to a specific operation.
- **Standard Usage Plans**: Rate limits are static and apply equally to all users.
- **Dynamic Usage Plans**: Adjusts limits according to business needs based on
current and historical data, applicable only for designated operations.
- Each operation has an associated rate limit (tokens added per second) and a burst
limit (maximum tokens held).
- Requests deplete tokens; if none are available, requests will be throttled
(resulting in a `429` error).
**Example Scenario**:
- Rate limit: 1 token/second, Burst limit: 2 tokens.
- Initial state: Bucket holds 2 tokens.
- At `01:00:100`, 1 request sent → Bucket = 1 token.
- At `01:00:200`, 1 request sent → Bucket = 0 tokens.
- At `01:00:300`, request throttled.
- At `01:01:000`, 1 token added → Imagine subsequent requests.
- **Can limits be increased?**: They are generally fixed but may be adjusted if
call patterns are optimized.
- **What to do on a 429 error?**: Implement a back-off strategy; retry the request
after stabilizing call patterns.
- **Testing usage plans**: Use the SP-API sandbox for error handling testing, but
remember that sandbox operations share limits.
- **Complete avoidance of throttling**: It's impossible due to variables outside
control; design applications to manage transient throttles gracefully.
### Conclusion
Understanding and effectively utilizing the usage plans and rate limits of the
Amazon SP-API is essential for developing robust applications. Developers should
follow best practices for optimizing API calls and managing rate limits to ensure
seamless integration and operation within the Amazon ecosystem.
This summary provides an overview of essential elements for working with the Amazon
SP-API rate limits and usage plans, enabling developers to avoid common pitfalls
related to API throttling and optimize their application's request patterns.
_____________________________
Summary of URL: https://developer-docs.amazon.com/sp-api/docs/sp-api-endpoints:
### Summary of SP-API Endpoints Documentation
#### Overview
The Selling Partner API (SP-API) provides interfaces that allow users to interact
programmatically with Amazon’s selling partner tools by gathering and posting data
on seller accounts. This guide focuses on the necessary endpoints, integration
processes, and the available functionalities within the SP-API.
2. **Authorization**:
- Applications must be authorized to access the SP-API. Authorization involves
obtaining credentials and managing self-authorization along with token renewals.
3. **Data Handling**:
- The API supports operations for various data types, including orders,
products, reports, and finances.
url = "https://sellingpartnerapi-na.amazon.com/orders/v0/orders"
headers = {
"Authorization": f"Bearer {authorization_token}",
"Content-Type": "application/json",
"User-Agent": "YourApp/1.0"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
data = response.json()
```
- **Rate Limits**:
- Be aware of usage plans and rate limits imposed by Amazon for API calls, as
exceeding limits may lead to throttling.
- **Error Handling**:
- Implement error handling for API request failures, including distinguishing
between authorization errors and request format issues.
- **SDK Usage**:
- Several SDKs are available for automating SP-API calls including those for
Python, Java, and C#, which streamline integration. Always check if you're using
the latest version of the SDKs.
#### Europe
| Country | Marketplace ID | Country Code |
|-----------------------------|----------------------------|--------------|
| Spain | A1RKKUPIHCS9HSES | - |
| United Kingdom | A1F83G8C2ARO7PUK | - |
| France | A13V1IB3VIYZZHFR | - |
| Belgium | AMEN7PMS3EDWLBEN | - |
| Netherlands | A1805IZSGTT6HSNLG | - |
| Germany | A1PA6795UKMFR9DE | - |
| Italy | APJ6JRA9NG5V4IT | - |
| Sweden | A2NODRKZP88ZB9SE | - |
| South Africa | AE08WJ6YKNBMCZAP | - |
| Poland | A1C3SOZRARQ6R3PL | - |
| Egypt | ARBP9OOSHTCHUEGT | - |
| Turkey | A33AVAJ2PDY3EVTR | - |
| Saudi Arabia | A17E79C6D8DWNPSA | - |
| United Arab Emirates | A2VIGQ35RCS4UGAE | - |
| India | A21TJRUUN4KGVIN | - |
## Key Concepts
- **Marketplace ID Usage:** When making requests to the SP-API, include the
relevant `marketplaceId` in your API call to specify the target marketplace for the
operation. This ensures that the data retrieved or posted pertains to the correct
geographical location and its regulations.
- **Country Codes:** Each marketplace ID has an associated country code which may
be useful for further regional identification.
This summary provides essential information for developers working with the Amazon
Selling Partner API related to marketplace IDs. Always refer to the full API
documentation for comprehensive details about making effective use of these
identifiers in your API calls.
_____________________________
**North America:**
| Country | Marketplace ID | Country Code |
|-----------------------|---------------------|--------------|
| Canada | A2EUQ1WTGCTBG2CA | CA |
| United States | ATVPDKIKX0DERUS | US |
| Mexico | A1AM78C64UM0Y8MX | MX |
| Brazil | A2Q3Y263D00KWCBR | BR |
**Europe:**
| Country | Marketplace ID | Country Code |
|---------------|---------------------|--------------|
| Spain | A1RKKUPIHCS9HSES | ES |
| United Kingdom | A1F83G8C2ARO7PUK | GB |
| France | A13V1IB3VIYZZHFR | FR |
| Belgium | AMEN7PMS3EDWLBEN | BE |
| Netherlands | A1805IZSGTT6HSNLG | NL |
| Germany | A1PA6795UKMFR9DE | DE |
| Italy | APJ6JRA9NG5V4ITS | IT |
| Sweden | A2NODRKZP88ZB9SE | SE |
| South Africa | AE08WJ6YKNBMCZAP | ZA |
| Poland | A1C3SOZRARQ6R3PL | PL |
| Egypt | ARBP9OOSHTCHUEGT | EG |
| Turkey | A33AVAJ2PDY3EVTR | TR |
| Saudi Arabia | A17E79C6D8DWNPSA | SA |
| United Arab Emirates | A2VIGQ35RCS4UGAE | AE |
| India | A21TJRUUN4KGVIN | IN |
**Far East:**
| Country | Marketplace ID | Country Code |
|-------------|---------------------|--------------|
| Singapore | A19VAU5U5O7RUSSG | SG |
| Australia | A39IBJ37TRP1C6AU | AU |
| Japan | A1VC38T7YXB528JP | JP |
This example demonstrates making an API call with the appropriate headers and
marketplace ID. Developers are encouraged to implement error checking and handle
various HTTP response statuses as part of their integration logic.
_____________________________
2. **Country Code**:
- Each marketplace ID is paired with a country code, which may be necessary in
certain API calls or configurations.
3. **API Requests**:
- When making SP-API requests, ensure to include the relevant `marketplaceId` in
your parameters, especially for methods that operate on product listings, pricing,
and inventory management.
#### Overview
Amazon's Selling Partner API (SP-API) offers interaction with a customer's selling
partner data, allowing developers to gather and post data to the selling account.
It supports various marketplaces, each identified by a unique `marketplaceId`.
**North America**
- Canada: `A2EUQ1WTGCTBG2CA`
- United States: `ATVPDKIKX0DERUS`
- Mexico: `A1AM78C64UM0Y8MX`
- Brazil: `A2Q3Y263D00KWCBR`
**Europe**
- Spain: `A1RKKUPIHCS9HSES`
- United Kingdom: `A1F83G8C2ARO7PUK`
- France: `A13V1IB3VIYZZHFR`
- Belgium: `AMEN7PMS3EDWLBEN`
- Netherlands: `A1805IZSGTT6HSNLG`
- Germany: `A1PA6795UKMFR9DE`
- Italy: `APJ6JRA9NG5V4ITS`
- Sweden: `A2NODRKZP88ZB9SE`
- South Africa: `AE08WJ6YKNBMCZAP`
- Poland: `A1C3SOZRARQ6R3PLE`
- Egypt: `ARBP9OOSHTCHUEGT`
- Turkey: `A33AVAJ2PDY3EVTR`
- Saudi Arabia: `A17E79C6D8DWNPSA`
- United Arab Emirates: `A2VIGQ35RCS4UGAE`
- India: `A21TJRUUN4KGVIN`
**Far East**
- Singapore: `A19VAU5U5O7RUSSG`
- Australia: `A39IBJ37TRP1C6AU`
- Japan: `A1VC38T7YXB528JP`
This summary provides essential details for developers looking to work with
Amazon's SP-API concerning marketplace IDs. Always refer to the API documentation
for updates and more detailed explanations.
_____________________________
### Overview:
The Amazon Selling Partner API (SP-API) provides developers the ability to gather
and post data to a customer’s selling partner account via an array of marketplace
identifiers (marketplaceIds). Each marketplace ID is crucial for making requests
through the API.
#### Europe:
| Country | Marketplace ID | Country Code |
|---------------------|-----------------------|--------------|
| Spain | A1RKKUPIHCS9HSES | ES |
| United Kingdom | A1F83G8C2ARO7PUK | GB |
| France | A13V1IB3VIYZZHFR | FR |
| Belgium | AMEN7PMS3EDWLBEN | BE |
| Netherlands | A1805IZSGTT6HSNLG | NL |
| Germany | A1PA6795UKMFR9DE | DE |
| Italy | APJ6JRA9NG5V4ITS | IT |
| Sweden | A2NODRKZP88ZB9SE | SE |
| South Africa | AE08WJ6YKNBMCZAP | ZA |
| Poland | A1C3SOZRARQ6R3PL | PL |
| Egypt | ARBP9OOSHTCHUEGT | EG |
| Turkey | A33AVAJ2PDY3EVTR | TR |
| Saudi Arabia | A17E79C6D8DWNPSA | SA |
| United Arab Emirates | A2VIGQ35RCS4UGAE | AE |
| India | A21TJRUUN4KGVIN | IN |
### Prerequisites
To complete the tutorial, ensure you have the following:
- A hybrid or SP-API app in draft or published state
- Integrated Development Environment (IDE) (e.g., Visual Studio IDE)
- Python (version 3.6 or later)
- `swagger-codegen-cli` (version 2.3 or later)
setup(
name='SellingPartnerAPIAuthAndAuthPython',
version='1.0.0',
package_dir={'': 'src'},
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'
)
```
config = SPAPIConfig(
client_id="Your client-id",
client_secret="Your client-secret",
refresh_token="Your refresh-token",
region="NA",
scope=None
)
api_client = SPAPIClient(config)
marketplace_ids = ["ATVPDKIKX0DER"]
created_after = "2024-01-19T00:00:00"
orders_api = api_client.get_api_client('OrdersV0Api')
orders_response = orders_api.get_orders(marketplace_ids=marketplace_ids,
created_after=created_after)
print("Orders API Response:")
print(orders_response)
```
### Conclusion
This tutorial guides users through creating a Python SDK for automating SP-API
calls, particularly to the Orders API, covering setup, configuration, and execution
of API requests. Follow the outlined steps to efficiently integrate and interact
with Amazon marketplace features within your applications.
_____________________________
## Overview
This tutorial provides a comprehensive guide on how to automate calls to the Amazon
Selling Partner API (SP-API) using a Python SDK. It includes prerequisites, setup
instructions, and example code for interacting with the Orders API.
## Prerequisites
Before starting, ensure you have:
- A hybrid or SP-API app in draft or published state.
- An integrated development environment (IDE) (e.g., Visual Studio).
- Python version 3.6 or later installed.
- Swagger Codegen CLI version 2.3 or later.
2. **Install Dependencies**:
Run the following command to install the backoff library:
```bash
pip install backoff
```
setup(
name='SellingPartnerAPIAuthAndAuthPython', # Update with your package's
name
version='1.0.0', # Update with your package's version
package_dir={'': 'src'},
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'
)
```
api_client = SPAPIClient(config)
marketplace_ids = ["ATVPDKIKX0DER"]
created_after = "2024-01-19T00:00:00"
orders_api = api_client.get_api_client('OrdersV0Api')
orders_response = orders_api.get_orders(marketplace_ids=marketplace_ids,
created_after=created_after)
print("Orders API Response:", orders_response)
```
## Overview
This tutorial provides guidance on automating Selling Partner API (SP-API) calls
using a Python SDK. It includes prerequisites, setup instructions, and code
snippets to assist developers in integrating Amazon marketplace features into their
applications.
## Prerequisites
1. **SP-API App**: Must be in draft or published state.
2. **IDE Software**: Development environment software installed.
3. **Python**: Version 3.6 or later.
4. **Swagger Codegen CLI**: Version 2.3 or later for generating Python client code
from the SP-API's Swagger definitions.
## Step-by-Step Guide
setup(
name='SellingPartnerAPIAuthAndAuthPython',
version='1.0.0',
package_dir={'': 'src'},
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'
)
```
### Step 5: Create an Instance of the Orders API and Invoke an Operation
Use the following sample code to make a `getOrders` request:
```python
if __name__ == "__main__":
from auth.credentials import SPAPIConfig
config = SPAPIConfig(
client_id="Your client-id",
client_secret="Your client-secret",
refresh_token="Your refresh-token",
region="NA", # Options: NA, EU, FE, SANDBOX
scope = None # Use for grant_type='client_credentials'
)
api_client = SPAPIClient(config)
marketplace_ids = ["ATVPDKIKX0DER"]
created_after = "2024-01-19T00:00:00"
orders_api = api_client.get_api_client('OrdersV0Api')
orders_response = orders_api.get_orders(marketplace_ids=marketplace_ids,
created_after=created_after)
print("Orders API Response:")
print(orders_response)
```
### Step 6: Connect to the Selling Partner API Using the Generated Python SDK
1. Build and install your SDK locally:
```bash
python3 setup.py sdist bdist_wheel
pip install dist/{YourPackageName}-1.0.0-py3-none-any.whl
```
2. Run a test script to validate the installation:
```bash
python test.py
```
## Important Notes
- Successful API calls return a status code of 200.
- Ensure that LWA credentials are stored securely and not exposed.
## Conclusion
This guide covers the complete setup and execution process for automating SP-API
calls using a Python SDK. The process involves setting up the development
environment, generating client code, handling authentication, and invoking API
operations.
_____________________________
## Overview
This tutorial provides a step-by-step guide to automate calls to the Amazon Selling
Partner API (SP-API) using a Python SDK. It covers setting up your local workspace,
generating the SDK, and invoking API operations such as retrieving orders.
## Prerequisites
Before proceeding, ensure you have the following:
- A hybrid or SP-API app in draft or published state.
- An Integrated Development Environment (IDE) (e.g., Visual Studio).
- Python version 3.6 or later.
- The `swagger-codegen-cli` (version 2.3 or later) for generating client code.
## Step-by-Step Guide
setup(
name='SellingPartnerAPIAuthAndAuthPython',
version='1.0.0',
package_dir={'': 'src'},
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'
)
```
### Step 5: Create an Instance of the Orders API and Invoke an Operation
Example code for using the Python SDK with the Orders API:
```python
if __name__ == "__main__":
from auth.credentials import SPAPIConfig
config = SPAPIConfig(
client_id="Your client-id",
client_secret="Your client-secret",
refresh_token="Your refresh-token",
region="NA", # Possible values NA, EU, FE, and SANDBOX
scope=None # Required for grant_type='client_credentials'
)
marketplace_ids = ["ATVPDKIKX0DER"]
created_after = "2024-01-19T00:00:00"
orders_api = api_client.get_api_client('OrdersV0Api')
orders_response = orders_api.get_orders(marketplace_ids=marketplace_ids,
created_after=created_after)
print("Orders API Response:")
print(orders_response)
```
**Important Note**: Never commit sensitive information like LWA credentials to
version control. Securely store credentials in an encrypted format.
### Step 6: Connect to the Selling Partner API Using the Generated Python SDK
1. Build and install your SDK:
```bash
python3 setup.py sdist bdist_wheel
pip install dist/{YourPackageName}-1.0.0-py3-none-any.whl
```
## Conclusion
This tutorial guides you through the setup and integration of a Python SDK for
automating calls to the Amazon SP-API. By following these steps, you can
effectively manage orders and access product information through the SP-API. Make
sure to handle your API credentials securely to protect sensitive information.
_____________________________
This tutorial guides you through the process of automating your Selling Partner API
(SP-API) calls with a Python SDK. It focuses on generating a Python client using
Swagger definitions and connecting to the SP-API.
- **Selling Partner API (SP-API)**: A set of APIs that allows integrations with
Amazon marketplace features, such as product information, order management, and
shipment handling.
#### Prerequisites:
setup(
name='SellingPartnerAPIAuthAndAuthPython',
version='1.0.0',
package_dir={'': 'src'},
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'
)
```
marketplace_ids = ["ATVPDKIKX0DER"]
created_after = "2024-01-19T00:00:00"
orders_api = api_client.get_api_client('OrdersV0Api')
orders_response = orders_api.get_orders(marketplace_ids=marketplace_ids,
created_after=created_after)
print("Orders API Response:", orders_response)
```
- **Note**: Do not commit files containing sensitive information (e.g., LWA
credentials).
- Ensure that proper permissions are set when requesting access to the Selling
Partner API.
- The generated SDK allows for integration with various Amazon Marketplace
features, but authentication setup is essential for functionality.
- Always keep sensitive information regarding credentials secure and encrypted.
This summary should provide a developer with a comprehensive guide on how to set up
and use the Python SDK for interacting with the Amazon SP-API.
_____________________________
## Overview
This tutorial guides developers to automate their Selling Partner API (SP-API)
calls using a Python SDK. It covers prerequisites, setup, SDK generation, and
making API calls, specifically focusing on the Orders API.
## Prerequisites
To follow the tutorial, you need:
- A hybrid or SP-API app in draft or published state.
- An Integrated Development Environment (IDE) like Visual Studio.
- Python 3.6 or later installed.
- Swagger Codegen CLI (version 2.4.13 or later) for client code generation.
## Steps
setup(
name='SellingPartnerAPIAuthAndAuthPython', # Your package's name
version='1.0.0', # Your package's version
package_dir={'': 'src'}, # Adjust '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'
)
```
### Step 5: Create an Instance of the Orders API and Invoke an Operation
- Use the following code snippet to create an instance of the Orders API:
```python
if __name__ == "__main__":
from auth.credentials import SPAPIConfig
config = SPAPIConfig(
client_id="Your client-id",
client_secret="Your client-secret",
refresh_token="Your refresh-token",
region="NA", # Region options: NA, EU, FE, SANDBOX
scope = None # For grant_type='client_credentials'; Possible values:
"sellingpartnerapi::notifications", "sellingpartnerapi::migration"
)
marketplace_ids = ["ATVPDKIKX0DER"]
created_after = "2024-01-19T00:00:00"
orders_api = api_client.get_api_client('OrdersV0Api')
orders_response = orders_api.get_orders(marketplace_ids=marketplace_ids,
created_after=created_after)
print("Orders API Response:")
print(orders_response)
```
### Step 6: Connect to the Selling Partner API
- Build and install your SDK:
```bash
python3 setup.py sdist bdist_wheel
pip install dist/{YourPackageName}-1.0.0-py3-none-any.whl
```
- Run a test script:
```bash
python test.py
```
## Important Notes
- Always keep your LWA credentials secure and never commit sensitive files to
version control.
- A response with a status code of 200 indicates a successful API call.
## Conclusion
This tutorial provides the foundational steps needed to automate SP-API calls with
a Python SDK, setting up the workspace, generating SDK, and making calls to the
Orders API. Follow each step carefully for successful implementation.
_____________________________
- **Python SDK**: A library to facilitate API interaction using Python. This SDK
enables integration with various Amazon marketplace features like product
information access, order management, and shipment handling.
- **LWA (Login with Amazon)**: An authentication method required for accessing the
SP-API.
#### Prerequisites
setup(
name='SellingPartnerAPIAuthAndAuthPython', # Package name
version='1.0.0', # Package version
package_dir={'': 'src'}, # Source directory
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'
)
```
api_client = SPAPIClient(config)
marketplace_ids = ["ATVPDKIKX0DER"]
created_after = "2024-01-19T00:00:00"
orders_api = api_client.get_api_client('OrdersV0Api')
orders_response = orders_api.get_orders(marketplace_ids=marketplace_ids,
created_after=created_after)
print("Orders API Response:")
print(orders_response)
```
**Caution**: Never commit sensitive files like those containing LWA credentials to
version control. Securely store credentials in an encrypted format.
### Conclusion
This tutorial guides you through automating SP-API calls using a Python SDK. You
learned how to set up your workspace, generate the required client for SP-API,
integrate authentication, create an Orders API instance, and test the setup
effectively.
## Overview
This tutorial guides developers in setting up a Python SDK to automate calls to the
Amazon Selling Partner API (SP-API). It covers prerequisites, workspace setup, SDK
generation, authentication integration, and a practical example of invoking API
requests.
## Prerequisites
Before you start, ensure you have:
- A hybrid or SP-API app in draft or published state.
- An Integrated Development Environment (IDE), such as Visual Studio.
- Python (version 3.6 or later) installed.
- Swagger Codegen CLI (version 2.3 or later) to generate Python SDK from SP-API's
Swagger definitions.
## Step-by-Step Instructions
### Step 1: Set Up Your Workspace
1. Create a directory for this project, e.g., `SPAPI_Python_SDK`.
2. Clone the client repository and download necessary tools.
3. Run the commands in your terminal:
```bash
wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.13/
swagger-codegen-cli-2.4.13.jar -O swagger-codegen-cli.jar
cp swagger-codegen-cli.jar C:\\SPAPI_Python_SDK
pip install backoff
git clone https://github.com/amzn/selling-partner-api-models
```
setup(
name='SellingPartnerAPIAuthAndAuthPython', # Package name
version='1.0.0', # Package version
package_dir={'': 'src'}, # Source directory
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' # URL of your package
)
```
### Step 5: Create an Instance of the Orders API and Invoke an Operation
Example code to make a `getOrders` request:
```python
if __name__ == "__main__":
from auth.credentials import SPAPIConfig
config = SPAPIConfig(
client_id="Your client-id",
client_secret="Your client-secret",
refresh_token="Your refresh-token",
region="NA", # Possible values: NA, EU, FE, and SANDBOX
scope=None # Required for grant_type='client_credentials'
)
marketplace_ids = ["ATVPDKIKX0DER"]
created_after = "2024-01-19T00:00:00"
orders_api = api_client.get_api_client('OrdersV0Api')
orders_response = orders_api.get_orders(marketplace_ids=marketplace_ids,
created_after=created_after)
print("Orders API Response:")
print(orders_response)
```
### Conclusion
By following this tutorial, you will have set up a Python SDK for automating your
SP-API calls, including making requests to the Orders API.
_____________________________
This tutorial guides you through automating calls to the Amazon Selling Partner API
(SP-API) using a Python SDK. The following sections highlight prerequisites, setup
instructions, code examples, important classes, functions, and guidelines.
### Prerequisites
To follow this tutorial, ensure you have:
- A hybrid or SP-API application in a draft or published state.
- Integrated Development Environment (IDE) software (e.g., Visual Studio).
- Python (version 3.6 or later).
- `swagger-codegen-cli-2.3` or later for generating Python client code from Swagger
definitions.
setup(
name='SellingPartnerAPIAuthAndAuthPython',
version='1.0.0',
package_dir={'': 'src'},
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'
)
```
#### Step 5: Create an Instance of the Orders API and Invoke an Operation
Here’s a code snippet to initialize the Orders API:
```python
if __name__ == "__main__":
from auth.credentials import SPAPIConfig
config = SPAPIConfig(
client_id="Your client-id",
client_secret="Your client-secret",
refresh_token="Your refresh-token",
region="NA", # Options: NA, EU, FE, SANDBOX
scope="sellingpartnerapi::notifications"
)
marketplace_ids = ["ATVPDKIKX0DER"]
created_after = "2024-01-19T00:00:00"
orders_api = api_client.get_api_client('OrdersV0Api')
orders_response = orders_api.get_orders(marketplace_ids=marketplace_ids,
created_after=created_after)
print("Orders API Response:")
print(orders_response)
```
### Conclusion
This tutorial has covered the necessary steps to set up a Python SDK for automating
SP-API calls, including the integration of authentication and creating an instance
of the Orders API. Use the provided code snippets to facilitate the implementation
of SP-API functionality in your applications.
_____________________________
## Overview
This tutorial explains how to set up a Python SDK for automating calls to the
Amazon Selling Partner API (SP-API). It covers prerequisites, workspace setup, SDK
generation, authentication integration, and making a sample API call.
## Prerequisites
- **Hybrid or SP-API App**: Must be in draft or published state.
- **IDE Software**: Installation of an Integrated Development Environment (IDE).
- **Python**: Version 3.6 or later.
- **Swagger Codegen**: Version 2.3 or later, used to generate Python client code.
## Steps
setup(
name='SellingPartnerAPIAuthAndAuthPython', # Your package's name
version='1.0.0', # Your package's version
package_dir={'': 'src'}, # Adjust 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' # Update URL if needed
)
```
### Step 5: Create an Instance of the Orders API and Invoke an Operation
Example code to make a `getOrders` request:
```python
if __name__ == "__main__":
from auth.credentials import SPAPIConfig
config = SPAPIConfig(
client_id="Your client-id",
client_secret="Your client-secret",
refresh_token="Your refresh-token",
region="NA", # NA, EU, FE, SANDBOX
scope=None # e.g., "sellingpartnerapi::notifications"
)
api_client = SPAPIClient(config)
marketplace_ids = ["ATVPDKIKX0DER"]
created_after = "2024-01-19T00:00:00"
orders_api = api_client.get_api_client('OrdersV0Api')
orders_response = orders_api.get_orders(marketplace_ids=marketplace_ids,
created_after=created_after)
print("Orders API Response:")
print(orders_response)
```
**Caution**: Don't commit sensitive information (like LWA credentials) to version
control.
### Step 6: Connect to the SP-API Using the Generated Python SDK
To build and install the SDK locally:
```bash
python3 setup.py sdist bdist_wheel
pip install dist/{YourPackageName}-1.0.0-py3-none-any.whl
```
Run the test script:
```bash
python test.py
```
## Key Concepts
- **Authentication Module**: Integrates LWA (Login with Amazon) credentials needed
for API access.
- **Generating SDK**: Uses Swagger definitions to create a customer-specific SDK
for the API model.
- **API Client Configuration**: Instantiates and configures the API client to make
requests.
## Important Notes
- Ensure LWA credentials are stored securely and not included in version control.
- Monitor response codes; a status code of **200** indicates a successful request.
This summary provides a complete overview of setting up and using the Amazon SP-API
with Python. Follow the outlined steps to automate API calls effectively.
_____________________________