In merchant recurrence, the recurrence process and interval will be executed by the store itself. The request follows the structure of a standard credit transaction, but the Payment.Recurrent
parameter must be true
, otherwise the transaction will be denied.
If
Payment.Recurrent
is sent asfalse
, the transaction will be denied.Accepted payment method: credit card.
Request
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 propria"
},
"Payment": {
"Type": "CreditCard",
"Amount": 1500,
"Installments": 1,
"SoftDescriptor": "123456789ABCD",
"Recurrent": true,
"CreditCard": {
"CardNumber": "1234123412341231",
"Holder": "Teste Holder",
"ExpirationDate": "12/2030",
"SecurityCode": "262",
"SaveCard": "false",
"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 propria"
},
"Payment":{
"Type":"CreditCard",
"Amount":1500,
"Installments":1,
"SoftDescriptor":"123456789ABCD",
"Recurrent": true,
"CreditCard":{
"CardNumber":"1234123412341231",
"Holder":"Teste Holder",
"ExpirationDate":"12/2030",
"SecurityCode":"262",
"SaveCard":"false",
"Brand":"Visa"
}
}
}
--verbose
Parameters in header
Environment | Method | Endpoint |
---|---|---|
Sandbox | post | https://apisandbox.cieloecommerce.cielo.com.br/1/sales/ |
Production | post | https://api.cieloecommerce.cielo.com.br/1/sales/ |
Parameters in body
Parameter | Description | Type | Syze | Required |
---|---|---|---|---|
MerchantOrderId | Order identification number. Warning: Allowed characters are a-z, A-Z, 0-9. Special characters and blank spaces are not allowed. | Text | 50 | Yes |
Customer.Name | Customer's name. | Text | 255 | Yes |
Payment.Type | Type of the payment method. | Text | 100 | Yes |
Payment.Amount | Order Amount (to be sent in cents). | Number | 15 | Yes |
Payment.Installments | Number of installments. If the transaction is a recurrence, the number of installments will be 1. | Number | 2 | Yes |
Payment.SoftDescriptor | The store's name that will be on the shopper's bank invoice. Does not allow special characters. | Text | 13 | No |
Payment.Recurrent | Indicates an unscheduled recurrence transaction. | boolean | 5 | Yes* |
CreditCard.CardNumber | Shopper's card number. | Text | 19 | Yes |
CreditCard.Holder | Name of the shopper that's printed on the card | Text | 25 | Yes |
CreditCard.ExpirationDate | Expiration date printed on the card. Example: MM/AAAA. | Text | 7 | Yes |
CreditCard.SecurityCode | Security code printed on the back of the card. | Text | 4 | No |
CreditCard.Brand | credit card brand. | Text | 10 | Yes |
*In this case, the Payment.Recurrent
field is mandatory, as this is a recurring transaction.
Response
{
"MerchantOrderId": "2014113245231706",
"Customer": {
"Name": "Comprador rec propria"
},
"Payment": {
"ServiceTaxAmount": 0,
"Installments": 1,
"Interest": "ByMerchant",
"Capture": false,
"Authenticate": false,
"Recurrent": true,
"CreditCard": {
"CardNumber": "123412******1231",
"Holder": "Teste Holder",
"ExpirationDate": "12/2030",
"SaveCard": false,
"Brand": "Visa"
},
"ProofOfSale": "3827556",
"Tid": "0504043827555",
"AuthorizationCode": "149867",
"SoftDescriptor":"123456789ABCD",
"PaymentId": "737a8d9a-88fe-4f74-931f-acf81149f4a0",
"Type": "CreditCard",
"Amount": 1500,
"Currency": "BRL",
"Country": "BRA",
"Provider": "Simulado",
"ExtraDataCollection": [],
"Status": 1,
"ReturnCode": "4",
"ReturnMessage": "Operation Successful",
"Link": {
"Method": "GET",
"Rel": "recurrentPayment",
"Href": "https://apiquerysandbox.cieloecommerce.cielo.com.br/1/RecurrentPayment/{RecurrentPaymentId}"
},
"AuthorizeNow": true
},
"Links": [
{
"Method": "GET",
"Rel": "self",
"Href": "https://apiquerysandbox.cieloecommerce.cielo.com.br/1/sales/{PaymentId}"
},
{
"Method": "PUT",
"Rel": "capture",
"Href": "https://apiquerysandbox.cieloecommerce.cielo.com.br/1/sales/{PaymentId}/capture"
},
{
"Method": "PUT",
"Rel": "void",
"Href": "https://apiquerysandbox.cieloecommerce.cielo.com.br/1/sales/{PaymentId}/void"
}
]
}
}
--header "Content-Type: application/json"
--header "RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
--data-binary
{
"MerchantOrderId": "2014113245231706",
"Customer": {
"Name": "Comprador rec propria"
},
"Payment": {
"ServiceTaxAmount": 0,
"Installments": 1,
"Interest": "ByMerchant",
"Capture": false,
"Authenticate": false,
"Recurrent": true,
"CreditCard": {
"CardNumber": "123412******1231",
"Holder": "Teste Holder",
"ExpirationDate": "12/2030",
"SaveCard": false,
"Brand": "Visa"
},
"ProofOfSale": "3827556",
"Tid": "0504043827555",
"AuthorizationCode": "149867",
"SoftDescriptor":"123456789ABCD",
"PaymentId": "737a8d9a-88fe-4f74-931f-acf81149f4a0",
"Type": "CreditCard",
"Amount": 1500,
"Currency": "BRL",
"Country": "BRA",
"ExtraDataCollection": [],
"Status": 1,
"ReturnCode": "4",
"ReturnMessage": "Operation Successful",
"Link": {
"Method": "GET",
"Rel": "recurrentPayment",
"Href": "https://apiquerysandbox.cieloecommerce.cielo.com.br/1/RecurrentPayment/{RecurrentPaymentId}"
},
"AuthorizeNow": true
},
"Links": [
{
"Method": "GET",
"Rel": "self",
"Href": "https://apiquerysandbox.cieloecommerce.cielo.com.br/1/sales/{PaymentId}"
},
{
"Method": "PUT",
"Rel": "capture",
"Href": "https://apiquerysandbox.cieloecommerce.cielo.com.br/1/sales/{PaymentId}/capture"
},
{
"Method": "PUT",
"Rel": "void",
"Href": "https://apiquerysandbox.cieloecommerce.cielo.com.br/1/sales/{PaymentId}/void"
}
]
}
}
Parameter | Descripition | Type |
---|---|---|
Status | Transaction Status. See the full table of Transactional status. | Text |
ReturnCode | Return code. See the full table ofReturnCode. | Text |
ReturnMessage | Return message. See the full table of ReturnMessage. | Text |
*In this case, the Payment.Recurrent
field is required, as this is a recurring transaction.