# Consumer_Refund_Request

For a merchant/contractor to refund a consumer, the partner/sponsor must first send a POST to Momnt to
request a payment refund. This request triggers an SMS message to the consumer requesting the refund
confirmation. The content of this SMS provides the consumer with the transaction amount, transaction type,
and a code they must reply with to approve the refund.
There will be a response to this POST request to notify the partner/sponsor that the refund request was
successfully sent or if it failed before sending. Additionally, a callback will be posted to the
partner/sponsor once the transaction is completed (success or failure), this is documented next.
**Requirements:**
- **Authentication information** (username and password) is required for this endpoint. Sponsor ID will be
determined by the authentication information used.
- This API will only be processed successfully if the merchant's status is **'Active'** or
**'Hold – Pause Applications'**.
- Only **Admin users** are authorized to initiate a refund request. If a user with insufficient
permissions attempts to initiate a refund, the request will return an error.

Endpoint: POST /api/v1/sponsor/merchants/refund-payment-request/
Version: 1.0.0 (sponsor_consumer_v1)
Security: basicAuth

## Security:

  - `basicAuth` (unknown)
    http basic

## Request fields (application/json):

  - `request_user_id` (string, required)
    The partner's merchant user UUID for the user making the request.

  - `consumer_application_uuid` (string, required)
    The identifier in the partner system for this loan application.

  - `payment_identifier` (any, required)
    Payment identifier number of consumer transaction

  - `consumer_refund_amount` (string, required)
    Total amount being refunded to the consumer

  - `net_to_merchant_amount` (string, required)
    Net amount out of the consumer refund that should be debited from merchant

  - `net_to_sponsor_amount` (string, required)
    Net amount out of the consumer refund that should be credited from the merchant deposit and debited from the sponsor. (i.e. processing fees, materials, etc.).

  - `net_artis_fee` (string, required)
    Net amount due to Momnt for the transaction - this should equal consumer charge amount * merchant fee % for the loan product. This should be pulled directly from the merchant's rate sheet every time - the refund will fail if the amount is incorrect.

  - `transaction_callback_url` (string, required)
    When consumer refunded is completed (Successful or Failed), Momnt will POST information to this fully qualified URL.

  - `external_org_id` (string)

## Response 201 fields (application/json):

  - `detail` (string, required)

## Callback:

  - `Consumer Refund Callback` (unknown)
    Consumer Refund Callback (POST)
The result of the consumer refund and other relevant details will be sent to the `transaction_callback_url`.
When consumer refund is completed, success or failure, Momnt will POST information to this fully qualified URL.
**Requirements:**
- Before this callback will fire, a successful POST to send a consumer refund request must have taken place.
- Basic Auth is supported by a username/password combination which is pre-shared between Momnt and the sponsor.

## Callback request fields (application/json):

  - `status` (string, required)
    Status of the transaction: Successful or Failed

  - `date_time` (string, required)
    Date time stamp of transaction

  - `first_name` (string, required)
    First Name of Consumer associated with Transaction

  - `last_name` (string, required)
    Last Name of Consumer associated with Transaction

  - `submitted_by` (string, required)
    UUID of merchant user that sent the payment request

  - `application_id` (string, required)
    10-digit Human Readable ID associated with consumer application/account

  - `consumer_refund_amount` (string, required)
    Amount refunded to consumer

  - `remaining_balance` (string, required)
    Amount of the consumer's credit limit that is remaining and available to spend after the transaction

  - `artis_fee` (string, required)
    Momnt Fee for transaction

  - `net_to_sponsor_amount` (string, required)
    Net amount sent to sponsor account for transaction

  - `net_to_merchant_amount` (string, required)
    Net amount sent to merchant account for transaction

  - `transaction_group_type` (string, required)
    Short description of transaction (Charge or Refund)

  - `transaction_description` (string, required)
    Description of the transaction

  - `payment_identifier` (integer, required)
    Momnt's identifier for the consumer refund transaction.

  - `external_application_id` (string, required)
    Partner's ID for the application sent in initial POST

  - `merchant_fee` (string, required)
    Commission percentage rate shown as decimal value. Also known as dealer fee.

  - `merchant_fee_transaction_amount` (string, required)
    Calculated commission based on consumer charge request. Also known as merchant fee.

  - `payment_request_uuid` (string, required)
    Momnt's ID for the charge request sent

## Callback response 200:

  - `200` (unknown)
    No response body

