Prepare a Payment

Prepare a payment. Provide the source, destination, currency, and value (amount) as query parameters. XRP-API will perform some pre-flight checks, and auto-fill the Fee, Sequence, and LastLedgerSequence fields.

Warning: XRP-API is early alpha software. API methods and data formats are likely to change often in ways that break backwards compatibility.

Request Format

GET /preparations/payments

This API method uses the following query parameters:

Field Value Required? Description
source String (Address) Optional The address of the account sending the payment.
destination String (Address) Optional The address of the account that will receive the payment.
currency String (Currency) Optional The currency to send.
value String Optional The value of the amount to send.
maxLedgerVersionOffset String Optional Offset from the current validated ledger version to the highest ledger version that the transaction can be included in. This effectively serves as the transaction's expiration time, after which it is invalid. Transactions are typically validated within 2-3 ledgers, but transactions that are signed manually and/or offline may need longer validity times. A ledger is created every 3-4 seconds. For example, a value of 500 would prepare a transaction that will be valid for approximately 25-30 minutes.

Response Formats

200 OK

A Prepared Payment Transaction, with min_ledger and max_ledger fields.

Media type: application/json

Formatted as a PreparedPaymentTransaction

400 Bad Request

The request was not properly formatted.

Media type: application/json

Formatted as a RippleAPIError

The response uses the following fields:

Field Type Required? Description
errors Array of ErrorItem May be omitted A list of errors that occurred when processing this request.
message String May be omitted A human-readable error message summarizing the problem(s) that occurred.