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.