{"openapi":"3.0.3","info":{"title":"Else Agent Payments API","version":"1.0.0","description":"Owner-funded Solana USDC purchasing for scoped agents. Budgets include fees and pending orders. Keys cannot withdraw funds. Revocation blocks new requests; already revealed cards and in-flight provider payments remain separate."},"servers":[{"url":"https://elsepay.co/v1"}],"security":[{"bearerAuth":[]}],"paths":{"/auth/device":{"post":{"summary":"Start owner CLI authorization","operationId":"post_auth_device","security":[],"responses":{"201":{"description":"Authorization request created","content":{"application/json":{"schema":{"type":"object","properties":{"device_code":{"type":"string"},"user_code":{"type":"string"},"verification_uri":{"type":"string","format":"uri"},"expires_in":{"type":"integer"},"interval":{"type":"integer"}}}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/auth/device/poll":{"post":{"summary":"Claim an approved owner CLI session","operationId":"post_auth_device_poll","security":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"202":{"description":"Authorization is pending","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Expired or already claimed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["device_code"],"properties":{"device_code":{"type":"string"}}}}}}}},"/auth/logout":{"post":{"summary":"Revoke the current owner CLI session","operationId":"post_auth_logout","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/me":{"get":{"summary":"Read owner balance or agent policy","operationId":"get_me","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents":{"get":{"summary":"List agents (owner)","operationId":"get_agents","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create an agent and return its key once (owner)","operationId":"post_agents","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Agent created; api_key is shown once","content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"$ref":"#/components/schemas/Agent"},"api_key":{"type":"string","readOnly":true}}}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPolicy"}}}}}},"/agents/{agent_id}/rotate":{"post":{"summary":"Rotate an agent key (owner)","operationId":"post_agents_agent_id_rotate","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/agents/{agent_id}/revoke":{"post":{"summary":"Revoke an agent key (owner)","operationId":"post_agents_agent_id_revoke","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/catalog/gifts":{"get":{"summary":"Search allowed gift products","operationId":"get_catalog_gifts","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"country","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}}]}},"/quotes":{"post":{"summary":"Quote a card or gift purchase (agent)","operationId":"post_quotes","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Exact quote; no payment submitted","content":{"application/json":{"schema":{"type":"object","properties":{"quote":{"$ref":"#/components/schemas/Quote"},"network":{"type":"string"}}}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteInput"}}}}}},"/orders":{"post":{"summary":"Reserve and submit one purchase (agent)","operationId":"post_orders","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Existing terminal order or ready gift","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"$ref":"#/components/schemas/Order"}}}}}},"202":{"description":"Accepted or awaiting approval; inspect state, not HTTP success alone","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"$ref":"#/components/schemas/Order"}}}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["quote_id"],"properties":{"quote_id":{"type":"string","format":"uuid"}}}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":120,"pattern":"^[A-Za-z0-9_.-]+$"}}]},"get":{"summary":"List owned orders","operationId":"get_orders","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{order_id}":{"get":{"summary":"Read an owned order, optionally refresh its card status","operationId":"get_orders_order_id","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean"}}]}},"/orders/{order_id}/reveal":{"post":{"summary":"Reveal card or gift details (agent with secrets scope)","operationId":"post_orders_order_id_reveal","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/orders/{order_id}/approve":{"post":{"summary":"Approve an exact pending purchase (owner)","operationId":"post_orders_order_id_approve","security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Approval processed; inspect the returned order state","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"$ref":"#/components/schemas/Order"}}}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/orders/{order_id}/reject":{"post":{"summary":"Cancel a pending approval and release its reservation (owner)","operationId":"post_orders_order_id_reject","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/requests/{request_key}":{"get":{"summary":"Recover an order by its idempotency key (agent)","operationId":"get_requests_request_key","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"request_key","in":"path","required":true,"schema":{"type":"string"}}]}},"/approvals":{"get":{"summary":"List pending approvals (owner)","operationId":"get_approvals","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/events":{"get":{"summary":"Read the scoped audit trail","operationId":"get_events","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Key is missing, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Owner role, agent scope or product permission required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Budget, balance, quote or order conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable or outcome uncertain. Recover the existing request before another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Agent key (else_ag_) for purchases; owner CLI session (else_cli_) for agent management and approvals."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id","retryable"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string","format":"uuid"},"retryable":{"type":"boolean"}}}}},"AgentPolicy":{"type":"object","required":["name","budget_usdc","per_order_usdc"],"properties":{"name":{"type":"string","minLength":1,"maxLength":60},"budget_usdc":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$","example":"25.000000"},"per_order_usdc":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$","example":"25.000000"},"daily_usdc":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$","example":"25.000000"},"approval_above_usdc":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$","example":"25.000000","nullable":true},"expires_in_days":{"type":"integer","minimum":1,"maximum":90,"default":30},"scopes":{"type":"array","items":{"type":"string","enum":["cards:purchase","gifts:purchase","orders:read","secrets:read"]}},"countries":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"},"default":["US"]},"products":{"type":"array","items":{"type":"string"},"description":"Optional gift product ID allowlist. Empty means any product in allowed countries."}}},"Agent":{"allOf":[{"$ref":"#/components/schemas/AgentPolicy"},{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"key_prefix":{"type":"string"},"used_usdc":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$","example":"25.000000"},"remaining_usdc":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$","example":"25.000000"},"daily_used_usdc":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$","example":"25.000000"},"expires_at":{"type":"string","format":"date-time"},"revoked":{"type":"boolean"}}}]},"QuoteInput":{"type":"object","required":["kind","amount","currency"],"properties":{"kind":{"type":"string","enum":["agent_card","international_card","gift_card"]},"amount":{"type":"string","pattern":"^[0-9]+(\\.[0-9]{1,2})?$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"product_id":{"type":"string"}},"description":"Cards use USD. Gift cards require product_id and country, with the catalog currency and allowed denomination."},"Quote":{"type":"object","required":["id","input","total_usdc","provider_total_usdc","service_fee_usdc","expires_at"],"properties":{"id":{"type":"string","format":"uuid"},"input":{"type":"object"},"total_usdc":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$","example":"25.000000"},"provider_total_usdc":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$","example":"25.000000"},"service_fee_usdc":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$","example":"25.000000"},"expires_at":{"type":"string","format":"date-time"},"eta":{"type":"string"}}},"Order":{"type":"object","required":["id","kind","total_usdc","state"],"properties":{"id":{"type":"string","format":"uuid"},"agent_id":{"type":"string","format":"uuid","nullable":true},"kind":{"type":"string"},"label":{"type":"string"},"amount":{"type":"string"},"currency":{"type":"string"},"total_usdc":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$","example":"25.000000"},"provider_total_usdc":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$","example":"25.000000"},"service_fee_usdc":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$","example":"25.000000"},"state":{"type":"string","enum":["awaiting_approval","processing","pending","queued","ready","action_required","review","failed","cancelled","complete","archived"]},"failure_code":{"type":"string","nullable":true},"last4":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}}},"GiftProduct":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"currency":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"},"increment":{"type":"number","nullable":true},"denominations":{"type":"array","nullable":true,"items":{"type":"number"}}}}}}}