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

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Create Card

> Adds a card on file to an existing merchant.

`square.createCard` adds a card on file to an existing merchant.

## Example

```ts automations/square-create-card.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { square } from "automate.ax/square"

export default automation("Create Square Card", () => {
  onDashboardRun({ title: "Create Square Card" })

  square.createCard({
    idempotencyKey: "4935a656-a929-4792-b97c-8848be85c27c",
    sourceId: "cnon:uIbfJXhXETSP197M3GB",
    card: {
      cardholderName: "Amelia Earhart",
      billingAddress: {
        addressLine1: "500 Electric Ave",
        addressLine2: "Suite 600",
        locality: "New York",
        administrativeDistrictLevel1: "NY",
        postalCode: "10003",
        country: "US",
      },
      customerId: "VDKXEEKPJN48QDG3BGGFAK05P8",
      referenceId: "user-id-1",
    },
  })
})
```

## Inputs

Every input accepts a compatible signal. It requires `PAYMENTS_WRITE`.

| Field               | Type          | Required | Default | Description                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------- | ------------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `idempotencyKey`    | `string`      | Yes      | —       | A unique string that identifies this CreateCard request. Keys can be any valid string and must be unique for every request. Max: 45 characters See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.                                                                                                                 |
| `sourceId`          | `string`      | Yes      | —       | The ID of the source which represents the card information to be stored. This can be a card nonce or a payment id.                                                                                                                                                                                                                                                                            |
| `verificationToken` | `string`      | No       | —       | An identifying token generated by [Payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer). Verification tokens encapsulate customer device information and 3-D Secure challenge results to indicate that Square has verified the buyer identity. See the [SCA Overview](https://developer.squareup.com/docs/sca-overview). |
| `card`              | `Square.Card` | Yes      | —       | Payment details associated with the card to be stored.                                                                                                                                                                                                                                                                                                                                        |

Use the official [CreateCard reference](https://developer.squareup.com/reference/square/cards-api/create-card) for provider field semantics and limits.

## Output

Returns the official `Square.CreateCardResponse` response as a codec-safe object. Square integer money amounts remain `bigint` values.
