Payments
Refunds

Refund a Payment

Issue a refund for a payment. You may refund the full payment amount or just a portion. When refunding a portion, multiple refunds are supported up until the full payment amount has been refunded.

Note: If the sub account status is not enabled, 400 will be returned.

post/payments/{id}/refunds

Request

Path parameters

idstring uuid required

Headers

Idempotency-Keystring uuid required

a string to identify your request (we recommend using a generated uuid, but you may use any unique string) see Idempotent Requests

Authorizationstring required

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Request body

amountnumber

amount to refund; must be less than or equal to the amount_refundable on the payment

descriptionstring

an optional note about this refund

reason'duplicate' | 'fraudulent' | 'customer_request'

the reason this refund is being issued

metadataobject

any useful information you'd like to store alongside this refund

Example request

{
  "amount": 10000,
  "reason": "duplicate",
  "fees": [
    {
      "type": "processing_fee",
      "amount": 175
    }
  ],
  "metadata": {}
}

Response

Refund was created successfully

idstring uuid

the object id, also found in the data object

typestring

the object type, or array of objects

page_infounknown

Example response

{
  "id": "prefix_xyz (same as id of data object)",
  "type": "refund",
  "data": {
    "id": "re_xyz",
    "payment_id": "py_xyz",
    "amount": 100,
    "description": "customer canceled their order",
    "reason": "duplicate",
    "status": "succeeded",
    "metadata": {},
    "returned_fees": [
      {
        "id": "rtfee_xyz",
        "payment_fee_id": "pyfee_abc",
        "type": "processing_fee",
        "returned_amount": 175,
        "original_amount": 350,
        "currency": "usd",
        "remaining_amount": 175
      }
    ],
    "created_at": "2021-01-01T12:00:00Z",
    "updated_at": "2021-01-01T12:00:00Z"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.