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 frequently 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.

Response Formats

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
message String May be omitted A human-readable error message summarizing the problem(s) that occurred.
errors Array of ErrorItem May be omitted A list of errors that occurred when processing this request.

200 OK

A prepared Payment Transaction in the XRP Ledger's native JSON format.

Media type: application/json

Formatted as a Transaction JSON

The response uses the following fields:

Field Type Required? Description
TransactionType String May be omitted The transaction type.
Fee String May be omitted Transaction fee, in drops.
Amount String May be omitted The amount.
Flags Integer May be omitted Transaction-specific flags (bit field).
LastLedgerSequence Integer May be omitted Highest ledger index this transaction can appear in. This field places a strict upper limit on how long the transaction can wait to be validated or rejected.
Sequence Integer May be omitted The sequence number (nonce).
Account String (Address) May be omitted The address of an XRP Ledger account.
Destination String (Address) May be omitted The address of an XRP Ledger account.
hash String May be omitted The hash value that uniquely identifies this transaction. Included only if the transaction was signed and submitted.