Sep31PostTransactionsRequest

data class Sep31PostTransactionsRequest(val amount: Double, val assetCode: String, val fundingMethod: String, val assetIssuer: String? = null, val destinationAsset: String? = null, val quoteId: String? = null, val senderId: String? = null, val receiverId: String? = null, val fields: Map<String, Any?>? = null, val lang: String? = null, val refundMemo: String? = null, val refundMemoType: String? = null)

Request body for the SEP-31 POST /transactions endpoint.

Initiates a cross-border payment by describing the amount, asset, funding method, optional SEP-38 quote, optional SEP-12 customer ids, and optional refund memo. The Receiving Anchor responds with a Sep31PostTransactionsResponse containing the on-chain payment instructions.

Field naming follows the spec: every JSON key is snake_case, every Kotlin property is camelCase. The toJson helper omits null entries and preserves insertion order so test fixtures and on-the-wire bodies remain byte-stable.

Usage

val request = Sep31PostTransactionsRequest(
amount = 100.0,
assetCode = "USDC",
fundingMethod = "SWIFT",
assetIssuer = "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
destinationAsset = "iso4217:BRL",
quoteId = "11111111-1111-1111-1111-111111111111",
senderId = "22222222-2222-2222-2222-222222222222",
receiverId = "33333333-3333-3333-3333-333333333333",
)
val response = sep31Service.postTransactions(request, jwt)

See also

Constructors

Link copied to clipboard
constructor(amount: Double, assetCode: String, fundingMethod: String, assetIssuer: String? = null, destinationAsset: String? = null, quoteId: String? = null, senderId: String? = null, receiverId: String? = null, fields: Map<String, Any?>? = null, lang: String? = null, refundMemo: String? = null, refundMemoType: String? = null)

Properties

Link copied to clipboard

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

Link copied to clipboard

Code of the Stellar asset; must match a key in the /info response.

Link copied to clipboard

Issuer of the Stellar asset; omit when the Receiving Anchor itself issues the asset.

Link copied to clipboard

SEP-38 asset identification string for the off-chain delivery asset. Omit when not using SEP-38.

Link copied to clipboard
val fields: Map<String, Any?>?

Deprecated per-transaction field map; migrate to SEP-12 PUT /customer instead.

Link copied to clipboard

Funding method the Receiving Anchor will use to deliver the asset (for example SWIFT, SEPA). Must match a value advertised in /info. The anchor uses this to determine which KYC fields to collect.

Link copied to clipboard
val lang: String?

ISO 639-1 language code for human-readable error and field descriptions.

Link copied to clipboard

SEP-38 firm quote id returned by POST /quote. Required when destinationAsset is set with an off-chain delivery rate.

Link copied to clipboard

SEP-12 customer id of the Receiving Client. Required when the Receiving Anchor requires SEP-12 KYC on receivers.

Link copied to clipboard

Memo the Receiving Anchor must attach when issuing refunds. If specified, refundMemoType must also be specified.

Link copied to clipboard

Type of refundMemo (id, text, or hash). If specified, refundMemo must also be specified.

Link copied to clipboard

SEP-12 customer id of the Sending Client. Required when the Receiving Anchor requires SEP-12 KYC on senders.

Functions

Link copied to clipboard
fun toJson(): Map<String, Any?>

Returns a snake_case Map<String, Any?> ready for JSON encoding.