# Accept request for payment

Accepts a request for payment.

Endpoint: POST /request_for_payment/{request_for_payment_id}/accept
Version: 4.0.0
Security: Bearer

## Path parameters:

  - `request_for_payment_id` (string, required)
    Unique identifier of the request for payment to accept.

## Request fields (application/json):

  - `payment_id` (string, required)
    Unique identifier of payment associated with the request for payment.
    Example: "1bf93760-ef69-4697-b2b4-47d9e1c42aa7"

  - `user_info` (object)
    User-provided data with arbitrary key/value pairs.

## Response 200 fields (application/json):

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

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

  - `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"

  - `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"

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

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

  - `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"

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

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

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

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

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

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

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

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

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

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

  - `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"


