Update a refund

post/refunds/{id}

The POST /refunds/{id} call allows your platform to update and add custom data to a refund. Refunds facilitate the return of money from the merchant to the payer.

SecurityappIdAuth and appTokenAuth
Request
path Parameters
id
required
string [ 1 .. 255 ] characters

ID of the refund, generated by WePay when the refund is created.

header Parameters
Api-Version
required
string
Example: 3.0
Content-Type
required
stringapplication/json
Example: application/json
Unique-Key
string
Request Body schema: application/json
object or null

Any custom data your platform chooses to attach to this resource. The custom data must be key-value pairs and not contain any personally identifiable information (PII) or payment card (PCI) data.

Array of objects or null

Any rbit data your platform chooses to attach to this resource. The rbit data must be key-value pairs and can be an array of rbit objects.

reference_id
string or null [ 1 .. 255 ] characters

A custom reference ID for your platform to track the object. It can be any string.

Responses
200
Response Schema: application/json
required
object or null

The amount of the refund when not performing a full refund.

id
required
string

ID of the refund, generated by WePay when the refund is created.

resource
required
string

Helps organize information by identifying the resource type of the object data.

Value: Description
refunds
path
required
string

Path of resource and resource ID.

create_time
required
integer <int64> >= 0

The time (in UNIX) when the refund was created.

required
object or null

Details the owner resource and owner path.

status
required
string

Status of the refund. Possible values include: pending, completed, failed.

required
object or null

The resource ID and path for the Order that your app created and associated with the payment.

required
object or null

The payment linked to this refund or dispute.

required
object
refund_reason
required
string

The reason for this refund.

required
Array of objects or null or null

Explains why refund is pending and may contain an array of reasons.

required
object or null
required
object or null

If a refund has occurred, fetch this transaction record to account for the portion of the refund debited from the merchant.

required
object or null

If a refund has occurred, fetch this transaction record to account for the portion of the refund debited from your platform account balance.

is_unreferenced_refund
required
boolean

Note: This parameter is currently only available in the closed BETA for Unreferenced Refunds. If you are not working with your integration team at WePay to implement Unreferenced Refunds, please be sure to exclude this parameter from your requests altogether; even sending a value of null will result in an error for apps not participating in the closed BETA.

required
object or null

Any custom data your platform chooses to attach to this resource. The custom data must be key-value pairs and not contain any personally identifiable information (PII) or payment card (PCI) data.

api_version
string
reference_id
string or null [ 1 .. 255 ] characters

A custom reference ID for your platform to track the object. It can be any string.

400

INVALID_PARAMS

403

NOT_AUTHORIZED

500

UNEXPECTED_ERROR

Request samples
application/json
{
  • "custom_data": {
    • "order_id": 34211134828443
    },
  • "reference_id": "reference_id_0"
}
Response samples
application/json
{
  • "amounts": {
    • "total_amount": 100,
    • "currency": "USD",
    • "fee_refund_amount": 0
    },
  • "create_time": 1509140695,
  • "custom_data": {
    • "order_id": 34211134828443
    },
  • "failure_reason": null,
  • "id": "021f2604-ef1e-4254-959b-54babd066830",
  • "order": null,
  • "owner": {
    • "id": "40200612-e849-4172-8308-657cf3a0de27",
    • "path": "/accounts/40200612-e849-4172-8308-657cf3a0de27",
    • "resource": "accounts"
    },
  • "path": "/refunds/021f2604-ef1e-4254-959b-54babd066830",
  • "payment": {
    • "id": "18e72698-eb94-4418-bfff-e4280d55953b",
    • "path": "/payments/18e72698-eb94-4418-bfff-e4280d55953b",
    • "resource": "payments"
    },
  • "payment_method": {
    • "id": "00000000-6363-0000-0000-0000c27db2f3",
    • "path": "/payment_methods/00000000-6363-0000-0000-0000c27db2f3",
    • "resource": "payment_methods"
    },
  • "pending_reasons": null,
  • "refund_reason": "example refund reason",
  • "resource": "refunds",
  • "status": "completed",
  • "txnr_app_fee_refund": null,
  • "txnr_merchant_refund": {
    • "id": "3afd82e3-714d-4c5d-a43b-6446ed6689cd",
    • "path": "/transaction_records/3afd82e3-714d-4c5d-a43b-6446ed6689cd",
    • "resource": "transaction_records"
    },
  • "is_unreferenced_refund": false,
  • "api_version": "3.2",
  • "reference_id": "reference_id_0"
}