POST
/
v0
/
business
/
{business_id}
/
refund
Refund an Invoice
curl --request POST \
  --url https://api.sandbox.getasset.com/v0/business/{business_id}/refund \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "amount": 1,
  "refund_external_id": "<string>",
  "refunded_at": "2023-11-07T05:31:56Z",
  "memo": "<string>",
  "processor": "<string>",
  "method": "cash",
  "is_return": false,
  "refund_credit": false,
  "invoices_to_refund": [
    {
      "invoice_id": "<string>",
      "invoice_external_id": "<string>",
      "invoice_line_id": "<string>",
      "amount": 1,
      "memo": "<string>"
    }
  ]
}'
{
  "data": {
    "business_id": "biz_Pk2fNFDd8wj7EFeLWJywc7",
    "external_id": "<string>",
    "amount": 123,
    "amount_paid": 0,
    "memo": "<string>",
    "processor": "<string>",
    "method": "cash",
    "is_return": false,
    "refund_credit": false,
    "refunded_at": "2023-11-07T05:31:56Z",
    "status": "pending",
    "id": "rfu_WQMDNUHpBThYSNh4AprDBo",
    "payments": [
      {
        "amount": 123,
        "id": "rfp_WQMDNUHpBThYSNh4AprDBo",
        "transaction_id": "txn_WQMDNUHpBThYSNh4AprDBo"
      }
    ],
    "refund_invoices": [
      {
        "external_id": "<string>",
        "amount": 123,
        "memo": "<string>",
        "id": "rfi_WQMDNUHpBThYSNh4AprDBo",
        "invoice_id": "inv_WQMDNUHpBThYSNh4AprDBo",
        "invoice_line_id": "inl_WQMDNUHpBThYSNh4AprDBo"
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

x-user-id
string | null

Optional external entity identifier that performed the action

Path Parameters

business_id
string<biz_string>
required

Body

application/json
amount
required

The amount to refund.

Required range: x > 0
refund_external_id
string
required

The external ID of the refund.

Maximum length: 255
refunded_at
string<date-time>
required

The date and time of the refund.

method
enum<string>
required

The method of the refund.

Available options:
cash,
check,
credit_card,
ach,
credit_balance,
other
invoices_to_refund
InvoicesToRefundRequest · object[]
required

The invoices to refund.

Required array length: 1 - 100 elements
memo
string | null

The memo for the refund.

Maximum length: 255
processor
string | null

The name of the person who processed the refund.

Maximum length: 255
is_return
boolean
default:false

Whether the refund is for a return.

refund_credit
boolean
default:false

Whether the refund is a credit (not a cash refund).

Response

Successful Response

data
object
required