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

List all authorizations

How to fetch a collection of authorizations via API

To fetch a collection of authorizations, send a GET request to the /api/authorizations endpoint.

Request

GET https://yourdomain.commercelayer.io/api/authorizations

Example

The following request fetches a collection of authorizations:

curl -g -X GET \
  'https://yourdomain.commercelayer.io/api/authorizations/' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token'

On success, the API responds with a 200 OK status code, returning a paginated collection of resource objects:

{
  "data": [
    {
      "id": "XAyRWNUzyN",
      "type": "authorizations",
      "links": {
        "self": "https://yourdomain.commercelayer.io/api/authorizations/XAyRWNUzyN"
      },
      "attributes": {
        "number": "42/T/001",
        "type": "authorizations",
        "payment_method_type": "credit card",
        "currency_code": "EUR",
        "amount_cents": 1500,
        "amount_float": 15.0,
        "formatted_amount": "€15,00",
        "succeeded": false,
        "message": "Accepted",
        "error_code": "00001",
        "error_detail": "Already settled",
        "token": "xxxx-yyyy-zzzz",
        "gateway_transaction_id": "xxxx-yyyy-zzzz",
        "created_at": "2018-01-01T12:00:00.000Z",
        "updated_at": "2018-01-01T12:00:00.000Z",
        "reference": "ANY-EXTERNAL-REFEFERNCE",
        "reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
        "metadata": {
          "foo": "bar"
        },
        "cvv_code": "000",
        "cvv_message": "validated",
        "avs_code": "000",
        "avs_message": "validated",
        "fraud_review": "passed",
        "capture_amount_cents": 500,
        "capture_amount_float": 5.0,
        "formatted_capture_amount": "€5,00",
        "capture_balance_cents": 1000,
        "capture_balance_float": 10.0,
        "formatted_capture_balance": "€10,00",
        "void_balance_cents": 1500,
        "void_balance_float": 15.0,
        "formatted_void_balance": "€15,00"
      },
      "relationships": {
        "order": {
          "links": {
            "self": "https://yourdomain.commercelayer.io/api/authorizations/XAyRWNUzyN/relationships/order",
            "related": "https://yourdomain.commercelayer.io/api/authorizations/XAyRWNUzyN/order"
          }
        },
        "payment_source": {
          "links": {
            "self": "https://yourdomain.commercelayer.io/api/authorizations/XAyRWNUzyN/relationships/payment_source",
            "related": "https://yourdomain.commercelayer.io/api/authorizations/XAyRWNUzyN/payment_source"
          }
        },
        "attachments": {
          "links": {
            "self": "https://yourdomain.commercelayer.io/api/authorizations/XAyRWNUzyN/relationships/attachments",
            "related": "https://yourdomain.commercelayer.io/api/authorizations/XAyRWNUzyN/attachments"
          }
        },
        "events": {
          "links": {
            "self": "https://yourdomain.commercelayer.io/api/authorizations/XAyRWNUzyN/relationships/events",
            "related": "https://yourdomain.commercelayer.io/api/authorizations/XAyRWNUzyN/events"
          }
        },
        "event_stores": {
          "links": {
            "self": "https://yourdomain.commercelayer.io/api/authorizations/XAyRWNUzyN/relationships/event_stores",
            "related": "https://yourdomain.commercelayer.io/api/authorizations/XAyRWNUzyN/event_stores"
          }
        },
        "captures": {
          "links": {
            "self": "https://yourdomain.commercelayer.io/api/authorizations/XAyRWNUzyN/relationships/captures",
            "related": "https://yourdomain.commercelayer.io/api/authorizations/XAyRWNUzyN/captures"
          }
        },
        "voids": {
          "links": {
            "self": "https://yourdomain.commercelayer.io/api/authorizations/XAyRWNUzyN/relationships/voids",
            "related": "https://yourdomain.commercelayer.io/api/authorizations/XAyRWNUzyN/voids"
          }
        }
      },
      "meta": {
        "mode": "test",
        "organization_id": "xRRkjDFafe",
        "trace_id": "69abaa3545913c78132e5578bd26208d44aa9043647d78698fd0021f3958cd74"
      }
    },
    {
      "other": "... 9 authorizations (first page)"
    }
  ],
  "meta": {
    "record_count": 140,
    "page_count": 14,
    "page_size": 10,
    "page_number": 1,
    "mode": "test",
    "organization_id": "xRRkjDFafe",
    "trace_id": "69abaa3545913c78132e5578bd26208d44aa9043647d78698fd0021f3958cd74"
  },
  "links": {
    "first": "https://yourdomain.commercelayer.io/api/authorizations?page[number]=1&page[size]=10",
    "next": "https://yourdomain.commercelayer.io/api/authorizations?page[number]=2&page[size]=10",
    "last": "https://yourdomain.commercelayer.io/api/authorizations?page[number]=14&page[size]=10"
  }
}

Remember that when you fetch a list of resources you get paginated result.

Sortable fields

The list of authorizations can be sorted by the following fields:

Attributes

  • number

  • type

  • amount_cents

  • id

  • created_at

  • updated_at

  • reference

  • reference_origin

Relationships

  • order

Filterable fields

The list of authorizations can be filtered by the following fields:

Attributes

  • number

  • type

  • currency_code

  • amount_cents

  • succeeded

  • message

  • error_code

  • error_detail

  • token

  • gateway_transaction_id

  • id

  • created_at

  • updated_at

  • reference

  • reference_origin

  • metadata

Relationships

  • order

  • payment_source

  • attachments

  • events

Last updated