# Lion Market API sandbox Run requests against sample inventory and test funds. Sandbox orders and shipments never purchase real cards or carrier labels. Sandbox page and API base: https://lionmarket.com/sandbox/api Start with an empty cookie jar. Reads work immediately. Your first write sets the session cookie. Keep using that cookie jar to retrieve your saved changes or retry a request. No API key is required. Each write needs a UUID in Idempotency-Key. The examples include a separate key for each step. Keep the same key and body for a retry. Use a new UUID for each new order, shipment or draw. The cURL examples save cookies to lion-sandbox.cookies. Two-step examples use jq to read the quote or estimate ID from the first response. Choose the other language tabs on the sandbox page for Node.js, Python and Rust. IDs and dates in a sample receipt will differ in your session. [Full workspace workflow](https://lionmarket.com/api#guide-repack-software) ## Make your first request Read your test workspace and available balance. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/account' ``` ## Get started Try a pack opening, purchase or shipment with sample cards and test funds. Start by reading your sandbox account. [Read guide](https://lionmarket.com/sandbox/api#guide-overview) **Your session.** Start without an API key. Your first write sets a session cookie. Use the same browser or cookie file to retrieve the result and continue. **Examples and receipts.** A write example shows a preview. Select “Run in my sandbox” to save the result. If you retry it, keep the same request ID and body. 1. **Check your test balance.** Read your account and note the workspace ID, default vault and available balance. Amounts are in US cents. [GET /sandbox/api/account](https://lionmarket.com/sandbox/api#get-account) 2. **Find a sample card.** List the copies in your workspace. Save an item ID and its vault ID to use in a postage request. [GET /sandbox/api/inventory/items](https://lionmarket.com/sandbox/api#get-api-inventory-items) 3. **Request postage.** Review the sample destination and quoted price. A shipping estimate leaves the card in your vault. [POST /sandbox/api/shipping/estimates](https://lionmarket.com/sandbox/api#post-shipping-estimates) 4. **Create a sample shipment.** Run the example to request an estimate and confirm it by ID. Keep the shipment ID from your response. No label is purchased. [POST /sandbox/api/vaults/{vault}/shipments](https://lionmarket.com/sandbox/api#post-vaults-vault-shipments) **A copied ID returns 404.** Run the earlier request in the same session. Use the ID it returned in your next request. [Build your own repack software](https://lionmarket.com/sandbox/api#guide-repack-software) ## Build your own repack software Open a published sample catalog pack with test funds. You’ll get the winning card ID and odds. Creating and publishing physical packs and settling exact holds require an enterprise workspace. You can try postage separately with sample vault inventory. [Read guide](https://lionmarket.com/sandbox/api#guide-repack-software) **Pack.** A pack has a stable ID, a display name and a price. Use its ID in requests so a rename keeps working. **Mode.** A mode sets the chance of each card-value band. Read the supported mode IDs before offering a choice. **Grail.** A grail is a chase card near your chosen target value. The search response includes the market-price range it applied. 1. **Choose the pack.** List the sample packs and save the ID of one that is available. These examples use Apex. [GET /sandbox/api/repacks](https://lionmarket.com/sandbox/api#get-api-repacks) 2. **Read the modes and odds.** Choose one of the pack’s published modes. Use that mode when you display the odds and when you open the pack. [GET /sandbox/api/repacks/{pack}/modes](https://lionmarket.com/sandbox/api#get-api-repacks-pack-modes) 3. **Find potential grails in the vault.** Search the vault with `grails=true`, `below_pct=20` and `above_pct=20`. For a $2,000 target this gives a $1,600–$2,400 window. [GET /sandbox/api/repacks/{pack}/search](https://lionmarket.com/sandbox/api#get-api-repacks-pack-search) 4. **Open the pack.** Select one card and save the returned receipt. Repeat the request with the same key to recover the same result. [POST /sandbox/api/repacks/{pack}/select](https://lionmarket.com/sandbox/api#post-api-repacks-pack-select) [Create packs, publish odds and settle physical cards](https://lionmarket.com/api#guide-repack-software) ## Vaulting Follow a sample copy from the inventory list to its valuation. [Read guide](https://lionmarket.com/sandbox/api#guide-vaulting) 1. **Find a copy.** Keep the vault ID and the item ID together. The printing identifies the card design. The item identifies one physical copy. [GET /sandbox/api/inventory/items](https://lionmarket.com/sandbox/api#get-api-inventory-items) 2. **Read its valuation.** Inspect the available price and observation details for that copy. [GET /sandbox/api/vaults/{vault}/items/{item}/valuation](https://lionmarket.com/sandbox/api#get-vaults-vault-items-item-valuation) ## Repacks Inspect the pack menu, look up modes and run a sample opening. [Read guide](https://lionmarket.com/sandbox/api#guide-repacks) 1. **Check availability.** Check that the chosen pack and mode have enough stock for the requested quantity before enabling checkout. [GET /sandbox/api/repacks/{pack}/availability](https://lionmarket.com/sandbox/api#get-api-repacks-pack-availability) [Build your own repack software](https://lionmarket.com/sandbox/api#guide-repack-software) ## Purchase orders Try two ways to buy cards with test funds. A purchase order gives Lion Market a sourcing brief. An on-demand order buys a specific supplier SKU. [Read guide](https://lionmarket.com/sandbox/api#guide-purchase-orders) 1. **Open a draft.** Create a purchase-order draft. Its ID identifies the sourcing request. [POST /sandbox/api/purchase-orders](https://lionmarket.com/sandbox/api#post-purchase-orders) 2. **Inspect sourcing progress.** Open the sourcing view for a sample order to see the items already vaulted. [GET /sandbox/api/purchase-orders/{purchase_order}/sourcing](https://lionmarket.com/sandbox/api#get-purchase-orders-purchase_order-sourcing) 3. **Buy from the on-demand catalog.** The example obtains a quote and passes its ID and maximum price to the order request. The resulting order appears in this sandbox session. [POST /sandbox/api/on-demand/orders](https://lionmarket.com/sandbox/api#post-on-demand-orders) ## Shipping Request a postage estimate for a sample card, then use the estimate to create and track a test shipment. [Read guide](https://lionmarket.com/sandbox/api#guide-shipping) 1. **Estimate the price.** Provide a vault copy and a delivery address. Read the estimate ID and shipping cost. [POST /sandbox/api/shipping/estimates](https://lionmarket.com/sandbox/api#post-shipping-estimates) 2. **Confirm the estimate.** Send the estimate ID to the source vault. The example supplies both requests so you can run them in order. [POST /sandbox/api/vaults/{vault}/shipments](https://lionmarket.com/sandbox/api#post-vaults-vault-shipments) 3. **Find the receipt.** List your sample shipments and open the receipt by its ID. [GET /sandbox/api/shipments](https://lionmarket.com/sandbox/api#get-shipments) ## Endpoint reference ### Account #### [Get wallet buyback terms](https://lionmarket.com/sandbox/api#get-wallet-terms) — GET /sandbox/api/wallet/terms Read the wallet program’s buyback window and settlement type. A funded sale requires a current offer on the exact copy. Your app sets the terms for its own player buybacks. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/wallet/terms' ``` Example response (HTTP 200) ```json {"buyback_window_seconds":172800,"settlement":"workspace_credit"} ``` #### [Get account details](https://lionmarket.com/sandbox/api#get-account) — GET /sandbox/api/account Read the shared company balance, business identity and receiving vault. ```javascript // Save as example.mjs and run with Node.js 22 or later. import { existsSync, readFileSync } from "node:fs"; const file = "lion-sandbox.node-cookie"; const resultResponse = await fetch("https://lionmarket.com/sandbox/api/account", { method: "GET", redirect: "error", headers: { ...(existsSync(file) && { Cookie: readFileSync(file, "utf8") }), }, }); if (!resultResponse.ok) throw new Error(`HTTP ${resultResponse.status}: ${await resultResponse.text()}`); console.log(await resultResponse.json()); ``` ```python from http.cookiejar import MozillaCookieJar from pathlib import Path import requests cookie_file = Path("lion-sandbox.cookies") session = requests.Session() session.cookies = MozillaCookieJar(str(cookie_file)) if cookie_file.exists(): session.cookies.load(ignore_discard=True) response = session.request( "GET", "https://lionmarket.com/sandbox/api/account", timeout=30, ) session.cookies.save(ignore_discard=True) if not response.ok: raise RuntimeError(f"HTTP {response.status_code}: {response.text}") print(response.json()) ``` ```rust // cargo add reqwest@0.12 --features blocking,json,cookies // cargo add serde_json use reqwest::blocking::Client; use reqwest::cookie::Jar; use std::{fs, path::Path, sync::Arc}; fn main() -> Result<(), Box> { let file = Path::new("lion-sandbox.cookie"); let jar = Arc::new(Jar::default()); if file.exists() { jar.add_cookie_str(&fs::read_to_string(file)?, &"https://lionmarket.com/sandbox/api".parse()?); } let client = Client::builder().cookie_provider(jar).build()?; let response = client.get("https://lionmarket.com/sandbox/api/account") .send()?; if !response.status().is_success() { return Err(format!("HTTP {}: {}", response.status(), response.text()?).into()); } let result: serde_json::Value = response.json()?; println!("{}", serde_json::to_string_pretty(&result)?); Ok(()) } ``` ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/account' ``` Example response (HTTP 200) ```json {"organization":{"id":"00000000-0000-4000-8000-00000000de00","name":"Lion Rips"},"currency":"USD","balance_cents":84625000,"committed_cents":0,"available_cents":84625000,"server_time":"2026-11-29T18:00:00Z","default_vault_id":"default","receiving_vault_id":"default","capabilities":{"shipping_estimates":true}} ``` ### Vaulting #### [Find cards across all vaults](https://lionmarket.com/sandbox/api#get-api-inventory-items) — GET /sandbox/api/inventory/items List every copy currently vaulted for your company across its own vaults and verified warehouse receipts. Cards appear as soon as custody is confirmed, including held cards and cards without photos, prices or published pack tickets. Parameters - `view` (query) — Omit to find all your vaulted copies. Use pack_ready for stock ready for a pack, or photo_candidates for available graded certificates. Values: photo_candidates, pack_ready. Example: `photo_candidates`. - `category` (query) — Exact category recorded on the holding. The match ignores case and treats Pokémon and Pokemon alike. Example: `Pokémon`. - `format` (query) — Return raw cards or graded slabs. Values: raw, graded. Example: `raw`. - `grader` (query) — Exact grading company, such as PSA. Matches regardless of letter case. Example: `PSA`. - `cert` (query) — Find a certificate, including its original intake number. Numeric PSA and BGS certificates accept leading zeros. Example: `160139511`. - `q` (query) — Match words in a name, set, card number, category, grader, certificate or ID. Available in the default and photo_candidates views. Example: `Pikachu`. - `card_id` (query) — Exact printing identifier. Several physical copies can share one. Example: `019bffc8-5c96-75dc-b3b6-c4a84117c6a3`. - `item_id` (query) — Exact identifier of one physical copy. Example: `copy_042`. - `vault_id` (query) — Return only copies in this vault. Example: `default`. - `limit` (query) — 1–100 copies per page, default 50. For pack_ready, use 1–1,000, default 100. Example: `10`. - `cursor` (query) — Pass the previous next_cursor with the same filters. A null cursor ends the list. Example: `eyJpZCI6ImNvcHlfMDQyIn0`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/inventory/items' ``` [Open the full sandbox response](https://lionmarket.com/sandbox/api/inventory/items) Example response excerpt (HTTP 200) ```json {"as_of":"2026-11-30T08:39:19.878Z","data":[{"id":"psa-141608759","item_id":"psa-141608759","card_id":"psa-141608759","vault_id":"default","name":"Cooper Dejean","category":"Football","number":"305","set_name":"Panini Donruss","set_id":"panini-donruss","language":"en","format":"graded","grader":"PSA","grade":"10","grade_label":"PSA 10","cert":"141608759","availability":"available","selectable":true,"selection_issues":[],"hold":null,"valuation_source":"lion_inventory","market_value_cents":187400,"preview_image_url":"/collectibles-demo/cards/copies/141608759-front.webp","preview_sides":{"front":"/api/collectibles/demo-photo/141608759/front","back":"/api/collectibles/demo-photo/141608759/back"},"images":{"front_url":"/collectibles-demo/cards/copies/141608759-front.webp","back_url":"/collectibles-demo/cards/copies/141608759-back.webp"},"acquired_at":"2026-11-07T19:46:04.579Z","received_at":"2026-11-07T19:46:04.579Z","valued_at":"2026-11-12T20:57:09.345Z","source":"owned","state":"available"}],"next_cursor":"WyI2YjZjZmZiNzU1YTVkMzRjNmM2NGE3YTkiLCJwc2EtMTc4Nzg3MDA4Il0"} ``` #### [Get vault inventory](https://lionmarket.com/sandbox/api#get-inventory) — GET /sandbox/api/inventory Read the default portfolio with values, acquisition dates and hold status. Use /inventory/items to find copies across all vaults. Parameters - `price_source` (query) — Choose Card Ladder Green (default) or Lion Price. Values and returns use the selected source. Values: card_ladder, lion_price. Example: `card_ladder`. - `include` (query) — filters adds set choices and availability options to the same response. Values: filters. Example: `filters`. - `availability` (query) — available or held. On shared Lion inventory, selectable tells you whether an available copy is ready to draw. Omit availability for both statuses. Values: available, held. Example: `available`. - `set_id` (query) — Use filters.sets[].value from this response. Each company sees its own choices. Example: `sv8`. - `q` (query) — Optional search text, such as a card name or certificate number. Example: `Pikachu`. - `page` (query) — Page number, starting at 1 (default). Example: `1`. - `limit` (query) — Copies per page, 1–100. Defaults to 24. Example: `3`. - `summary` (query) — true includes combined value and history for the entire vault. Use false for a lighter page. Example: `false`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/inventory?availability=available&page=1&limit=3&summary=false&include=filters' ``` [Open the full sandbox response](https://lionmarket.com/sandbox/api/inventory?availability=available&page=1&limit=3&summary=false&include=filters) Example response excerpt (HTTP 200) ```json {"vault_id":"default","price_source":"card_ladder","data":[{"id":"psa-141608759","item_id":"psa-141608759","card_id":"psa-141608759","vault_id":"default","name":"Cooper Dejean","category":"Football","number":"305","set_name":"Panini Donruss","set_id":"panini-donruss","language":"en","format":"graded","grader":"PSA","grade":"10","grade_label":"PSA 10","cert":"141608759","availability":"available","selectable":true,"selection_issues":[],"hold":null,"valuation_source":"card_ladder","market_value_cents":187400,"preview_image_url":"/collectibles-demo/cards/copies/141608759-front.webp","preview_sides":{"front":"/api/collectibles/demo-photo/141608759/front","back":"/api/collectibles/demo-photo/141608759/back"},"images":{"front_url":"/collectibles-demo/cards/copies/141608759-front.webp","back_url":"/collectibles-demo/cards/copies/141608759-back.webp"},"acquired_at":"2026-11-07T19:46:04.579Z","received_at":"2026-11-07T19:46:04.579Z","valued_at":"2026-11-30T08:39:19.878Z"}],"page":1,"total_count":448,"total_pages":150,"limit":3,"as_of":"2026-11-30T08:39:19.878Z","filters":{"availability":["available"],"sets":[{"value":"bowman-chrome-sapphire-edition-prospects","label":"Bowman Chrome Sapphire Edition Prospects"}]}} ``` #### [Get vaults](https://lionmarket.com/sandbox/api#get-vaults) — GET /sandbox/api/vaults Find the vault IDs available to this organization. Parameters - `external_ref` (query) — Optional exact client reference. Example: `order-42`. - `limit` (query) — 1–100. Defaults to 50. Example: `10`. - `cursor` (query) — Opaque next_cursor from the preceding page. Keep the same filters. Example: `eyJpZCI6ImNvcHlfMDQyIn0`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/vaults' ``` Example response (HTTP 200) ```json {"data":[{"id":"default","name":"Main portfolio","external_ref":null}],"next_cursor":null} ``` #### [Get a vault](https://lionmarket.com/sandbox/api#get-vaults-vault) — GET /sandbox/api/vaults/{vault} Read the name, client reference and metadata for one vault. Parameters - `vault` (URL path) — The vault_id on the card or default_vault_id from GET /account. Example: `default`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/vaults/default' ``` Example response (HTTP 200) ```json {"id":"default","name":"Main portfolio","external_ref":null} ``` #### [Get vault holdings and value](https://lionmarket.com/sandbox/api#get-vaults-vault-portfolio) — GET /sandbox/api/vaults/{vault}/portfolio Choose Card Ladder Green or Lion Price to value the copies currently in this vault. Each gain starts at the owner’s recorded purchase cost. Selling or shipping a copy removes it from every date in the chart. Parameters - `vault` (URL path) — The vault_id on the card or default_vault_id from GET /account. Example: `default`. - `page` (query) — Page number, starting at 1 (default). Example: `1`. - `limit` (query) — Copies per page, 1–100. Defaults to 24. Example: `10`. - `q` (query) — Search the card name or certificate. Example: `Pikachu`. - `availability` (query) — Return available copies or held copies. Omit to include both. Values: available, held. Example: `available`. - `price_source` (query) — card_ladder (default) or lion_price (beta). A missing price is null. Values: card_ladder, lion_price. Example: `card_ladder`. - `summary` (query) — Include total value, priced_count, item_count and returns by period. acquisition_basis_count counts priced copies with a recorded purchase cost. Example: `true`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/vaults/default/portfolio?price_source=card_ladder' ``` [Open the full sandbox response](https://lionmarket.com/sandbox/api/vaults/default/portfolio?price_source=card_ladder) Example response excerpt (HTTP 200) ```json {"vault_id":"default","price_source":"card_ladder","data":[{"id":"psa-141608759","item_id":"psa-141608759","card_id":"psa-141608759","vault_id":"default","name":"Cooper Dejean","category":"Football","number":"305","set_name":"Panini Donruss","set_id":"panini-donruss","language":"en","format":"graded","grader":"PSA","grade":"10","grade_label":"PSA 10","cert":"141608759","availability":"available","selectable":true,"selection_issues":[],"hold":null,"valuation_source":"card_ladder","market_value_cents":187400,"preview_image_url":"/collectibles-demo/cards/copies/141608759-front.webp","preview_sides":{"front":"/api/collectibles/demo-photo/141608759/front","back":"/api/collectibles/demo-photo/141608759/back"},"images":{"front_url":"/collectibles-demo/cards/copies/141608759-front.webp","back_url":"/collectibles-demo/cards/copies/141608759-back.webp"},"acquired_at":"2026-11-07T19:46:04.579Z","received_at":"2026-11-07T19:46:04.579Z","valued_at":"2026-11-30T08:39:19.878Z"}],"summary":{"currency":"USD","sources":{"card_ladder":571,"lion_price":0,"pending":0},"acquisition_basis_count":571,"item_count":571,"priced_count":571,"value_cents":9160950,"history":[{"at":"2026-09-28","value_cents":14131,"priced_count":1}],"change_cents":592948,"change_bps":692,"performance":{"1D":{"gain_cents":35196,"return_bps":39,"points":[{"at":"2026-11-29T08:39:19.878Z","gain_cents":0}],"gainers":{"count":307,"cents":90247},"decliners":{"count":260,"cents":-55051}},"1W":{"gain_cents":179545,"return_bps":204,"points":[{"at":"2026-11-23T08:39:19.878Z","gain_cents":0}],"gainers":{"count":485,"cents":220376},"decliners":{"count":84,"cents":-40831}},"1M":{"gain_cents":577937,"return_bps":1008,"points":[{"at":"2026-10-30T08:39:19.878Z","gain_cents":0}],"gainers":{"count":414,"cents":724480},"decliners":{"count":140,"cents":-146543}},"3M":{"gain_cents":592948,"return_bps":1931,"points":[{"at":"2026-09-26T17:40:08.651Z","gain_cents":0}],"gainers":{"count":389,"cents":756083},"decliners":{"count":164,"cents":-163135}},"YTD":{"gain_cents":592948,"return_bps":1931,"points":[{"at":"2026-09-26T17:40:08.651Z","gain_cents":0}],"gainers":{"count":389,"cents":756083},"decliners":{"count":164,"cents":-163135}},"1Y":{"gain_cents":592948,"return_bps":1931,"points":[{"at":"2026-09-26T17:40:08.651Z","gain_cents":0}],"gainers":{"count":389,"cents":756083},"decliners":{"count":164,"cents":-163135}},"All":{"gain_cents":592948,"return_bps":692,"points":[{"at":"2026-09-26T17:40:08.651Z","gain_cents":0}],"gainers":{"count":389,"cents":756083},"decliners":{"count":164,"cents":-163135}}},"history_type":"illustrative"},"page":1,"total_count":571,"total_pages":24,"limit":24,"as_of":"2026-11-30T08:39:19.878Z"} ``` #### [Search vault items](https://lionmarket.com/sandbox/api#get-vaults-vault-items) — GET /sandbox/api/vaults/{vault}/items Find copies by printing, value, format or availability. A verified photographed pair includes images.verified_pair with grader, cert, and the SHA-256 and byte length for front and back. Parameters - `vault` (URL path) — The vault_id on the card or default_vault_id from GET /account. Example: `default`. - `q` (query) — Search card names. Example: `Pikachu`. - `set_id` (query) — Exact set identifier from sets[].id on this vault’s filter-options endpoint. Example: `sv8`. - `category` (query) — Category recorded in this vault. Use a value from filter-options categories[]. Example: `Pokémon`. - `language` (query) — Language recorded in this vault. Use a value from filter-options languages[]. Example: `en`. - `card_id` (query) — The exact card_id from a previous card response. Example: `019bffc8-5c96-75dc-b3b6-c4a84117c6a3`. - `format` (query) — raw or graded. Values: raw, graded. Example: `raw`. - `condition` (query) — Raw only. NEAR_MINT, LIGHTLY_PLAYED, MODERATELY_PLAYED, HEAVILY_PLAYED or DAMAGED. Values: NEAR_MINT, LIGHTLY_PLAYED, MODERATELY_PLAYED, HEAVILY_PLAYED, DAMAGED. Example: `NEAR_MINT`. - `grader` (query) — Grading company from filter-options graders[].value. Example: `PSA`. - `grade` (query) — Grade listed for the selected grader. Include grader with this filter. Example: `8`. - `min_value_cents` (query) — Lowest included market value in USD cents. Example: `1000`. - `max_value_cents` (query) — Highest included market value in USD cents. Example: `50000`. - `availability` (query) — available or held. Values: available, held. Example: `available`. - `external_ref` (query) — Exact client reference. Example: `order-42`. - `preview_images` (query) — true to include a gallery thumbnail when present. Example: `true`. - `limit` (query) — 1–100. Defaults to 50. Example: `3`. - `cursor` (query) — Opaque next_cursor from the preceding page. Keep the same filters. Example: `eyJpZCI6ImNvcHlfMDQyIn0`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/vaults/default/items?limit=3' ``` Example response (HTTP 200) ```json {"data":[{"id":"psa-141608759","item_id":"psa-141608759","card_id":"psa-141608759","vault_id":"default","name":"Cooper Dejean","category":"Football","number":"305","set_name":"Panini Donruss","set_id":"panini-donruss","language":"en","format":"graded","grader":"PSA","grade":"10","grade_label":"PSA 10","cert":"141608759","availability":"available","selectable":true,"selection_issues":[],"hold":null,"valuation_source":"lion_inventory","market_value_cents":187400,"preview_image_url":"/collectibles-demo/cards/copies/141608759-front.webp","preview_sides":{"front":"/api/collectibles/demo-photo/141608759/front","back":"/api/collectibles/demo-photo/141608759/back"},"images":{"front_url":"/collectibles-demo/cards/copies/141608759-front.webp","back_url":"/collectibles-demo/cards/copies/141608759-back.webp"},"acquired_at":"2026-11-07T19:46:04.579Z","received_at":"2026-11-07T19:46:04.579Z","valued_at":"2026-11-12T20:57:09.345Z"},{"id":"psa-92423775","item_id":"psa-92423775","card_id":"psa-92423775","vault_id":"default","name":"Rayquaza-Reverse Foil","category":"Pokémon","number":"13","set_name":"Pokemon Ex Delta Species","set_id":"pokemon-ex-delta-species","language":"en","format":"graded","grader":"PSA","grade":"8","grade_label":"PSA 8","cert":"92423775","availability":"available","selectable":true,"selection_issues":[],"hold":null,"valuation_source":"lion_inventory","market_value_cents":172500,"preview_image_url":"/collectibles-demo/cards/copies/92423775-front.webp","preview_sides":{"front":"/api/collectibles/demo-photo/92423775/front","back":"/api/collectibles/demo-photo/92423775/back"},"images":{"front_url":"/collectibles-demo/cards/copies/92423775-front.webp","back_url":"/collectibles-demo/cards/copies/92423775-back.webp"},"acquired_at":"2026-11-22T02:12:00.346Z","received_at":"2026-11-22T02:12:00.346Z","valued_at":"2026-11-30T01:23:04.070Z"},{"id":"psa-79299847","item_id":"psa-79299847","card_id":"psa-79299847","vault_id":"default","name":"Vaporeon-Holo","category":"Pokémon","number":"H31","set_name":"Pokemon Skyridge","set_id":"pokemon-skyridge","language":"en","format":"graded","grader":"PSA","grade":"8","grade_label":"PSA 8","cert":"79299847","availability":"available","selectable":true,"selection_issues":[],"hold":null,"valuation_source":"lion_inventory","market_value_cents":160000,"preview_image_url":"/collectibles-demo/cards/copies/79299847-front.webp","preview_sides":{"front":"/api/collectibles/demo-photo/79299847/front","back":"/api/collectibles/demo-photo/79299847/back"},"images":{"front_url":"/collectibles-demo/cards/copies/79299847-front.webp","back_url":"/collectibles-demo/cards/copies/79299847-back.webp"},"acquired_at":"2026-10-24T20:40:37.674Z","received_at":"2026-10-24T20:40:37.674Z","valued_at":"2026-11-29T22:53:06.005Z"}],"next_cursor":"3"} ``` #### [Get a vault card](https://lionmarket.com/sandbox/api#get-vaults-vault-items-item) — GET /sandbox/api/vaults/{vault}/items/{item} Read the exact physical copy, acquisition and retention dates, pictures and any active hold. Parameters - `item` (URL path) — The item_id from inventory. Example: `psa-92423775`. - `vault` (URL path) — The vault_id on the card or default_vault_id from GET /account. Example: `default`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/vaults/default/items/psa-92423775' ``` Example response (HTTP 200) ```json {"id":"psa-92423775","item_id":"psa-92423775","card_id":"psa-92423775","vault_id":"default","name":"Rayquaza-Reverse Foil","category":"Pokémon","number":"13","set_name":"Pokemon Ex Delta Species","set_id":"pokemon-ex-delta-species","language":"en","format":"graded","grader":"PSA","grade":"8","grade_label":"PSA 8","cert":"92423775","availability":"available","selectable":true,"selection_issues":[],"hold":null,"valuation_source":"lion_inventory","market_value_cents":172500,"preview_image_url":"/collectibles-demo/cards/copies/92423775-front.webp","preview_sides":{"front":"/api/collectibles/demo-photo/92423775/front","back":"/api/collectibles/demo-photo/92423775/back"},"images":{"front_url":"/collectibles-demo/cards/copies/92423775-front.webp","back_url":"/collectibles-demo/cards/copies/92423775-back.webp"},"acquired_at":"2026-11-22T02:12:00.346Z","received_at":"2026-11-22T02:12:00.346Z","valued_at":"2026-11-30T01:23:04.070Z","purchase_order":{"id":"a00d0000-0000-4000-8000-000000000101","name":"Apex chase restock"}} ``` #### [Get a card valuation](https://lionmarket.com/sandbox/api#get-vaults-vault-items-item-valuation) — GET /sandbox/api/vaults/{vault}/items/{item}/valuation Get both prices for this copy in USD cents. The value and daily history default to Card Ladder Green. Set price_source=lion_price for Lion Price instead. Each missing price is null. Parameters - `item` (URL path) — The item_id from inventory. Example: `psa-92423775`. - `vault` (URL path) — The vault_id on the card or default_vault_id from GET /account. Example: `default`. - `price_source` (query) — card_ladder (default) or lion_price. market_prices contains both. Values: card_ladder, lion_price. Example: `card_ladder`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/vaults/default/items/psa-92423775/valuation?price_source=card_ladder' ``` Example response (HTTP 200) ```json {"item_id":"psa-92423775","vault_id":"default","currency":"USD","price_source":"card_ladder","source":"card_ladder","market_prices":{"card_ladder":{"price_cents":172500,"as_of":"2026-11-30T08:39:19.878Z"},"lion_price":{"price_cents":179400,"as_of":"2026-11-30T08:39:19.878Z"}},"value_cents":172500,"valued_at":"2026-11-30T08:39:19.878Z","checked_at":"2026-11-30T08:39:19.878Z","market_card_id":null,"catalog_card_id":null,"tier":"PSA_8","history":[{"at":"2026-11-23T08:39:19.878Z","value_cents":168523},{"at":"2026-11-24T08:39:19.878Z","value_cents":168385},{"at":"2026-11-25T08:39:19.878Z","value_cents":167472},{"at":"2026-11-26T08:39:19.878Z","value_cents":169473},{"at":"2026-11-27T08:39:19.878Z","value_cents":170895},{"at":"2026-11-28T08:39:19.878Z","value_cents":173263},{"at":"2026-11-29T08:39:19.878Z","value_cents":173218},{"at":"2026-11-29T11:39:19.878Z","value_cents":172991},{"at":"2026-11-29T14:39:19.878Z","value_cents":173345},{"at":"2026-11-29T17:39:19.878Z","value_cents":172960},{"at":"2026-11-29T20:39:19.878Z","value_cents":173082},{"at":"2026-11-29T23:39:19.878Z","value_cents":172735},{"at":"2026-11-30T02:39:19.878Z","value_cents":172936},{"at":"2026-11-30T05:39:19.878Z","value_cents":172442},{"at":"2026-11-30T08:39:19.878Z","value_cents":172500}],"public_price_url":null} ``` ### Repacks #### [List packs](https://lionmarket.com/sandbox/api#get-api-repacks) — GET /sandbox/api/repacks List packs and their sale status. Show the display name to players and use the returned ID in requests. Use links.select from the displayed mode when the player buys. Parameters - `kind` (query) — Optional pack type. Omit to list both types. Values: physical, catalog. Example: `physical`. - `q` (query) — Find a pack by name or ID. Example: `Starter`. - `view` (query) — Use drafts to list saved physical pack drafts for editing. Omit to list published packs. Values: drafts. Example: `drafts`. - `include` (query) — Use odds to load every mode’s odds with the pack list. Values: odds. Example: `odds`. - `limit` (query) — Maximum results per page, from 1 to 100. Example: `10`. - `cursor` (query) — Pass the next_cursor from the last page to continue. Example: `eyJpZCI6ImNvcHlfMDQyIn0`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/repacks' ``` Example response (HTTP 200) ```json {"version":"f5dee1a2110371895fc7faff","data":[{"id":"starter","name":"Starter","display_price_cents":100,"sold_out":false,"variants":["normal","hard","crazy"],"version":"f5dee1a2110371895fc7faff","modes":["normal","hard","crazy"],"currency":"USD","kind":"catalog","mode_availability":{"normal":true,"hard":true,"crazy":true},"links":{"self":"/sandbox/api/repacks/starter?kind=catalog","search":"/sandbox/api/repacks/starter/search?kind=catalog","select":"/sandbox/api/repacks/starter/select?kind=catalog&offer=f5dee1a2110371895fc7faff%7Enormal"}},{"id":"basic","name":"Basic","display_price_cents":250,"sold_out":false,"variants":["normal","hard","crazy"],"version":"f5dee1a2110371895fc7faff","modes":["normal","hard","crazy"],"currency":"USD","kind":"catalog","mode_availability":{"normal":true,"hard":true,"crazy":true},"links":{"self":"/sandbox/api/repacks/basic?kind=catalog","search":"/sandbox/api/repacks/basic/search?kind=catalog","select":"/sandbox/api/repacks/basic/select?kind=catalog&offer=f5dee1a2110371895fc7faff%7Enormal"}},{"id":"rally","name":"Rally","display_price_cents":500,"sold_out":false,"variants":["normal","hard","crazy"],"version":"f5dee1a2110371895fc7faff","modes":["normal","hard","crazy"],"currency":"USD","kind":"catalog","mode_availability":{"normal":true,"hard":true,"crazy":true},"links":{"self":"/sandbox/api/repacks/rally?kind=catalog","search":"/sandbox/api/repacks/rally/search?kind=catalog","select":"/sandbox/api/repacks/rally/select?kind=catalog&offer=f5dee1a2110371895fc7faff%7Enormal"}},{"id":"signature","name":"Signature","display_price_cents":1000,"sold_out":false,"variants":["normal","hard","crazy"],"version":"f5dee1a2110371895fc7faff","modes":["normal","hard","crazy"],"currency":"USD","kind":"catalog","mode_availability":{"normal":true,"hard":true,"crazy":true},"links":{"self":"/sandbox/api/repacks/signature?kind=catalog","search":"/sandbox/api/repacks/signature/search?kind=catalog","select":"/sandbox/api/repacks/signature/select?kind=catalog&offer=f5dee1a2110371895fc7faff%7Enormal"}},{"id":"summit","name":"Summit","display_price_cents":2500,"sold_out":false,"variants":["normal","hard","crazy"],"version":"f5dee1a2110371895fc7faff","modes":["normal","hard","crazy"],"currency":"USD","kind":"catalog","mode_availability":{"normal":true,"hard":true,"crazy":true},"links":{"self":"/sandbox/api/repacks/summit?kind=catalog","search":"/sandbox/api/repacks/summit/search?kind=catalog","select":"/sandbox/api/repacks/summit/select?kind=catalog&offer=f5dee1a2110371895fc7faff%7Enormal"}},{"id":"cosmic","name":"Cosmic","display_price_cents":5000,"sold_out":false,"variants":["normal","hard","crazy"],"version":"f5dee1a2110371895fc7faff","modes":["normal","hard","crazy"],"currency":"USD","kind":"catalog","mode_availability":{"normal":true,"hard":true,"crazy":true},"links":{"self":"/sandbox/api/repacks/cosmic?kind=catalog","search":"/sandbox/api/repacks/cosmic/search?kind=catalog","select":"/sandbox/api/repacks/cosmic/select?kind=catalog&offer=f5dee1a2110371895fc7faff%7Enormal"}},{"id":"apex","name":"Apex","display_price_cents":10000,"sold_out":false,"variants":["normal","hard","crazy"],"version":"f5dee1a2110371895fc7faff","modes":["normal","hard","crazy"],"currency":"USD","kind":"catalog","mode_availability":{"normal":true,"hard":true,"crazy":true},"links":{"self":"/sandbox/api/repacks/apex?kind=catalog","search":"/sandbox/api/repacks/apex/search?kind=catalog","select":"/sandbox/api/repacks/apex/select?kind=catalog&offer=f5dee1a2110371895fc7faff%7Enormal"}},{"id":"divine","name":"Divine","display_price_cents":100000,"sold_out":true,"variants":[],"version":"f5dee1a2110371895fc7faff","modes":[],"currency":"USD","kind":"catalog","mode_availability":{},"links":{"self":"/sandbox/api/repacks/divine?kind=catalog","search":"/sandbox/api/repacks/divine/search?kind=catalog","select":"/sandbox/api/repacks/divine/select?kind=catalog&offer=f5dee1a2110371895fc7faff%7Enormal"}}],"next_cursor":null} ``` #### [Get a pack and its odds](https://lionmarket.com/sandbox/api#get-api-repacks-pack) — GET /sandbox/api/repacks/{pack} Use links.self from the pack list. It returns the current price, modes and odds, even if the display name changes. Parameters - `pack` (URL path) — Use the ID in the pack’s links. A display name can contain spaces and can change. Example: `apex`. - `mode` (query) — Choose a listed mode. Omit to use the pack’s default odds. Example: `normal`. - `view` (query) — Use draft to read the latest editable settings and preview_id for a physical pack. Omit to read published odds. Values: draft. Example: `draft`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/repacks/apex' ``` Example response (HTTP 200) ```json {"id":"apex","name":"Apex","display_price_cents":10000,"sold_out":false,"variants":["normal","hard","crazy"],"graded_chance":{"numerator":7848738,"denominator":10000000},"actual_ev_cents":9567,"min_pull_cents":3000,"max_pull_cents":175000,"bands":[{"min_value_cents":3000,"max_value_cents":3999,"graded_probability_bps":5994.792452830189,"probability_bps":530,"chance":{"numerator":530000,"denominator":10000000}},{"min_value_cents":4000,"max_value_cents":9999,"graded_probability_bps":7568.178970917226,"probability_bps":4470,"chance":{"numerator":4470000,"denominator":10000000}},{"min_value_cents":10000,"max_value_cents":11999,"graded_probability_bps":8538.722419928827,"probability_bps":2810,"chance":{"numerator":2810000,"denominator":10000000}},{"min_value_cents":12000,"max_value_cents":13999,"graded_probability_bps":8176.483606557377,"probability_bps":1220,"chance":{"numerator":1220000,"denominator":10000000}},{"min_value_cents":14000,"max_value_cents":15999,"graded_probability_bps":7073.75,"probability_bps":520,"chance":{"numerator":520000,"denominator":10000000}},{"min_value_cents":16000,"max_value_cents":175000,"graded_probability_bps":8517.577777777777,"probability_bps":450,"chance":{"numerator":450000,"denominator":10000000}}],"version":"f5dee1a2110371895fc7faff","variant":"normal","pack_id":"apex","modes":["normal","hard","crazy"],"kind":"catalog","currency":"USD","mode":"normal","probability":"published","mode_availability":{"normal":true,"hard":true,"crazy":true},"links":{"self":"/sandbox/api/repacks/apex?kind=catalog","search":"/sandbox/api/repacks/apex/search?kind=catalog","select":"/sandbox/api/repacks/apex/select?kind=catalog&offer=f5dee1a2110371895fc7faff%7Enormal"}} ``` #### [Find cards in a pack](https://lionmarket.com/sandbox/api#get-api-repacks-pack-search) — GET /sandbox/api/repacks/{pack}/search Use links.search to find cards players can draw. For potential grails in your own vault, set source=vault and grails=true. Parameters - `pack` (URL path) — Use the ID in the pack’s links. A display name can contain spaces and can change. Example: `apex`. - `q` (query) — Search card names. Example: `Pikachu`. - `source` (query) — eligible returns drawable cards. vault returns available copies your company owns. Values: eligible, vault. Example: `eligible`. - `grails` (query) — Use true to limit results to the pack’s grail price range. Example: `true`. - `below_pct` (query) — Percent below the target, from 0 to 100. Defaults to 20. A $2,000 target starts at $1,600 with this default. Example: `20`. - `above_pct` (query) — Percent above the target, default 20. With a $2,000 target the default upper limit is $2,400. Example: `20`. - `target_cents` (query) — Use an explicit target in USD cents only when the pack has no configured maximum. Physical packs with closed bands use their largest upper bound. Catalog packs can define a grail target or tier maximum. Example: `200000`. - `min_value_cents` (query) — Inclusive minimum current market value in USD cents. Example: `1000`. - `max_value_cents` (query) — Inclusive maximum current market value in USD cents. Example: `50000`. - `mode` (query) — Choose a listed mode. Omit to use the pack’s default odds. Example: `normal`. - `category` (query) — Match the card category. Example: `Pokémon`. - `language` (query) — Match the printing’s language code. Example: `en`. - `set_id` (query) — Match the set identifier. Example: `sv8`. - `card_id` (query) — Match the opaque card ID returned for this pack. Example: `019bffc8-5c96-75dc-b3b6-c4a84117c6a3`. - `format` (query) — Choose raw or graded. Values: raw, graded. Example: `raw`. - `grade` (query) — Numeric grade from the grading company, such as 8. Use with grader. Example: `8`. - `grader` (query) — Grading company, such as PSA. Example: `PSA`. - `condition` (query) — Filter raw cards by condition. Values: NEAR_MINT, LIGHTLY_PLAYED, MODERATELY_PLAYED, HEAVILY_PLAYED, DAMAGED. Example: `NEAR_MINT`. - `photo` (query) — Choose the images each result must have. Values: any, front, pair, none, actual, reference. Example: `pair`. - `vault_id` (query) — Search a particular vault with source=vault. Example: `default`. - `band_index` (query) — Limit drawable cards to one published price band. The first band is 0. Example: `0`. - `limit` (query) — Maximum results per page, from 1 to 100. Example: `10`. - `cursor` (query) — Pass the next_cursor from the last page to continue. Example: `eyJpZCI6ImNvcHlfMDQyIn0`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/repacks/apex/search?grails=true' ``` Example response (HTTP 200) ```json {"pack_id":"apex","kind":"catalog","version":"f5dee1a2110371895fc7faff","mode":"normal","source":"eligible","currency":"USD","target_cents":200000,"below_pct":20,"above_pct":20,"min_value_cents":160000,"max_value_cents":240000,"total_count":2,"distinct_printings":2,"data":[{"id":"psa-92423775","name":"Rayquaza-Reverse Foil","set":"","number":"92423775","variant":"","grade":"2005 · Pokemon Ex Delta Species · #13 · PSA 8","date":"2026-11-22T00:47:57.348Z","front":"72c1cd5ef2e3712cfae09e36aafee9ffb3e82f5dab4784f62d6b5c13d7d4bc63","back":"11cefba8b2266ec6b6ce3c1eb581983c66e458265df94e42739b1f3934840116","slab":true,"cents":175000,"language":null,"card_id":"psa-92423775","printing_id":"psa-92423775","item_id":"psa-92423775","vault_id":"default","cert":"92423775","format":"graded","grader":"PSA","category":"Pokémon","set_id":"pokemon-ex-delta-species","images":{"front_url":"https://chat.lionmarket.app/api/rips/photo/72c1cd5ef2e3712cfae09e36aafee9ffb3e82f5dab4784f62d6b5c13d7d4bc63.jpg","back_url":"https://chat.lionmarket.app/api/rips/photo/11cefba8b2266ec6b6ce3c1eb581983c66e458265df94e42739b1f3934840116.jpg"},"photo_kind":"actual_copy","market_value_cents":172500,"value_cents":172500,"market_price_source":"demo_snapshot","market_prices":{"card_ladder":null,"lion_price":null},"published_value_cents":175000,"weight":10035,"band_index":5,"first_draw_chance":{"numerator":10035,"denominator":10000000}},{"id":"psa-79299847","name":"2003 Pokemon Skyridge H31 Vaporeon-Holo PSA 8","set":"","number":"79299847","variant":"","grade":"PSA 8","date":"2026-11-20T16:01:42.280Z","front":"495ed98fe8b0bf722f0c8fff5c2d80376fd06e34577b1b909f6f11750f5cef28","back":"ae699634603716b569c1d418a7d62ee1fd1ca6762cfed0ecf585b5631fa0a557","slab":true,"cents":142300,"language":null,"card_id":"psa-79299847","printing_id":"psa-79299847","item_id":"psa-79299847","vault_id":"default","cert":"79299847","format":"graded","grader":"PSA","category":"Pokémon","set_id":"pokemon-skyridge","images":{"front_url":"https://chat.lionmarket.app/api/rips/photo/495ed98fe8b0bf722f0c8fff5c2d80376fd06e34577b1b909f6f11750f5cef28.jpg","back_url":"https://chat.lionmarket.app/api/rips/photo/ae699634603716b569c1d418a7d62ee1fd1ca6762cfed0ecf585b5631fa0a557.jpg"},"photo_kind":"actual_copy","market_value_cents":160000,"value_cents":160000,"market_price_source":"demo_snapshot","market_prices":{"card_ladder":null,"lion_price":null},"published_value_cents":142300,"weight":42,"band_index":5,"first_draw_chance":{"numerator":42,"denominator":10000000}}],"next_cursor":null} ``` #### [Check availability before charging](https://lionmarket.com/sandbox/api#get-api-repacks-pack-availability) — GET /sandbox/api/repacks/{pack}/availability Check stock before offering a quantity or collecting room payments. This read makes no reservation. The select transaction checks supply again. Parameters - `pack` (URL path) — Use the ID in the pack’s links. A display name can contain spaces and can change. Example: `apex`. - `mode` (query) — Choose a published mode. For a catalog room, repeat this query parameter in paid-seat order. Example: `normal`. - `reserved_card_id` (query) — Catalog rooms only. Repeat once per sealed card to exclude it from the new seats. Paid and sealed seats together must total at most five. - `quantity` (query) — For a solo availability check, request 1–10 cards. Example: `1`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/repacks/apex/availability?mode=normal' ``` Example response (HTTP 200) ```json {"version":"f5dee1a2110371895fc7faff","modes":["normal"],"reserved_card_ids":[],"probability":"published","pack_id":"apex","kind":"catalog","available":true,"quantity":1,"mode":"normal"} ``` #### [Open a pack](https://lionmarket.com/sandbox/api#post-api-repacks-pack-select) — POST /sandbox/api/repacks/{pack}/select For a vault-backed award, authorize payment first and follow links.select with auto_release_after_seconds set to null. Save the returned batch ID, item_id and hold_url before capturing payment once. After a timeout, replay the exact URL, body and Idempotency-Key to recover the same receipt. An on-demand result is a price quote and a catalog draw is a card ID. Parameters - `pack` (URL path) — Use the ID in the pack’s links. A display name can contain spaces and can change. Example: `apex`. - `mode` (JSON body) — Choose a listed mode. Omit to use the pack’s default odds. Example: `normal`. - `quantity` (JSON body) — Number of solo draws, from 1 to 10. Defaults to 1. Example: `1`. ```javascript // Save as example.mjs and run with Node.js 22 or later. import { existsSync, readFileSync, writeFileSync } from "node:fs"; const file = "lion-sandbox.node-cookie"; const resultResponse = await fetch("https://lionmarket.com/sandbox/api/repacks/apex/select", { method: "POST", redirect: "error", headers: { ...(existsSync(file) && { Cookie: readFileSync(file, "utf8") }), "Content-Type": "application/json", "Idempotency-Key": "a62935cc-4916-8245-96c5-c67d7e5504c9", }, body: JSON.stringify({ "mode": "normal", "quantity": 1 }), }); for (const cookie of resultResponse.headers.getSetCookie()) { if (cookie.startsWith("lion_purchase_demo_v2=")) writeFileSync(file, cookie.split(";", 1)[0], { mode: 0o600 }); } if (!resultResponse.ok) throw new Error(`HTTP ${resultResponse.status}: ${await resultResponse.text()}`); console.log(await resultResponse.json()); ``` ```python from http.cookiejar import MozillaCookieJar from pathlib import Path import requests cookie_file = Path("lion-sandbox.cookies") session = requests.Session() session.cookies = MozillaCookieJar(str(cookie_file)) if cookie_file.exists(): session.cookies.load(ignore_discard=True) response = session.request( "POST", "https://lionmarket.com/sandbox/api/repacks/apex/select", headers={"Idempotency-Key": "a62935cc-4916-8245-96c5-c67d7e5504c9"}, json={ "mode": "normal", "quantity": 1 }, timeout=30, ) session.cookies.save(ignore_discard=True) if not response.ok: raise RuntimeError(f"HTTP {response.status_code}: {response.text}") print(response.json()) ``` ```rust // cargo add reqwest@0.12 --features blocking,json,cookies // cargo add serde_json use reqwest::blocking::Client; use reqwest::cookie::Jar; use std::{fs, path::Path, sync::Arc}; fn main() -> Result<(), Box> { let file = Path::new("lion-sandbox.cookie"); let jar = Arc::new(Jar::default()); if file.exists() { jar.add_cookie_str(&fs::read_to_string(file)?, &"https://lionmarket.com/sandbox/api".parse()?); } let client = Client::builder().cookie_provider(jar).build()?; let response = client.post("https://lionmarket.com/sandbox/api/repacks/apex/select") .header("Idempotency-Key", "a62935cc-4916-8245-96c5-c67d7e5504c9") .json(&serde_json::json!({ "mode": "normal", "quantity": 1 })) .send()?; for cookie in response.headers().get_all(reqwest::header::SET_COOKIE) { let value = cookie.to_str()?; if value.starts_with("lion_purchase_demo_v2=") { fs::write(file, value)?; } } if !response.status().is_success() { return Err(format!("HTTP {}: {}", response.status(), response.text()?).into()); } let result: serde_json::Value = response.json()?; println!("{}", serde_json::to_string_pretty(&result)?); Ok(()) } ``` ```sh curl --silent --show-error --fail-with-body --request POST \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ --header 'Idempotency-Key: a62935cc-4916-8245-96c5-c67d7e5504c9' \ --header 'Content-Type: application/json' \ --data '{"mode":"normal","quantity":1}' \ 'https://lionmarket.com/sandbox/api/repacks/apex/select' ``` [View the request steps and a fresh sample receipt](https://lionmarket.com/sandbox/api/examples?path=%2Fapi%2Frepacks%2F%7Bpack%7D%2Fselect) Example response (HTTP 201) ```json {"id":"0d63f5f4-c81a-87de-bbaf-49bae04ca42d","version":"f5dee1a2110371895fc7faff","pack_id":"apex","kind":"catalog","probability":"published","quantity":1,"mode":"normal","style":"normal","card_ids":["print-019c120d-efcb-702c-81c2-ff0668601f17"],"outcomes":[{"card_id":"print-019c120d-efcb-702c-81c2-ff0668601f17","mode":"normal","chance":{"numerator":85379,"denominator":10000000}}]} ``` #### [List a pack’s modes](https://lionmarket.com/sandbox/api#get-api-repacks-pack-modes) — GET /sandbox/api/repacks/{pack}/modes Find the mode ID to show its odds or start a checkout. A physical pack can also have saved modes before its first publication. Parameters - `pack` (URL path) — Use the ID in the pack’s links. A display name can contain spaces and can change. Example: `apex`. - `q` (query) — Match mode name or ID. Example: `Hard`. - `limit` (query) — 1–100. Defaults to 50. Example: `10`. - `cursor` (query) — Opaque next_cursor from the preceding page. Keep the same filters. Example: `eyJpZCI6ImNvcHlfMDQyIn0`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/repacks/apex/modes?q=Hard' ``` Example response (HTTP 200) ```json {"data":[{"mode":"hard","mode_name":"Hard","available":true,"version":"f5dee1a2110371895fc7faff"}],"next_cursor":null} ``` #### [Download a card catalog](https://lionmarket.com/sandbox/api#get-api-repack-catalogs-version) — GET /sandbox/api/repack-catalogs/{version} Load the cards, artwork IDs, packs and draw weights in one request. Use current to load the active release or the release ID saved with an opening to show what that player drew. Parameters - `version` (URL path) — current or an immutable version obtained from the menu. Example: `f5dee1a2110371895fc7faff`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/repack-catalogs/f5dee1a2110371895fc7faff' ``` [Open the full sandbox response](https://lionmarket.com/sandbox/api/repack-catalogs/f5dee1a2110371895fc7faff) Example response excerpt (HTTP 200) ```json {"oddsVersion":"f5dee1a2110371895fc7faff","cards":[{"id":"practice-019c000a-36f2-733d-933f-e8cc2552e8aa","name":"Drilbur","set":"SV: Black Bolt","number":"124/086","variant":"Holofoil","grade":"Raw","date":"2026-10-20","front":"1d40c110f7c4c0414c36b251dc060cf0aade1b28d1adf3b9bfe631feb36dfacc","back":null,"slab":false,"cents":650,"source":"019c000a-36f2-733d-933f-e8cc2552e8aa","year":2025,"language":"English","archived":true}],"packs":[{"id":"starter","name":"Starter","price":100,"ticketScale":10000000,"tierMax":2000,"publishedMin":10,"advertisedMax":2000,"bracketStarts":[10],"outcomes":[{"card":"print-019c3ac3-ec72-71a9-8358-a4f1c013554e","weight":259722}],"styles":{"high":[{"card":"print-019c3ac3-ec72-71a9-8358-a4f1c013554e","weight":190821}],"crazy":[{"card":"print-019c3ac3-ec72-71a9-8358-a4f1c013554e","weight":204588}]}}]} ``` #### [Read a card from a saved opening](https://lionmarket.com/sandbox/api#get-api-repack-catalogs-version-cards-card) — GET /sandbox/api/repack-catalogs/{version}/cards/{card} Use the edition version saved with the pull to display its grade, value and both available images. Parameters - `card` (URL path) — The card ID returned by the opening. Example: `psa-92423775`. - `version` (URL path) — The game catalog version. Example: `f5dee1a2110371895fc7faff`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/repack-catalogs/f5dee1a2110371895fc7faff/cards/psa-92423775' ``` Example response (HTTP 200) ```json {"id":"psa-92423775","name":"Rayquaza-Reverse Foil","set":"","number":"92423775","variant":"","grade":"2005 · Pokemon Ex Delta Species · #13 · PSA 8","date":"2026-11-22T00:47:57.348Z","front":"72c1cd5ef2e3712cfae09e36aafee9ffb3e82f5dab4784f62d6b5c13d7d4bc63","back":"11cefba8b2266ec6b6ce3c1eb581983c66e458265df94e42739b1f3934840116","slab":true,"cents":175000,"language":null,"card_id":"psa-92423775","value_cents":175000,"images":{"front_url":"https://chat.lionmarket.app/api/rips/photo/72c1cd5ef2e3712cfae09e36aafee9ffb3e82f5dab4784f62d6b5c13d7d4bc63.jpg","back_url":"https://chat.lionmarket.app/api/rips/photo/11cefba8b2266ec6b6ce3c1eb581983c66e458265df94e42739b1f3934840116.jpg"},"version":"f5dee1a2110371895fc7faff"} ``` ### Purchase orders #### [Find cards in a purchase order](https://lionmarket.com/sandbox/api#get-purchase-orders-purchase_order-sourcing) — GET /sandbox/api/purchase-orders/{purchase_order}/sourcing Filter this order’s sourcing records by stage, bucket, card name or certificate. Amounts are in USD cents. Received copies with a current vault link include vault_id and item_id. Parameters - `purchase_order` (URL path) — The id from the purchase order. Example: `a00d0000-0000-4000-8000-000000000102`. - `stage` (query) — Group cards by sourcing stage or physical activity. If stage and status are both supplied, stage takes precedence. Values: pending, received, rejected, picked_up, vaulted. Example: `received`. - `status` (query) — Match the exact sourcing record status. Values: received, pending, pickup, in_transit, rejected, released, vaulted, delivered. Example: `vaulted`. - `bucket` (query) — Bucket ID from the order’s progress array. Example: feature. - `q` (query) — Part of a card name, certificate or sourcing description. Example: Pikachu. Example: `22222222`. - `page` (query) — Page number, 1–100,000. Defaults to 1. Example: `1`. - `limit` (query) — Records per page, 1–100. Defaults to 25. Counts include units across all stages matching the search and bucket. Example: `10`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/purchase-orders/a00d0000-0000-4000-8000-000000000101/sourcing?status=vaulted&q=22222222' ``` Example response (HTTP 200) ```json {"data":[],"total":0,"page":1,"limit":25,"counts":{"received":0,"pending":0,"pickup":0,"in_transit":0,"rejected":0,"released":0,"vaulted":0,"delivered":0},"activity_counts":{"pending":0,"picked_up":0,"rejected":0,"vaulted":0},"sourcing_counts":{"pending":0,"received":0,"rejected":0},"buckets":[{"id":"core","label":"Under $100","target_cards":12,"target_cents":null,"max_value_cents":9999,"rules":["Card Ladder Green below $100."],"filled_cards":12,"filled_cents":57822,"incoming_cards":0,"incoming_cents":0,"rejected_cards":1,"released_cards":0},{"id":"feature","label":"$100–$499.99","target_cards":null,"target_cents":4800000,"min_value_cents":10000,"max_value_cents":49999,"rules":["Card Ladder Green from $100 to $499.99."],"filled_cards":34,"filled_cents":841414,"incoming_cards":39,"incoming_cents":1604715,"rejected_cards":1,"released_cards":0},{"id":"chase","label":"$500 and up","target_cards":null,"target_cents":6600000,"min_value_cents":50000,"rules":["Card Ladder Green of $500 or more."],"filled_cards":7,"filled_cents":688268,"incoming_cards":34,"incoming_cents":2175000,"rejected_cards":1,"released_cards":0}]} ``` #### [Get purchase order invoice](https://lionmarket.com/sandbox/api#get-purchase-orders-purchase_order-invoice) — GET /sandbox/api/purchase-orders/{purchase_order}/invoice Get the approved total in USD cents, company, sequential invoice number, issue time and optional note. Before staff confirmation this returns 409 invoice_not_issued. Historical statements keep their original format. Parameters - `purchase_order` (URL path) — The id from the purchase order. Example: `a00d0000-0000-4000-8000-000000000102`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/purchase-orders/a00d0000-0000-4000-8000-000000000102/invoice' ``` Example response (HTTP 409) ```json {"error":"invoice_not_issued","message":"The invoice is issued at admin confirmation."} ``` #### [Find current and past purchase orders](https://lionmarket.com/sandbox/api#get-purchase-orders) — GET /sandbox/api/purchase-orders Current includes orders through confirmation and shipping. Done and vaulted orders appear under Past. Each order records its original fulfillment mode and includes its start date and filled and incoming progress per bucket. Parameters - `tab` (query) — current (default) or past. Values: current, past. Example: `current`. - `q` (query) — Optional text in the order name. Example: `restock`. - `page` (query) — Page number, starting at 1 (default). Example: `1`. - `limit` (query) — Orders per page, 1–100. Defaults to 25. Example: `10`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/purchase-orders?tab=current&q=restock' ``` Example response (HTTP 200) ```json {"data":[{"id":"a00d0000-0000-4000-8000-000000000101","name":"Apex chase restock","workflow":{"mode":"vault","stage":"sourcing","paused":false,"cutoff_at":"2026-12-07T08:00:00.000Z","submitted_at":null,"tracking_code":null,"tracking_url":null,"delivered_at":null,"invoice":null},"origin":"portal","status":"live","categories":["pokemon"],"budget_cents":12000000,"start_date":"2026-11-29","created_at":"2026-10-01T12:00:00Z","updated_at":"2026-11-27T17:00:00Z","progress":[{"id":"core","label":"Under $100","target_cards":12,"target_cents":null,"max_value_cents":9999,"rules":["Card Ladder Green below $100."],"filled_cards":12,"filled_cents":57822,"incoming_cards":0,"incoming_cents":0,"rejected_cards":1,"released_cards":0},{"id":"feature","label":"$100–$499.99","target_cards":null,"target_cents":4800000,"min_value_cents":10000,"max_value_cents":49999,"rules":["Card Ladder Green from $100 to $499.99."],"filled_cards":34,"filled_cents":841414,"incoming_cards":39,"incoming_cents":1604715,"rejected_cards":1,"released_cards":0},{"id":"chase","label":"$500 and up","target_cards":null,"target_cents":6600000,"min_value_cents":50000,"rules":["Card Ladder Green of $500 or more."],"filled_cards":7,"filled_cents":688268,"incoming_cards":34,"incoming_cents":2175000,"rejected_cards":1,"released_cards":0}]}],"total":1,"page":1,"limit":20} ``` #### [Start a purchase order](https://lionmarket.com/sandbox/api#post-purchase-orders) — POST /sandbox/api/purchase-orders Create a buying brief with order-wide requirements and individual bucket targets. A company can source with a zero or negative balance. Lion Market charges accepted vault cards at final confirmation and invoices warehouse deliveries separately. ```sh curl --silent --show-error --fail-with-body --request POST \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ --header 'Idempotency-Key: 88323ade-3f18-85c8-9307-5db3d61354c3' \ --header 'Content-Type: application/json' \ --data '{}' \ 'https://lionmarket.com/sandbox/api/purchase-orders' ``` [View the request steps and a fresh sample receipt](https://lionmarket.com/sandbox/api/examples?path=%2Fpurchase-orders) Example response (HTTP 200) ```json {"id":"2d2b2359-8f74-8fd6-9d0e-16094119590a","name":"Untitled purchase order","created_at":"2026-11-29T18:00:00.000Z","updated_at":"2026-11-29T18:00:00.000Z","revision":1,"status":"draft","categories":[],"budget_cents":null,"brief":{"name":null,"categories":[],"pokemon_languages":[],"budget_cents":null,"allocations":null,"era":null,"year_from":null,"year_to":null,"include":null,"exclude":null,"max_copies_per_printing":null,"minimum_confidence":null,"wanted_by":null},"messages":[{"role":"assistant","text":"Which cards should we look for? Tell me the price ranges and the card or dollar target for each category."}],"missing":["Order name","Card categories","Spending budget","Budget allocation","Buying preferences"],"grades":{"grader":"PSA","minimum_grade":null,"minimum_certificate":null},"pricing":[{"min_cents":1,"max_cents":9999,"rate_bps":11000,"requires_consultation":false},{"min_cents":10000,"max_cents":999999,"rate_bps":10000,"requires_consultation":false},{"min_cents":1000000,"max_cents":null,"rate_bps":10000,"requires_consultation":true}],"price_basis":{"pokemon":"card_ladder_green","one_piece":"card_ladder_green","baseball":"card_ladder_green","basketball":"card_ladder_green","football":"card_ladder_green"},"spending_enabled":false,"spent_cents":0,"metadata":{},"external_ref":null} ``` #### [Read a purchase order](https://lionmarket.com/sandbox/api#get-purchase-orders-purchase_order) — GET /sandbox/api/purchase-orders/{purchase_order} Get the saved brief, conversation and sourcing progress. Spent means money taken from the company balance. Sourced is the cost booked during sourcing. An order from the warehouse includes its original request and any issued buyer invoice links in metadata. Parameters - `purchase_order` (URL path) — The id from the purchase order. Example: `a00d0000-0000-4000-8000-000000000102`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/purchase-orders/a00d0000-0000-4000-8000-000000000102' ``` Example response (HTTP 200) ```json {"id":"a00d0000-0000-4000-8000-000000000102","name":"Weekend Rally refill","status":"draft","categories":["pokemon"],"budget_cents":8500000,"brief":{"name":"Weekend Rally refill","categories":["pokemon"],"pokemon_languages":["en","ja"],"budget_cents":8500000,"allocations":null,"era":"Scarlet & Violet","year_from":2023,"year_to":2026,"include":["Illustration rares for the Rally lineup"],"exclude":["Mega Hyper Rare printings"],"max_copies_per_printing":3,"minimum_confidence":null,"wanted_by":"2026-12-09","start_date":"2026-11-29"},"created_at":"2026-11-24T12:00:00Z","start_date":"2026-11-29","updated_at":"2026-11-24T17:00:00Z","revision":1,"messages":[{"role":"user","text":"Put together a $85,000 weekend refill for Rally. English and Japanese printings both work."},{"role":"assistant","text":"How would you like to split the budget between English and Japanese printings?"}],"missing":["Budget allocation"],"grades":{"grader":"PSA","minimum_grade":null,"minimum_certificate":null},"pricing":[{"min_cents":1,"max_cents":9999,"rate_bps":11000,"requires_consultation":false},{"min_cents":10000,"max_cents":999999,"rate_bps":10000,"requires_consultation":false},{"min_cents":1000000,"max_cents":null,"rate_bps":10000,"requires_consultation":true}],"price_basis":{"pokemon":"card_ladder_green","one_piece":"card_ladder_green","baseball":"card_ladder_green","basketball":"card_ladder_green","football":"card_ladder_green"},"spending_enabled":false,"spent_cents":0,"metadata":{},"external_ref":null,"workflow":{"mode":"vault","stage":"request","paused":false,"cutoff_at":"2026-12-07T08:00:00.000Z","submitted_at":null,"tracking_code":null,"tracking_url":null,"delivered_at":null,"invoice":null},"origin":"portal","progress":[{"id":"order","label":"All requested cards","categories":["pokemon"],"target_cards":null,"target_cents":8500000,"rules":[],"filled_cards":0,"filled_cents":0,"incoming_cards":0,"incoming_cents":0,"rejected_cards":0,"released_cards":0}],"sourced_cents":0} ``` #### [Find sourcing cards](https://lionmarket.com/sandbox/api#get-on-demand-cards) — GET /sandbox/api/on-demand/cards Search approved, orderable cards. The SKU fixes the printing, grade or raw condition. Parameters - `q` (query) — Search for a card name. Example: `Pikachu`. - `format` (query) — Choose graded or raw. Values: raw, graded. Example: `graded`. - `grader` (query) — For a graded card, copy both values from a returned card, such as PSA and 8. Example: `PSA`. - `grade` (query) — For a graded card, copy both values from a returned card, such as PSA and 8. Example: `10`. - `min_value_cents` (query) — Inclusive market-value range in USD cents. Example: `1000`. - `max_value_cents` (query) — Inclusive market-value range in USD cents. Example: `50000`. - `limit` (query) — 1–100. Defaults to 50. Example: `3`. - `cursor` (query) — Opaque next_cursor from the preceding page. Keep the same filters. Example: `eyJpZCI6ImNvcHlfMDQyIn0`. - `language` (query) — Query value for this request. Example: `ja`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/on-demand/cards?format=graded&language=ja&limit=3&grade=10&q=Pikachu' ``` Example response (HTTP 200) ```json {"data":[{"sku_id":"sku-psa-167522076","card_id":"psa-167522076","name":"Pikachu ex","set_name":"Pokemon Scarlet & Violet: Surging Sparks","number":"238","category":"Pokémon","format":"graded","grader":"PSA","grade":"10","order_price_cents":62197,"market_value_cents":62197,"images":{"front_url":"/collectibles-demo/cards/copies/167522076-front.webp","back_url":"/collectibles-demo/cards/copies/167522076-back.webp"}},{"sku_id":"sku-psa-164196751","card_id":"psa-164196751","name":"Pikachu Ex","set_name":"Pokemon Asc En-Ascended Heroes","number":"277","category":"Pokémon","format":"graded","grader":"PSA","grade":"10","order_price_cents":47610,"market_value_cents":47610,"images":{"front_url":"/collectibles-demo/cards/copies/164196751-front.webp","back_url":"/collectibles-demo/cards/copies/164196751-back.webp"}},{"sku_id":"sku-psa-131429550","card_id":"psa-131429550","name":"Full Art / Pikachu V","set_name":"Pokemon Sword & Shield Lost Origin","number":"TG16","category":"Pokémon","format":"graded","grader":"PSA","grade":"10","order_price_cents":39900,"market_value_cents":39900,"images":{"front_url":"/collectibles-demo/cards/copies/131429550-front.webp","back_url":"/collectibles-demo/cards/copies/131429550-back.webp"}}],"next_cursor":"3"} ``` #### [Get a sourcing card](https://lionmarket.com/sandbox/api#get-on-demand-cards-sku) — GET /sandbox/api/on-demand/cards/{sku} Read live eligibility, order price and grade-specific stock photography. Parameters - `sku` (URL path) — The sku_id from the sourcing catalog. Example: `sku-psa-92423775`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/on-demand/cards/sku-psa-92423775' ``` Example response (HTTP 200) ```json {"sku_id":"sku-psa-92423775","card_id":"psa-92423775","name":"Rayquaza-Reverse Foil","set_name":"Pokemon Ex Delta Species","number":"13","category":"Pokémon","format":"graded","grader":"PSA","grade":"8","order_price_cents":172500,"market_value_cents":172500,"images":{"front_url":"/collectibles-demo/cards/copies/92423775-front.webp","back_url":"/collectibles-demo/cards/copies/92423775-back.webp"}} ``` #### [Lock a sourcing price](https://lionmarket.com/sandbox/api#post-on-demand-quotes) — POST /sandbox/api/on-demand/quotes Freeze prices for specified SKU quantities until the quote expires. Parameters - `lines` (JSON body) — 1–100 unique SKUs. Each line has sku_id and quantity from 1–100. Example: `[{"sku_id":"sku-psa-92423775","quantity":1}]`. ```sh curl --silent --show-error --fail-with-body --request POST \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ --header 'Idempotency-Key: 7fe99627-afbf-811a-941c-e5e7df8a0d38' \ --header 'Content-Type: application/json' \ --data '{"lines":[{"sku_id":"sku-psa-92423775","quantity":1}]}' \ 'https://lionmarket.com/sandbox/api/on-demand/quotes' ``` [View the request steps and a fresh sample receipt](https://lionmarket.com/sandbox/api/examples?path=%2Fon-demand%2Fquotes) Example response (HTTP 200) ```json {"id":"d93470c1-9e12-8fa1-b5bb-4802916fdad5","expires_at":"2026-11-29T18:15:00.000Z","lines":[{"sku_id":"sku-psa-92423775","quantity":1,"name":"Rayquaza-Reverse Foil","category":"Pokémon","grader":"PSA","grade":"8","unit_price_cents":172500,"market_value_cents":172500}],"item_subtotal_cents":172500,"quote_id":"d93470c1-9e12-8fa1-b5bb-4802916fdad5","currency":"USD"} ``` #### [Order sourcing stock](https://lionmarket.com/sandbox/api#post-on-demand-orders) — POST /sandbox/api/on-demand/orders Buy quoted stock into a vault from the company balance, or order direct delivery using an accepted estimate. Parameters - `quote_id` (JSON body) — Previously locked sourcing quote. Example: `$quote_id`. - `destination` (JSON body) — For vault delivery use type vault and vault_id. Each verified physical receipt adds the corresponding copy. Example: `{"type":"vault","vault_id":"default"}`. - `max_total_cents` (JSON body) — Maximum authorized total debit in USD cents. Example: `172500`. ```sh # Requires jq. Keep the cookie file to retry this sandbox action. ( set -e receipt=$(curl --silent --show-error --fail-with-body --request POST \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ --header 'Idempotency-Key: b77bfb6a-0dbe-87e7-ba11-07e62c623d39' \ --header 'Content-Type: application/json' \ --data '{"lines":[{"sku_id":"sku-psa-92423775","quantity":1}]}' \ 'https://lionmarket.com/sandbox/api/on-demand/quotes') || { printf '%s\n' "$receipt" >&2; exit 1; } quote_id=$(printf '%s' "$receipt" | jq -er '.quote_id') curl --silent --show-error --fail-with-body --request POST \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ --header 'Idempotency-Key: 7d1619b9-d352-8d4a-a7b4-53016841eb60' \ --header 'Content-Type: application/json' \ --data '{"quote_id":"'"$quote_id"'","max_total_cents":172500,"destination":{"type":"vault","vault_id":"default"}}' \ 'https://lionmarket.com/sandbox/api/on-demand/orders' ) ``` [View the request steps and a fresh sample receipt](https://lionmarket.com/sandbox/api/examples?path=%2Fon-demand%2Forders) Example response (HTTP 200) ```json {"id":"abe0e298-c7a9-8808-98c3-ce727f28b545","status":"awaiting_receipt","created_at":"2026-11-29T18:00:00.000Z","ordered_at":"2026-11-29T18:00:00.000Z","quote_id":"445969ac-3573-880c-9071-40f75966ecaa","currency":"USD","item_subtotal_cents":172500,"shipping_cents":0,"total_cents":172500,"lines":[{"sku_id":"sku-psa-92423775","quantity":1,"name":"Rayquaza-Reverse Foil","category":"Pokémon","grader":"PSA","grade":"8","unit_price_cents":172500,"market_value_cents":172500}],"destination":{"type":"vault","vault_id":"default"},"shipment_ids":[]} ``` #### [Get sourcing orders](https://lionmarket.com/sandbox/api#get-on-demand-orders) — GET /sandbox/api/on-demand/orders Review orders and fulfillment history. Parameters - `external_ref` (query) — Exact reference your app saved with the receipt. Example: `shop_1`. - `status` (query) — Match the saved receipt status. Values: awaiting_receipt, partially_received, received, sourcing, shipped, delivered. Example: `awaiting_receipt`. - `sort` (query) — Use recent to show the newest receipt first and include its created_at. Values: recent. Example: `recent`. - `limit` (query) — 1–100. Defaults to 50. Example: `10`. - `cursor` (query) — Opaque next_cursor from the preceding page. Keep the same filters. Example: `eyJpZCI6ImNvcHlfMDQyIn0`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/on-demand/orders?external_ref=shop_1' ``` [Open the full sandbox response](https://lionmarket.com/sandbox/api/on-demand/orders?external_ref=shop_1) Example response excerpt (HTTP 200) ```json {"data":[{"id":"50dc0000-0000-4000-8000-000000000201","status":"received","created_at":"2026-11-01T12:00:00Z","total_cents":187400,"shipping_cents":0,"shipment_ids":[],"destination":{"type":"vault","vault_id":"default"},"received_items":[{"item_id":"psa-141608759","sku_id":"sku-psa-141608759","received_at":"2026-11-07T19:46:04.579Z"}],"lines":[{"sku_id":"sku-psa-141608759","name":"Cooper Dejean","grader":"PSA","grade":"10","quantity":1,"unit_price_cents":187400}]}],"next_cursor":"20"} ``` #### [Get a sourcing order](https://lionmarket.com/sandbox/api#get-on-demand-orders-order) — GET /sandbox/api/on-demand/orders/{order} Read order status, received copies and shipment IDs for tracking. Parameters - `order` (URL path) — The id from the order receipt. Example: `50dc0000-0000-4000-8000-000000000201`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/on-demand/orders/50dc0000-0000-4000-8000-000000000201' ``` Example response (HTTP 200) ```json {"id":"50dc0000-0000-4000-8000-000000000201","status":"received","created_at":"2026-11-01T12:00:00Z","total_cents":187400,"shipping_cents":0,"shipment_ids":[],"destination":{"type":"vault","vault_id":"default"},"received_items":[{"item_id":"psa-141608759","sku_id":"sku-psa-141608759","received_at":"2026-11-07T19:46:04.579Z"}],"lines":[{"sku_id":"sku-psa-141608759","name":"Cooper Dejean","grader":"PSA","grade":"10","quantity":1,"unit_price_cents":187400}]} ``` ### Shipping #### [Find outgoing shipments](https://lionmarket.com/sandbox/api#get-shipments) — GET /sandbox/api/shipments See who is receiving each card, where it is going and when your company requested shipping. Search past shipments by recipient, card, address or tracking number. Parameters - `delivery_status` (query) — Delivery milestone. queued and awaiting_sourcing are pending, shipped is in_transit, and delivered is delivered. Values: pending, in_transit, delivered. Example: `pending`. - `source` (query) — vault for cards leaving your vault. on_demand for a direct sourcing order. Omit for both. Values: vault, on_demand. Example: `vault`. - `q` (query) — Text from the recipient, address, card name, certificate, tracking number, shipment ID or your external reference. Example: `9400111899221111111111`. - `sort` (query) — Use recent for newest requested first. Omit for shipment ID order. Values: recent. Example: `recent`. - `requested_at_gte` (query) — Include shipments requested at or after this ISO 8601 timestamp with timezone. Example: `2026-11-01T00:00:00Z`. - `requested_at_lt` (query) — Include shipments requested before this ISO 8601 timestamp with timezone. Example: `2026-12-01T00:00:00Z`. - `external_ref` (query) — Exact reference you attached when requesting the shipment. Example: `order-42`. - `status` (query) — Exact fulfillment status. Vault shipments start queued. Direct sourcing shipments start awaiting_sourcing. Values: queued, awaiting_sourcing, shipped, delivered. Example: `queued`. - `limit` (query) — 1–100. Defaults to 50. Example: `10`. - `cursor` (query) — Opaque next_cursor from the preceding page. Keep the same filters. Example: `eyJpZCI6ImNvcHlfMDQyIn0`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/shipments?status=shipped' ``` [Open the full sandbox response](https://lionmarket.com/sandbox/api/shipments?status=shipped) Example response excerpt (HTTP 200) ```json {"data":[{"id":"5a1d0000-0000-4000-8000-000000000001","org_id":"00000000-0000-4000-8000-00000000de00","organization_name":"Lion Rips","external_ref":"RIPS-DEMO-8101","status":"requested","delivery_status":"pending","requested_at":"2026-11-29T17:28:00.000Z","shipped_at":null,"delivered_at":null,"ship_to":{"name":"Sam Park","line1":"11 Example Lane","city":"Denver","region":"CO","postal_code":"80202","country_code":"US"},"items":[{"item_id":"psa-118241090","quantity":1,"card_id":"psa-118241090","name":"Glaceon Ex","grader":"PSA","grade":"10","set_name":"Pokemon Pre En-Prismatic Evolutions","cert":"118241090","category":"Pokémon","format":"graded","number":"150","language":"en","grade_label":"PSA 10","acquired_at":"2026-11-14T19:53:33.434Z","received_at":"2026-11-14T19:53:33.434Z","market_value_cents":44000,"images":{"front_url":"/collectibles-demo/cards/copies/118241090-front.webp","back_url":"/collectibles-demo/cards/copies/118241090-back.webp"},"preview_image_url":"/collectibles-demo/cards/copies/118241090-front.webp"}],"carrier":null,"service":null,"tracking_number":null,"tracking_url":null}],"next_cursor":"10","counts":{"all":1167,"pending":123,"in_transit":126,"delivered":918}} ``` #### [Track one shipment](https://lionmarket.com/sandbox/api#get-shipments-shipment) — GET /sandbox/api/shipments/{shipment} Read tracking_url to follow the parcel. For a vault shipment, postage_billing shows the billing method, label cost, and amount due in USD cents. Save the shipment ID as the reference for this charge. Parameters - `shipment` (URL path) — The id from the shipping receipt. Example: `5a1d0000-0000-4000-8000-000000000001`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/shipments/5a1d0000-0000-4000-8000-000000000001' ``` Example response (HTTP 200) ```json {"id":"5a1d0000-0000-4000-8000-000000000001","org_id":"00000000-0000-4000-8000-00000000de00","organization_name":"Lion Rips","external_ref":"RIPS-DEMO-8101","status":"requested","delivery_status":"pending","requested_at":"2026-11-29T17:28:00.000Z","shipped_at":null,"delivered_at":null,"ship_to":{"name":"Sam Park","line1":"11 Example Lane","city":"Denver","region":"CO","postal_code":"80202","country_code":"US"},"items":[{"item_id":"psa-118241090","quantity":1,"card_id":"psa-118241090","name":"Glaceon Ex","grader":"PSA","grade":"10","set_name":"Pokemon Pre En-Prismatic Evolutions","cert":"118241090","category":"Pokémon","format":"graded","number":"150","language":"en","grade_label":"PSA 10","acquired_at":"2026-11-14T19:53:33.434Z","received_at":"2026-11-14T19:53:33.434Z","market_value_cents":44000,"images":{"front_url":"/collectibles-demo/cards/copies/118241090-front.webp","back_url":"/collectibles-demo/cards/copies/118241090-back.webp"},"preview_image_url":"/collectibles-demo/cards/copies/118241090-front.webp"}],"carrier":null,"service":null,"tracking_number":null,"tracking_url":null} ``` #### [Inspect a card in a customer parcel](https://lionmarket.com/sandbox/api#get-shipments-shipment-cards-ordinal) — GET /sandbox/api/shipments/{shipment}/cards/{ordinal} Read the card and parcel together. Use a one-based position from the parcel’s items list. Each available face is a photograph of that physical copy. Parameters - `ordinal` (URL path) — Use the ID from the preceding response. Example: `1`. - `shipment` (URL path) — The id from the shipping receipt. Example: `5a1d0000-0000-4000-8000-000000000001`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/shipments/5a1d0000-0000-4000-8000-000000000001/cards/1' ``` Example response (HTTP 200) ```json {"shipment":{"id":"5a1d0000-0000-4000-8000-000000000001","external_ref":"RIPS-DEMO-8101","ship_to":{"name":"Sam Park","line1":"11 Example Lane","city":"Denver","region":"CO","postal_code":"80202","country_code":"US"},"carrier":null,"service":null,"delivery_status":"pending","requested_at":"2026-11-29T17:28:00.000Z","shipped_at":null,"delivered_at":null,"tracking_number":null,"tracking_url":null},"card":{"ordinal":1,"quantity":1,"acquisition_cost_cents":null,"item":{"id":"psa-118241090","name":"Glaceon Ex","format":"graded","availability":"","category":"Pokémon","set_name":"Pokemon Pre En-Prismatic Evolutions","number":"150","language":"en","cert":"118241090","grader":"PSA","grade":"10","grade_label":"PSA 10","acquired_at":"2026-11-14T19:53:33.434Z","received_at":"2026-11-14T19:53:33.434Z","market_value_cents":44000,"images":{"front_url":"/collectibles-demo/cards/copies/118241090-front.webp","back_url":"/collectibles-demo/cards/copies/118241090-back.webp"},"preview_sides":{"front":"/api/collectibles/demo-photo/118241090/front","back":"/api/collectibles/demo-photo/118241090/back"}}}} ``` #### [List warehouse deliveries](https://lionmarket.com/sandbox/api#get-warehouse-shipments) — GET /sandbox/api/warehouse-shipments Find your company’s boxes from confirmed purchase orders, including boxes being prepared. Parameters - `status` (query) — Stage of the warehouse box. Values: preparing, in_transit, delivered. Example: `in_transit`. - `q` (query) — Search the purchase order, invoice, tracking number or destination. Example: `DEMO-LMR-326`. - `page` (query) — Page number, starting at 1 (default). Example: `1`. - `limit` (query) — Boxes per page, 1–100. Defaults to 24. Example: `10`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/warehouse-shipments' ``` Example response (HTTP 200) ```json {"data":[{"id":"b0700000-0000-4000-8000-000000000001","name":"Winter restock","invoice_number":"LM-LIONRIPS-327","status":"preparing","confirmed_at":"2026-11-30T20:10:00Z","shipped_at":null,"delivered_at":null,"carrier":null,"tracking_number":null,"tracking_url":null,"ship_to":{"name":"Warehouse receiving","company":"Lion Rips","line1":"100 Example Way","city":"Sacramento","region":"CA","postal_code":"95814","country_code":"US"},"card_count":8},{"id":"b0700000-0000-4000-8000-000000000002","name":"November mixed slabs","invoice_number":"LM-LIONRIPS-326","status":"in_transit","confirmed_at":"2026-11-27T18:30:00Z","shipped_at":"2026-11-28T17:15:00Z","delivered_at":null,"carrier":"UPS","tracking_number":"DEMO-LMR-326","tracking_url":"https://www.ups.com/track?tracknum=DEMO-LMR-326","ship_to":{"name":"Warehouse receiving","company":"Lion Rips","line1":"100 Example Way","city":"Sacramento","region":"CA","postal_code":"95814","country_code":"US"},"card_count":28},{"id":"b0700000-0000-4000-8000-000000000003","name":"November collector restock","invoice_number":"LM-LIONRIPS-325","status":"delivered","confirmed_at":"2026-11-21T20:10:00Z","shipped_at":"2026-11-23T16:20:00Z","delivered_at":"2026-11-25T19:46:00Z","carrier":"UPS","tracking_number":"DEMO-LMR-325","tracking_url":"https://www.ups.com/track?tracknum=DEMO-LMR-325","ship_to":{"name":"Warehouse receiving","company":"Lion Rips","line1":"100 Example Way","city":"Sacramento","region":"CA","postal_code":"95814","country_code":"US"},"card_count":12}],"counts":{"all":3,"preparing":1,"in_transit":1,"delivered":1},"total":3,"page":1,"limit":24} ``` #### [Read a box and search its cards](https://lionmarket.com/sandbox/api#get-warehouse-shipments-box) — GET /sandbox/api/warehouse-shipments/{box} Read the receiving address, carrier, tracking and accepted cards. Search all cards before paging the results. Parameters - `box` (URL path) — Use the ID from the preceding response. Example: `b0700000-0000-4000-8000-000000000002`. - `q` (query) — Search by name, grade, set, card number or certificate. Example: `123402`. - `page` (query) — Page number, starting at 1 (default). Example: `1`. - `limit` (query) — Cards per page, 1–100. Defaults to 24. Example: `3`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/warehouse-shipments/b0700000-0000-4000-8000-000000000002?limit=3&q=123402' ``` Example response (HTTP 200) ```json {"box":{"id":"b0700000-0000-4000-8000-000000000002","name":"November mixed slabs","invoice_number":"LM-LIONRIPS-326","status":"in_transit","confirmed_at":"2026-11-27T18:30:00Z","shipped_at":"2026-11-28T17:15:00Z","delivered_at":null,"carrier":"UPS","tracking_number":"DEMO-LMR-326","tracking_url":"https://www.ups.com/track?tracknum=DEMO-LMR-326","ship_to":{"name":"Warehouse receiving","company":"Lion Rips","line1":"100 Example Way","city":"Sacramento","region":"CA","postal_code":"95814","country_code":"US"},"card_count":28},"data":[],"total":0,"page":1,"limit":3} ``` #### [Inspect a card in a warehouse box](https://lionmarket.com/sandbox/api#get-warehouse-shipments-box-cards-ordinal) — GET /sandbox/api/warehouse-shipments/{box}/cards/{ordinal} Use the ordinal returned in the box manifest. Get the exact copy, its recorded cost and the shipment containing it. Parameters - `ordinal` (URL path) — Use the ID from the preceding response. Example: `1`. - `box` (URL path) — Use the ID from the preceding response. Example: `b0700000-0000-4000-8000-000000000002`. ```sh curl --silent --show-error --fail-with-body --request GET \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ 'https://lionmarket.com/sandbox/api/warehouse-shipments/b0700000-0000-4000-8000-000000000002/cards/1' ``` Example response (HTTP 200) ```json {"box":{"id":"b0700000-0000-4000-8000-000000000002","name":"November mixed slabs","invoice_number":"LM-LIONRIPS-326","status":"in_transit","confirmed_at":"2026-11-27T18:30:00Z","shipped_at":"2026-11-28T17:15:00Z","delivered_at":null,"carrier":"UPS","tracking_number":"DEMO-LMR-326","tracking_url":"https://www.ups.com/track?tracknum=DEMO-LMR-326","ship_to":{"name":"Warehouse receiving","company":"Lion Rips","line1":"100 Example Way","city":"Sacramento","region":"CA","postal_code":"95814","country_code":"US"},"card_count":28},"card":{"ordinal":1,"quantity":1,"acquisition_cost_cents":4620,"item":{"id":"psa-152798719","name":"Togedemaru","format":"graded","availability":"","cert":"152798719","category":"Pokémon","set_name":"Pokemon Pfl En-Phantasmal Flames","number":"104","language":"en","grader":"PSA","grade":"10","images":{"front_url":"/collectibles-demo/cards/copies/152798719-front.webp","back_url":"/collectibles-demo/cards/copies/152798719-back.webp"},"preview_sides":{"front":"/api/collectibles/demo-photo/152798719/front","back":"/api/collectibles/demo-photo/152798719/back"},"acquired_at":"2026-11-02T23:18:56.806Z","received_at":"2026-11-02T23:18:56.806Z","market_value_cents":4200,"valued_at":"2026-11-29T09:16:04.448Z"}}} ``` #### [Estimate shipping](https://lionmarket.com/sandbox/api#post-shipping-estimates) — POST /sandbox/api/shipping/estimates Check the address and obtain a carrier rate from Lion’s warehouse. Present any suggested correction for acceptance. Parameters - `source` (JSON body) — Use type vault with vault_id and hold_id or item_ids. For a player pull, pass its pull_id as hold_id and its original vault_id. For on_demand, send exact SKU lines or repack_id, version, optional variant and quantity. Use your locked quote’s lines to estimate shipping. Example: `{"type":"vault","vault_id":"default","item_ids":["psa-92423775"]}`. - `ship_to` (JSON body) — name, line1, city, region, postal_code, country_code. Optional company, line2 and phone. US destinations require a state abbreviation and ZIP. Example: `{"name":"Alex Rivera","line1":"100 Example Avenue","city":"Portland","region":"OR","postal_code":"97201","country_code":"US"}`. ```sh curl --silent --show-error --fail-with-body --request POST \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ --header 'Idempotency-Key: 8e9da072-c6f3-8877-9b12-79f8c86eb86b' \ --header 'Content-Type: application/json' \ --data '{"source":{"type":"vault","vault_id":"default","item_ids":["psa-92423775"]},"ship_to":{"name":"Alex Rivera","line1":"100 Example Avenue","city":"Portland","region":"OR","postal_code":"97201","country_code":"US"}}' \ 'https://lionmarket.com/sandbox/api/shipping/estimates' ``` [View the request steps and a fresh sample receipt](https://lionmarket.com/sandbox/api/examples?path=%2Fshipping%2Festimates) Example response (HTTP 200) ```json {"status":"ready","address_status":"accepted","rate_source":"demo","postage_billing_method":"prepaid","estimate_id":"d6638400-a616-8e13-be74-d16ef801e8e1","id":"d6638400-a616-8e13-be74-d16ef801e8e1","expires_at":"2026-11-29T18:15:00.000Z","source":{"type":"vault","vault_id":"default","item_ids":["psa-92423775"]},"shipping_cents":525,"currency":"USD","ship_to":{"name":"Alex Rivera","line1":"100 Example Avenue","city":"Portland","region":"OR","postal_code":"97201","country_code":"US"},"carrier":"usps","service":"Ground Advantage"} ``` #### [Confirm a vault shipment](https://lionmarket.com/sandbox/api#post-vaults-vault-shipments) — POST /sandbox/api/vaults/{vault}/shipments Queue the exact cards for delivery. Prepaid workspaces pay the quoted postage at confirmation. Approved invoice workspaces owe the actual label cost when the warehouse dispatches the parcel. Parameters - `vault` (URL path) — The vault_id on the card or default_vault_id from GET /account. Example: `default`. - `estimate_id` (JSON body) — Required unexpired, verified estimate for this vault. Example: `$estimate_id`. ```javascript // Save as example.mjs and run with Node.js 22 or later. import { existsSync, readFileSync, writeFileSync } from "node:fs"; const file = "lion-sandbox.node-cookie"; const estimate_idResponse = await fetch("https://lionmarket.com/sandbox/api/shipping/estimates", { method: "POST", redirect: "error", headers: { ...(existsSync(file) && { Cookie: readFileSync(file, "utf8") }), "Content-Type": "application/json", "Idempotency-Key": "02483754-c63d-8a4c-967b-74e9d37f6168", }, body: JSON.stringify({ "source": { "type": "vault", "vault_id": "default", "item_ids": [ "psa-92423775" ] }, "ship_to": { "name": "Alex Rivera", "line1": "100 Example Avenue", "city": "Portland", "region": "OR", "postal_code": "97201", "country_code": "US" } }), }); for (const cookie of estimate_idResponse.headers.getSetCookie()) { if (cookie.startsWith("lion_purchase_demo_v2=")) writeFileSync(file, cookie.split(";", 1)[0], { mode: 0o600 }); } if (!estimate_idResponse.ok) throw new Error(`HTTP ${estimate_idResponse.status}: ${await estimate_idResponse.text()}`); const estimate_id = (await estimate_idResponse.json())["estimate_id"]; const resultResponse = await fetch("https://lionmarket.com/sandbox/api/vaults/default/shipments", { method: "POST", redirect: "error", headers: { ...(existsSync(file) && { Cookie: readFileSync(file, "utf8") }), "Content-Type": "application/json", "Idempotency-Key": "5527f788-8dd4-8182-985c-4042099c1078", }, body: JSON.stringify({ "estimate_id": estimate_id }), }); for (const cookie of resultResponse.headers.getSetCookie()) { if (cookie.startsWith("lion_purchase_demo_v2=")) writeFileSync(file, cookie.split(";", 1)[0], { mode: 0o600 }); } if (!resultResponse.ok) throw new Error(`HTTP ${resultResponse.status}: ${await resultResponse.text()}`); console.log(await resultResponse.json()); ``` ```python from http.cookiejar import MozillaCookieJar from pathlib import Path import requests cookie_file = Path("lion-sandbox.cookies") session = requests.Session() session.cookies = MozillaCookieJar(str(cookie_file)) if cookie_file.exists(): session.cookies.load(ignore_discard=True) response = session.request( "POST", "https://lionmarket.com/sandbox/api/shipping/estimates", headers={"Idempotency-Key": "02483754-c63d-8a4c-967b-74e9d37f6168"}, json={ "source": { "type": "vault", "vault_id": "default", "item_ids": [ "psa-92423775" ] }, "ship_to": { "name": "Alex Rivera", "line1": "100 Example Avenue", "city": "Portland", "region": "OR", "postal_code": "97201", "country_code": "US" } }, timeout=30, ) session.cookies.save(ignore_discard=True) if not response.ok: raise RuntimeError(f"HTTP {response.status_code}: {response.text}") estimate_id = response.json()["estimate_id"] response = session.request( "POST", "https://lionmarket.com/sandbox/api/vaults/default/shipments", headers={"Idempotency-Key": "5527f788-8dd4-8182-985c-4042099c1078"}, json={ "estimate_id": estimate_id }, timeout=30, ) session.cookies.save(ignore_discard=True) if not response.ok: raise RuntimeError(f"HTTP {response.status_code}: {response.text}") print(response.json()) ``` ```rust // cargo add reqwest@0.12 --features blocking,json,cookies // cargo add serde_json use reqwest::blocking::Client; use reqwest::cookie::Jar; use std::{fs, path::Path, sync::Arc}; fn main() -> Result<(), Box> { let file = Path::new("lion-sandbox.cookie"); let jar = Arc::new(Jar::default()); if file.exists() { jar.add_cookie_str(&fs::read_to_string(file)?, &"https://lionmarket.com/sandbox/api".parse()?); } let client = Client::builder().cookie_provider(jar).build()?; let response = client.post("https://lionmarket.com/sandbox/api/shipping/estimates") .header("Idempotency-Key", "02483754-c63d-8a4c-967b-74e9d37f6168") .json(&serde_json::json!({ "source": { "type": "vault", "vault_id": "default", "item_ids": [ "psa-92423775" ] }, "ship_to": { "name": "Alex Rivera", "line1": "100 Example Avenue", "city": "Portland", "region": "OR", "postal_code": "97201", "country_code": "US" } })) .send()?; for cookie in response.headers().get_all(reqwest::header::SET_COOKIE) { let value = cookie.to_str()?; if value.starts_with("lion_purchase_demo_v2=") { fs::write(file, value)?; } } if !response.status().is_success() { return Err(format!("HTTP {}: {}", response.status(), response.text()?).into()); } let result: serde_json::Value = response.json()?; let estimate_id = result["estimate_id"].as_str().ok_or("Missing estimate_id")?; let response = client.post("https://lionmarket.com/sandbox/api/vaults/default/shipments") .header("Idempotency-Key", "5527f788-8dd4-8182-985c-4042099c1078") .json(&serde_json::json!({ "estimate_id": estimate_id })) .send()?; for cookie in response.headers().get_all(reqwest::header::SET_COOKIE) { let value = cookie.to_str()?; if value.starts_with("lion_purchase_demo_v2=") { fs::write(file, value)?; } } if !response.status().is_success() { return Err(format!("HTTP {}: {}", response.status(), response.text()?).into()); } let result: serde_json::Value = response.json()?; println!("{}", serde_json::to_string_pretty(&result)?); Ok(()) } ``` ```sh # Requires jq. Keep the cookie file to retry this sandbox action. ( set -e receipt=$(curl --silent --show-error --fail-with-body --request POST \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ --header 'Idempotency-Key: 02483754-c63d-8a4c-967b-74e9d37f6168' \ --header 'Content-Type: application/json' \ --data '{"source":{"type":"vault","vault_id":"default","item_ids":["psa-92423775"]},"ship_to":{"name":"Alex Rivera","line1":"100 Example Avenue","city":"Portland","region":"OR","postal_code":"97201","country_code":"US"}}' \ 'https://lionmarket.com/sandbox/api/shipping/estimates') || { printf '%s\n' "$receipt" >&2; exit 1; } estimate_id=$(printf '%s' "$receipt" | jq -er '.estimate_id') curl --silent --show-error --fail-with-body --request POST \ --cookie lion-sandbox.cookies --cookie-jar lion-sandbox.cookies \ --header 'Idempotency-Key: 5527f788-8dd4-8182-985c-4042099c1078' \ --header 'Content-Type: application/json' \ --data '{"estimate_id":"'"$estimate_id"'"}' \ 'https://lionmarket.com/sandbox/api/vaults/default/shipments' ) ``` [View the request steps and a fresh sample receipt](https://lionmarket.com/sandbox/api/examples?path=%2Fvaults%2F%7Bvault%7D%2Fshipments) Example response (HTTP 200) ```json {"id":"447c285a-bbba-816b-88fd-94b8d98792aa","status":"queued","delivery_status":"pending","requested_at":"2026-11-29T18:00:00.000Z","shipped_at":null,"delivered_at":null,"ship_to":{"name":"Alex Rivera","line1":"100 Example Avenue","city":"Portland","region":"OR","postal_code":"97201","country_code":"US"},"items":[{"item_id":"psa-92423775","quantity":1,"card_id":"psa-92423775","name":"Rayquaza-Reverse Foil","grader":"PSA","grade":"8","set_name":"Pokemon Ex Delta Species","cert":"92423775","category":"Pokémon","format":"graded","number":"13","language":"en","grade_label":"PSA 8","acquired_at":"2026-11-22T02:12:00.346Z","received_at":"2026-11-22T02:12:00.346Z","market_value_cents":172500,"images":{"front_url":"/collectibles-demo/cards/copies/92423775-front.webp","back_url":"/collectibles-demo/cards/copies/92423775-back.webp"},"preview_image_url":"/collectibles-demo/cards/copies/92423775-front.webp"}],"carrier":"usps","service":"Ground Advantage","tracking_number":null,"tracking_url":null,"source":{"type":"vault","vault_id":"default","item_ids":["psa-92423775"]},"estimate_id":"e5ecb7bb-8f68-804b-978c-5751633b494d","external_ref":null,"metadata":{},"delivery_target_days":{"min":2,"max":3},"shipping_cents":525,"currency":"USD","postage_paid_at":"2026-11-29T18:00:00.000Z","postage_billing":{"shipment_id":"447c285a-bbba-816b-88fd-94b8d98792aa","method":"prepaid","status":"paid","currency":"USD","quoted_cents":525,"label_cost_cents":null,"adjustment_cents":0,"amount_due_cents":0,"paid_cents":525,"credit_cents":0,"charged_at":null}} ```