path_find - XRPL

Example code for the path_find JSON RPC method. Complete guide to using path_find JSON-RPC in the GetBlock Web3 documentation.

This method searches for a path along which a payment can be made, and periodically sends updates when the path changes.

Parameters

Parameter
Type
Required
Description

subcommand

string

Yes

"create", "close", or "status"

source_account

string

Yes

Sending account

destination_account

string

Yes

Receiving account

destination_amount

object

Yes

Amount to receive

send_max

object

No

Maximum to send

source_currencies

array

No

Currencies to use

Request Example

curl --location --request POST 'https://xrp.getblock.io/mainnet/' \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "path_find",
    "params": [{
        "subcommand": "create",
        "source_account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
        "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
        "destination_amount": {
            "currency": "USD",
            "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
            "value": "100"
        }
    }],
    "id": "getblock.io"
}'

Response Example

Returns

Field
Type
Description

alternatives

array

Payment paths found

destination_account

string

Destination

destination_amount

object

Amount

Use Cases

  • Cross-currency payments

  • Find best exchange rates

  • Payment routing

SDK Integration

Last updated

Was this helpful?