Chargebacks

Use this view endpoint to retrieve chargeback data aggregated by 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 chargeback data (JSON)

Action: GET
Endpoint: /views/chargebacks

Retrieve chargeback data aggregated by transaction. This endpoint returns a JSON object that contains an array of records matching your filter query.

Sample response body

The following sample shows a representative response for a GET request to the /views/chargebacks?program=my_program&network=MASTERCARD&fields=original_transaction_token,chargeback_state&last_modified_time=2018-04-01..2018-04-07 endpoint.

{
"total": 3,
"is_more": false,
"count": 3,
"info": {},
"start_date": "2018-04-01T00:00:00+0000",
"end_date": "2018-04-07T00:00:00+0000",
"last_run_time": "2018-05-08T04:05:50Z",
"schema": [
{
"field": "original_transaction_token",
"type": "integer",
"display": "Original Transaction Token",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "chargeback_state",
"type": "character varying(50)",
"display": "Chargeback State",
"units": null,
"hasTotal": false,
"is_filter_only": false
}
],
"records": [
{
"original_transaction_token": 5164413,
"chargeback_state": "CASE_WON"
},
{
"original_transaction_token": 3984647,
"chargeback_state": "CASE_WON"
},
{
"original_transaction_token": 4509573,
"chargeback_state": "CASE_WON"
}
]
}


Retrieve chargeback data (file export)

Action: GET
Endpoint: /views/chargebacks/{export_type}

Retrieve chargeback data aggregated by transaction. 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

Name Type Required? Description Allowable Values
export_type string Yes File format in which to export the data. csv | xlsx

Query parameters

Name Type Required? Description Allowable Values
compress string No Type of file compression for the exported file. gz | zip

Default: gz

Sample response body

{
"token":"d22d718504d51ff7a49efcc40d5fe808fd1e9d9e.csv.gz"
}


Retrieve chargeback schema

Action: GET
Endpoint: /views/chargebacks/schema

Retrieve a JSON representation of the chargeback view schema for data aggregated by transaction. The schema object contains an array of objects that describe the available columns and the data type of each column.

Sample response body

The following sample shows a representative response for a GET request to the /views/chargebacks/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": "acting_card_type",
"type": "character varying(50)",
"display": "Acting Card Type",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "role",
"type": "character varying(20)",
"display": "Role",
"enum_values": [],
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "chargeback_state",
"type": "character varying(50)",
"display": "Chargeback State",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "chargeback_previous_state",
"type": "character varying(50)",
"display": "Chargeback Previous State",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "chargeback_created_date",
"type": "timestamp without time zone",
"display": "Chargeback Created Date",
"units": null,
"hasTotal": false,
"date_format": "YYYY-MM-DD HH:mm:ss",
"is_filter_only": false
},
{
"field": "original_transaction_token",
"type": "integer",
"display": "Original Transaction Token",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "chargeback_reason_code",
"type": "character varying(40)",
"display": "Chargeback Reason Code",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "chargeback_reason",
"type": "character varying(1024)",
"display": "Chargeback Reason",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "network_reason_code",
"type": "character varying(20)",
"display": "Network Reason Code",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "network_case_id",
"type": "character varying(60)",
"display": "Network Case Id",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "has_documentation",
"type": "character(1)",
"display": "Has Documentation",
"enum_values": [],
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "provisional_credit_given",
"type": "character(1)",
"display": "Provisional Credit Given",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "notes",
"type": "character varying(1024)",
"display": "Notes",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "transaction_processing_type",
"type": "character varying(128)",
"display": "Transaction Processing Type",
"enum_values": [],
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "network",
"type": "character varying(50)",
"display": "Network",
"enum_values": [],
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "chargeback_amount",
"type": "numeric(14,2)",
"display": "Chargeback Amount",
"units": null,
"hasTotal": false,
"is_filter_only": false
},
{
"field": "last_modified_time",
"type": "timestamp without time zone",
"display": "Last Modified Time",
"units": null,
"hasTotal": false,
"date_format": "YYYY-MM-DD HH:mm:ss",
"is_filter_only": false
}
]