SEP24WithdrawRequest
in package
Request parameters for initiating a SEP-24 interactive withdrawal
This class represents the request payload for starting an interactive withdrawal flow as defined by SEP-24 (Hosted Deposit and Withdrawal). It contains all the parameters needed to initiate a withdrawal from the Stellar network to an external payment system (e.g., bank account, crypto exchange).
A withdrawal transfers assets from the user's Stellar account to an off-chain destination. The anchor processes the withdrawal and sends funds to the specified external account. This request initiates the interactive flow where the user provides withdrawal details through the anchor's web interface.
Interactive Flow Lifecycle:
- Client submits this request to POST /transactions/withdraw/interactive
- Anchor returns SEP24InteractiveResponse with an interactive URL and transaction ID
- Client opens the interactive URL in a popup or webview
- The JWT is passed to the web interface via query parameters automatically
- User completes the withdrawal form in the anchor's web interface (provides bank account details, etc.)
- Anchor provides withdrawal account address and memo for the Stellar payment
- Anchor closes the popup/webview and returns control to the client
- Client polls the transaction endpoint to get withdrawal account details
- User sends Stellar assets to the anchor's withdrawal account with the specified memo
- Anchor receives Stellar payment and processes external transfer to user's bank 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, destination asset, and KYC details to streamline the user experience.
Tags
Table of Contents
Properties
- $account : string|null
- $amount : float|null
- $assetCode : string
- $assetIssuer : string|null
- $customerId : string|null
- $customFields : array<string|int, mixed>|null
- $customFiles : array<string|int, string>|null
- $destinationAsset : string|null
- $jwt : string
- $kycFields : StandardKYCFields|null
- $lang : string|null
- $memo : string|null
- $memoType : string|null
- $quoteId : string|null
- $refundMemo : string|null
- $refundMemoType : string|null
- $walletName : string|null
- $walletUrl : string|null
Methods
- getAccount() : string|null
- getAmount() : float|null
- getAssetCode() : string
- getAssetIssuer() : string|null
- getCustomerId() : string|null
- getCustomFields() : array<string|int, mixed>|null
- getCustomFiles() : array<string|int, string>|null
- getDestinationAsset() : string|null
- getJwt() : string
- getKycFields() : StandardKYCFields|null
- getLang() : string|null
- getMemo() : string|null
- getMemoType() : string|null
- getQuoteId() : string|null
- getRefundMemo() : string|null
- getRefundMemoType() : string|null
- getWalletName() : string|null
- getWalletUrl() : string|null
- setAccount() : void
- setAmount() : void
- setAssetCode() : void
- setAssetIssuer() : void
- setCustomerId() : void
- setCustomFields() : void
- setCustomFiles() : void
- setDestinationAsset() : void
- setJwt() : void
- setKycFields() : void
- setLang() : void
- setMemo() : void
- setMemoType() : void
- setQuoteId() : void
- setRefundMemo() : void
- setRefundMemoType() : void
- setWalletName() : void
- setWalletUrl() : void
Properties
$account
public
string|null
$account
= null
The Stellar or muxed account the client will use as the source of the withdrawal payment to 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 withdraw. If this is not provided it will be collected in the interactive flow.
$assetCode
public
string
$assetCode
Code of the asset the user wants to withdraw. The value passed must match one of the codes listed in the /info response's withdraw 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 withdraw with the anchor. If asset_issuer is not provided, the anchor should use the asset issued by themselves as described in their TOML file. If 'native' is specified as the asset_code, asset_issuer must be not be set.
$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", ...])
$destinationAsset
public
string|null
$destinationAsset
= null
(optional) string in Asset Identification Format - The asset user wants to receive. See: https://github.com/stellar/stellar-protocol/blob/v2.5.0/ecosystem/sep-0038.md#asset-identification-format. It's an off-chain or fiat asset. If this is not provided, it will be collected in the interactive flow. When quote_id is specified, this parameter must match the quote's buy_asset asset code or be omitted.
$jwt
public
string
$jwt
jwt token previously received from the anchor via the SEP-10 authentication flow
$kycFields
public
StandardKYCFields|null
$kycFields
= null
Additionally, any SEP-9 parameters may be passed as well to make the onboarding experience simpler.
$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
(deprecated, optional) This field was originally intended to differentiate users of the same Stellar account. However, the anchor should use the sub value included in the decoded SEP-10 JWT instead. Anchors should still support this parameter to maintain support for outdated clients. See the Shared Account Authentication section for more information. https://github.com/stellar/stellar-protocol/blob/v3.8.0/ecosystem/sep-0024.md#shared-omnibus-or-pooled-accounts
$memoType
public
string|null
$memoType
= null
(deprecated, optional) Type of memo. One of text, id or hash. Deprecated because memos used to identify users of the same Stellar account should always be of type of id.
$quoteId
public
string|null
$quoteId
= null
(optional) The id returned from a SEP-38 POST /quote response.
$refundMemo
public
string|null
$refundMemo
= null
(optional) The memo the anchor must use when sending refund payments back to the user. If not specified, the anchor should use the same memo used by the user to send the original payment. If specified, refund_memo_type must also be specified.
$refundMemoType
public
string|null
$refundMemoType
= null
(optional) The type of the refund_memo. Can be id, text, or hash. See the memos documentation for more information. If specified, refund_memo must also be specified. https://developers.stellar.org
$walletName
public
string|null
$walletName
= null
(deprecated,optional) In communications / pages about the withdrawal, anchor should display the wallet name to the user to explain where funds are coming from. However, anchors should use client_domain (for non-custodial) and sub value of JWT (for custodial) to determine wallet information.
$walletUrl
public
string|null
$walletUrl
= null
(deprecated,optional) Anchor can show this to the user when referencing the wallet involved in the withdrawal (ex. in the anchor's transaction history). However, anchors should use client_domain (for non-custodial) and sub value of JWT (for custodial) to determine wallet information.
Methods
getAccount()
public
getAccount() : string|null
Return values
string|null —The Stellar or muxed account the client will use as the source of the withdrawal payment to the anchor. Defaults to the account authenticated via SEP-10 if not specified.
getAmount()
public
getAmount() : float|null
Return values
float|null —(optional) Amount of asset requested to withdraw. If this is not provided it will be collected in the interactive flow.
getAssetCode()
public
getAssetCode() : string
Return values
string —Code of the asset the user wants to withdraw. The value passed must match one of the codes listed in the /info response's withdraw object. 'native' is a special asset_code that represents the native XLM token.
getAssetIssuer()
public
getAssetIssuer() : string|null
Return values
string|null —(optional) The issuer of the stellar asset the user wants to withdraw with the anchor. If asset_issuer is not provided, the anchor should use the asset issued by themselves as described in their TOML file. If 'native' is specified as the asset_code, asset_issuer must be not be set.
getCustomerId()
public
getCustomerId() : string|null
Return values
string|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.
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", ...])
getDestinationAsset()
public
getDestinationAsset() : string|null
Return values
string|null —(optional) string in Asset Identification Format - The asset user wants to receive. See: https://github.com/stellar/stellar-protocol/blob/v2.5.0/ecosystem/sep-0038.md#asset-identification-format. It's an off-chain or fiat asset. If this is not provided, it will be collected in the interactive flow. When quote_id is specified, this parameter must match the quote's buy_asset asset code or be omitted.
getJwt()
public
getJwt() : string
Return values
string —jwt token previously received from the anchor via the SEP-10 authentication flow
getKycFields()
public
getKycFields() : StandardKYCFields|null
Return values
StandardKYCFields|null —Additionally, any SEP-9 parameters may be passed as well to make the onboarding experience simpler.
getLang()
public
getLang() : string|null
Return values
string|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.
getMemo()
public
getMemo() : string|null
Return values
string|null —(deprecated, optional) This field was originally intended to differentiate users of the same Stellar account. However, the anchor should use the sub value included in the decoded SEP-10 JWT instead. Anchors should still support this parameter to maintain support for outdated clients. See the Shared Account Authentication section for more information. https://github.com/stellar/stellar-protocol/blob/v3.8.0/ecosystem/sep-0024.md#shared-omnibus-or-pooled-accounts
getMemoType()
public
getMemoType() : string|null
Return values
string|null —(deprecated, optional) Type of memo. One of text, id or hash. Deprecated because memos used to identify users of the same Stellar account should always be of type of id.
getQuoteId()
public
getQuoteId() : string|null
Return values
string|null —The id returned from a SEP-38 POST /quote response.
getRefundMemo()
public
getRefundMemo() : string|null
Return values
string|null —(optional) The memo the anchor must use when sending refund payments back to the user. If not specified, the anchor should use the same memo used by the user to send the original payment. If specified, refund_memo_type must also be specified.
getRefundMemoType()
public
getRefundMemoType() : string|null
Return values
string|null —(optional) The type of the refund_memo. Can be id, text, or hash. See the memos documentation for more information. If specified, refund_memo must also be specified. https://developers.stellar.org
getWalletName()
public
getWalletName() : string|null
Return values
string|null —(deprecated,optional) In communications / pages about the withdrawal, anchor should display the wallet name to the user to explain where funds are coming from. However, anchors should use client_domain (for non-custodial) and sub value of JWT (for custodial) to determine wallet information.
getWalletUrl()
public
getWalletUrl() : string|null
Return values
string|null —(deprecated,optional) Anchor can show this to the user when referencing the wallet involved in the withdrawal (ex. in the anchor's transaction history). However, anchors should use client_domain (for non-custodial) and sub value of JWT (for custodial) to determine wallet information.
setAccount()
public
setAccount(string|null $account) : void
Parameters
- $account : string|null
-
The Stellar or muxed account the client will use as the source of the withdrawal payment to the anchor. Defaults to the account authenticated via SEP-10 if not specified.
setAmount()
public
setAmount(float|null $amount) : void
Parameters
- $amount : float|null
-
(optional) Amount of asset requested to withdraw. If this is not provided it will be collected in the interactive flow.
setAssetCode()
public
setAssetCode(string $assetCode) : void
Parameters
- $assetCode : string
-
Code of the asset the user wants to withdraw. The value passed must match one of the codes listed in the /info response's withdraw object. 'native' is a special asset_code that represents the native XLM token.
setAssetIssuer()
public
setAssetIssuer(string|null $assetIssuer) : void
Parameters
- $assetIssuer : string|null
-
(optional) The issuer of the stellar asset the user wants to withdraw with the anchor. If asset_issuer is not provided, the anchor should use the asset issued by themselves as described in their TOML file. If 'native' is specified as the asset_code, asset_issuer must be not be set.
setCustomerId()
public
setCustomerId(string|null $customerId) : void
Parameters
- $customerId : string|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.
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", ...])
setDestinationAsset()
public
setDestinationAsset(string|null $destinationAsset) : void
Parameters
- $destinationAsset : string|null
-
(optional) string in Asset Identification Format - The asset user wants to receive. See: https://github.com/stellar/stellar-protocol/blob/v2.5.0/ecosystem/sep-0038.md#asset-identification-format. It's an off-chain or fiat asset. If this is not provided, it will be collected in the interactive flow. When quote_id is specified, this parameter must match the quote's buy_asset asset code or be omitted.
setJwt()
public
setJwt(string $jwt) : void
Parameters
- $jwt : string
-
jwt token previously received from the anchor via the SEP-10 authentication flow
setKycFields()
public
setKycFields(StandardKYCFields|null $kycFields) : void
Parameters
- $kycFields : StandardKYCFields|null
-
Additionally, any SEP-9 parameters may be passed as well to make the onboarding experience simpler.
setLang()
public
setLang(string|null $lang) : void
Parameters
- $lang : string|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.
setMemo()
public
setMemo(string|null $memo) : void
Parameters
- $memo : string|null
-
(deprecated, optional) This field was originally intended to differentiate users of the same Stellar account. However, the anchor should use the sub value included in the decoded SEP-10 JWT instead. Anchors should still support this parameter to maintain support for outdated clients. See the Shared Account Authentication section for more information. https://github.com/stellar/stellar-protocol/blob/v3.8.0/ecosystem/sep-0024.md#shared-omnibus-or-pooled-accounts
setMemoType()
public
setMemoType(string|null $memoType) : void
Parameters
- $memoType : string|null
-
(deprecated, optional) Type of memo. One of text, id or hash. Deprecated because memos used to identify users of the same Stellar account should always be of type of id.
setQuoteId()
public
setQuoteId(string|null $quoteId) : void
Parameters
- $quoteId : string|null
-
The id returned from a SEP-38 POST /quote response.
setRefundMemo()
public
setRefundMemo(string|null $refundMemo) : void
Parameters
- $refundMemo : string|null
-
(optional) The memo the anchor must use when sending refund payments back to the user. If not specified, the anchor should use the same memo used by the user to send the original payment. If specified, refund_memo_type must also be specified.
setRefundMemoType()
public
setRefundMemoType(string|null $refundMemoType) : void
Parameters
- $refundMemoType : string|null
-
(optional) The type of the refund_memo. Can be id, text, or hash. See the memos documentation for more information. If specified, refund_memo must also be specified. https://developers.stellar.org
setWalletName()
public
setWalletName(string|null $walletName) : void
Parameters
- $walletName : string|null
-
(deprecated,optional) In communications / pages about the withdrawal, anchor should display the wallet name to the user to explain where funds are coming from. However, anchors should use client_domain (for non-custodial) and sub value of JWT (for custodial) to determine wallet information.
setWalletUrl()
public
setWalletUrl(string|null $walletUrl) : void
Parameters
- $walletUrl : string|null
-
(deprecated,optional) Anchor can show this to the user when referencing the wallet involved in the withdrawal (ex. in the anchor's transaction history). However, anchors should use client_domain (for non-custodial) and sub value of JWT (for custodial) to determine wallet information.