# Get requests for payment

Gets requests for payment that match the query parameters.

Endpoint: GET /request_for_payment
Version: 4.0.0
Security: Bearer

## Query parameters:

  - `end_to_end_id` (string)
    Optional parameter to filter results matching this endToEndId value.

  - `state` (string)
    State by which to filter results.
    Enum: "REQUESTED", "ACCEPTED", "FAILED"

  - `sender_address` (string)
    Field to filter results matching this senderAddress value.

  - `receiver_address` (string)
    Field to filter results matching this receiverAddress value.

  - `payment_id` (string)
    Field to filter results matching this paymentId value.

  - `before` (string)
    Filters for requests for payment whose range_field column value is before this specified time stamp (not inclusive). You can also specify after to create a time range between after and before. If before is specified, range_field must also be specified

  - `after` (string)
    Filters for requests for payment whose range_field column value is after this specified time stamp (not inclusive). You can also specify before to create a time range between after and before. If after is specified, range_field must also be specified.

  - `range_field` (string)
    Designates the column name of the requests for payment database table that is used for filtering payments before/after/between time stamps. For example, if you specify range_field=MODIFIED_AT, you would specify a time stamp (in the 24 character ISO 8601 YYYY-MM-DDTHH:mm:ss.sssZ format used in request for payment objects) as the value for before and/or after to fetch request for payment before, after, or between the specified time range(s) (not inclusive). If range_field is specified, before and/or after must also be specified.
    Enum: "CREATED_AT", "MODIFIED_AT"

  - `sort_field` (string)
    Field to use to sort results.
    Enum: "CREATED_AT", "MODIFIED_AT"

  - `sort_direction` (string)
    Sorts result according to the specified direction.
    Enum: "ASC", "DESC"

  - `page` (integer)
    Zero-based index of the page number of results.

  - `size` (integer)
    The number of payments per page.

## Response 200 fields (application/json):

  - `first` (boolean)
    true if  this is the first page.

  - `last` (boolean)
    true if  this is the last page.

  - `number` (integer)
    page number

  - `numberOfElements` (integer)
    Number Of elements in this request

  - `size` (integer)
    page size

  - `totalElements` (integer)
    Total number of elements for the given request

  - `totalPages` (integer)
    Total number of pages for the given request

  - `sort` (array)
    Sort details of this page

  - `sort.direction` (string)
    Direction of the sort
    Example: "ASC"

  - `sort.property` (string)

  - `sort.ignoreCase` (boolean)

  - `sort.nullHandling` (string)
    Example: "NULLS_FIRST"

  - `sort.ascending` (boolean)
    Example: true

  - `sort.descending` (boolean)

  - `content` (array)

  - `content.request_for_payment_id` (string, required)
    Unique identifier of a request for payment.
    Example: "1bf93760-ef69-4697-b2b4-47d9e1c42aa7"

  - `content.request_for_payment_state` (string, required)
    State of the request for payment.
    Enum: "REQUESTED", "ACCEPTED", "FAILED"

  - `content.sender_address` (string, required)
    RippleNet address of the node that is receiving the request for payment, or the eventual sender of the payment.
    Example: "trans_usd_sf@rn.us.ca.san_francisco"

  - `content.receiver_address` (string, required)
    RippleNet address of the node that is sending the request for payment, or the eventual receiver of the payment.
    Example: "trans_gbp_lon@rn.eur.uk.london"

  - `content.amount` (number, required)
    Amount requested to be paid.
    Example: 100.01

  - `content.currency` (string, required)
    Currency code for the amount value.
    Example: "USD"

  - `content.quote_type` (string, required)
    Indicates how the amount field should be treated for calculating quote values.
    Enum: "SENDER_AMOUNT", "RECEIVER_AMOUNT", "SENDER_INSTITUTION_AMOUNT", "RECEIVER_INSTITUTION_AMOUNT"

  - `content.end_to_end_id` (string)
    ID that the eventual payment receiver can specify. Persisted on all rippleNet Node instances (namely, the sender and receiver of the payment) that participate in the request for payment.

  - `content.user_info` (array, required)
    User-provided data with arbitrary key/value pairs.

  - `content.user_info.node_address` (string, required)
    RippleNet address of the node that provided the user information.

  - `content.user_info.requested` (array)
    User information optionally provided when sending the request for payment.

  - `content.user_info.requested.json` (object, required)
    User information provided across the payment lifecycle stored as arbitrary JSON key/value pairs.

  - `content.user_info.requested.created_at` (string, required)
    Date and time at which the user information was added to the payment, as an ISO-8601 timestamp in UTC.

  - `content.user_info.requested.subState` (string)
    If provided, this parameter descibes payment state more granularly.
    Example: "EXECUTING"

  - `content.user_info.accepted` (array)
    User information optionally provided when accepting the request for payment.

  - `content.user_info.failed` (array)
    User information optionally provided when failing the request payment.

  - `content.created_at` (string, required)
    Date and time at which the request for payment was created, as an ISO-8601 timestamp in UTC.

  - `content.payment_id` (string)
    Unique identifier of a payment associated to request for payment.
    Example: "5492648d-2132-4e70-9ded-2fc86f22b321"

## Response 400 fields (application/json):

  - `type` (string)
    URL to the error documentation.
    Example: "https://errors.ripplenet.ripple.com/error/json-processing-error"

  - `title` (string)
    Summary of the returned problem.
    Example: "Invalid Request Object"

  - `detail` (string)
    Description of the returned problem.
    Example: "The request parameter [account_id] is not in the correct format."

  - `status` (number)
    HTTP error code.
    Example: 400

  - `ripplenet_error_code` (string)
    RippleNet specific error code.
    Example: "E0104"

  - `finality` (string)
    Specifies if the request can be retried for a successful response.
    Example: "PERMANENT"


