Skip to main content
Before an AI session can make on-chain payments on your behalf, you must link a deployed Soroban smart account contract to your Pay3 account. This endpoint creates that association — it does not deploy the contract itself, but records your contract’s address so Pay3 AI sessions can reference it as a spending vault and apply your spending policies. If the contract address has already been linked by the same user, the record is updated rather than duplicated.

Endpoint

POST /api/smart-accounts Authentication is required. Include either the pay3_session cookie or an Authorization: Bearer <session-token> header.

Request Body

string
required
The Soroban contract address to link — a 56-character Stellar address beginning with C. The address is case-insensitive and will be normalized to uppercase.Example: CDJT5OQNBBSXMFBKXH3ZHQJH3XPXKBQQMYIBNHQK5ZYXDV7KXQHRMTE
The contract must already be deployed and initialized on Stellar before you link it here. Pay3 expects the contract to have been set up by calling initialize(owner, usdc_token) with your wallet as the owner and the correct USDC SAC contract ID as the token. Linking an uninitialized contract will succeed at the API level but may cause failures when AI sessions attempt to use it.

Response

All Pay3 API responses are wrapped in a standard envelope:
A successful 201 Created response returns the newly created (or updated) smart account record, along with on-chain reference values, inside data.
object
The linked smart account record.
string
A unique identifier for this API request, useful for support and debugging.

Example

Request

Response Body


Error Responses