Submit Payment

Sign a payment transaction and submit it to the XRP Ledger network. The sending account must match an account address and secret the XRP-API server is configured with.

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

POST /payments

{
    "submit": true,
    "payment": {
        "destination_tag": 456,
        "destination_address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
        "source_address": "rBEXjfD3MuXKATePRwrk4AqgqzuD9JjQqv",
        "destination_amount": {
            "value": "5000000",
            "currency": "drops"
        },
        "source_amount": {
            "value": "5000000",
            "currency": "drops"
        },
        "source_tag": 123
    }
}

A transaction object and instructions.

Media type: application/json

Formatted as a Payment object and instructions

The request uses the following fields:

Field Type Required? Description
instructions Object (Transaction Instructions) May be omitted Indicates how to execute a transaction. Complements the transaction specification.
submit Boolean May be omitted If false, the server will not submit the transaction to the network. Instead, it will only return the following additional fields in the response: tx_json, tx_blob, and id (hash).
payment Object (Payment Object) May be omitted A payment object (specification).

Response Formats

400 Bad Request

This error case indicates that 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 successful response provides the native XRP Ledger format for the transaction, the transaction's identifying hash, and the preliminary result of processing the transaction.

Media type: application/json

Formatted as a TransactionStatus

The response uses the following fields:

Field Type Required? Description
engine_result String May be omitted Code indicating the preliminary result of the transaction, for example tesSUCCESS. Not final until included in a fully validated TransactionResult.
validated_ledger_index Integer May be omitted The ledger index of the latest validated ledger prior to submission. The earliest ledger index that the submitted transaction could appear in, as a result of this submission, is this value +1. Use this to bound your tx queries to find out the final status of this transaction. This is a validated ledger index because getting the latest current or closed ledger is not a guarantee—your transaction could make it into an earlier ledger index that also hasn't been validated yet.
engine_result_message String May be omitted Human-readable explanation of the transaction's preliminary result.
tx_blob String May be omitted The complete transaction in hex string format.
tx_json Object (Transaction JSON) May be omitted The complete transaction in rippled JSON format. If the transaction was submitted, get the transaction hash from here.
engine_result_code Integer May be omitted Numeric code indicating the preliminary result of the transaction, directly correlated to engine_result.