Single Order or Listing - RoyalGr4pe/stockx-sdk GitHub Wiki
๐ฆ Single Listing & Order Endpoints โ StockX Python SDK
This page covers how to retrieve detailed information about a single listing or individual order using the StockX SDK.
๐ Get Single Listing
Retrieves the full details of a single listing using its listingId
.
โถ๏ธ Function
from stockx.listings import get_single_listing
result = await get_single_listing("your-listing-id")
๐งพ Parameters
- listingId (
str
):
The unique identifier for the listing you want to retrieve.
๐ค Response
Returns a dict
containing listing details such as:
- Listing status (ACTIVE, COMPLETED, etc.)
- Product and variant IDs
- Inventory type
- Creation and update timestamps
- Associated shipment IDs (if any)
๐ฆ Get Single Order
Retrieves a specific order's full record using its orderNumber
.
โถ๏ธ Function
from stockx.orders import get_order_by_id
result = await get_order_by_id("your-order-number")
๐งพ Parameters
- orderNumber (
str
):
The unique order number assigned by StockX.
๐ค Response
Returns a dict
containing:
- Order status (e.g., SHIPPED, COMPLETED)
- Product and variant information
- Tracking and fulfillment details
- Timestamps for various lifecycle stages
โ Usage Example
import asyncio
from stockx.connection import setup
from stockx.orders import get_order_by_id
from stockx.listings import get_single_listing
setup({"api_key": "YOUR_API_KEY", "jwt": "YOUR_JWT_TOKEN"})
async def main():
listing = await get_single_listing("listing-id")
print("Listing Details:", listing)
order = await get_order_by_id("order-number")
print("Order Details:", order)
asyncio.run(main())
๐ Notes
- Ensure
setup()
is called before using any API functions. - Both endpoints require valid and active credentials.
- These calls are read-only and do not modify your StockX account.
Need help? Visit the FAQs or open a GitHub issue.