DOCS

New!

/

5 minute read

August 5, 2019

Authorizations

Use this view endpoint to retrieve authorization transaction data at a specified aggregation level. For example, if you choose an aggregation level of detail, each row represents a single authorization transaction. The data is derived from the transaction-related messages sent to and from the Marqeta platform.

This endpoint supports multiple response formats, query filtering, field filtering, sorting, pagination, and currency conversion. For more information about response options, see Response Customization.

Retrieve authorization data (JSON)

Action: GET
Endpoint: /views/authorizations/{time_agg}

Retrieve authorization transaction data, aggregated over the specified time period. This endpoint returns a JSON object that contains an array of records matching your filter query.

Path parameters

Fields Description

time_agg

string, required

Time period over which to aggregate the data. For more information, see Data aggregation levels.

Allowable Values: detail, day, week, month

Sample response body

The following sample shows a representative response for a GET request to the /views/authorizations/detail?program=my_program&fields=transaction_timestamp,acting_user_token,transaction_amount endpoint.

{
    "total": 372,
    "is_more": false,
    "count": 372,
    "info": {},
    "start_date": "2018-02-22T01:06:08+0000",
    "end_date": "2018-02-22T22:00:11+0000",
    "last_run_time": "",
    "schema": [
        {
            "field": "transaction_timestamp",
            "type": "timestamp without time zone",
            "display": "Transaction Timestamp",
            "units": null,
            "has_total": false,
            "date_format": "YYYY-MM-DD HH:mm:ss",
            "is_filter_only": false
        },
        {
            "field": "acting_user_token",
            "type": "character varying(128)",
            "display": "Acting User Token",
            "units": null,
            "has_total": false,
            "is_filter_only": false
        },
        {
            "field": "transaction_amount",
            "type": "numeric(14,2)",
            "display": "Transaction Amount",
            "units": null,
            "has_total": false,
            "is_filter_only": false
        }
    ],
    "records" : [
        {
             "transaction_timestamp": "2018-02-22T22:00:11.000Z",
             "acting_user_token": "720edb9c-2ccc-4176-a55b-58b54badg26e",
             "transaction_amount": 128.0
         },
          ...
    ]
}

Is this helpful?

Retrieve authorization data (file export)

Action: GET
Endpoint: /views/authorizations/{time_agg}/{export_type}

Retrieve authorization transaction data, aggregated over the specified time period. This endpoint asynchronously generates a file in the specified format and returns a job token for retrieving the file when it is completed. The file contains a list of records matching your filter query.

Path parameters

Fields Description

time_agg

string, required

Time period over which to aggregate the data. For more information, see Data aggregation levels.

Allowable Values: detail, day, week, month

export_type

string, required

File format in which to export the data.

Allowable Values: csv

Query parameters

Fields Description

compress

string, optional

Type of file compression for the exported file.

Allowable Values: gz, zip

Default value: gz

Sample response body

{
    "token":"111122226c444d8888888a9999ae11111db63da4.csv.gz"
}

Is this helpful?

Retrieve authorization schema

Action: GET
Endpoint: /views/authorizations/{time_agg}/schema

Retrieve a JSON representation of the authorizations view schema for data aggregated over the specified time period. The schema object contains an array of objects that describe the available columns and the data type of each column.

Path parameters

Fields Description

time_agg

string, required

Time period over which to aggregate the data. For more information, see Data aggregation levels.

Allowable Values: detail, day, week, month

Sample response body

The following sample shows a representative response for a GET request to the /views/authorizations/detail/schema?program=my_program endpoint. The schema can vary based on the data aggregation level and the data you are authorized to access (based on the credentials you provide in your request).

[
     {
         "field": "program",
         "type": "character varying(128)",
         "display": "Program",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "transaction_token",
         "type": "integer",
         "display": "Transaction Token",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "transaction_timestamp",
         "type": "timestamp without time zone",
         "display": "Transaction Timestamp",
         "units": null,
         "has_total": false,
         "date_format": "YYYY-MM-DD HH:mm:ss",
         "is_filter_only": false
     },
     {
         "field": "initiating_transaction_token",
         "type": "integer",
         "display": "Initiating Transaction Token",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "transaction_completion_token",
         "type": "integer",
         "display": "Transaction Completion Token",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "transaction_status",
         "type": "character varying(128)",
         "display": "Transaction Status",
         "enum_values": [
             "Account_Verification",
             "Approved or completed successfully",
             "Declined Authorization",
             "Failed Authorization Attempt",
             "Failed Reversal",
             "Failed Token Activation Request",
             "Pending Settlement",
             "Reversal",
             "Reversed Authorization",
             "Settled Authorization",
             "Successful Token Activation Request",
             "Undefined"
         ],
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "transaction_type",
         "type": "character varying(128)",
         "display": "Transaction Type",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "transaction_processing_type",
         "type": "character varying(128)",
         "display": "Transaction Processing Type",
         "enum_values": [
             "ATM",
             "Atm",
             "CHIP",
             "CHIP_FALLBACK",
             "Chip",
             "Chip_Fallback",
             "Digital Wallet Token",
             "ECOMMERCE",
             "Ecommerce",
             "MAGSTRIPE",
             "Magstripe",
             "OTHER",
             "Other",
             "UNKNOWN",
             "Undefined",
             "Unknown"
         ],
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "displaymessage",
         "type": "character varying(128)",
         "display": "Displaymessage",
         "enum_values": [
             "AVS decline",
             "Account does not exist",
             "Accounting exception",
             "Additional identity verification required",
             "Approved or completed successfully",
             "Auth restriction found for given mid or mcc",
             "Card account verification success",
             "Card expired",
             "Card is active",
             "Card not active",
             "Card not found",
             "Card not present",
             "Card product controls prevent transaction",
             "Card security code not present",
             "Card suspended",
             "Card suspicious",
             "CardHolder not present",
             "Cardholder not active",
             "Cardholder not enabled",
             "Configuration error",
             "Corresponding JIT Reversal Failure",
             "Digital wallet token not active",
             "Digital wallet token not found",
             "Digital wallet token suspended",
             "ECommerce transaction not allowed",
             "Exceeds max auth amount limit",
             "Exceeds withdrawal amount limit",
             "Exceeds withdrawal count limit",
             "Inactive card",
             "Internal error (TXN)",
             "International transaction decline",
             "Invalid Card Service Code detected",
             "Invalid Chip Data / ARQC",
             "Invalid Pin",
             "Invalid amount",
             "Invalid card security code",
             "Invalid message",
             "KYC is required in order to complete this action",
             "Missing fields",
             "Network decline advice",
             "Not sufficient funds",
             "Original not found",
             "PIN not present",
             "Partially approved",
             "Quasi Cash transaction not allowed",
             "REVERSAL NOT ALLOWED",
             "Security violation",
             "System error",
             "Transaction already confirmed",
             "Transaction already reversed",
             "Transactions not allowed from this country",
             "Undefined",
             "token activation request card product config decline"
         ],
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "network",
         "type": "character varying(128)",
         "display": "Network",
         "enum_values": [],
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "sub_network",
         "type": "character varying(128)",
         "display": "Sub Network",
         "enum_values": [],
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "account_user_token",
         "type": "character varying(128)",
         "display": "Account User Token",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "business_user_token",
         "type": "character varying(128)",
         "display": "Business User Token",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "parent_user_token",
         "type": "character varying(128)",
         "display": "Parent User Token",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "acting_user_token",
         "type": "character varying(128)",
         "display": "Acting User Token",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "business_name",
         "type": "character varying(128)",
         "display": "Business Name",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "acting_card_token",
         "type": "character varying(128)",
         "display": "Acting Card Token",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "acting_card_product",
         "type": "character varying(128)",
         "display": "Acting Card Product",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "merchant",
         "type": "character varying(128)",
         "display": "Merchant",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "clean_merchant",
         "type": "character varying(128)",
         "display": "Clean Merchant",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "merchant_category_code",
         "type": "bigint",
         "display": "Merchant Category Code",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "merchant_category_code_group",
         "type": "character varying(2000)",
         "display": "Merchant Category Code Group",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "merchant_category_code_description",
         "type": "character varying(1000)",
         "display": "Merchant Category Code Description",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "merchant_country",
         "type": "character varying(128)",
         "display": "Merchant Country",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "merchant_state",
         "type": "character varying(128)",
         "display": "Merchant State",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "merchant_city",
         "type": "character varying(128)",
         "display": "Merchant City",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "standin_approved_by",
         "type": "character varying(128)",
         "display": "Standin Approved By",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "currency",
         "type": "character varying(10)",
         "display": "Currency",
         "units": null,
         "has_total": false,
         "is_filter_only": false
     },
     {
         "field": "transaction_amount",
         "type": "numeric(14,2)",
         "display": "Transaction Amount",
         "units": null,
         "has_total": true,
         "is_filter_only": false
     }
 ]

Is this helpful?

Have any feedback on this page?

If you feel we can do anything better, please let our team know.

We strive for the best possible developer experience.