postTransactions

Initiates a SEP-31 cross-border payment.

Sends the supplied request to the Receiving Anchor and returns the persistent transaction id plus any on-chain payment instructions the anchor has already determined. The SDK accepts both HTTP 200 and HTTP 201 as success per spec.

This method does not retry on network failure. Retrying without out-of-band reconciliation may create duplicate transactions at the anchor.

If the anchor responds with HTTP 400 and error == "customer_info_needed", the SDK raises Sep31CustomerInfoNeededException with the requested SEP-12 customer type. If error == "transaction_info_needed", the SDK raises Sep31TransactionInfoNeededException with a primitive-leafed fields map. Other 400 responses surface as generic Sep31BadRequestException.

Example:

val request = Sep31PostTransactionsRequest(
amount = 100.0,
assetCode = "USDC",
fundingMethod = "SWIFT",
senderId = "11111111-1111-1111-1111-111111111111",
receiverId = "22222222-2222-2222-2222-222222222222"
)
val response = sep31Service.postTransactions(request, jwtToken)
println("Pay to ${response.stellarAccountId} with memo ${response.stellarMemo}")

Return

The parsed Sep31PostTransactionsResponse.

Parameters

request

The request body.

jwt

SEP-10 authentication token.

Throws

on a generic HTTP 400.

on HTTP 400 with customer_info_needed.

on HTTP 400 with transaction_info_needed.

on a 200/201 with a malformed body, unexpected Content-Type, or a response that exceeds 256 KB.

on any other HTTP status code.