2024-01-15 13:35:14 -08:00
{
"$schema" : "../rpc-schema-draft.json" ,
"type" : "object" ,
"rpc" : "listpays" ,
"title" : "Command for querying payment status" ,
"description" : [
2024-11-11 10:48:03 +10:30
"The **listpays** RPC command gets the status of all *pay* commands (by combining results from listsendpays which lists every payment part), or a single one if either *bolt11* or *payment_hash* was specified."
2024-01-15 13:35:14 -08:00
] ,
2024-07-22 19:21:49 -07:00
"categories" : [
"readonly"
] ,
2024-01-15 13:35:14 -08:00
"request" : {
"required" : [ ] ,
2024-10-30 09:38:42 +10:30
"additionalProperties" : false ,
2024-01-15 13:35:14 -08:00
"properties" : {
"bolt11" : {
"type" : "string" ,
"description" : [
"Bolt11 string to get the payment details."
]
} ,
"payment_hash" : {
"type" : "hash" ,
"description" : [
"Payment hash to get the payment details."
]
} ,
"status" : {
"type" : "string" ,
"description" : [
"To filter the payment by status."
] ,
"enum" : [
"pending" ,
"complete" ,
"failed"
]
2024-06-10 19:19:58 +02:00
} ,
"index" : {
"type" : "string" ,
"added" : "v24.11" ,
"enum" : [
"created" ,
"updated"
] ,
"description" : [
2024-11-11 10:48:03 +10:30
"If neither *in_channel* nor *out_channel* is specified, it controls ordering, by `created` or `updated`."
]
2024-06-10 19:19:58 +02:00
} ,
"start" : {
"type" : "u64" ,
"added" : "v24.11" ,
"description" : [
2024-11-11 10:48:03 +10:30
"If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)." ,
"NOTE: if this is used, `amount_sent_msat` and `number_of_parts` fields may be lower than expected, as not all payment parts will be considered"
2024-06-10 19:19:58 +02:00
]
} ,
"limit" : {
"type" : "u32" ,
"added" : "v24.11" ,
"description" : [
2024-11-11 10:48:03 +10:30
"If `index` is specified, `limit` can be used to specify the maximum number of entries to return." ,
"NOTE: if this is used, `amount_sent_msat` and `number_of_parts` fields may be lower than expected, as not all payment parts will be considered" ,
"NOTE: the actual number returned may be less than the limit, as individual payment parts are combined together"
2024-06-10 19:19:58 +02:00
]
2024-01-15 13:35:14 -08:00
}
}
} ,
"response" : {
"required" : [
"pays"
] ,
2024-10-30 09:38:42 +10:30
"additionalProperties" : false ,
2024-01-15 13:35:14 -08:00
"properties" : {
"pays" : {
"type" : "array" ,
"items" : {
"type" : "object" ,
"additionalProperties" : true ,
"required" : [
"payment_hash" ,
"status" ,
2024-06-10 19:19:58 +02:00
"created_at" ,
"created_index"
2024-01-15 13:35:14 -08:00
] ,
"properties" : {
"payment_hash" : {
"type" : "hash" ,
"description" : [
"The hash of the *payment_preimage* which will prove payment."
]
} ,
"status" : {
"type" : "string" ,
"enum" : [
"pending" ,
"failed" ,
"complete"
] ,
"description" : [
"Status of the payment."
]
} ,
"destination" : {
"type" : "pubkey" ,
"description" : [
"The final destination of the payment if known."
]
} ,
"created_at" : {
"type" : "u64" ,
"description" : [
"The UNIX timestamp showing when this payment was initiated."
]
} ,
"completed_at" : {
"type" : "u64" ,
"description" : [
"The UNIX timestamp showing when this payment was completed."
]
} ,
"label" : {
"type" : "string" ,
"description" : [
"The label, if given to sendpay."
]
} ,
"bolt11" : {
"type" : "string" ,
"description" : [
"The bolt11 string (if pay supplied one)."
]
} ,
"description" : {
"type" : "string" ,
"description" : [
"The description matching the bolt11 description hash (if pay supplied one)."
]
} ,
"bolt12" : {
"type" : "string" ,
"description" : [
2024-11-18 15:10:55 +10:30
"The bolt12 string (if supplied for pay)."
2024-01-15 13:35:14 -08:00
]
2024-06-10 19:19:58 +02:00
} ,
"created_index" : {
"type" : "u64" ,
"added" : "v24.11" ,
"description" : [
"1-based index indicating order this payment was created in."
]
} ,
"updated_index" : {
"type" : "u64" ,
"added" : "v24.11" ,
"description" : [
"1-based index indicating order this payment was changed (only present if it has changed since creation)."
]
2024-01-15 13:35:14 -08:00
}
} ,
"allOf" : [
{
"if" : {
2024-10-30 09:38:42 +10:30
"additionalProperties" : true ,
2024-01-15 13:35:14 -08:00
"properties" : {
"status" : {
"type" : "string" ,
"enum" : [
"complete"
]
}
}
} ,
"then" : {
"additionalProperties" : false ,
"required" : [
"amount_sent_msat" ,
"preimage"
] ,
"properties" : {
2024-06-10 19:19:58 +02:00
"created_index" : { } ,
"updated_index" : { } ,
2024-01-15 13:35:14 -08:00
"payment_hash" : { } ,
"status" : { } ,
"destination" : { } ,
"created_at" : { } ,
"completed_at" : { } ,
"label" : { } ,
"bolt11" : { } ,
"description" : { } ,
"bolt12" : { } ,
"amount_msat" : {
"type" : "msat" ,
"description" : [
2025-06-30 11:15:55 +09:30
"The amount of millisatoshi we intended to send to the destination. This can only be missing in the case of someone manually calling sendonion without the `amount_msat` parameter (which no plugin currently does)."
2024-01-15 13:35:14 -08:00
]
} ,
"amount_sent_msat" : {
"type" : "msat" ,
"description" : [
"The amount of millisatoshi we sent in order to pay (may include fees and not match amount_msat)."
]
} ,
"preimage" : {
"type" : "secret" ,
"description" : [
"Proof of payment."
]
} ,
"number_of_parts" : {
"type" : "u64" ,
"description" : [
"The number of parts for a successful payment (only if more than one)."
]
}
}
}
} ,
{
"if" : {
2024-10-30 09:38:42 +10:30
"additionalProperties" : true ,
2024-01-15 13:35:14 -08:00
"properties" : {
"status" : {
"type" : "string" ,
"enum" : [
"failed"
]
}
}
} ,
"then" : {
"additionalProperties" : false ,
"required" : [
"amount_sent_msat"
] ,
"properties" : {
2024-06-10 19:19:58 +02:00
"created_index" : { } ,
"updated_index" : { } ,
2024-01-15 13:35:14 -08:00
"payment_hash" : { } ,
"status" : { } ,
"destination" : { } ,
"created_at" : { } ,
"label" : { } ,
"bolt11" : { } ,
"description" : { } ,
"bolt12" : { } ,
"amount_sent_msat" : { } ,
"erroronion" : {
"type" : "hex" ,
"description" : [
"The error onion returned on failure, if any."
]
}
}
}
}
]
}
}
} ,
"post_return_value_notes" : [
"The returned array is ordered by increasing **created_at** fields."
]
} ,
2024-06-20 14:57:02 -07:00
"author" : [
2025-12-17 11:30:56 -08:00
"Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
2024-06-20 14:57:02 -07:00
] ,
"see_also" : [
"lightning-pay(7)" ,
"lightning-paystatus(7)" ,
"lightning-listsendpays(7)"
] ,
"resources" : [
2025-12-17 11:30:56 -08:00
"Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
2024-06-20 14:57:02 -07:00
] ,
"examples" : [
2024-01-15 13:35:14 -08:00
{
2024-03-27 18:45:18 -07:00
"request" : {
"id" : "example:listpays#1" ,
"method" : "listpays" ,
"params" : {
2024-08-09 22:44:53 -07:00
"bolt11" : "lnbcrt100n1pnt2bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000"
2024-01-15 13:35:14 -08:00
}
2024-03-27 18:45:18 -07:00
} ,
"response" : {
2024-07-18 00:28:22 -07:00
"pays" : [ ]
2024-03-27 18:45:18 -07:00
}
2024-01-15 13:35:14 -08:00
} ,
{
2024-03-27 18:45:18 -07:00
"request" : {
"id" : "example:listpays#2" ,
"method" : "listpays" ,
2024-07-18 00:28:22 -07:00
"params" : { }
2024-03-27 18:45:18 -07:00
} ,
"response" : {
2024-08-09 22:44:53 -07:00
"pays" : [ ]
2024-03-27 18:45:18 -07:00
}
2024-01-15 13:35:14 -08:00
}
]
}