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

# Create card subscription

> Create a recurring subscription charged through card

Creates a card subscription.

## Body parameters

<ParamField body="identifier" type="string" required>
  Unique identifier for this subscription in your application.
</ParamField>

<ParamField body="amount" type="number" required>
  Subscription charge amount.
</ParamField>

<ParamField body="client" type="object" required>
  Customer information.
</ParamField>

<ParamField body="client.name" type="string" required>
  Customer full name.
</ParamField>

<ParamField body="client.email" type="string" required>
  Customer email address.
</ParamField>

<ParamField body="client.phone" type="string" required>
  Customer phone number.
</ParamField>

<ParamField body="client.document" type="string" required>
  Customer document.
</ParamField>

<ParamField body="clientIp" type="string" required>
  IPv4 of the customer performing the subscription transaction.
</ParamField>

<ParamField body="card" type="object" required>
  Card data used for recurring charges.
</ParamField>

<ParamField body="card.number" type="string" required>
  Card number.
</ParamField>

<ParamField body="card.owner" type="string" required>
  Cardholder name.
</ParamField>

<ParamField body="card.expiresAt" type="string" required>
  Card expiration date in `YYYY-MM` format.
</ParamField>

<ParamField body="card.cvv" type="string" required>
  Card security code.
</ParamField>

<ParamField body="card.statementDescriptor" type="string">
  Statement descriptor displayed on the card charge.
</ParamField>

<ParamField body="product" type="object" required>
  Product associated with the subscription.
</ParamField>

<ParamField body="subscription" type="object" required>
  Recurrence configuration.
</ParamField>

<ParamField body="callbackUrl" type="string">
  URL that will receive subscription webhook notifications.
</ParamField>

## Request example

<RequestExample>
  ```bash theme={null}
  curl --request POST \
    --url https://app.amplopay.com/api/v1/gateway/card/subscription \
    --header 'Content-Type: application/json' \
    --header 'x-public-key: SUA_CHAVE_PUBLICA_AQUI' \
    --header 'x-secret-key: SUA_CHAVE_PRIVADA_AQUI' \
    --data '{
      "identifier": "assinatura-card-123",
      "amount": 97,
      "client": {
        "name": "João da Silva",
        "email": "joao@email.com",
        "phone": "(11) 99999-9999",
        "document": "123.456.789-00"
      },
      "clientIp": "127.0.0.1",
      "card": {
        "number": "4111111111111111",
        "owner": "JOAO DA SILVA",
        "expiresAt": "2030-12",
        "cvv": "123",
        "statementDescriptor": "MINHA LOJA"
      },
      "product": {
        "id": "plano-mensal",
        "name": "Plano mensal",
        "price": 97
      },
      "subscription": {
        "periodicityType": "MONTHS",
        "periodicity": 1,
        "firstChargeIn": 0
      },
      "callbackUrl": "https://example.com/webhooks/payment"
    }'
  ```
</RequestExample>

## Payload example

```json theme={null}
{
  "identifier": "assinatura-card-123",
  "amount": 97,
  "client": {
    "name": "João da Silva",
    "email": "joao@email.com",
    "phone": "(11) 99999-9999",
    "document": "123.456.789-00"
  },
  "clientIp": "127.0.0.1",
  "card": {
    "number": "4111111111111111",
    "owner": "JOAO DA SILVA",
    "expiresAt": "2030-12",
    "cvv": "123",
    "statementDescriptor": "MINHA LOJA"
  },
  "product": {
    "id": "plano-mensal",
    "name": "Plano mensal",
    "price": 97
  },
  "subscription": {
    "periodicityType": "MONTHS",
    "periodicity": 1,
    "firstChargeIn": 0
  },
  "callbackUrl": "https://example.com/webhooks/payment"
}
```
