# How to Create a Refund via API

**URL:** https://community.rapyd.net/t/how-to-create-a-refund-via-api/1818
**Category:** I am a Developer
**Created:** [February 1, 2022, 7:00am UTC](https://community.rapyd.net/t/how-to-create-a-refund-via-api/1818 "2022-02-01T07:00:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Community\_Team](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@Community\_Team](https://community.rapyd.net/u/Community_Team)
#### Post date: [February 1, 2022, 7:00am UTC](https://community.rapyd.net/t/how-to-create-a-refund-via-api/1818/1 "2022-02-01T07:00:00Z")

</div>

You can create a refund when a payment is closed. When a refund is made, the money is returned to the payment method that was used to make the payment.

- **Note** : to refund a payment where the funds are collected from two or more payment methods, see [Create Group Refund](https://docs.rapyd.net/build-with-rapyd/reference-link/create-group-refund).

### Create Refund Request

```auto
{ "payment": "payment_f379e572d074e81822693f96a51e572c" }

```

### Create Refund Response

```auto
{
    "status": {
        "error_code": "",
        "status": "SUCCESS",
        "message": "",
        "response_code": "",
        "operation_id": "0d42df9a-8c02-4873-9997-c05c6966dd3f"
    },
    "data": {
        "id": "refund_9a083a4cd5afef0c39b8a133783edadb",
        "amount": 1,
        "payment": "payment_f379e572d074e81822693f96a51e572c",
        "currency": "SGD",
        "failure_reason": "",
        "metadata": {},
        "reason": "",
        "status": "Completed",
        "receipt_number": 0,
        "created_at": 1631049435,
        "updated_at": 1641114366,
        "merchant_reference_id": "",
        "payment_created_at": 1631044225,
        "payment_method_type": "sg_credit_visa_card",
        "ewallets": [
            {
                "ewallet": "ewallet_db4ad4a76278f94c4a83dd9b28b483ed",
                "amount": 1
            }
        ],
        "proportional_refund": true,
        "merchant_debited_amount": null,
        "merchant_debited_currency": null,
        "fx_rate": null,
        "fixed_side": null
    }
}

```

- If you are running this method in the sandbox and the payment method requires the action of a third party, to complete your refund simulation you must run [Complete Refund](https://docs.rapyd.net/build-with-rapyd/reference-link/complete-refund).

[Learn More](https://docs.rapyd.net/build-with-rapyd/reference/refund-object#create-refund)

- **Note** : You can create a refund using the Client Portal, or Create Refund API call.
