Skip to content

A Rust client library for Amazon Selling Partner API (SP-API), providing complete API coverage and type-safe interfaces.

License

Notifications You must be signed in to change notification settings

houxd/amazon-spapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Amazon SPAPI Rust SDK

Crates.io Documentation License

A Rust client library for Amazon Selling Partner API (SP-API), providing complete API coverage and type-safe interfaces.

Features

  • Complete API Coverage: Auto-generated API models from OpenAPI specifications covering nearly all Amazon SP-API endpoints
  • Integrated Client: High-level client wrapper with convenient methods for common API operations

Quick Start

1. Environment Setup

First, set up your Amazon SP-API credentials as environment variables:

export SPAPI_CLIENT_ID="your_client_id"
export SPAPI_CLIENT_SECRET="your_client_secret"
export SPAPI_REFRESH_TOKEN="your_refresh_token"
export SPAPI_SANDBOX="false"  # or "true" for sandbox environment

2. Basic Usage

use amazon_spapi::{
    client::{SpapiClient, SpapiConfig},
    models::fba_inventory::InventorySummary,
};
use anyhow::Result;

#[tokio::main]
async fn main() -> Result<()> {
    // Create client from environment variables
    let client = SpapiClient::new(SpapiConfig::from_env()?)?;
    
    // Get FBA inventory summaries
    let inventory = client
        .get_inventory_summaries(
            "Marketplace",
            amazon_spapi::marketplace_ids::US,
            vec![amazon_spapi::marketplace_ids::US.to_string()],
            Some(false),
            None,
            None,
            None,
            None,
        )
        .await?;
    
    println!("Inventory summaries: {:?}", inventory);
    Ok(())
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Related Links


Note: This is an unofficial Amazon SP-API Rust client library. Please ensure compliance with Amazon's terms of service and API limitations.

About

A Rust client library for Amazon Selling Partner API (SP-API), providing complete API coverage and type-safe interfaces.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages