For the complete documentation index, see llms.txt. This page is also available as Markdown.

Refunds

List refunds

get

Get a paginated list of refunds with optional filtering

Required scopes
This endpoint requires the following scopes:
Authorizations
OAuth2clientCredentialsRequired
Token URL:
Query parameters
limitintegerOptional

Number of items to return

Default: 100
afterstringOptional

Specifies the cursor after which to start returning results. For the first page, this should be left empty. For subsequent pages, use the value of the end_cursor field from the previous response.

beforestringOptional

Specifies the cursor before which to return results. Use this to paginate backwards. For example, to load the previous page, provide the value of the start_cursor field from the last response.

customer_idstringOptional

Filter by customer ID

invoice_idstringOptional

Filter by invoice ID

payment_methodstring · enumOptional

Filter by payment method

Possible values:
created_at_startstringOptional

Filter by creation date start (RFC3339 format)

created_at_endstringOptional

Filter by creation date end (RFC3339 format)

Responses
200

OK

application/json
end_cursorstringOptionalExample: gaFpxBACEaXBVABEYbHG+X9LyLnH
has_next_pagebooleanOptionalExample: true
has_previous_pagebooleanOptional
start_cursorstringOptionalExample: gaFpxBACEaXBVABEYbHG+X9LyLnH
get/refunds
GET /refunds HTTP/1.1
Host: public-api.alternativepayments.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "data": [
    {
      "created_at": "2021-01-01T00:00:00Z",
      "customer_id": "00000000-0000-0000-0000-000000000000",
      "due_date": "2021-01-01T00:00:00Z",
      "fees": [
        {
          "amount": 1,
          "covered_by_customer": true,
          "name": "text",
          "type": "FT_LATE_PAYMENT"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "payment_method": "card,standard_ach,same_day_ach,manual",
      "sub_total": 50,
      "total": 50
    }
  ],
  "end_cursor": "gaFpxBACEaXBVABEYbHG+X9LyLnH",
  "has_next_page": true,
  "has_previous_page": false,
  "start_cursor": "gaFpxBACEaXBVABEYbHG+X9LyLnH"
}

Create refund

post

Create a full refund for a payment. Partial refunds are not supported.

Required scopes
This endpoint requires the following scopes:
Authorizations
OAuth2clientCredentialsRequired
Token URL:
Body

Request body for creating a refund

amountstringOptionalExample: 50.00
idempotency_keystringOptionalExample: 00000000-0000-0000-0000-000000000000
payment_idstringOptionalExample: 00000000-0000-0000-0000-000000000000
Responses
201

Refund is being processed!

application/json
stringOptional
post/refunds
POST /refunds HTTP/1.1
Host: public-api.alternativepayments.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 321

{
  "amount": "50.00",
  "idempotency_key": "00000000-0000-0000-0000-000000000000",
  "payment_id": "00000000-0000-0000-0000-000000000000",
  "reason": {
    "description": "Please specify the reason in more detail. Min 40 characters.",
    "type": "Customer Request, Duplicate, Fraud, Other. If 'Other', please specify the reason in more detail."
  }
}
text

Get refund by ID

get

Retrieve detailed information about a specific refund

Required scopes
This endpoint requires the following scopes:
Authorizations
OAuth2clientCredentialsRequired
Token URL:
Path parameters
idstringRequired

Refund ID

Responses
200

OK

application/json
created_atstringOptionalExample: 2021-01-01T00:00:00Z
customer_idstringOptionalExample: 00000000-0000-0000-0000-000000000000
due_datestringOptionalExample: 2021-01-01T00:00:00Z
idstringOptionalExample: 00000000-0000-0000-0000-000000000000
payment_methodstringOptionalExample: card,standard_ach,same_day_ach,manual
sub_totalnumberOptionalExample: 50
totalnumberOptionalExample: 50
get/refunds/{id}
GET /refunds/{id} HTTP/1.1
Host: public-api.alternativepayments.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "created_at": "2021-01-01T00:00:00Z",
  "customer_id": "00000000-0000-0000-0000-000000000000",
  "due_date": "2021-01-01T00:00:00Z",
  "fees": [
    {
      "amount": 1,
      "covered_by_customer": true,
      "name": "text",
      "type": "FT_LATE_PAYMENT"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "payment_method": "card,standard_ach,same_day_ach,manual",
  "sub_total": 50,
  "total": 50
}

Last updated

Was this helpful?