---
updatedAt: 2026-06-05T22:10:56.000Z
agentTools:
  projectIndex: https://docs.astra.finance/llms.txt
---

# Create a Card for a User

> 📘
>
> You can place the bearer `access_token` for a specific user into the Authentication section of this documentation 👉.

Cards can be created directly through the API using this PCI-compliant endpoint.

Cards can also be created through the OAuth Module by selecting the **Connect New Debit Card** button.

Astra authorizes the card with the issuer before returning it. When the issuer refuses the card, the response is a `400` carrying `embedded_error.code` of `card_authorization_declined`, and the same card will be refused again. When no decision was reached about the card, the response is a `429` with `card_authorization_throttled` or a `503` with `card_authorization_unavailable`, and the same request can be retried.

Cards on Discover, Diners Club, UnionPay, Maestro and private-label networks, whose card numbers begin with 6, require an enhanced client configuration. A card on one of these networks is rejected with a `403` for clients without it. Please contact customer support if you are interested in accepting them.

For Unit customers, please reference their technical documentation below to learn more about enabling card to card payments. [Enabling Card to Card Payments with Unit & Astra](https://guides.unit.co/partnerships/astra/)

> ❗️ This resource requires the use of the secure endpoint.
>
> | Environment | Secure Endpoint                                   |
> |-------------|---------------------------------------------------|
> | Production  | https://secure.api.astra.finance/v1/cards         |
> | Sandbox     | https://secure.api-sandbox.astra.finance/v1/cards |

**Retrying a card add.** Send an optional `Idempotency-Key` header, unique to each card add (for example a UUID), and resend the same key, with the same request unchanged, when you retry that request. A retry with the same key within 24 hours returns the same card, as it is now, without authorizing it again. Reusing a key with a different request, such as a different card, cardholder or billing address, returns a `422`. `card_security_code` is not compared, as a tokenized security code may differ between retries. If the first request is still being processed, a retry may return a `409` with a `Retry-After` header: wait that many seconds and retry. To add a card again, for example after it was removed, use a new key. Requests without the header behave as before.


# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Astra Developer API",
    "description": "Astra's public API endpoints available to our customers.",
    "version": "1.0.0"
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "headers": {
      "request-id": {
        "description": "Unique ID returned with each API response",
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "generic_error": {
        "type": "object",
        "properties": {
          "code": {
            "description": "Response code",
            "type": "integer"
          },
          "name": {
            "description": "Name of response code",
            "type": "string"
          },
          "description": {
            "description": "Error message",
            "type": "string"
          }
        }
      },
      "validation_error": {
        "type": "object",
        "properties": {
          "status_code": {
            "description": "HTTP Response code",
            "type": "integer"
          },
          "description": {
            "description": "Object of invalid fields with accompanying descriptions",
            "type": "object"
          }
        }
      },
      "card_authorization_error": {
        "allOf": [
          {
            "$ref": "#/components/schemas/generic_error"
          },
          {
            "type": "object",
            "properties": {
              "embedded_error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Why Astra could not authorize the card. Returned by `POST /v1/cards`.",
                    "enum": [
                      "card_authorization_declined",
                      "card_authorization_throttled",
                      "card_authorization_unavailable"
                    ]
                  }
                }
              }
            }
          }
        ]
      }
    },
    "examples": {
      "generic_error_unauthorized": {
        "summary": "Invalid or Expired Access Token",
        "value": {
          "code": 401,
          "name": "Unauthorized",
          "description": null
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api-sandbox.astra.finance",
      "description": "Sandbox Environment"
    },
    {
      "url": "https://secure.api-sandbox.astra.finance",
      "description": "Secure Sandbox URL"
    }
  ],
  "tags": [
    {
      "name": "Cards"
    }
  ],
  "paths": {
    "/v1/cards": {
      "post": {
        "tags": [
          "Cards"
        ],
        "summary": "Create a Card for a User",
        "servers": [
          {
            "url": "https://secure.api-sandbox.astra.finance",
            "description": "Secure Sandbox URL"
          }
        ],
        "description": "> 📘\n>\n> You can place the bearer `access_token` for a specific user into the Authentication section of this documentation 👉.\n\nCards can be created directly through the API using this PCI-compliant endpoint.\n\nCards can also be created through the OAuth Module by selecting the **Connect New Debit Card** button.\n\nAstra authorizes the card with the issuer before returning it. When the issuer refuses the card, the response is a `400` carrying `embedded_error.code` of `card_authorization_declined`, and the same card will be refused again. When no decision was reached about the card, the response is a `429` with `card_authorization_throttled` or a `503` with `card_authorization_unavailable`, and the same request can be retried.\n\nCards on Discover, Diners Club, UnionPay, Maestro and private-label networks, whose card numbers begin with 6, require an enhanced client configuration. A card on one of these networks is rejected with a `403` for clients without it. Please contact customer support if you are interested in accepting them.\n\nFor Unit customers, please reference their technical documentation below to learn more about enabling card to card payments. [Enabling Card to Card Payments with Unit & Astra](https://guides.unit.co/partnerships/astra/)\n\n> ❗️ This resource requires the use of the secure endpoint.\n>\n> | Environment | Secure Endpoint                                   |\n> |-------------|---------------------------------------------------|\n> | Production  | https://secure.api.astra.finance/v1/cards         |\n> | Sandbox     | https://secure.api-sandbox.astra.finance/v1/cards |\n\n**Retrying a card add.** Send an optional `Idempotency-Key` header, unique to each card add (for example a UUID), and resend the same key, with the same request unchanged, when you retry that request. A retry with the same key within 24 hours returns the same card, as it is now, without authorizing it again. Reusing a key with a different request, such as a different card, cardholder or billing address, returns a `422`. `card_security_code` is not compared, as a tokenized security code may differ between retries. If the first request is still being processed, a retry may return a `409` with a `Retry-After` header: wait that many seconds and retry. To add a card again, for example after it was removed, use a new key. Requests without the header behave as before.\n",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "A key unique to this card add, resent unchanged on each retry of it. 1 to 255 characters; a UUID is recommended. Keys are kept for 24 hours per client.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "example": "5f0c8b9e-2d4a-4c7e-9b1a-3e6f2a7d8c41"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "card_number": {
                    "type": "string",
                    "description": "The card number the User"
                  },
                  "card_security_code": {
                    "type": "string",
                    "description": "The card security code"
                  },
                  "expiration_date": {
                    "type": "string",
                    "description": "The card expiration date"
                  },
                  "first_name": {
                    "type": "string",
                    "description": "The card owner's first name"
                  },
                  "last_name": {
                    "type": "string",
                    "description": "The card owner's last name"
                  },
                  "street_line_1": {
                    "type": "string",
                    "description": "The street line 1 of the card billing address"
                  },
                  "street_line_2": {
                    "type": "string",
                    "description": "The street line 2 of the card billing address"
                  },
                  "city": {
                    "type": "string",
                    "description": "The city of the card billing address"
                  },
                  "state": {
                    "type": "string",
                    "description": "The US State of the card billing address"
                  },
                  "zip_code": {
                    "type": "string",
                    "description": "The zip code of the card billing address"
                  },
                  "added_by_user": {
                    "type": "boolean",
                    "description": "Set to `false` for client-issued debit cards. Set to `true` for externally linked debit cards. Defaults to `false` if not provided"
                  }
                },
                "required": [
                  "card_number",
                  "card_security_code",
                  "expiration_date",
                  "first_name",
                  "last_name",
                  "street_line_1",
                  "city",
                  "state",
                  "zip_code"
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "headers": {
              "request-id": {
                "$ref": "#/components/headers/request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Unique card ID"
                    },
                    "active": {
                      "type": "boolean",
                      "description": "Whether or not the card is active with the issuing bank"
                    },
                    "address_verified": {
                      "type": "boolean",
                      "description": "AVS response from debit networks"
                    },
                    "card_company": {
                      "type": "string",
                      "description": "Name of card company"
                    },
                    "card_fingerprint": {
                      "type": "string",
                      "description": "A unique identifier derived from the card number"
                    },
                    "card_type": {
                      "type": "string",
                      "description": "The type of card",
                      "enum": [
                        "debit",
                        "prepaid",
                        "credit",
                        "unknown"
                      ]
                    },
                    "city": {
                      "type": "string",
                      "description": "The city of the card billing address"
                    },
                    "created": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Date and time of card creation"
                    },
                    "expiration_date": {
                      "type": "string",
                      "description": "Month/Year of card expiration"
                    },
                    "first_name": {
                      "type": "string",
                      "description": "The first name of card user"
                    },
                    "first_six_digits": {
                      "type": "string",
                      "description": "The provided Bank Identification Number (BIN)"
                    },
                    "last_four_digits": {
                      "type": "string",
                      "description": "Last 4 digits of the card number"
                    },
                    "last_name": {
                      "type": "string",
                      "description": "The last name of card user"
                    },
                    "name_verification_result": {
                      "type": "string",
                      "description": "The ANI results from the issuing bank of the card",
                      "enum": [
                        "Match",
                        "No Match",
                        "Partial Match",
                        "Unknown"
                      ]
                    },
                    "product_type": {
                      "type": "string",
                      "description": "The product type of the card",
                      "enum": [
                        "Consumer",
                        "Business",
                        "Commercial",
                        "Unknown"
                      ]
                    },
                    "pull_enabled": {
                      "type": "boolean",
                      "description": "Whether or not the card is enabled for pull transactions"
                    },
                    "push_enabled": {
                      "type": "boolean",
                      "description": "Whether or not the card is enabled for push transactions"
                    },
                    "aft_enabled": {
                      "type": "boolean",
                      "description": "If true, this card is allowed to be used as a source in routines."
                    },
                    "oct_enabled": {
                      "type": "boolean",
                      "description": "If true, this card is allowed to be used as a desetination in routines."
                    },
                    "removed": {
                      "type": "boolean",
                      "description": "Whether or not the user has removed the card"
                    },
                    "review_reasons": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "description": "The review reason code (see [Card Review Reasons](ref:card-review-statuses#review-reasons))"
                          },
                          "description": {
                            "type": "string",
                            "description": "The review reason description (see [Card Review Reasons](ref:card-review-statuses#review-reasons))"
                          }
                        }
                      }
                    },
                    "reviewed_at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "The date and time the Card was reviewed"
                    },
                    "review_status": {
                      "type": "string",
                      "description": "(Deprecated) Review status of the card",
                      "enum": [
                        "approved",
                        "flagged",
                        "rejected"
                      ]
                    },
                    "state": {
                      "type": "string",
                      "description": "Card address state"
                    },
                    "status": {
                      "type": "string",
                      "description": "The status of the card ([Card Statuses](ref:card-review-statuses#card-statuses))",
                      "enum": [
                        "approved",
                        "flagged",
                        "rejected",
                        "removed"
                      ]
                    },
                    "street_line_1": {
                      "type": "string",
                      "description": "The street line 1 of the card billing address"
                    },
                    "street_line_2": {
                      "type": "string",
                      "description": "The street line 2 of the card billing address"
                    },
                    "zip_code": {
                      "type": "string",
                      "description": "The zip code of the card billing address"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "request-id": {
                "$ref": "#/components/headers/request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/validation_error"
                    },
                    {
                      "$ref": "#/components/schemas/card_authorization_error"
                    }
                  ]
                },
                "examples": {
                  "missing_required_field": {
                    "summary": "Missing Field Errors",
                    "value": {
                      "status_code": 400,
                      "description": [
                        {
                          "card_number": "Please provide a card_number."
                        },
                        {
                          "card_security_code": "Please provide a card_security_code."
                        },
                        {
                          "street_line_1": "Missing data for required field."
                        },
                        {
                          "city": "Missing data for required field."
                        },
                        {
                          "state": "Missing data for required field."
                        },
                        {
                          "zip_code": "Missing data for required field."
                        }
                      ]
                    }
                  },
                  "first_name_validation": {
                    "summary": "first_name Validation",
                    "value": {
                      "status_code": 400,
                      "description": [
                        {
                          "first_name": [
                            "First name must be at least two characters.",
                            "First name must be forty characters or less.",
                            "First name contains invalid characters."
                          ]
                        }
                      ]
                    }
                  },
                  "last_name_validation": {
                    "summary": "last_name Validation",
                    "value": {
                      "status_code": 400,
                      "description": [
                        {
                          "last_name": [
                            "Last name must be at least two characters.",
                            "Last name must be forty characters or less.",
                            "Last name contains invalid characters."
                          ]
                        }
                      ]
                    }
                  },
                  "invalid_expiration_date": {
                    "summary": "Invalid Expiration Date",
                    "value": {
                      "status_code": 400,
                      "description": [
                        {
                          "expiration_date": "Expiration date is invalid."
                        }
                      ]
                    }
                  },
                  "invalid_oauth_client": {
                    "summary": "Invalid OAuth Client",
                    "value": {
                      "status_code": 400,
                      "description": [
                        {
                          "oauth_client_id_created_by": "OAuth Client is invalid."
                        }
                      ]
                    }
                  },
                  "card_authorization_declined": {
                    "summary": "Card Declined by the Issuer",
                    "value": {
                      "code": 400,
                      "name": "Bad Request",
                      "description": "This card could not be authorized. Check the card details or use a different card.",
                      "embedded_error": {
                        "code": "card_authorization_declined"
                      }
                    }
                  },
                  "invalid_idempotency_key": {
                    "summary": "Invalid Idempotency-Key",
                    "value": {
                      "code": 400,
                      "name": "Bad Request",
                      "description": "Idempotency-Key must be 1 to 255 characters."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "request-id": {
                "$ref": "#/components/headers/request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/generic_error"
                },
                "examples": {
                  "generic_error_unauthorized": {
                    "$ref": "#/components/examples/generic_error_unauthorized"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "request-id": {
                "$ref": "#/components/headers/request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/generic_error"
                },
                "examples": {
                  "blacklisted_card": {
                    "summary": "Blacklisted Card",
                    "value": {
                      "code": 403,
                      "name": "Forbidden",
                      "description": "This card is not authorized for use."
                    }
                  },
                  "max_cards": {
                    "summary": "Maximum Card Limit Per User",
                    "value": {
                      "code": 403,
                      "name": "Forbidden",
                      "description": "User has reached allowed debit card limit."
                    }
                  },
                  "unsupported_network": {
                    "summary": "Card Network Not Enabled",
                    "value": {
                      "code": 403,
                      "name": "Forbidden",
                      "description": "This card network is not supported at this time."
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflict. A card add with this `Idempotency-Key` is still in progress. Wait for the number of seconds in `Retry-After` and retry with the same key.",
            "headers": {
              "request-id": {
                "$ref": "#/components/headers/request-id"
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status_code": {
                      "description": "Response code",
                      "type": "integer"
                    },
                    "name": {
                      "description": "Name of the error",
                      "type": "string"
                    },
                    "description": {
                      "description": "Error message",
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "idempotent_request_conflict": {
                    "summary": "Card Add In Progress",
                    "value": {
                      "status_code": 409,
                      "name": "IdempotentRequestConflictDetected",
                      "description": "A card add with this Idempotency-Key is in progress."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity. The `Idempotency-Key` was already used for a different request. Use a new key for a new card add.",
            "headers": {
              "request-id": {
                "$ref": "#/components/headers/request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status_code": {
                      "description": "Response code",
                      "type": "integer"
                    },
                    "name": {
                      "description": "Name of the error",
                      "type": "string"
                    },
                    "description": {
                      "description": "Error message",
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "idempotency_key_reused": {
                    "summary": "Idempotency-Key Reused",
                    "value": {
                      "status_code": 422,
                      "name": "IdempotencyKeyReused",
                      "description": "Idempotency-Key was already used for a different card."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "request-id": {
                "$ref": "#/components/headers/request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/card_authorization_error"
                },
                "examples": {
                  "card_authorization_throttled": {
                    "summary": "Card Authorization Throttled",
                    "value": {
                      "code": 429,
                      "name": "Too Many Requests",
                      "description": "Card authorization is temporarily unavailable. Retry shortly.",
                      "embedded_error": {
                        "code": "card_authorization_throttled"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "request-id": {
                "$ref": "#/components/headers/request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/generic_error"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "request-id": {
                "$ref": "#/components/headers/request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/card_authorization_error"
                },
                "examples": {
                  "card_authorization_unavailable": {
                    "summary": "Card Authorization Unavailable",
                    "value": {
                      "code": 503,
                      "name": "Service Unavailable",
                      "description": "Card authorization is temporarily unavailable. Retry shortly.",
                      "embedded_error": {
                        "code": "card_authorization_unavailable"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true,
    "samples-enabled": true
  }
}
```