Stellar PHP SDK API Documentation

SEP24DepositRequest

Request parameters for initiating a SEP-24 interactive deposit

This class represents the request payload for starting an interactive deposit flow as defined by SEP-24 (Hosted Deposit and Withdrawal). It contains all the parameters needed to initiate a deposit from an external payment system to the Stellar network.

A deposit transfers assets from an off-chain source (e.g., bank account, crypto exchange) to the user's Stellar account. The user provides the external funds to the anchor, and the anchor credits the equivalent Stellar asset to the user's account. This request initiates the interactive flow where the user provides deposit details through the anchor's web interface.

Interactive Flow Lifecycle:

  1. Client submits this request to POST /transactions/deposit/interactive
  2. Anchor returns SEP24InteractiveResponse with an interactive URL and transaction ID
  3. Client opens the interactive URL in a popup or webview
  4. The JWT is passed to the web interface via query parameters automatically
  5. User completes the deposit form in the anchor's web interface (provides bank details, etc.)
  6. Anchor closes the popup/webview and returns control to the client
  7. Client polls the transaction endpoint to monitor deposit status
  8. User sends funds to anchor via external payment method
  9. Anchor receives funds and credits Stellar asset to user's account

JWT Parameter Handling: The JWT token is transmitted to the interactive web interface as a query parameter (e.g., ?token=JWT_VALUE). The anchor's web interface uses this for authentication and session management. Each interactive session uses a one-time JWT context, though the JWT itself may be reused across multiple transactions during its validity period.

Required fields include the JWT authentication token and asset code. Optional fields allow pre-filling the interactive form with known information like amount, source asset, destination account, memo, and KYC details to streamline the user experience.

Tags
see
https://github.com/stellar/stellar-protocol/blob/v3.8.0/ecosystem/sep-0024.md

SEP-24 Specification

see
InteractiveService

For executing deposit requests

see
SEP24InteractiveResponse

For the interactive URL response

see
SEP24Transaction

For the transaction response

see
StandardKYCFields

For KYC data structure

Table of Contents

Properties

$account  : string|null
$amount  : float|null
$assetCode  : string
$assetIssuer  : string|null
$claimableBalanceSupported  : string|null
$customerId  : string|null
$customFields  : array<string|int, mixed>|null
$customFiles  : array<string|int, string>|null
$jwt  : string
$kycFields  : StandardKYCFields|null
$lang  : string|null
$memo  : string|null
$memoType  : string|null
$quoteId  : string|null
$sourceAsset  : string|null
$walletName  : string|null
$walletUrl  : string|null

Methods

getAccount()  : string|null
getAmount()  : float|null
getAssetCode()  : string
getAssetIssuer()  : string|null
getClaimableBalanceSupported()  : string|null
getCustomerId()  : string|null
getCustomFields()  : array<string|int, mixed>|null
getCustomFiles()  : array<string|int, string>|null
getJwt()  : string
getKycFields()  : StandardKYCFields|null
getLang()  : string|null
getMemo()  : string|null
getMemoType()  : string|null
getQuoteId()  : string|null
getSourceAsset()  : string|null
getWalletName()  : string|null
getWalletUrl()  : string|null
setAccount()  : void
setAmount()  : void
setAssetCode()  : void
setAssetIssuer()  : void
setClaimableBalanceSupported()  : void
setCustomerId()  : void
setCustomFields()  : void
setCustomFiles()  : void
setJwt()  : void
setKycFields()  : void
setLang()  : void
setMemo()  : void
setMemoType()  : void
setQuoteId()  : void
setSourceAsset()  : void
setWalletName()  : void
setWalletUrl()  : void

Properties

$account

public string|null $account = null

(optional) The Stellar or muxed account the client wants to use as the destination of the payment sent by the anchor. Defaults to the account authenticated via SEP-10 if not specified.

$amount

public float|null $amount = null

(optional) Amount of asset requested to deposit. If this is not provided it will be collected in the interactive flow. When qouteId is specified, this parameter must match the quote's quote.sell_amount or be omitted.

$assetCode

public string $assetCode

The code of the stellar asset the user wants to receive for their deposit with the anchor. The value passed must match one of the codes listed in the /info response's deposit object. 'native' is a special asset_code that represents the native XLM token.

$assetIssuer

public string|null $assetIssuer = null

(optional) The issuer of the stellar asset the user wants to receive for their deposit with the anchor. If assetIssuer is not provided, the anchor will use the asset issued by themselves as described in their TOML file. If 'native' is specified as the assetCode, assetIssuer must be not be set.

$claimableBalanceSupported

public string|null $claimableBalanceSupported = null

(optional) True if the client supports receiving deposit transactions as a claimable balance, false otherwise.

$customerId

public string|null $customerId = null

(optional) id of an off-chain account (managed by the anchor) associated with this user's Stellar account (identified by the JWT's sub field). If the anchor supports [SEP-12], the customer_id field should match the [SEP-12] customer's id. customer_id should be passed only when the off-chain id is known to the client, but the relationship between this id and the user's Stellar account is not known to the Anchor.

$customFields

public array<string|int, mixed>|null $customFields = null

Custom SEP-9 fields that you can use for transmission.

$customFiles

public array<string|int, string>|null $customFiles = null

Custom SEP-9 files that you can use for transmission (["fieldname" => "binary string value", ...])

$jwt

public string $jwt

jwt token previously received from the anchor via the SEP-10 authentication flow

$lang

public string|null $lang = null

(optional) Defaults to en if not specified or if the specified language is not supported. Language code specified using RFC 4646 which means it can also accept locale in the format en-US. error fields in the response, as well as the interactive flow UI and any other user-facing strings returned for this transaction should be in this language.

$memo

public string|null $memo = null

(optional) Value of memo to attach to transaction, for hash this should be base64-encoded. Because a memo can be specified in the SEP-10 JWT for Shared Accounts, this field can be different than the value included in the SEP-10 JWT. For example, a client application could use the value passed for this parameter as a reference number used to match payments made to account.

$memoType

public string|null $memoType = null

(optional) type of memo that anchor should attach to the Stellar payment transaction, one of 'text', 'id' or 'hash'

$quoteId

public string|null $quoteId = null

(optional) The id returned from a SEP-38 POST /quote response.

$sourceAsset

public string|null $sourceAsset = null

(optional) - string in Asset Identification Format - The asset user wants to send. See: https://github.com/stellar/stellar-protocol/blob/v2.5.0/ecosystem/sep-0038.md#asset-identification-format. Note, that this is the asset user initially holds (off-chain or fiat asset). If this is not provided, it will be collected in the interactive flow. When quoteId is specified, this parameter must match the quote's sell_asset asset code or be omitted.

$walletName

public string|null $walletName = null

(deprecated, optional) In communications / pages about the deposit, anchor should display the wallet name to the user to explain where funds are going.

$walletUrl

public string|null $walletUrl = null

(deprecated, optional) Anchor should link to this when notifying the user that the transaction has completed.

Methods

getAccount()

public getAccount() : string|null
Return values
string|null

The Stellar or muxed account the client wants to use as the destination of the payment sent by the anchor. Defaults to the account authenticated via SEP-10 if not specified.

getAmount()

public getAmount() : float|null
Return values
float|null

Amount of asset requested to deposit. If this is not provided it will be collected in the interactive flow. When qouteId is specified, this parameter must match the quote's quote.sell_amount or be omitted.

getAssetCode()

public getAssetCode() : string
Return values
string

The code of the stellar asset the user wants to receive for their deposit with the anchor. The value passed must match one of the codes listed in the /info response's deposit object. 'native' is a special asset_code that represents the native XLM token.

getAssetIssuer()

public getAssetIssuer() : string|null
Return values
string|null

The issuer of the stellar asset the user wants to receive for their deposit with the anchor. If assetIssuer is not provided, the anchor will use the asset issued by themselves as described in their TOML file. If 'native' is specified as the assetCode, assetIssuer must be not be set.

getClaimableBalanceSupported()

public getClaimableBalanceSupported() : string|null
Return values
string|null

True if the client supports receiving deposit transactions as a claimable balance, false otherwise.

getCustomerId()

public getCustomerId() : string|null
Return values
string|null

id of an off-chain account (managed by the anchor) associated with this user's Stellar account (identified by the JWT's sub field). If the anchor supports [SEP-12], the customer_id field should match the [SEP-12] customer's id. customer_id should be passed only when the off-chain id is known to the client, but the relationship between this id and the user's Stellar account is not known to the Anchor.

getCustomFields()

public getCustomFields() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

Custom SEP-9 fields that you can use for transmission.

getCustomFiles()

public getCustomFiles() : array<string|int, string>|null
Return values
array<string|int, string>|null

Custom SEP-9 files that you can use for transmission (["fieldname" => "binary string value", ...])

getJwt()

public getJwt() : string
Return values
string

jwt token previously received from the anchor via the SEP-10 authentication flow

getLang()

public getLang() : string|null
Return values
string|null

Defaults to en if not specified or if the specified language is not supported. Language code specified using RFC 4646 which means it can also accept locale in the format en-US. error fields in the response, as well as the interactive flow UI and any other user-facing strings returned for this transaction should be in this language.

getMemo()

public getMemo() : string|null
Return values
string|null

Value of memo to attach to transaction, for hash this should be base64-encoded. Because a memo can be specified in the SEP-10 JWT for Shared Accounts, this field can be different than the value included in the SEP-10 JWT. For example, a client application could use the value passed for this parameter as a reference number used to match payments made to account.

getMemoType()

public getMemoType() : string|null
Return values
string|null

type of memo that anchor should attach to the Stellar payment transaction, one of 'text', 'id' or 'hash'

getQuoteId()

public getQuoteId() : string|null
Return values
string|null

The id returned from a SEP-38 POST /quote response.

getSourceAsset()

public getSourceAsset() : string|null
Return values
string|null

string in Asset Identification Format - The asset user wants to send. See: https://github.com/stellar/stellar-protocol/blob/v2.5.0/ecosystem/sep-0038.md#asset-identification-format. Note, that this is the asset user initially holds (off-chain or fiat asset). If this is not provided, it will be collected in the interactive flow. When quoteId is specified, this parameter must match the quote's sell_asset asset code or be omitted.

getWalletName()

public getWalletName() : string|null
Return values
string|null

(deprecated, optional) In communications / pages about the deposit, anchor should display the wallet name to the user to explain where funds are going.

getWalletUrl()

public getWalletUrl() : string|null
Return values
string|null

(deprecated, optional) Anchor should link to this when notifying the user that the transaction has completed.

setAccount()

public setAccount(string|null $account) : void
Parameters
$account : string|null

The Stellar or muxed account the client wants to use as the destination of the payment sent by the anchor. Defaults to the account authenticated via SEP-10 if not specified.

setAmount()

public setAmount(float|null $amount) : void
Parameters
$amount : float|null

Amount of asset requested to deposit. If this is not provided it will be collected in the interactive flow. When qouteId is specified, this parameter must match the quote's quote.sell_amount or be omitted.

setAssetCode()

public setAssetCode(string $assetCode) : void
Parameters
$assetCode : string

The code of the stellar asset the user wants to receive for their deposit with the anchor. The value passed must match one of the codes listed in the /info response's deposit object. 'native' is a special asset_code that represents the native XLM token.

setAssetIssuer()

public setAssetIssuer(string|null $assetIssuer) : void
Parameters
$assetIssuer : string|null

The issuer of the stellar asset the user wants to receive for their deposit with the anchor. If assetIssuer is not provided, the anchor will use the asset issued by themselves as described in their TOML file. If 'native' is specified as the assetCode, assetIssuer must be not be set.

setClaimableBalanceSupported()

public setClaimableBalanceSupported(string|null $claimableBalanceSupported) : void
Parameters
$claimableBalanceSupported : string|null

True if the client supports receiving deposit transactions as a claimable balance, false otherwise.

setCustomerId()

public setCustomerId(string|null $customerId) : void
Parameters
$customerId : string|null

id of an off-chain account (managed by the anchor) associated with this user's Stellar account (identified by the JWT's sub field). If the anchor supports [SEP-12], the customer_id field should match the [SEP-12] customer's id. customer_id should be passed only when the off-chain id is known to the client, but the relationship between this id and the user's Stellar account is not known to the Anchor.

setCustomFields()

public setCustomFields(array<string|int, mixed>|null $customFields) : void
Parameters
$customFields : array<string|int, mixed>|null

Custom SEP-9 fields that you can use for transmission.

setCustomFiles()

public setCustomFiles(array<string|int, string>|null $customFiles) : void
Parameters
$customFiles : array<string|int, string>|null

Custom SEP-9 files that you can use for transmission (["fieldname" => "binary string value", ...])

setJwt()

public setJwt(string $jwt) : void
Parameters
$jwt : string

jwt token previously received from the anchor via the SEP-10 authentication flow

setLang()

public setLang(string|null $lang) : void
Parameters
$lang : string|null

Defaults to en if not specified or if the specified language is not supported. Language code specified using RFC 4646 which means it can also accept locale in the format en-US. error fields in the response, as well as the interactive flow UI and any other user-facing strings returned for this transaction should be in this language.

setMemo()

public setMemo(string|null $memo) : void
Parameters
$memo : string|null

Value of memo to attach to transaction, for hash this should be base64-encoded. Because a memo can be specified in the SEP-10 JWT for Shared Accounts, this field can be different than the value included in the SEP-10 JWT. For example, a client application could use the value passed for this parameter as a reference number used to match payments made to account.

setMemoType()

public setMemoType(string|null $memoType) : void
Parameters
$memoType : string|null

type of memo that anchor should attach to the Stellar payment transaction, one of 'text', 'id' or 'hash'

setQuoteId()

public setQuoteId(string|null $quoteId) : void
Parameters
$quoteId : string|null

The id returned from a SEP-38 POST /quote response.

setSourceAsset()

public setSourceAsset(string|null $sourceAsset) : void
Parameters
$sourceAsset : string|null

string in Asset Identification Format - The asset user wants to send. See: https://github.com/stellar/stellar-protocol/blob/v2.5.0/ecosystem/sep-0038.md#asset-identification-format. Note, that this is the asset user initially holds (off-chain or fiat asset). If this is not provided, it will be collected in the interactive flow. When quoteId is specified, this parameter must match the quote's sell_asset asset code or be omitted.

setWalletName()

public setWalletName(string|null $walletName) : void
Parameters
$walletName : string|null

(deprecated, optional) In communications / pages about the deposit, anchor should display the wallet name to the user to explain where funds are going.

setWalletUrl()

public setWalletUrl(string|null $walletUrl) : void
Parameters
$walletUrl : string|null

(deprecated, optional) Anchor should link to this when notifying the user that the transaction has completed.


        
On this page

Search results