### List Businesses with Query Parameters
Source: https://www.marqeta.com/docs/core-api/businesses
This example demonstrates how to list businesses using the `/businesses` endpoint. You can filter results by legal or fictitious name, control the number of results, specify the starting index, and select specific fields to return.
```http
GET /businesses?count=5&business_name_dba=My_fictitious_business_name&fields=token,business_name_legal
```
--------------------------------
### JIT Funding Configuration Example
Source: https://www.marqeta.com/docs/developer-guides/mq-eu-jit-funding
Example of configuring Just-in-Time Funding within a GPA order, specifying the funding method and amount.
```json
{
"state": "COMPLETION",
"gpa_order": {
"jit_funding": {
"method": "pgfs.balanceinquiry",
"amount": 0.00
}
},
"amount": 0.00
}
```
--------------------------------
### JIT Funding Response Example
Source: https://www.marqeta.com/docs/developer-guides/mq-eu-jit-funding
Example of a response detailing Just-in-Time Funding information, including token, method, amount, and available balances.
```json
{
"jit_funding": {
"token": "45831493-571d-4ded-8376-315201210dbf",
"method": "pgfs.balanceinquiry",
"amount": 0,
"balances": {
"USD": {
"currency_code": "USD",
"available_balance": 1206.45
}
}
}
}
```
--------------------------------
### Program Balances Response Example
Source: https://www.marqeta.com/docs/diva-api/exploring-the-diva-api
Example JSON response for the /programbalances/day endpoint, detailing schema and records with financial transaction data.
```json
{
"total": 16,
"is_more": false,
"count": 16,
"info": {},
"start_date": "2023-10-01T00:00:00+0000",
"end_date": "2023-10-03T00:00:00+0000",
"last_run_time": "2022-08-27T16:08:03Z",
"schema": [
{
"field": "beginning_bank_balance",
"type": "numeric(14,2)",
"description": "#N/A",
"display": "Beginning Bank Balance",
"units": "USD",
"has_total": true,
"is_filter_only": false
},
{
"field": "amount_to_send",
"type": "numeric(14,2)",
"description": "The net amount of partner funds and JIT Funding loads: (Partner Funds Loads + Partner Funds Unloads + Partner Funds Adjustments) + (JIT Loads + JIT Unloads + JIT Adjustments)",
"display": "Amount To Send",
"units": "USD",
"has_total": true,
"is_filter_only": false
},
{
"field": "ending_bank_balance",
"type": "numeric(14,2)",
"description": "",
"display": "Ending Bank Balance",
"units": "USD",
"has_total": true,
"is_filter_only": false
}
],
"records": [
{
"beginning_bank_balance": 13721500.57,
"amount_to_send": -2007425.14,
"ending_bank_balance": 11714075.43
},
{
"beginning_bank_balance": 10676468.56,
"amount_to_send": -2069664.32,
"ending_bank_balance": 10821608.44
}
...
{
"beginning_bank_balance": 13883983.47,
"amount_to_send": -2275955.87,
"ending_bank_balance": 13721500.57
}
]
}
```
--------------------------------
### Gateway Request Example
Source: https://www.marqeta.com/docs/developer-guides/about-credit-program-gateways
This is an example of a Gateway request object, showing the structure of information Marqeta sends to your Program Gateway for transaction authorization.
```json
{
"token": "198d1132-b34e-4445-a5ca-2e0fe4a55e26",
"user_token": "user-158634",
"acting_user_token": "user-158634",
"card_token": "card-158634",
"gpa": {
"currency_code": "USD",
"ledger_balance": 252.93,
"available_balance": 0.00,
"credit_balance": 0.00,
"pending_credits": 0.00,
"balances": {
"USD": {
"currency_code": "USD",
"ledger_balance": 252.93,
"available_balance": 0.00,
"credit_balance": 0.00,
"pending_credits": 0.00
}
}
},
"gpa_order": {
"token": "b849f8a2-77a6-4745-bbb3-1dd8710427fa",
"amount": 29.74,
"transaction_token": "198d1132-b34e-4445-a5ca-2e0fe4a55e26",
"state": "PENDING",
"funding": {
"amount": 29.74,
"source": {
"type": "programgateway",
"token": "**********6a19",
"active": true,
"name": "jit funding source name",
"is_default_account": false,
"created_time": "2022-11-09T09:36:09Z",
"last_modified_time": "2023-01-15T19:38:55Z"
}
},
"funding_source_token": "**********6a19",
"jit_funding": {
"token": "0b199f94-2d5c-4fc4-9357-be998eaeebfd",
"method": "pgfs.authorization",
"user_token": "user-158634",
"acting_user_token": "user-158634",
"amount": 29.74
},
"user_token": "user-158634",
"currency_code": "USD"
},
"created_time": "2022-09-25T23:41:25Z",
"user_transaction_time": "2022-09-25T23:41:25Z",
"amount": 29.74,
"currency_code": "USD",
"network": "MASTERCARD",
"card_acceptor": {
"mid": "4445001899609",
"mcc": "5411",
"name": "WHOLEFDS EGW 101",
"city": "EDGEWATER",
"state": "NJ",
"postal_code": "07020",
"country_code": "USA"
},
"acquirer": {
"institution_country": "840",
"institution_id_code": "375321467",
"retrieval_reference_number": "526051868288",
"system_trace_audit_number": "676127"
},
"fraud": {
"network": {
"transaction_risk_score": 86,
"account_risk_score": 2
}
},
"pos": {
"pan_entry_mode": "MAG_STRIPE",
"pin_entry_mode": "TRUE",
"terminal_id": "TR100000",
"terminal_attendance": "ATTENDED",
"card_holder_presence": false,
"card_presence": false,
"partial_approval_capable": false,
"purchase_amount_only": false,
"is_recurring": false
}
}
```
--------------------------------
### Get Payment Schedules
Source: https://www.marqeta.com/docs/core-api/credit-account-payment-schedules
Retrieves a list of payment schedule resources. Supports filtering by count, start index, and sorting by creation time.
```APIDOC
## GET /credit/accounts/{account_token}/payment_schedules
### Description
Retrieves a list of payment schedule resources for a specific credit account. You can control the number of results, the starting index, and the sort order.
### Method
GET
### Endpoint
/credit/accounts/{account_token}/payment_schedules
### Parameters
#### Query Parameters
- **count** (integer) - Optional - Number of payment schedule resources to retrieve. Minimum value is 1.
- **start_index** (integer) - Optional - Sort order index of the first resource in the returned array. Minimum value is 0.
- **sort_by** (string) - Optional - Field on which to sort. Prefix the field name with a hyphen (`-`) to sort in descending order. Omit the hyphen to sort in ascending order. Allowable values: `createdTime`, `-createdTime`.
### Response
#### Success Response (200)
- **count** (integer) - Number of resources returned. Allowable values: 1-10.
- **start_index** (integer) - Sort order index of the first resource in the returned array.
- **end_index** (integer) - Sort order index of the last resource in the returned array.
- **is_more** (boolean) - A value of `true` indicates that more unreturned resources exist.
- **data** (array of objects) - List of payment schedule transitions.
- **data[].token** (string) - Unique identifier of the payment schedule transition. Max length is 36 characters.
- **data[].account_token** (string) - Unique identifier of the credit account on which to transition a payment schedule.
```
--------------------------------
### Card Product Configuration Example
Source: https://www.marqeta.com/docs/core-api/card-products
Example JSON payload for creating a new physical card product. Includes settings for fulfillment, card life cycle, and JIT funding.
```json
{
"name": "My Card Product",
"physical_card_options": {
"name_line_1": {
"value": "My Company Name"
},
"name_line_2": {
"value": "Aegis Fleet Services"
},
"carrier": {
"name": "my_carrier_logo.png",
"message_line": "my message"
},
"images": {
"card": {
"name": "my_card_logo.png",
"thermal_color": "Black"
}
},
"signature": {
"name": "my_signature.png"
},
"carrier_return_window": {
"name": "my_return_address_image.png"
}
},
"payment_instrument": "PHYSICAL_MSR",
"package_id": "0",
"all_zero_card_security_code": false,
"bin_prefix": "111111",
"bin_issue_country": "USA",
"bulk_ship": false,
"pan_length": "16",
"fulfillment_provider": "PERFECTPLASTIC",
"selective_auth": {
"sa_mode": 1,
"enable_regex_search_chain": false,
"dmd_location_sensitivity": 0
},
"card_life_cycle": {
"activate_upon_issue": true,
"expiration_offset": {
"unit": "YEARS",
"value": 10
},
"card_service_code": 101,
"update_expiration_upon_activation": false
},
"jit_funding": {
"paymentcard_funding_source": {
"enabled": true
}
}
}
```
--------------------------------
### Get Monthly Authorizations
Source: https://www.marqeta.com/docs/diva-api/exploring-the-diva-api
Retrieve authorization amounts and counts for the current month using the `/authorizations/month` endpoint. This example specifies the program and desired fields.
```http
https://diva-api.marqeta.com/data/v2/views/authorizations/month?program=my_program&fields=acting_users,acting_cards,transaction_count,transaction_amount
```
--------------------------------
### Filter Response Fields
Source: https://www.marqeta.com/docs/diva-api/exploring-the-diva-api
Append specific fields to the GET request to limit the response data. This example requests 'post_date', 'settlement_date', 'transaction_type', and 'network'.
```HTTP
https://diva-api.marqeta.com/data/v2/views/settlements/week?program=my_program&fields=post_date,settlement_date,transaction_type,network
```
--------------------------------
### Credit Product Configuration Example
Source: https://www.marqeta.com/docs/core-api/credit-products
This JSON object represents a sample configuration for a credit product, detailing interest application, fees, and billing cycle settings.
```json
{
"interest_application": [
"PRINCIPAL",
"FEES"
],
"minimum_interest": 1,
"interest_on_grace_reactivation": "ACCRUE_FULL_CYCLE",
"grace_days_application": "NEXT_CYCLE_DATE",
"exclude_tran_types": [
"ANNUAL_FEE",
"LATE_PAYMENT_FEE",
"CASH_BACK_STATEMENT_CREDIT"
]
},
"config": {
"billing_cycle_day": 1,
"payment_due_day": 31,
"fees": [
"LATE_PAYMENT_FEE"
],
"periodic_fees": [],
"fees_config": [],
"rewards_config": []
}
}
```
--------------------------------
### Create a Card Product with JIT Funding Enabled
Source: https://www.marqeta.com/docs/developer-guides/configuring-gateway-jit-funding
Configure a card product to use program gateway JIT funding. Ensure the `jit_funding.programgateway_funding_source.enabled` field is set to `true`.
```json
{
"start_date": "2020-01-01",
"token": "**YOUR CARD PRODUCT TOKEN**",
"name": "Example Card Product",
"config": {
"fulfillment": {
"payment_instrument": "VIRTUAL_PAN"
},
"poi": {
"ecommerce": true
},
"card_life_cycle": {
"activate_upon_issue": true
},
"jit_funding": {
"programgateway_funding_source": {
"funding_source_token": "**YOUR FUNDING SOURCE TOKEN**",
"refunds_destination": "GATEWAY",
"enabled": true
}
}
}
}
```
--------------------------------
### Get Specific Deposit Account Details
Source: https://www.marqeta.com/docs/core-api/deposit-accounts
This example demonstrates how to retrieve the details of a single deposit account using its unique token. The response provides comprehensive information about the specified account.
```javascript
const depositAccountToken = "g1h2i3j4-k5l6-7890-1234-567890abcdef";
client.depositAccounts.get(depositAccountToken)
.then(response => {
console.log(response);
});
```
--------------------------------
### Tokenization Configuration Example
Source: https://www.marqeta.com/docs/developer-guides/mq-eu-tokenization
This JSON object shows how to enable digital wallet tokenization and configure provisioning controls at different levels. It includes settings for manual entry, wallet provider card on file, and in-app provisioning, along with an option for specifying card art.
```JSON
{
"config": {
"digital_wallet_tokenization": {
"provisioning_controls": {
"manual_entry": {
"enabled": true,
"address_verification": {
"validate": false
}
},
"wallet_provider_card_on_file": {
"enabled": true,
"address_verification": {
"validate": false
}
},
"in_app_provisioning": {
"enabled": true,
"address_verification": {
"validate": false
}
}
},
"card_art_id": ""
}
}
}
```
--------------------------------
### List Account Transitions Endpoint
Source: https://www.marqeta.com/docs/core-api/credit-account-transitions
Use this GET request to retrieve a paginated list of all status transitions for a specific credit account. You can control the number of results and the starting index for pagination.
```http
GET /credit/accounts/{account_token}/accounttransitions
```
--------------------------------
### Get Credit Account Statements
Source: https://www.marqeta.com/docs/core-api/credit-account-statements
Retrieves a list of credit account statements. You can filter statements by date range, specify the number of results, set the starting index for pagination, and define the sorting order.
```APIDOC
## GET /credit/account/statements
### Description
Retrieves a list of credit account statements. You can filter statements by date range, specify the number of results, set the starting index for pagination, and define the sorting order.
### Method
GET
### Endpoint
/credit/account/statements
### Parameters
#### Query Parameters
- **start_date** (datetime) - Optional - Returns statements with a matching opening date. If both `start_date` and `end_date` are specified, statements whose closing date falls between the start and end dates are returned. Format: yyyy-MM-ddThh:mm:ssZ
- **end_date** (datetime) - Optional - Returns statements with a matching closing date. If both `start_date` and `end_date` are specified, statements whose closing date falls between the start and end dates are returned. Format: yyyy-MM-ddThh:mm:ssZ
- **count** (integer) - Optional - The number of resources to retrieve. Allowable Values: 1–100
- **start_index** (integer) - Optional - Sort order index of the first resource in the returned array. Allowable Values: 0 min
- **sort_by** (string) - Optional - Field on which to sort. Prefix the field name with a hyphen (`-`) to sort in descending order. Omit the hyphen to sort in ascending order. NOTE: You must sort using system field names such as `createdTime`, and not by the field names appearing in response bodies such as `created_time`. Allowable Values: `createdTime`, `-createdTime`
### Response
#### Success Response (200)
- **Fields** (Description of fields returned in the response body - details not provided in source)
```
--------------------------------
### Full HTML Example with Marqeta.js PIN Reveal
Source: https://www.marqeta.com/docs/developer-guides/using-marqeta-js
This example demonstrates a complete HTML page integrating Marqeta.js for PIN reveal functionality. It includes basic HTML structure, styles, references to the Marqeta.js library, and a marqeta.bootstrap() call with configuration for PIN reveal components.
```html
Marqeta.js PIN Reveal Tutorial
```
--------------------------------
### Get Commando Mode Control Set Transitions
Source: https://www.marqeta.com/docs/core-api/commando-mode
Retrieves a list of Commando Mode control set transitions. You can specify the number of transitions to retrieve, the starting index for sorting, and the field by which to sort the results.
```APIDOC
## GET /commando-mode
### Description
Retrieves a list of Commando Mode control set transitions. Supports pagination and sorting.
### Method
GET
### Endpoint
/commando-mode
### Parameters
#### Query Parameters
- **count** (integer) - Optional - Number of Commando Mode control set transitions to retrieve. Allowable values: 1-10. Default value: 5.
- **start_index** (integer) - Optional - Sort order index of the first resource in the returned array. Allowable values: Any integer. Default value: 0.
- **sort_by** (string) - Optional - Field on which to sort. Use any field in the resource model, or one of the system fields `lastModifiedTime` or `createdTime`. Prefix the field name with a hyphen (`-`) to sort in descending order. Omit the hyphen to sort in ascending order. Allowable values: `createdTime`, `lastModifiedTime`, or any field in the resource model. Default value: `-createdTime`.
### Response
#### Success Response (200)
- **count** (integer) - Conditionally returned - Number of Commando Mode control set transition objects to retrieve. Allowable values: 1-10.
- **data** (array of objects) - Conditionally returned - Array of Commando Mode control set transition objects.
- **data[].commando_mode_token** (string) - Conditionally returned - Unique identifier of the Commando Mode control set. Allowable values: Existing Commando Mode control set token.
- **data[].created_time** (datetime) - Returned - Date and time when the resource was created, in UTC. Format: yyyy-MM-ddThh:mm:ssZ.
- **data[].name** (string) - Conditionally returned - Identifies the user who changed the Commando Mode control set’s state. Allowable values: 255 char max.
```
--------------------------------
### JIT Funding Response Example (Balance Inquiry)
Source: https://www.marqeta.com/docs/core-api/gateway-jit-funding-messages
This example demonstrates a JIT Funding response for a balance inquiry. It includes the additional `balances` object required for such requests. The HTTP response code should be 200 OK.
```json
{
"jit_funding": {
"transaction_details": {
"approval_code": "123456",
"amount": 0.00,
"currency_code": "USD"
},
"balances": {
"available_balance": 100.00,
"cash_back_balance": 50.00,
"credit_limit": 1000.00,
"current_balance": 200.00,
"pending_balance": 75.00
}
}
}
```
--------------------------------
### Get Reward Redemptions
Source: https://www.marqeta.com/docs/core-api/credit-reward-redemptions
Retrieves a list of reward redemptions within a specified date range. It can return the starting and ending dates of the range, and a list of redemption details including type, destination, and points redeemed.
```APIDOC
## GET /reward-redemptions
### Description
Retrieves a list of reward redemptions within a specified date range. It can return the starting and ending dates of the range, and a list of redemption details including type, destination, and points redeemed.
### Method
GET
### Endpoint
/reward-redemptions
### Parameters
#### Query Parameters
- **start_date** (datetime) - Optional - Starting date and time of a date range from which to return the redemption balance, in UTC. Format: yyyy-MM-ddThh:mm:ssZ
- **end_date** (datetime) - Optional - Ending date and time of a date range from which to return the redemption balance, in UTC. Format: yyyy-MM-ddThh:mm:ssZ
### Response
#### Success Response (200)
- **start_date** (datetime) - Starting date and time of a date range from which to return the redemption balance, in UTC.
- **end_date** (datetime) - Ending date and time of a date range from which to return the redemption balance, in UTC.
- **redemptions** (array of objects) - List of each redemption total by type.
- **type** (string) - Type of redemption. Allowable Values: `EXTERNAL`, `STATEMENT_CREDIT`.
- **destination** (string) - The brand-managed program to which the reward balance was redeemed. 255 char max.
- **point_redeemed** (decimal) - Total points redeemed for redemption type for a reward account. Any integer.
- **retrieved_time** (datetime) - The time the redemption information was retrieved.
#### Response Example
{
"start_date": "2023-01-05T20:37:11Z",
"end_date": "2024-01-05T20:37:11Z",
"redemptions": [
{
"type": "EXTERNAL",
"destination": "BRAND_WALLET",
"points_redeemed": 100000
},
{
"type": "EXTERNAL",
"destination": "MILEAGE_PLUS",
"points_redeemed": 5000
},
{
"type": "STATEMENT_CREDIT",
"points_redeemed": 5000
}
],
"retrieved_time": "2024-01-05T20:37:11Z"
}
```
--------------------------------
### Card Product Configuration Example
Source: https://www.marqeta.com/docs/core-api/card-products
This JSON object represents a full configuration for a card product, including settings for card lifecycle, clearing and settlement, JIT funding, and digital wallet tokenization.
```json
{
"enable_regex_search_chain": false,
"dmd_location_sensitivity": 0
},
"card_life_cycle": {
"activate_upon_issue": true,
"expiration_offset": {
"unit": "YEARS",
"value": 10,
"min_offset": {
"unit": "YEARS",
"value": 4
}
},
"card_service_code": 101,
"update_expiration_upon_activation": false
},
"clearing_and_settlement": {
"overdraft_destination": "GPA"
},
"jit_funding": {
"paymentcard_funding_source": {
"enabled": true,
"refunds_destination": ""
},
"programgateway_funding_source": {
"enabled": false,
"funding_source_token": "",
"refunds_destination": "GATEWAY"
},
"program_funding_source": {
"enabled": false,
"funding_source_token": "",
"refunds_destination": "PROGRAM_FUNDING_SOURCE"
}
},
"digital_wallet_tokenization": {
"provisioning_controls": {
"manual_entry": {
"enabled": false,
"address_verification": {
"validate": true
}
},
"wallet_provider_card_on_file": {
"enabled": false,
"address_verification": {
"validate": true
}
},
"in_app_provisioning": {
"enabled": false,
"address_verification": {
"validate": true
}
},
"dwt_use_card_status_during_auth": false
}
},
"start_date": "2022-04-27",
"created_time": "2022-04-27T19:25:55Z",
"last_modified_time": "2022-04-27T21:29:12Z"
}
```
--------------------------------
### Simulate a transaction
Source: https://www.marqeta.com/docs/core-api/simulating-transactions
This example demonstrates how to simulate a basic transaction. Ensure you have the necessary user, card, and funding source tokens.
```json
{
"user_token": "b2d2c739-a9fe-4af0-9f34-964aae4c3e31",
"acting_user_token": "b2d2c739-a9fe-4af0-9f34-964aae4c3e31",
"card_token": "f9c00b07-be2d-4240-ad89-98a0595fc3a2",
"gpa": {
"currency_code": "USD",
"ledger_balance": 10,
"available_balance": 0,
"credit_balance": 0,
"pending_credits": 0,
"impacted_amount": -1,
"balances": {
"USD": {
"currency_code": "USD",
"ledger_balance": 10,
"available_balance": 0,
"credit_balance": 0,
"pending_credits": 0,
"impacted_amount": -1
}
}
},
"gpa_order": {
"token": "d5f0486a-e831-4926-9e59-47427948d68d",
"amount": 1,
"created_time": "2024-07-11T19:45:22Z",
"last_modified_time": "2024-07-11T19:45:22Z",
"transaction_token": "a870af0e-f98e-40d3-a8d2-350d015d69f9",
"state": "COMPLETION",
"response": {
"code": "0000",
"memo": "Approved or completed successfully"
},
"funding": {
"amount": 1,
"source": {
"type": "program",
"token": "**********b4c2",
"active": true,
"name": "PFS for simulating transactions",
"is_default_account": false,
"created_time": "2024-07-10T00:09:35Z",
"last_modified_time": "2024-07-10T00:09:35Z"
}
},
"funding_source_token": "**********b4c2",
"user_token": "b2d2c739-a9fe-4af0-9f34-964aae4c3e31",
"currency_code": "USD"
},
"duration": 129,
"created_time": "2024-07-11T19:45:22Z",
"user_transaction_time": "2024-07-11T19:45:22Z",
"request_amount": 1,
"amount": 1,
"issuer_interchange_amount": 0,
"currency_code": "USD",
"approval_code": "693945",
"response": {
"code": "0000",
"memo": "Approved or completed successfully"
},
"network": "VISA",
"subnetwork": "VISANET",
"acquirer_fee_amount": 0,
"acquirer": {
"institution_id_code": "59103660914",
"retrieval_reference_number": "492752528413",
"system_trace_audit_number": "977404"
},
"user": {
"metadata": {}
},
"card": {
"metadata": {}
},
"card_acceptor": {
"mid": "11111",
"mcc": "6411",
"name": "Marqeta Storefront",
"street_address": "330 Central Ave.",
"city": "St. Petersburg",
"state": "FL",
"zip": "33705",
"country_code": "USA"
},
"pos": {
"terminal_id": "TR100000",
"partial_approval_capable": false,
"purchase_amount_only": false,
"is_recurring": false
}
}
```
--------------------------------
### User Counts API Response Schema
Source: https://www.marqeta.com/docs/diva-api/user-counts
This JSON object represents the schema of a sample response from the GET /views/usercounts/day/schema endpoint. It details fields like program, period start date, user type, and various user counts (open, limited, suspended, etc.).
```json
[
{
"field": "program",
"type": "character varying(128)",
"description": "The name of the card program.",
"display": "Program",
"units": null,
"has_total": false,
"is_filter_only": false
},
{
"field": "period_start_date",
"type": "date",
"description": null,
"display": "Period Start Date",
"units": null,
"has_total": false,
"date_format": "YYYY-MM-DD",
"is_filter_only": false
},
{
"field": "user_type",
"type": "character varying(128)",
"description": "Designates the type of user record as being child, parent or business.",
"display": "User Type",
"units": null,
"has_total": false,
"is_filter_only": false
},
{
"field": "open_eop",
"type": "bigint",
"description": null,
"display": "Open Eop",
"units": null,
"has_total": false,
"is_filter_only": false
},
{
"field": "limited_eop",
"type": "bigint",
"description": null,
"display": "Limited Eop",
"units": null,
"has_total": false,
"is_filter_only": false
},
{
"field": "in_suspension_eop",
"type": "bigint",
"description": null,
"display": "In Suspension Eop",
"units": null,
"has_total": false,
"is_filter_only": false
},
{
"field": "open_ever_during",
"type": "bigint",
"description": null,
"display": "Open Ever During",
"units": null,
"has_total": false,
"is_filter_only": false
},
{
"field": "in_suspension_ever_during",
"type": "bigint",
"description": null,
"display": "In Suspension Ever During",
"units": null,
"has_total": false,
"is_filter_only": false
},
{
"field": "opened_during_period",
"type": "bigint",
"description": null,
"display": "Opened During Period",
"units": null,
"has_total": false,
"is_filter_only": false
},
{
"field": "activated_during_period",
"type": "bigint",
"description": null,
"display": "Activated During Period",
"units": null,
"has_total": false,
"is_filter_only": false
},
{
"field": "suspended_during_period",
"type": "bigint",
"description": null,
"display": "Suspended During Period",
"units": null,
"has_total": false,
"is_filter_only": false
},
{
"field": "terminated_during_period",
"type": "bigint",
"description": null,
"display": "Terminated During Period",
"units": null,
"has_total": false,
"is_filter_only": false
},
{
"field": "swiped_during_period",
"type": "bigint",
"description": null,
"display": "Swiped During Period",
"units": null,
"has_total": false,
"is_filter_only": false
},
{
"field": "entry_createdate",
"type": "timestamp without time zone",
"description": "The date and time when a record has been read into the database following a replication cycle.",
"display": "Entry Createdate",
"units": null,
"has_total": false,
"date_format": "YYYY-MM-DD",
"is_filter_only": false
},
{
"field": "last_modified_time",
"type": "timestamp without time zone",
"description": "The date when the record was most recently updated.",
"display": "Last Modified Time",
"units": null,
"has_total": false,
"date_format": "YYYY-MM-DD",
"is_filter_only": false
},
{
"field": "etl_batch_id",
"type": "bigint",
"description": null,
"display": "Etl Batch Id",
"units": null,
"has_total": false,
"is_filter_only": false
}
]
```
--------------------------------
### Generate UX Toolkit OAuth authentication token
Source: https://www.marqeta.com/docs/developer-guides/cardholder-auth-api.yaml
Use this endpoint to generate your UX Toolkit OAuth authentication token. This token enables access to the specified account to pass it back to the UX Toolkit client. For details, see UX Toolkit Getting Started.
```APIDOC
## POST /oauth/token
### Description
Generates a UX Toolkit OAuth authentication token. This token grants access to a specified account for use with the UX Toolkit client.
### Method
POST
### Endpoint
/oauth/token
### Parameters
#### Header Parameters
- **DPoP** (string) - Required - DPoP proof JWT for OAuth-bound access token
### Request Example
```json
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwcm9ncmFtX3Nob3J0X2NvZGUiOiJteXByZ3JtIiwidXNlcl90b2tlbiI6IjE0OWNjYjVmLWUwZDYtNGMwZS05MjAzLWJkMDkyZGI0N2UzNCJ9.6TdyvMOa_eUSvN5GpUZKBOgcHxmWTuYQPMEgNwBfVS0",
"expires_in": 3600,
"token_type": "DPoP"
}
```
### Response
#### Success Response (200)
- **access_token** (string) - DPoP-bound JWT that must be passed back to UX Toolkit client via your Customer Authentication API.
- **expires_in** (number) - Number of seconds for which the returned `access_token` will remain valid.
- **token_type** (string) - Identifies the token type. For DPoP flows, this value is always `DPoP`.
#### Response Example
```json
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwcm9ncmFtX3Nob3J0X2NvZGUiOiJteXByZ3JtIiwidXNlcl90b2tlbiI6IjE0OWNjYjVmLWUwZDYtNGMwZS05MjAzLWJkMDkyZGI0N2UzNCJ9.6TdyvMOa_eUSvN5GpUZKBOgcHxmWTuYQPMEgNwBfVS0",
"expires_in": 3600,
"token_type": "DPoP"
}
```
```
--------------------------------
### Bootstrap Marqeta.js
Source: https://www.marqeta.com/docs/developer-guides/using-marqeta-js
Add this script tag to your HTML to initialize Marqeta.js. Pass an empty object as an argument for now.
```html
```
--------------------------------
### Field Selection Example
Source: https://www.marqeta.com/docs/diva-api/response-customization
This example shows how to specify which fields to return in the response.
```APIDOC
## GET /views/authorizations/detail
### Description
Retrieves detailed authorization data, allowing selection of specific fields to be returned.
### Method
GET
### Endpoint
`/views/authorizations/detail?program=my_program&fields=transaction_timestamp,state,transaction_amount`
### Parameters
#### Query Parameters
- **program** (string) - Required - The program identifier.
- **fields** (string) - Optional - A comma-delimited list of field names to include in the response (e.g., `transaction_timestamp,state,transaction_amount`).
### Response
#### Success Response (200)
- **transaction_timestamp** (string) - The timestamp of the transaction.
- **state** (string) - The state of the authorization.
- **transaction_amount** (number) - The amount of the transaction.
#### Response Example
(Example response not provided in source)
```
--------------------------------
### Initialize Marqeta.js with Card Copy Functionality
Source: https://www.marqeta.com/docs/developer-guides/using-marqeta-js
This snippet demonstrates how to initialize Marqeta.js, configure card PAN display, and set up a transparent iframe for copying card PAN to the clipboard. It includes success and failure callbacks for the copy operation.
```html
```
--------------------------------
### Incremental Authorization Response Example
Source: https://www.marqeta.com/docs/core-api/postman-collection-simulations.yaml
Example of a response when simulating an incremental authorization.
```json
{
"transaction": {
"type": "authorization.incremental",
"state": "PENDING",
"token": "**AUTHORIZATION_INCREMENTAL_TRANSACTION_TOKEN**",
"user_token": "**USER_TOKEN**",
"card_token": "**CARD_TOKEN**",
"response": {
"code": "0000",
"memo": "Approved or completed successfully"
},
"created_time": "2025-02-22T18:10:12.000Z",
"user_transaction_time": "2025-02-22T18:10:12.000Z"
}
}
```
--------------------------------
### Refund Authorization Response Example
Source: https://www.marqeta.com/docs/core-api/postman-collection-simulations.yaml
Example response for a successful refund authorization simulation.
```json
{
"transaction": {
"type": "refund.authorization",
"state": "PENDING",
"token": "**REFUND_AUTHORIZATION_TRANSACTION_TOKEN**",
"user_token": "**USER_TOKEN**",
"card_token": "**CARD_TOKEN**",
"response": {
"code": "0000",
"memo": "Approved or completed successfully"
},
"created_time": "2025-03-07T21:48:48.000Z",
"user_transaction_time": "2025-03-07T21:48:48.000Z",
"settlement_date": "2025-03-07T00:00:00.000Z",
"amount": 10,
"request_amount": 10,
"gpa": {
"ledger_balance": 250,
"available_balance": 250,
"impacted_amount": 10
},
"currency_code": "USD",
"currency_conversion": {
"original_amount": 10,
"conversion_rate": 1,
"original_currency_code": "840"
},
"network": "VISA",
"subnetwork": "VISANET",
"acquirer_fee_amount": 0,
"fraud": {
"network": {
"transaction_risk_score": 22,
"account_risk_score": "2"
}
},
"card_acceptor": {
"mid": "000000000011111",
"mcc": "6411",
"name": "Marqeta Storefront",
"city": "St. Petersburg",
"state": "FL",
"postal_code": "33705"
}
}
}
```
--------------------------------
### Example Daily Program Balance Data
Source: https://www.marqeta.com/docs/diva-api/exploring-the-diva-api
This JSON snippet shows sample data for daily program balances, including beginning and ending bank balances.
```json
{
"total": 16,
"is_more": false,
"count": 16,
"info": {},
"start_date": "2023-10-01T00:00:00+0000",
"end_date": "2023-10-02T00:00:00+0000",
"last_run_time": "2022-08-27T16:08:03Z",
"schema": [
{
"field": "beginning_bank_balance",
"type": "numeric(14,2)",
"description": "#N/A",
"display": "Beginning Bank Balance",
"units": "USD",
"has_total": true,
"is_filter_only": false
},
{
"field": "ending_bank_balance",
"type": "numeric(14,2)",
"description": "",
"display": "Ending Bank Balance",
"units": "USD",
"has_total": true,
"is_filter_only": false
}
],
"records": [
{
"beginning_bank_balance": 13253690.06,
"ending_bank_balance": 13883983.47
},
{
"beginning_bank_balance": 13883983.47,
"ending_bank_balance": 13721500.57
},
...
{
"beginning_bank_balance": 8856705.74,
"ending_bank_balance": 7106342.25
}
]
}
```