Stellar PHP SDK API Documentation

SEP31TransactionResponse

Details of a cross-border payment transaction retrieved via SEP-31.

This class represents the full transaction state including status, amounts, fees, refunds, and payment details. It is returned when querying a specific transaction via GET /transactions/:id.

Amount Formulas (when amount_in_asset equals amount_out_asset):

  • amount_out = amount_in - amount_fee - refunds.amount_refunded - refunds.amount_fee
  • When using quote_id: amount_in = quote.sell_amount and amount_out = quote.buy_amount
  • Price calculation uses quote.price (not quote.total_price)
Tags
see
https://github.com/stellar/stellar-protocol/blob/v3.1.0/ecosystem/sep-0031.md#transaction
see
CrossBorderPaymentsService::getTransaction()
see
SEP31FeeDetails
see
SEP31Refunds

Table of Contents

Properties

$amountFee  : string|null
$amountFeeAsset  : string|null
$amountIn  : string|null
$amountInAsset  : string|null
$amountOut  : string|null
$amountOutAsset  : string|null
$completedAt  : string|null
$externalTransactionId  : string|null
$feeDetails  : SEP31FeeDetails|null
$id  : string
$quoteId  : string|null
$refunded  : bool|null
$refunds  : SEP31Refunds|null
$requiredInfoMessage  : string|null
$requiredInfoUpdates  : array<string|int, mixed>|null
$startedAt  : string|null
$status  : string
$statusEta  : int|null
$statusMessage  : string|null
$stellarAccountId  : string|null
$stellarMemo  : string|null
$stellarMemoType  : string|null
$stellarTransactionId  : string|null
$updatedAt  : string|null

Methods

__construct()  : mixed
fromJson()  : SEP31TransactionResponse
Constructs a new instance of SEP31TransactionResponse by using the given data.

Properties

$amountFee

public string|null $amountFee = null

(deprecated, optional) The amount of fee charged by the Receiving Anchor. Should be equals quote.fee.total if a quote_id was used.

$amountFeeAsset

public string|null $amountFeeAsset = null

(deprecated, optional) The asset in which fees are calculated in. Must be present if quote_id or destination_asset was included in the POST /transactions request. The value must be in SEP-38 Asset Identification Format. Should be equals quote.fee.asset if a quote_id was used.

$amountIn

public string|null $amountIn = null

(optional) The amount of the Stellar asset received or to be received by the Receiving Anchor. Excludes any fees charged after Receiving Anchor receives the funds. If a quote_id was used, the amount_in should be equals to both: (i) the amount value used in the POST /transactions request; and (ii) the quote's sell_amount.

$amountInAsset

public string|null $amountInAsset = null

(optional) The asset received or to be received by the Receiving Anchor. Must be present if quote_id or destination_asset was included in the POST /transactions request. The value must be in SEP-38 Asset Identification Format.

$amountOut

public string|null $amountOut = null

(optional) The amount sent or to be sent by the Receiving Anchor to the Receiving Client. When using a destination_asset in the POST /transactions request, it's expected that this value is only populated after the Receiving Anchor receives the incoming payment. Should be equal to quote.buy_amount if a quote_id was used.

$amountOutAsset

public string|null $amountOutAsset = null

(optional) The asset delivered to the Receiving Client. Must be present if quote_id or destination_asset was included in the POST /transactions request. The value must be in SEP-38 Asset Identification Format.

$completedAt

public string|null $completedAt = null

(optional) Completion date and time of transaction.

$externalTransactionId

public string|null $externalTransactionId = null

(optional) The ID of transaction on external network that completes the payment into the receivers account.

$id

public string $id

The ID returned from the POST /transactions request that created this transaction record.

$quoteId

public string|null $quoteId = null

(optional) The ID of the quote used to create this transaction. Should be present if a quote_id was included in the POST /transactions request. Clients should be aware though that the quote_id may not be present in older implementations.

$refunded

public bool|null $refunded = null

(deprecated, optional) This field is deprecated in favor of the refunds object. True if the transaction was refunded in full. False if the transaction was partially refunded or not refunded. For more details about any refunds, see the refunds object.

$requiredInfoMessage

public string|null $requiredInfoMessage = null

(optional) A human-readable message indicating any errors that require updated information from the sender.

$requiredInfoUpdates

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

(optional) A set of fields that require update values from the Sending Anchor, in the same format as described in GET /info. This field is only relevant when status is pending_transaction_info_update.

$startedAt

public string|null $startedAt = null

(optional) Start date and time of transaction. UTC ISO 8601 string

$status

public string $status

The status of the transaction.

Possible status values:

  • pending_sender: Awaiting payment from Sending Anchor
  • pending_stellar: Transaction submitted to Stellar network but not confirmed
  • pending_customer_info_update: KYC information needs updating (see SEP-12)
  • pending_transaction_info_update: Transaction fields need updating (deprecated, use SEP-12)
  • pending_receiver: Payment being processed by Receiving Anchor
  • pending_external: Payment submitted to external network but not confirmed
  • completed: Funds successfully delivered to Receiving Client
  • refunded: Funds refunded to Sending Anchor (see refunds object for details)
  • expired: Transaction abandoned or quote expired
  • error: Catch-all for unspecified errors (check status_message for details)
Tags
see
https://github.com/stellar/stellar-protocol/blob/v3.1.0/ecosystem/sep-0031.md#transaction-object
see
SEP31Refunds

$statusEta

public int|null $statusEta = null

(optional) The estimated number of seconds until a status change is expected.

$statusMessage

public string|null $statusMessage = null

(optional) A human-readable message describing the status of the transaction.

$stellarAccountId

public string|null $stellarAccountId = null

(optional) The Receiving Anchor's Stellar account that the Sending Anchor will be making the payment to.

$stellarMemo

public string|null $stellarMemo = null

(optional) The memo to attach to the Stellar payment.

$stellarMemoType

public string|null $stellarMemoType = null

(optional) The type of memo to attach to the Stellar payment: text, hash, or id.

$stellarTransactionId

public string|null $stellarTransactionId = null

(optional) The transaction_id on Stellar network of the transfer that initiated the payment.

$updatedAt

public string|null $updatedAt = null

(optional) The date and time of transaction reaching the current status. UTC ISO 8601 string

Methods

__construct()

public __construct(string $id, string $status[, int|null $statusEta = null ][, string|null $statusMessage = null ][, string|null $amountIn = null ][, string|null $amountInAsset = null ][, string|null $amountOut = null ][, string|null $amountOutAsset = null ][, string|null $amountFee = null ][, string|null $amountFeeAsset = null ][, SEP31FeeDetails|null $feeDetails = null ][, string|null $quoteId = null ][, string|null $stellarAccountId = null ][, string|null $stellarMemoType = null ][, string|null $stellarMemo = null ][, string|null $startedAt = null ][, string|null $updatedAt = null ][, string|null $completedAt = null ][, string|null $stellarTransactionId = null ][, string|null $externalTransactionId = null ][, bool|null $refunded = null ][, SEP31Refunds|null $refunds = null ][, string|null $requiredInfoMessage = null ][, array<string|int, mixed>|null $requiredInfoUpdates = null ]) : mixed
Parameters
$id : string

The ID returned from the POST /transactions request that created this transaction record.

$status : string

The status of the transaction.

$statusEta : int|null = null

(optional) The estimated number of seconds until a status change is expected.

$statusMessage : string|null = null

(optional) A human-readable message describing the status of the transaction.

$amountIn : string|null = null

(optional) The amount of the Stellar asset received or to be received by the Receiving Anchor. Excludes any fees charged after Receiving Anchor receives the funds. If a quote_id was used, the amount_in should be equals to both: (i) the amount value used in the POST /transactions request; and (ii) the quote's sell_amount.

$amountInAsset : string|null = null

(optional) The asset received or to be received by the Receiving Anchor. Must be present if quote_id or destination_asset was included in the POST /transactions request. The value must be in SEP-38 Asset Identification Format.

$amountOut : string|null = null

(optional) The amount sent or to be sent by the Receiving Anchor to the Receiving Client. When using a destination_asset in the POST /transactions request, it's expected that this value is only populated after the Receiving Anchor receives the incoming payment. Should be equals to quote.buy_amount if a quote_id was used.

$amountOutAsset : string|null = null

(optional) The asset delivered to the Receiving Client. Must be present if quote_id or destination_asset was included in the POST /transactions request. The value must be in SEP-38 Asset Identification Format.

$amountFee : string|null = null

(deprecated, optional) The amount of fee charged by the Receiving Anchor. Should be equals quote.fee.total if a quote_id was used.

$amountFeeAsset : string|null = null

(deprecated, optional) The asset in which fees are calculated in. Must be present if quote_id or destination_asset was included in the POST /transactions request. The value must be in SEP-38 Asset Identification Format. Should be equals quote.fee.asset if a quote_id was used.

$feeDetails : SEP31FeeDetails|null = null

Description of fee charged by the anchor. The schema for this object is defined in the Fee Details Object Schema section below. If quote_id is present, it should match the referenced quote's fee object.

$quoteId : string|null = null

(optional) The ID of the quote used to create this transaction. Should be present if a quote_id was included in the POST /transactions request. Clients should be aware though that the quote_id may not be present in older implementations.

$stellarAccountId : string|null = null

(optional) The Receiving Anchor's Stellar account that the Sending Anchor will be making the payment to.

$stellarMemoType : string|null = null

(optional) The type of memo to attach to the Stellar payment: text, hash, or id.

$stellarMemo : string|null = null

(optional) The memo to attach to the Stellar payment.

$startedAt : string|null = null

(optional) Start date and time of transaction. UTC ISO 8601 string

$updatedAt : string|null = null

(optional) The date and time of transaction reaching the current status. UTC ISO 8601 string

$completedAt : string|null = null

(optional) Completion date and time of transaction. UTC ISO 8601 string

$stellarTransactionId : string|null = null

(optional) The transaction_id on Stellar network of the transfer that initiated the payment.

$externalTransactionId : string|null = null

(optional) The ID of transaction on external network that completes the payment into the receivers account.

$refunded : bool|null = null

(deprecated, optional) This field is deprecated in favor of the refunds object. True if the transaction was refunded in full. False if the transaction was partially refunded or not refunded. For more details about any refunds, see refunds.

$refunds : SEP31Refunds|null = null

(optional) An object describing any on-chain refund associated with this transaction.

$requiredInfoMessage : string|null = null

(optional) A human-readable message indicating any errors that require updated information from the sender.

$requiredInfoUpdates : array<string|int, mixed>|null = null

(optional) A set of fields that require update values from the Sending Anchor, in the same format as described in GET /info. This field is only relevant when status is pending_transaction_info_update.

fromJson()

Constructs a new instance of SEP31TransactionResponse by using the given data.

public static fromJson(array<string|int, mixed> $jsonData) : SEP31TransactionResponse
Parameters
$jsonData : array<string|int, mixed>

the data to construct the object from.

Return values
SEP31TransactionResponse

the object containing the parsed data.


        
On this page

Search results