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"
}'
Endpoints
Create card subscription
Create a recurring subscription charged through card
POST
/
gateway
/
card
/
subscription
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"
}'
Creates a card subscription.
Body parameters
string
required
Unique identifier for this subscription in your application.
number
required
Subscription charge amount.
object
required
Customer information.
string
required
Customer full name.
string
required
Customer email address.
string
required
Customer phone number.
string
required
Customer document.
string
required
IPv4 of the customer performing the subscription transaction.
object
required
Card data used for recurring charges.
string
required
Card number.
string
required
Cardholder name.
string
required
Card expiration date in
YYYY-MM format.string
required
Card security code.
string
Statement descriptor displayed on the card charge.
object
required
Product associated with the subscription.
object
required
Recurrence configuration.
string
URL that will receive subscription webhook notifications.
Request example
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"
}'
Payload example
{
"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"
}
Was this page helpful?

