> ## Documentation Index
> Fetch the complete documentation index at: https://explore.airia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Stripe

> Read your Stripe account balance and manage charges and customers from inside an agent workflow.

Stripe actions let an agent work with payments data directly in a flow. An agent can look up the account balance, create and update charges, and manage customer records, then pass the results to later steps.

## Supported actions

| Group        | Actions                              |
| ------------ | ------------------------------------ |
| **Balance**  | Get                                  |
| **Charge**   | Create, Get, Get All, Update         |
| **Customer** | Create, Get, Get All, Update, Delete |

## Prerequisites

<AccordionGroup>
  <Accordion title="Create a Stripe credential" icon="key">
    Generate a secret API key in your Stripe dashboard under **Developers, API keys**, then store it as a **Stripe API key** credential in [Credential Management](/admin-hub/account_settings/credential-management). Select that credential on every Stripe action.
  </Accordion>
</AccordionGroup>

## How to use these actions

* **Amounts are in the smallest currency unit.** A charge of one US dollar is an **Amount** of `100`, not `1.00`.
* **Map text inputs from earlier steps.** Inputs such as **Customer ID**, **Currency**, and **Description** accept a value mapped from a previous step. Numeric inputs such as **Amount** and **Limit**, and the **Metadata** key value set, take fixed values.
* **Pagination uses cursors.** The Get All actions return a page of results. To page through more, pass the ID of the last item you saw into **Starting After** on the next call, or use **Ending Before** to page backward.
* **Reading output.** Each action returns the Stripe object it acted on, including its generated ID. Map that ID into a later step, for example to charge a customer you just created.

## Actions

### Balance

#### Stripe Balance Get

Retrieves the current Stripe account balance.

This action takes no inputs beyond the credential.

### Charge

#### Stripe Charge Create

Creates a new charge.

| Input             | Required | Description                                                                          |
| ----------------- | -------- | ------------------------------------------------------------------------------------ |
| **Amount**        | Yes      | Amount to charge in the smallest currency unit, for example `100` for one US dollar. |
| **Currency**      | Yes      | Three letter ISO currency code. Defaults to `usd`.                                   |
| **Customer ID**   | No       | The ID of an existing customer to charge.                                            |
| **Source**        | No       | A payment source to charge, such as a card token or source ID.                       |
| **Description**   | No       | An arbitrary description for the charge statement.                                   |
| **Receipt Email** | No       | Email address to send the receipt to.                                                |
| **Metadata**      | No       | A set of key value pairs for additional information.                                 |

#### Stripe Charge Get

Retrieves a charge by ID.

| Input         | Required | Description                                      |
| ------------- | -------- | ------------------------------------------------ |
| **Charge ID** | Yes      | The unique identifier of the charge to retrieve. |

#### Stripe Charge Get All

Lists charges.

| Input              | Required | Description                                         |
| ------------------ | -------- | --------------------------------------------------- |
| **Limit**          | No       | Maximum number of charges to return, from 1 to 100. |
| **Starting After** | No       | Pagination cursor. The charge ID to start after.    |
| **Ending Before**  | No       | Pagination cursor. The charge ID to end before.     |
| **Customer ID**    | No       | Return only charges that belong to this customer.   |

#### Stripe Charge Update

Updates an existing charge.

| Input             | Required | Description                                          |
| ----------------- | -------- | ---------------------------------------------------- |
| **Charge ID**     | Yes      | The unique identifier of the charge to update.       |
| **Description**   | No       | An arbitrary description for the charge.             |
| **Receipt Email** | No       | Email address to send the receipt to.                |
| **Metadata**      | No       | A set of key value pairs for additional information. |

### Customer

#### Stripe Customer Create

Creates a new customer.

| Input           | Required | Description                                          |
| --------------- | -------- | ---------------------------------------------------- |
| **Email**       | No       | The customer's email address.                        |
| **Name**        | No       | The customer's full or business name.                |
| **Phone**       | No       | The customer's phone number.                         |
| **Description** | No       | An arbitrary description of the customer.            |
| **Metadata**    | No       | A set of key value pairs for additional information. |

#### Stripe Customer Get

Retrieves a customer by ID.

| Input           | Required | Description                                        |
| --------------- | -------- | -------------------------------------------------- |
| **Customer ID** | Yes      | The unique identifier of the customer to retrieve. |

#### Stripe Customer Get All

Lists customers.

| Input              | Required | Description                                           |
| ------------------ | -------- | ----------------------------------------------------- |
| **Limit**          | No       | Maximum number of customers to return, from 1 to 100. |
| **Starting After** | No       | Pagination cursor. The customer ID to start after.    |
| **Ending Before**  | No       | Pagination cursor. The customer ID to end before.     |
| **Email**          | No       | Return only customers with this email address.        |

#### Stripe Customer Update

Updates an existing customer.

| Input           | Required | Description                                          |
| --------------- | -------- | ---------------------------------------------------- |
| **Customer ID** | Yes      | The unique identifier of the customer to update.     |
| **Email**       | No       | The customer's email address.                        |
| **Name**        | No       | The customer's full or business name.                |
| **Phone**       | No       | The customer's phone number.                         |
| **Description** | No       | An arbitrary description of the customer.            |
| **Metadata**    | No       | A set of key value pairs for additional information. |

#### Stripe Customer Delete

Deletes a customer.

| Input           | Required | Description                                      |
| --------------- | -------- | ------------------------------------------------ |
| **Customer ID** | Yes      | The unique identifier of the customer to delete. |

## Example

An agent that bills a customer for an approved invoice:

<Steps>
  <Step title="Find or create the customer">
    A **Stripe Customer Get All** action filters by the buyer's **Email**. A later branch creates the customer with **Stripe Customer Create** if none was found.
  </Step>

  <Step title="Create the charge">
    A **Stripe Charge Create** action maps **Customer ID** to the customer from the previous step, sets **Amount** and **Currency**, and adds a **Description** that references the invoice number.
  </Step>

  <Step title="Confirm">
    A model step summarizes the charge result, including the returned charge ID, for the activity log.
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Amount must be a positive integer" icon="triangle-exclamation">
    **Amount** is in the smallest currency unit and must be `1` or greater. Send `100` for one US dollar, not `1.00`.
  </Accordion>

  <Accordion title="Authentication failed" icon="lock">
    Confirm the stored key is a valid Stripe secret key and has not been rolled. A restricted key must include permission for the resource you are calling.
  </Accordion>

  <Accordion title="No such customer or charge" icon="circle-question">
    The ID you passed does not exist in the environment the key belongs to. A key from test mode cannot read live objects and the reverse is also true.
  </Accordion>
</AccordionGroup>

For issues common to every vendor, see the [Actions overview](/building-and-deploying-agents/agent-basics/actions/overview#troubleshooting).
