Create a deposit-address payment
const url = 'https://hub.stablezact.com/api/v1/deposits/create';const options = { method: 'POST', headers: {'X-Public-Key': '<X-Public-Key>', 'Content-Type': 'application/json'}, body: '{"amount":1,"currency":"USDT","network":"example","customerEmail":"hello@example.com","callbackUrl":"https://example.com","orderId":"example","metadata":{"additionalProperty":"example"},"expiresIn":1,"agentId":"example","agentOwner":"example","autonomous":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://hub.stablezact.com/api/v1/deposits/create \ --header 'Content-Type: application/json' \ --header 'X-Public-Key: <X-Public-Key>' \ --data '{ "amount": 1, "currency": "USDT", "network": "example", "customerEmail": "hello@example.com", "callbackUrl": "https://example.com", "orderId": "example", "metadata": { "additionalProperty": "example" }, "expiresIn": 1, "agentId": "example", "agentOwner": "example", "autonomous": true }'Generates an address unique to this payment. The customer sends to it, and the funds are forwarded to your settlement wallet once confirmed.
A payment created this way finishes at status swept, not completed.
Waiting for completed on a deposit payment means waiting forever.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Same core fields as creating a payment, plus the agent fields. The deposit window is a fixed fifteen minutes; see expiresIn below.
object
In practice only USDC and USDT are configured on any network.
Must be a chain with deposit-address support and a settlement wallet of yours.
object
Ignored. The deposit window is fixed at fifteen minutes (900 seconds) and is returned as expiresAt. It was previously settable and defaulted to twenty minutes, but the expiry job always closed deposits at fifteen, so a longer value only quoted a time that was not kept. Sending this field is accepted and has no effect.
For agent-initiated payments. Must be sent with agentOwner.
Only permitted when the agent has a policy allowing it. Otherwise the request is refused with 403.
Responses
Section titled “Responses”Payment created, with the address to send to.
object
Includes depositAddress, expiresAt and the confirmations required.
object
Examplegenerated
{ "success": true, "requestId": "example", "payment": {}}The request was rejected. Read error and message.
object
Short machine-ish reason.
Longer explanation, when there is one.
Example
{ "success": false, "error": "Validation failed", "message": "Unsupported currency: GBP"}Missing or invalid credentials.
object
Short machine-ish reason.
Longer explanation, when there is one.
Example
{ "error": "API credentials required. Use x-public-key header or x-api-key and x-api-secret headers."}The agent policy does not permit this. Either the payment exceeds the agent’s limits, or autonomous was requested without a policy allowing it.
object
Short machine-ish reason.
Longer explanation, when there is one.
Example
{ "success": false}