{"openapi":"3.0.3","info":{"title":"X Market API","version":"1.0","description":"Order from Amazon through X Market, paid with crypto, card or PayPal. See /llms.txt for the flow."},"servers":[{"url":"https://xmarket.cash"}],"paths":{"/api/v1/config":{"get":{"summary":"Brand, fee, stores, payment details","responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/catalog":{"get":{"summary":"Search products","parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"store","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/resolve":{"get":{"summary":"Read a product link","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/rate":{"get":{"summary":"The SOL price in dollars used for quotes","responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/keys":{"post":{"summary":"Make an API key","responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"}}}}}}}}},"/api/v1/orders":{"post":{"summary":"Make an order","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"id":{"type":"string"},"qty":{"type":"integer"},"price_usd":{"type":"number"},"max_usd":{"type":"number"},"title":{"type":"string"},"image":{"type":"string"}}}},"email":{"type":"string"},"ship_to":{"type":"object","properties":{"name":{"type":"string"},"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"zip":{"type":"string"},"country":{"type":"string"},"phone":{"type":"string"}},"required":["name","line1","city","state","zip","country"]},"pay_method":{"type":"string","enum":["crypto","card","paypal"],"description":"crypto (SOL/USDC) works for bots; card and paypal give a hosted checkout url for a person to finish"},"pay_token":{"type":"string","enum":["SOL","USDC"]},"agent":{"type":"string"},"webhook":{"type":"string"}},"required":["items","email","ship_to"]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"content":{"application/json":{"schema":{"type":"object"}}}}}},"get":{"summary":"Orders made with your API key","security":[{"bearer":[]}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/orders/{id}":{"get":{"summary":"One order","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}}},"404":{"content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/orders/{id}/pay":{"post":{"summary":"Report the payment signature","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"signature":{"type":"string"}},"required":["signature"]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}}},"202":{"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/orders/{id}/tx":{"post":{"summary":"Unsigned payment transaction for a browser wallet","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"payer":{"type":"string"}},"required":["payer"]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/orders/{id}/send":{"post":{"summary":"Send a signed payment transaction","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"signed":{"type":"string"}},"required":["signed"]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/orders/{id}/cancel":{"post":{"summary":"Cancel an order","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}}}