{"openapi":"3.1.0","info":{"title":"StablePay merchant API","version":"1.0.0","description":"StablePay is a self-custody USDC checkout for apps. Create a checkout over HTTP, send the customer to the hosted page, and receive a signed webhook when the USDC payment lands on Base or Solana. Receive-only: no private keys, funds go straight to the merchant's own wallet. Not available to residents of Vietnam (HTTP 451). Checkout URLs always use https://pay.growfast.sh."},"servers":[{"url":"https://pay.shipfast.sh"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Merchant API key"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"CreateCheckout":{"type":"object","required":["amountUsd","productName","customerRef","successUrl"],"properties":{"amountUsd":{"type":"string","pattern":"^\\d{1,7}(\\.\\d{1,2})?$","description":"> 0 and <= 1000000","example":"19.00"},"productName":{"type":"string","minLength":1,"maxLength":200},"customerRef":{"type":"string","minLength":1,"maxLength":200},"metadata":{"type":"object","additionalProperties":true},"periodDays":{"type":"integer","minimum":1,"maximum":3650},"successUrl":{"type":"string","format":"uri","pattern":"^https?://"},"cancelUrl":{"type":"string","format":"uri","pattern":"^https?://"}}},"CreatedCheckout":{"type":"object","required":["id","url","expiresAt"],"properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"}}},"Checkout":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"status":{"type":"string","enum":["open","paid","expired"]},"amountUsd":{"type":"string"},"baseAmount":{"type":"string","description":"Exact USDC amount to send on Base (price plus unique offset)"},"productName":{"type":"string"},"customerRef":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"periodDays":{"type":["integer","null"]},"expiresAt":{"type":"string","format":"date-time"},"paidAt":{"type":["string","null"],"format":"date-time"},"chain":{"type":["string","null"],"enum":["base","solana",null]},"tx":{"type":["string","null"]},"accessUntil":{"type":["string","null"],"format":"date-time"},"renewalOf":{"type":["string","null"]}}}}},"paths":{"/v1/checkouts":{"post":{"operationId":"createCheckout","summary":"Create a checkout and get the hosted payment URL","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckout"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedCheckout"}}}},"400":{"description":"Invalid body or amount","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"451":{"description":"Not available in your region","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Could not allocate a unique Base amount; retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/checkouts/{id}":{"get":{"operationId":"getCheckout","summary":"Get one of your checkouts","security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"co_abc123"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Checkout"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/c/{id}":{"get":{"operationId":"hostedCheckoutPage","summary":"Hosted payment page (HTML). Redirects to successUrl when paid","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"co_abc123"}}],"responses":{"200":{"description":"HTML page"},"302":{"description":"Paid: redirect to successUrl"},"404":{"description":"Not found"},"451":{"description":"Not available in your region"}}}},"/c/{id}/status":{"get":{"operationId":"checkoutStatus","summary":"Polling status for the hosted page","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"co_abc123"}}],"responses":{"200":{"description":"Status","content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["open","paid","expired"]},"successUrl":{"type":"string"}}}}}},"404":{"description":"Not found (empty body)"}}}},"/health":{"get":{"operationId":"health","summary":"Liveness and database check","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}}}}}}}