It is possible to create a scheduled recurrence that does not authorize the transaction immediately but schedules a future transaction instead. This action is called scheduling recurrence and has two characteristics:
- To not authorize the transaction at the time it is created, send
AuthorizeNow
as "false"; - Send the
StartDate
parameter, which determines the start date of the recurring charge.
Before scheduling a scheduled recurrence, use Zero Auth to validate the card. This way, you ensure that you are scheduling the recurrence with a valid card.
Accepted payment method: credit card.
Requisição
Environment | Method | Endpoint |
---|---|---|
Sandbox | post | https://apisandbox.cieloecommerce.cielo.com.br/1/sales/ |
Production | post | https://api.cieloecommerce.cielo.com.br/1/sales/ |
{
"MerchantOrderId": "2014113245231706",
"Customer": {
"Name": "Comprador rec programada"
},
"Payment": {
"Type": "CreditCard",
"Amount": 1500,
"Installments": 1,
"SoftDescriptor": "123456789ABCD",
"RecurrentPayment": {
"AuthorizeNow": "false",
"EndDate": "2030-12-01",
"Interval": "SemiAnnual",
"StartDate": "2025-02-01"
},
"CreditCard": {
"CardNumber": "1234123412341231",
"Holder": "Teste Holder",
"ExpirationDate": "12/2030",
"SecurityCode": "262",
"Brand": "Visa"
}
}
}
curl
--request POST "https://apisandbox.cieloecommerce.cielo.com.br/1/sales/"
--header "Content-Type: application/json"
--header "MerchantId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
--header "MerchantKey: 0123456789012345678901234567890123456789"
--header "RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
--data-binary
{
"MerchantOrderId":"2014113245231706",
"Customer":{
"Name":"Comprador rec programada"
},
"Payment":{
"Type":"CreditCard",
"Amount":1500,
"Installments":1,
"SoftDescriptor":"123456789ABCD",
"RecurrentPayment":{
"AuthorizeNow":"false",
"EndDate":"2019-12-01",
"Interval":"SemiAnnual",
"StartDate":"2015-06-01"
},
"CreditCard":{
"CardNumber":"1234123412341231",
"Holder":"Teste Holder",
"ExpirationDate":"12/2030",
"SecurityCode":"262",
"Brand":"Visa"
}
}
}
--verbose
Parâmetros no header
Parameter | Type | Size | Required | Description |
---|---|---|---|---|
MerchantId | Store identifier in API E-commerce Cielo. | String | 6 | Yes |
MerchantKey | Public Key for Double Authentication in API E-commerce Cielo. | String | 40 | Yes |
RequestId | Request identifier, used when the merchant uses different servers for each GET/POST/PUT. | String | 36 | No |
Parâmetros no body
Parameter | Type | Size | Required | Description |
---|---|---|---|---|
MerchantOrderId | Order identification number. Warning: Allowed characters are a-z, A-Z, 0-9. Special characters and blank spaces are not allowed. | String | 50 | Sim |
Customer.Name | Shopper's name. | String | 255 | Sim |
Payment.Type | Type of the Payment Method. | String | 100 | Sim |
Payment.Amount | Order Amount (to be sent in cents). | Número | 15 | Sim |
Payment.Installments | Number of installments. As this is a recurrence, the number of installments will be 1. | Número | 2 | Sim |
Payment.SoftDescriptor | Text that will be printed on the carrier's bank invoice - Available only for VISA/MASTER - does not allow special characters | String | 13 | Não |
Payment.RecurrentPayment.AuthorizeNow | Boolean to know if the first recurrence is going to be Authorized or not. | Boolean | - | Sim |
Payment.RecurrentPayment.StartDate | Start date of recurrence. | Boolean | - | Sim |
Payment.RecurrentPayment.EndDate | End date of recurrence. | String | 10 | Não |
Payment.RecurrentPayment.Interval | Recurrence interval. - Monthly (Default) - Bimonthly - Quarterly - SemiAnnual - Annual | String | 10 | Não |
Payment.RecurrentPayment.AuthorizeNow | Boolean to know if the first recurrence is going to be Authorized or not. | Boolean | *** | Sim |
CreditCard.CardNumber | Shopper's Card Number. | String | 19 | Sim |
CreditCard.Holder | Shopper's name printed on card. | String | 25 | Sim |
CreditCard.ExpirationDate | Expiration date printed on card. | String | 7 | Sim |
CreditCard.SecurityCode | Security code printed on back of card. | String | 4 | Não |
CreditCard.Brand | Card brand. | String | 10 | Sim |
Resposta
{
"MerchantOrderId": "2014113245231706",
"Customer": {
"Name": "Comprador rec programada"
},
"Payment": {
"ServiceTaxAmount": 0,
"Installments": 1,
"Interest": "ByMerchant",
"Capture": false,
"Authenticate": false,
"Recurrent": false,
"CreditCard": {
"CardNumber": "123412******1231",
"Holder": "Teste Holder",
"ExpirationDate": "12/2030",
"SaveCard": false,
"Brand": "Visa"
},
"SoftDescriptor": "123456789ABCD",
"Type": "CreditCard",
"Amount": 1500,
"Currency": "BRL",
"Country": "BRA",
"ExtraDataCollection": [],
"Status": 20,
"RecurrentPayment": {
"RecurrentPaymentId": "0d2ff85e-594c-47b9-ad27-bb645a103db4",
"NextRecurrency": "2015-06-01",
"StartDate": "2015-06-01",
"EndDate": "2019-12-01",
"Interval": "SemiAnnual",
"Link": {
"Method": "GET",
"Rel": "recurrentPayment",
"Href": "https://apiquerysandbox.cieloecommerce.cielo.com.br/1/RecurrentPayment/{PaymentId}"
},
"AuthorizeNow": false
}
}
}
--header "Content-Type: application/json"
--header "RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
--data-binary
{
"MerchantOrderId": "2014113245231706",
"Customer": {
"Name": "Comprador rec programada"
},
"Payment": {
"ServiceTaxAmount": 0,
"Installments": 1,
"Interest": "ByMerchant",
"Capture": false,
"Authenticate": false,
"Recurrent": false,
"CreditCard": {
"CardNumber": "123412******1231",
"Holder": "Teste Holder",
"ExpirationDate": "12/2030",
"SaveCard": false,
"Brand": "Visa"
},
"SoftDescriptor":"123456789ABCD",
"Type": "CreditCard",
"Amount": 1500,
"Currency": "BRL",
"Country": "BRA",
"Provider": "Simulado",
"ExtraDataCollection": [],
"Status": 20,
"RecurrentPayment": {
"RecurrentPaymentId": "0d2ff85e-594c-47b9-ad27-bb645a103db4",
"NextRecurrency": "2015-06-01",
"StartDate": "2015-06-01",
"EndDate": "2019-12-01",
"Interval": "SemiAnnual",
"Link": {
"Method": "GET",
"Rel": "recurrentPayment",
"Href": "https://apiquerysandbox.cieloecommerce.cielo.com.br/1/RecurrentPayment/{PaymentId}"
},
"AuthorizeNow": false
}
}
}
Parameter | Type | Size | Required | Description |
---|---|---|---|---|
RecurrentPaymentId | Next recurrence Identifier field. | GUID | 36 | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
NextRecurrency | Date of next recurrence. | String | 7 | 12/2030 (MM/YYYY) |
StartDate | Start date of recurrence. | String | 7 | 12/2030 (MM/YYYY) |
EndDate | End date of recurrence. | String | 7 | 12/2030 (MM/YYYY) |
Interval | Interval between recurrences. | Number | 10 | - Monthly (mensal, é o padrão) - Bimonthly (bimensal) - Quarterly (trimestral) - SemiAnnual (semestral) - Annual (anual) |
AuthorizeNow | Boolean to know if the first recurrence is about to be Authorized or not. | Boolean | *** | false |