E-commerce integration with Amazon SP-API

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Integration of Online Store with Amazon (SP-API)

Amazon Selling Partner API (SP-API) is a modern replacement for the outdated MWS. Used for managing listings, prices, inventory, and orders on global Amazon marketplaces (US, EU, UK, DE, JP, and others).

SP-API Authentication

SP-API uses AWS Signature Version 4 + LWA (Login with Amazon) OAuth2:

import boto3
from sp_api.api import Products, Orders, Inventories
from sp_api.base import Marketplaces, Credentials

credentials = Credentials(
    refresh_token   = os.environ['SP_REFRESH_TOKEN'],
    lwa_app_id      = os.environ['LWA_APP_ID'],
    lwa_client_secret = os.environ['LWA_CLIENT_SECRET'],
    aws_access_key  = os.environ['AWS_ACCESS_KEY'],
    aws_secret_key  = os.environ['AWS_SECRET_KEY'],
    role_arn        = os.environ['SP_API_ROLE_ARN'],
)

Creating/Updating Listings

from sp_api.api import Listings

listings = Listings(credentials=credentials, marketplace=Marketplaces.DE)

def upsert_listing(product: dict) -> None:
    listing_body = {
        'productType': product['amazon_product_type'],
        'attributes': {
            'item_name': [{'value': product['name'], 'language_tag': 'de_DE'}],
            'brand':     [{'value': product['brand']}],
            'description': [{'value': product['description'], 'language_tag': 'de_DE'}],
            'list_price': [{
                'currency': 'EUR',
                'value':    product['price'],
            }],
            'main_product_image_locator': [{'media_location': product['main_image']}],
        },
    }

    listings.put_listings_item(
        sellerId=SELLER_ID,
        sku=product['sku'],
        marketplaceIds=[Marketplaces.DE.marketplace_id],
        body=listing_body,
    )

Updating Prices and Inventory

from sp_api.api import Pricing, FbaInventory

# Price
pricing = Pricing(credentials=credentials, marketplace=Marketplaces.US)
pricing.get_competitive_pricing(Asins=[asin])

# FBA inventory
fba = FbaInventory(credentials=credentials, marketplace=Marketplaces.US)
summary = fba.get_inventory_summaries(granularityType='Marketplace', granularityId=Marketplaces.US.marketplace_id)

Getting Orders

from sp_api.api import Orders as SpOrders
from datetime import datetime, timedelta

orders_api = SpOrders(credentials=credentials, marketplace=Marketplaces.DE)

orders = orders_api.get_orders(
    MarketplaceIds=[Marketplaces.DE.marketplace_id],
    CreatedAfter=(datetime.utcnow() - timedelta(hours=24)).isoformat(),
    OrderStatuses=['Pending', 'Unshipped'],
)

Notifications (Push Notifications via SQS)

SP-API supports real push notifications through Amazon SQS:

from sp_api.api import Notifications

notif = Notifications(credentials=credentials)

# Subscribe to new order notifications
notif.create_subscription(
    notificationType='ORDER_CHANGE',
    body={
        'payloadVersion': '1.0',
        'destinationId':  SQS_QUEUE_ARN,
    }
)

Regional Specifics

Amazon has regional endpoints: sellingpartnerapi-na.amazon.com (US/CA/MX), sellingpartnerapi-eu.amazon.com (EU/UK/IN), sellingpartnerapi-fe.amazon.com (JP/AU). Each has its own marketplace_id.

Timeline

SP-API application registration takes 1–2 weeks. Development of integration (products + prices + orders for one region): 16–24 business days.