patchTransaction

Deprecated

Use SEP-12 PUT /customer to update KYC fields instead. SEP-31 v2.5.0 deprecated per-transaction fields.

Updates legacy per-transaction fields on a pending transaction.

This endpoint supports the pending_transaction_info_update workflow defined by SEP-31 v2.5.0. New integrations should register customer KYC via SEP-12 PUT /customer and pass sender_id / receiver_id on the original postTransactions request instead.

Unlike postTransactions, a 400 response here always surfaces as Sep31BadRequestException; the customer_info_needed and transaction_info_needed error tags are POST-only per spec.

Returns Sep31TransactionResponse because the SEP-31 spec specifies the PATCH response body must match GET /transactions/:id. Surfacing the parsed response makes it observable without a follow-up getTransaction call.

Example:

@Suppress("DEPRECATION")
val updated = sep31Service.patchTransaction(
id = "11111111-1111-1111-1111-111111111111",
fields = mapOf(
"transaction" to mapOf(
"receiver_account_number" to "0987654321"
)
),
jwt = jwtToken
)
println("Updated status: ${updated.status}")

Return

The updated Sep31TransactionResponse returned by the anchor. See the spec-divergence paragraph above for why this method returns a value rather than Unit.

Parameters

id

Transaction identifier returned by postTransactions.

fields

Per-transaction field map; the SDK wraps this in a {"fields": ...} envelope.

jwt

SEP-10 authentication token.

Throws

if id fails path-segment validation.

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

on any other HTTP status code.