# Marqeta

> Issue and manage cards, cardholders and businesses in Marqeta, fund accounts, read transactions and balances, and follow transactions and status changes as they happen.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/marqeta

## Actions

### Change card state

Activate, suspend or terminate a card. Terminating can't be undone.

**Inputs**

- Card (`card_token`, text, required): The card.
- New status (`state`, text, required): The card's new state. One of: `ACTIVE`, `SUSPENDED`, `TERMINATED` (Terminated (permanent)), `LIMITED`.
- Reason (`reason_code`, text, required): Marqeta's standard reason for the change. One of: `00` (Activated for the first time (00)), `01` (Requested by you (01)), `02` (Inactive for a long time (02)), `03` (Mail can't be delivered to the address (03)), `04` (Negative account balance (04)), `05` (Account under review (05)), `06` (Suspicious activity (06)), `07` (Activity outside the program's rules (07)), `08` (Confirmed fraud (08)), `09` (Matched a sanctions (OFAC) list (09)), and 23 more.
- Note (`reason`, text): A note about the change, kept with it.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "card_token": "example",
    "channel": "example",
    "created_time": "example",
    "fulfillment_status": "example",
    "reason": "example",
    "reason_code": "example",
    "state": "example",
    "token": "example",
    "user_token": "example"
  }
}
```

### Change cardholder status

Activate, suspend, close or terminate a cardholder. Terminating can't be undone.

**Inputs**

- Cardholder (`user_token`, text, required): The cardholder (user).
- New status (`status`, text, required): The cardholder's new status. One of: `ACTIVE`, `SUSPENDED`, `CLOSED`, `TERMINATED` (Terminated (permanent)), `UNVERIFIED`, `LIMITED`.
- Reason (`reason_code`, text, required): Marqeta's standard reason for the change. One of: `00` (Activated for the first time (00)), `01` (Requested by you (01)), `02` (Inactive for a long time (02)), `03` (Mail can't be delivered to the address (03)), `04` (Negative account balance (04)), `05` (Account under review (05)), `06` (Suspicious activity (06)), `07` (Activity outside the program's rules (07)), `08` (Confirmed fraud (08)), `09` (Matched a sanctions (OFAC) list (09)), and 23 more.
- Note (`reason`, text): A note about the change, kept with it.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "channel": "example",
    "created_time": "example",
    "reason": "example",
    "reason_code": "example",
    "status": "example",
    "token": "example",
    "user_token": "example"
  }
}
```

### Create business

Create a business account holder.

**Inputs**

- Legal name (`business_name_legal`, text, required): The business's legal name.
- Trading name (`business_name_dba`, text): The name it trades under (doing business as).
- Phone (`phone`, text): The phone number with its country code, such as +15105551212.
- Website (`website`, text): The business's website.
- Description (`general_business_description`, text): What the business does.
- Address (`address1`, text): The office's street address.
- City (`city`, text): The office's city.
- State (`state`, text): The office's state or province.
- Postal code (`postal_code`, text): The office's postal code.
- Country (`country`, text): The office's country, such as USA.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "active": true,
    "business_name_dba": "example",
    "business_name_legal": "example",
    "created_time": "example",
    "general_business_description": "example",
    "last_modified_time": "example",
    "office_location": {
      "address1": "example",
      "address2": "example",
      "city": "example",
      "country": "example",
      "postal_code": "example",
      "state": "example"
    },
    "phone": "example",
    "status": "example",
    "token": "example",
    "website": "example"
  }
}
```

### Create card

Issue a card to a cardholder from a card product.

**Inputs**

- Cardholder (`user_token`, text, required): The cardholder (user).
- Card product (`card_product_token`, text, required): The card product.
- Metadata (`metadata`, object): Your own name and value pairs to keep with the card.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "card_product_token": "example",
    "created_time": "example",
    "expiration": "example",
    "fulfillment_status": "example",
    "instrument_type": "example",
    "last_four": "example",
    "last_modified_time": "example",
    "metadata": {},
    "state": "example",
    "state_reason": "example",
    "token": "example",
    "user_token": "example"
  }
}
```

### Create cardholder

Create a cardholder (user). Their first status depends on your program's identity-check (KYC) rules.

**Inputs**

- First name (`first_name`, text, required): The cardholder's legal first name.
- Last name (`last_name`, text, required): The cardholder's legal last name.
- Email (`email`, text): The cardholder's email. Each user's must be unique.
- Phone (`phone`, text): The phone number with its country code, such as +15105551212.
- Address (`address1`, text): The street address. Not a PO box.
- City (`city`, text): The city.
- State (`state`, text): The state or province, such as CA.
- Postal code (`postal_code`, text): The postal code.
- Country (`country`, text): The country, such as USA.
- Date of birth (`birth_date`, date): The cardholder's date of birth.
- Metadata (`metadata`, object): Your own name and value pairs to keep with the cardholder.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "active": true,
    "address1": "example",
    "birth_date": "example",
    "city": "example",
    "country": "example",
    "created_time": "example",
    "email": "example",
    "first_name": "example",
    "last_modified_time": "example",
    "last_name": "example",
    "metadata": {},
    "phone": "example",
    "postal_code": "example",
    "state": "example",
    "status": "example",
    "token": "example"
  }
}
```

### Create program funding source

Create a program funding source: the account of your program that funds cardholders' and businesses' accounts.

**Inputs**

- Name (`name`, text, required): A name for the funding source.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "account": "example",
    "active": true,
    "created_time": "example",
    "last_modified_time": "example",
    "name": "example",
    "token": "example"
  }
}
```

### Fund account

Move money from a funding source into a cardholder's or business's general purpose account (GPA).

**Inputs**

- Account of (`account_type`, text, required): Whether the account belongs to a cardholder or a business. One of: `user` (Cardholder), `business`.
- Cardholder or business (`account_holder_token`, text, required): The cardholder or business whose account to fund.
- Amount (`amount`, number, required): How much to add. At least 0.01.
- Currency (`currency_code`, text, required): The account's currency. One of: `USD`, `CAD`, `EUR`, `GBP`, `AUD`, `NZD`, `MXN`, `BRL`, `SGD`, `JPY`.
- Funding source token (`funding_source_token`, text, required): The funding source the money comes from, such as a program funding source.
- Memo (`memo`, text): A note kept with the order.
- Tags (`tags`, text): Comma-separated tags for the order.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "amount": 1,
    "business_token": "example",
    "created_time": "example",
    "currency_code": "example",
    "funding_source_token": "example",
    "memo": "example",
    "response": {
      "code": "example",
      "memo": "example"
    },
    "state": "example",
    "tags": "example",
    "token": "example",
    "transaction_token": "example",
    "user_token": "example"
  }
}
```

### Get account balance

Get the balance of a cardholder's or business's general purpose account (GPA).

**Inputs**

- Cardholder or business (`account_holder_token`, text, required): The cardholder or business whose balance to read.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "gpa": {
      "available_balance": 1,
      "credit_balance": 1,
      "currency_code": "example",
      "ledger_balance": 1,
      "pending_credits": 1
    }
  }
}
```

### Get business

Get a business's details and status.

**Inputs**

- Business (`business_token`, text, required): The business.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "active": true,
    "business_name_dba": "example",
    "business_name_legal": "example",
    "created_time": "example",
    "general_business_description": "example",
    "last_modified_time": "example",
    "office_location": {
      "address1": "example",
      "address2": "example",
      "city": "example",
      "country": "example",
      "postal_code": "example",
      "state": "example"
    },
    "phone": "example",
    "status": "example",
    "token": "example",
    "website": "example"
  }
}
```

### Get card

Get a card's state, last four digits and expiration. The full card number is never returned.

**Inputs**

- Card (`card_token`, text, required): The card.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "card_product_token": "example",
    "created_time": "example",
    "expiration": "example",
    "fulfillment_status": "example",
    "instrument_type": "example",
    "last_four": "example",
    "last_modified_time": "example",
    "metadata": {},
    "state": "example",
    "state_reason": "example",
    "token": "example",
    "user_token": "example"
  }
}
```

### Get card product

Get a card product's details.

**Inputs**

- Card product (`card_product_token`, text, required): The card product.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "active": true,
    "created_time": "example",
    "end_date": "example",
    "last_modified_time": "example",
    "name": "example",
    "start_date": "example",
    "token": "example"
  }
}
```

### Get cardholder

Get a cardholder's details and status.

**Inputs**

- Cardholder (`user_token`, text, required): The cardholder (user).

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "active": true,
    "address1": "example",
    "birth_date": "example",
    "city": "example",
    "country": "example",
    "created_time": "example",
    "email": "example",
    "first_name": "example",
    "last_modified_time": "example",
    "last_name": "example",
    "metadata": {},
    "phone": "example",
    "postal_code": "example",
    "state": "example",
    "status": "example",
    "token": "example"
  }
}
```

### Get funding order

Get a funding (GPA) order and whether it went through.

**Inputs**

- Funding order (`gpa_order_token`, text, required): The funding order's token, from Fund account.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "amount": 1,
    "business_token": "example",
    "created_time": "example",
    "currency_code": "example",
    "funding_source_token": "example",
    "memo": "example",
    "response": {
      "code": "example",
      "memo": "example"
    },
    "state": "example",
    "tags": "example",
    "token": "example",
    "transaction_token": "example",
    "user_token": "example"
  }
}
```

### Get program funding source

Get a program funding source and whether it is active.

**Inputs**

- Funding source token (`funding_source_token`, text, required): The program funding source's token, from Create program funding source or your Marqeta dashboard.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "account": "example",
    "active": true,
    "created_time": "example",
    "last_modified_time": "example",
    "name": "example",
    "token": "example"
  }
}
```

### Get transaction

Get a transaction's amount, merchant, state and response.

**Inputs**

- Transaction (`transaction_token`, text, required): The transaction's token, from a list of transactions or a trigger.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "amount": 1,
    "business_token": "example",
    "card_acceptor": {
      "city": "example",
      "country_code": "example",
      "mcc": "example",
      "name": "example",
      "state": "example"
    },
    "card_token": "example",
    "created_time": "example",
    "currency_code": "example",
    "response": {
      "code": "example",
      "memo": "example"
    },
    "state": "example",
    "token": "example",
    "type": "example",
    "user_token": "example",
    "user_transaction_time": "example"
  }
}
```

### List businesses

List the program's businesses.

**Inputs**

- Legal name (`business_name_legal`, text): Only businesses with this legal name.
- Trading name (`business_name_dba`, text): Only businesses with this trading (DBA) name.
- Records to return (`count`, number): How many records to return. Leave empty for Marqeta's default. From 1 to 100.
- Start at record (`start_index`, number): How many records to skip, for reading the next page. Leave empty to start at the first. At least 0.
- Order (`sort_by`, text): The order to list them in. Leave empty for the most recently changed first. One of: `-createdTime` (Newest first), `createdTime` (Oldest first), `-lastModifiedTime` (Most recently changed first).

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "active": true,
        "business_name_dba": "example",
        "business_name_legal": "example",
        "created_time": "example",
        "general_business_description": "example",
        "last_modified_time": "example",
        "office_location": {
          "address1": "example",
          "address2": "example",
          "city": "example",
          "country": "example",
          "postal_code": "example",
          "state": "example"
        },
        "phone": "example",
        "status": "example",
        "token": "example",
        "website": "example"
      }
    ],
    "end_index": 1,
    "is_more": true,
    "start_index": 1
  }
}
```

### List card products

List the program's card products: the templates cards are issued from.

**Inputs**

- Records to return (`count`, number): How many card products to return, up to 10. From 1 to 10.
- Start at record (`start_index`, number): How many records to skip, for reading the next page. Leave empty to start at the first. At least 0.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "active": true,
        "created_time": "example",
        "end_date": "example",
        "last_modified_time": "example",
        "name": "example",
        "start_date": "example",
        "token": "example"
      }
    ],
    "end_index": 1,
    "is_more": true,
    "start_index": 1
  }
}
```

### List card state changes

List the history of a card's state, newest first.

**Inputs**

- Card (`card_token`, text, required): The card.
- Records to return (`count`, number): How many records to return. Leave empty for Marqeta's default. From 1 to 100.
- Start at record (`start_index`, number): How many records to skip, for reading the next page. Leave empty to start at the first. At least 0.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "card_token": "example",
        "channel": "example",
        "created_time": "example",
        "fulfillment_status": "example",
        "reason": "example",
        "reason_code": "example",
        "state": "example",
        "token": "example",
        "user_token": "example"
      }
    ],
    "end_index": 1,
    "is_more": true,
    "start_index": 1
  }
}
```

### List cardholder status changes

List the history of a cardholder's status, newest first.

**Inputs**

- Cardholder (`user_token`, text, required): The cardholder (user).
- Records to return (`count`, number): How many records to return. Leave empty for Marqeta's default. From 1 to 100.
- Start at record (`start_index`, number): How many records to skip, for reading the next page. Leave empty to start at the first. At least 0.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "channel": "example",
        "created_time": "example",
        "reason": "example",
        "reason_code": "example",
        "status": "example",
        "token": "example",
        "user_token": "example"
      }
    ],
    "end_index": 1,
    "is_more": true,
    "start_index": 1
  }
}
```

### List cardholder's cards

List the cards a cardholder has.

**Inputs**

- Cardholder (`user_token`, text, required): The cardholder (user).
- Records to return (`count`, number): How many records to return. Leave empty for Marqeta's default. From 1 to 100.
- Start at record (`start_index`, number): How many records to skip, for reading the next page. Leave empty to start at the first. At least 0.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "card_product_token": "example",
        "created_time": "example",
        "expiration": "example",
        "fulfillment_status": "example",
        "instrument_type": "example",
        "last_four": "example",
        "last_modified_time": "example",
        "metadata": {},
        "state": "example",
        "state_reason": "example",
        "token": "example",
        "user_token": "example"
      }
    ],
    "end_index": 1,
    "is_more": true,
    "start_index": 1
  }
}
```

### List cardholders

List the program's cardholders (users).

**Inputs**

- Records to return (`count`, number): How many records to return. Leave empty for Marqeta's default. From 1 to 100.
- Start at record (`start_index`, number): How many records to skip, for reading the next page. Leave empty to start at the first. At least 0.
- Order (`sort_by`, text): The order to list them in. Leave empty for the most recently changed first. One of: `-createdTime` (Newest first), `createdTime` (Oldest first), `-lastModifiedTime` (Most recently changed first).

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "active": true,
        "address1": "example",
        "birth_date": "example",
        "city": "example",
        "country": "example",
        "created_time": "example",
        "email": "example",
        "first_name": "example",
        "last_modified_time": "example",
        "last_name": "example",
        "metadata": {},
        "phone": "example",
        "postal_code": "example",
        "state": "example",
        "status": "example",
        "token": "example"
      }
    ],
    "end_index": 1,
    "is_more": true,
    "start_index": 1
  }
}
```

### List transactions

List transactions, newest first, for the whole program or one cardholder, business or card.

**Inputs**

- Cardholder (`user_token`, text): The cardholder (user).
- Business (`business_token`, text): The business.
- Card (`card_token`, text): The card.
- From (`start_date`, date): Only transactions on or after this day.
- To (`end_date`, date): Only transactions on or before this day.
- States (`state`, list): Only transactions in these states. Leave empty for pending and completed ones. One or more of: `PENDING`, `CLEARED`, `COMPLETION` (Completed), `DECLINED`, `ERROR`.
- Records to return (`count`, number): How many records to return. Leave empty for Marqeta's default. From 1 to 100.
- Start at record (`start_index`, number): How many records to skip, for reading the next page. Leave empty to start at the first. At least 0.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "amount": 1,
        "business_token": "example",
        "card_acceptor": {
          "city": "example",
          "country_code": "example",
          "mcc": "example",
          "name": "example",
          "state": "example"
        },
        "card_token": "example",
        "created_time": "example",
        "currency_code": "example",
        "response": {
          "code": "example",
          "memo": "example"
        },
        "state": "example",
        "token": "example",
        "type": "example",
        "user_token": "example",
        "user_transaction_time": "example"
      }
    ],
    "end_index": 1,
    "is_more": true,
    "start_index": 1
  }
}
```

### Search cardholders

Find cardholders by email, phone or the start of their name.

**Inputs**

- Email (`email`, text): The exact email (not case-sensitive).
- First name (`first_name`, text): The start of the first name.
- Last name (`last_name`, text): The start of the last name.
- Phone (`phone`, text): The phone number.
- Records to return (`count`, number): How many records to return. Leave empty for Marqeta's default. From 1 to 100.
- Start at record (`start_index`, number): How many records to skip, for reading the next page. Leave empty to start at the first. At least 0.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "count": 1,
    "data": [
      {
        "active": true,
        "address1": "example",
        "birth_date": "example",
        "city": "example",
        "country": "example",
        "created_time": "example",
        "email": "example",
        "first_name": "example",
        "last_modified_time": "example",
        "last_name": "example",
        "metadata": {},
        "phone": "example",
        "postal_code": "example",
        "state": "example",
        "status": "example",
        "token": "example"
      }
    ],
    "end_index": 1,
    "is_more": true,
    "start_index": 1
  }
}
```

### Update cardholder

Change a cardholder's details. Fields left empty stay as they are.

**Inputs**

- Cardholder (`user_token`, text, required): The cardholder (user).
- First name (`first_name`, text): The cardholder's legal first name.
- Last name (`last_name`, text): The cardholder's legal last name.
- Email (`email`, text): The cardholder's email. Each user's must be unique.
- Phone (`phone`, text): The phone number with its country code, such as +15105551212.
- Address (`address1`, text): The street address. Not a PO box.
- City (`city`, text): The city.
- State (`state`, text): The state or province, such as CA.
- Postal code (`postal_code`, text): The postal code.
- Country (`country`, text): The country, such as USA.
- Date of birth (`birth_date`, date): The cardholder's date of birth.
- Metadata (`metadata`, object): Your own name and value pairs to keep with the cardholder.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "active": true,
    "address1": "example",
    "birth_date": "example",
    "city": "example",
    "country": "example",
    "created_time": "example",
    "email": "example",
    "first_name": "example",
    "last_modified_time": "example",
    "last_name": "example",
    "metadata": {},
    "phone": "example",
    "postal_code": "example",
    "state": "example",
    "status": "example",
    "token": "example"
  }
}
```

### Update program funding source

Rename a program funding source, or turn it off so it can no longer fund accounts.

**Inputs**

- Funding source token (`funding_source_token`, text, required): The program funding source's token, from Create program funding source or your Marqeta dashboard.
- Name (`name`, text): The new name.
- Active (`active`, true/false): On lets the funding source fund accounts; off stops it.

**Outputs**

- `data` (object): The response from Marqeta.

**Example output**

```json
{
  "data": {
    "account": "example",
    "active": true,
    "created_time": "example",
    "last_modified_time": "example",
    "name": "example",
    "token": "example"
  }
}
```
