Skip to main content

A Python SDK for seamless interaction with the StockX marketplace API

Project description

StockX SDK

A Python SDK for seamless interaction with the StockX Marketplace API. This SDK provides a simplified and secure interface to programmatically interact with StockX's selling features, including listings and order management.


📦 Installation

pip install stockx

🛠 Setup

Before calling any functions, you must configure the SDK with your API key and JWT token:

from stockx.connection import setup

setup({"api_key": "YOUR_API_KEY", "jwt": "YOUR_JWT_TOKEN"})

🔍 Functions

get_all_listings(params: dict)

Fetch all listings based on various filters.

Parameters:

  • pageNumber (int): The requested page number. Starts at 1.
  • pageSize (int): Number of listings per page.
  • productIds (str): Comma-separated product IDs.
  • variantIds (str): Comma-separated variant IDs.
  • batchIds (str): Comma-separated batch IDs.
  • fromDate (str): Start date in YYYY-MM-DD format.
  • toDate (str): End date in YYYY-MM-DD format.
  • listingStatuses (str): Listing statuses (e.g., ACTIVE).
  • inventoryTypes (str): STANDARD or FLEX.
  • initiatedShipmentDisplayIds (str): Unique shipment display IDs.

Returns:

dict – JSON response containing listing data.


get_single_listing(listingId: str)

Fetch a single listing by its ID.

Parameters:

  • listingId (str): The unique ID of the listing.

Returns:

dict – JSON response of the listing.


get_active_orders(params: dict)

Fetch active orders using optional filters.

Parameters:

  • pageNumber (int): Page number to retrieve.
  • pageSize (int): Number of results per page.
  • orderStatus (str): Status filter (CREATED, SHIPPED, etc.).
  • productId (str): StockX product ID.
  • variantId (str): StockX variant ID.
  • sortOrder (str): Sort field (CREATEDAT, SHIPBYDATE).
  • inventoryTypes (str): Comma-separated list, e.g., STANDARD.
  • initiatedShipmentDisplayIds (str): Shipment display ID.

Returns:

dict – JSON response with active orders.


get_order_history(params: dict)

Fetch historical orders using filters and date range.

Parameters:

  • fromDate (str): Start date (YYYY-MM-DD).
  • toDate (str): End date (YYYY-MM-DD).
  • pageNumber (int): Page number (default: 1).
  • pageSize (int): Page size (default: 10).
  • orderStatus (str): Historical status (CANCELED, COMPLETED, etc.).
  • productId (str): Product ID.
  • variantId (str): Variant ID.
  • inventoryTypes (str): STANDARD, FLEX.
  • initiatedShipmentDisplayIds (str): Shipment display ID.

Returns:

dict – JSON response with order history.


get_single_order(orderNumber: str)

Fetch a specific order by order number.

Parameters:

  • orderNumber (str): The unique order number to fetch.

Returns:

dict – JSON response with order details.


search(params: dict)

Search the StockX product catalog using a keyword and optional pagination.

Parameters:

  • query (str): Search term (e.g., product name, style code).
  • pageNumber (int): Page number of results to retrieve (default: 1).
  • pageSize (int): Number of results per page (default: 1).

Returns:

dict – JSON response containing matched products and pagination metadata.


📄 License

This project is licensed under the MIT License.


📬 Contact

Created by Nick. Contributions welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stockx-1.1.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stockx-1.1.1-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file stockx-1.1.1.tar.gz.

File metadata

  • Download URL: stockx-1.1.1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for stockx-1.1.1.tar.gz
Algorithm Hash digest
SHA256 4bbb3a431384ba766a423b70183913f287629f2e2fc2a4192ac6dd8e9137480f
MD5 e0d2aa46c8989cbd4bd266770c55934a
BLAKE2b-256 9866c65fd809afc424ce7304cb1425f3acb55b057da64c2a6bc23f14e7de6415

See more details on using hashes here.

File details

Details for the file stockx-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: stockx-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for stockx-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eb05c9ac3076c8292682ccad038aa3b4c408116d2919dbc4ca0759bbe7a3ca86
MD5 bd558ecb89aff98c0db017c58d6db525
BLAKE2b-256 c25ad59053f3d51c7a18958f636589a62813f8b182f4615493109c072c068134

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page