Stellar PHP SDK API Documentation

SEP31PostTransactionsRequest

Request body for initiating a cross-border payment transaction via SEP-31.

This class represents the data required to submit a POST /transactions request to a Receiving Anchor. The request initiates a payment from a Sending Anchor to a Receiving Client through the Receiving Anchor's direct payment server.

Tags
see
https://github.com/stellar/stellar-protocol/blob/v3.1.0/ecosystem/sep-0031.md#post-transactions
see
CrossBorderPaymentsService::postTransactions()
see
SEP31PostTransactionsResponse

Table of Contents

Properties

$amount  : float
$assetCode  : string
$assetIssuer  : string|null
$destinationAsset  : string|null
$fields  : array<string|int, mixed>|null
$fundingMethod  : string|null
$lang  : string|null
$quoteId  : string|null
$receiverId  : string|null
$refundMemo  : string|null
$refundMemoType  : string|null
$senderId  : string|null

Methods

__construct()  : mixed
toJson()  : array<string|int, mixed>

Properties

$assetCode

public string $assetCode

Code of the asset the Sending Anchor intends to send. This must match one of the entries listed in the receiving anchor's GET /info endpoint.

$assetIssuer

public string|null $assetIssuer = null

(optional) The issuer of the Stellar asset the Sending Anchor intends to send. If not specified, the asset sent must be issued by the Receiving Anchor.

$destinationAsset

public string|null $destinationAsset = null

(optional) The off-chain asset the Receiving Anchor will deliver to the Receiving Client. The value must match one of the asset values included in a SEP-38 GET /prices?sell_asset=stellar:<asset_code>:<asset_issuer> response using SEP-38 Asset Identification Format. If neither this field nor quote_id are set, it's assumed that Sending Anchor Asset Conversions was used.

$fields

since SEP-31 v2.5.0, use SEP-12 PUT /customer instead

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

(deprecated, optional) An object containing the values requested by the Receiving Anchor in the GET /info endpoint.

DEPRECATED: This field is maintained for backward compatibility only and will be removed in a future version. Use SEP-12 PUT /customer to pass SEP-9 standard fields instead.

Migration: Move all KYC/customer data to SEP-12 customer records before using this API.

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

$lang

public string|null $lang = null

(optional) Defaults to en. Language code specified using ISO 639-1. Any human-readable error codes or field descriptions should be returned in this language.

$quoteId

public string|null $quoteId = null

(optional) The id returned from a SEP-38 POST /quote response. If this attribute is specified, the values for the fields defined above must match the values associated with the quote.

SEP-38 Quote Workflow:

  1. Request indicative or firm quote from Receiving Anchor's SEP-38 endpoint
  2. Receive quote_id with buy_amount, sell_amount, price, and expiration
  3. Include quote_id in this transaction request
  4. Transaction amounts must match quote values exactly
  5. For firm quotes: Submit Stellar payment before quote expires to guarantee rate
Tags
see
https://github.com/stellar/stellar-protocol/blob/v3.1.0/ecosystem/sep-0038.md#post-quote

$receiverId

public string|null $receiverId = null

(optional) The ID included in the SEP-12 PUT /customer response for the Receiving Client. Required if the Receiving Anchor requires SEP-12 KYC on the Receiving Client.

$refundMemo

public string|null $refundMemo = null

(optional) The memo the Receiving Anchor must use when sending refund payments back to the Sending Anchor. If not specified, the Receiving Anchor should use the same memo the Sending Anchor used 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.

$senderId

public string|null $senderId = null

(optional) The ID included in the SEP-12 PUT /customer response for the Sending Client. Required if the Receiving Anchor requires SEP-12 KYC on the Sending Client.

Methods

__construct()

public __construct(float $amount, string $assetCode[, string|null $assetIssuer = null ][, string|null $destinationAsset = null ][, string|null $quoteId = null ][, string|null $senderId = null ][, string|null $receiverId = null ][, array<string|int, mixed>|null $fields = null ][, string|null $lang = null ][, string|null $refundMemo = null ][, string|null $refundMemoType = null ][, string|null $fundingMethod = null ]) : mixed
Parameters
$amount : float

Amount of the Stellar asset to send to the Receiving Anchor.

$assetCode : string

Code of the asset the Sending Anchor intends to send. This must match one of the entries listed in the receiving anchor's GET /info endpoint.

$assetIssuer : string|null = null

The issuer of the Stellar asset the Sending Anchor intends to send. If not specified, the asset sent must be issued by the Receiving Anchor.

$destinationAsset : string|null = null

The off-chain asset the Receiving Anchor will deliver to the Receiving Client. The value must match one of the asset values included in a SEP-38 GET /prices?sell_asset=stellar:<asset_code>:<asset_issuer> response using SEP-38 Asset Identification Format. If neither this field nor quote_id are set, it's assumed that Sending Anchor Asset Conversions was used.

$quoteId : string|null = null

The id returned from a SEP-38 POST /quote response. If this attribute is specified, the values for the fields defined above must match the values associated with the quote.

$senderId : string|null = null

The ID included in the SEP-12 PUT /customer response for the Sending Client. Required if the Receiving Anchor requires SEP-12 KYC on the Sending Client.

$receiverId : string|null = null

The ID included in the SEP-12 PUT /customer response for the Receiving Client. Required if the Receiving Anchor requires SEP-12 KYC on the Receiving Client.

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

(deprecated, optional) An object containing the values requested by the Receiving Anchor in the GET /info endpoint. Pass SEP-9 fields via SEP-12 PUT /customer instead.

$lang : string|null = null

defaults to en. Language code specified using ISO 639-1. Any human-readable error codes or field descriptions should be returned in this language.

$refundMemo : string|null = null

The memo the Receiving Anchor must use when sending refund payments back to the Sending Anchor. If not specified, the Receiving Anchor should use the same memo the Sending Anchor used to send the original payment. If specified, refund_memo_type must also be specified.

$refundMemoType : string|null = null

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.

$fundingMethod : string|null = null

A method supported by the Receiving Anchor for transferring or settling assets. Must match one of the values specified in the corresponding /info response.

toJson()

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

json array containing the request data.


        
On this page

Search results