Card on file

EnvironmentMethodEndpoint
Sandboxhttps://apisandbox.cieloecommerce.cielo.com.br/v1/sales/
Produçãohttps://api.cieloecommerce.cielo.com.br/v1/sales/

ℹ️

Learn more about this feature in the documentation.

POST /1/sales/
{  
   "MerchantOrderId":"2014111701",
   "Customer":{  
      "Name":"Comprador crédito completo",
      "Email":"[email protected]",
      "Birthdate":"1991-01-02"
   },
   "Payment":{  
     "Type":"CreditCard",
     "Amount":15700,
     "Currency":"BRL",
     "Country":"BRA",
     "Installments":1,
     "Interest":"ByMerchant",
     "Capture":true,
     "Authenticate":"false",
     "Recurrent":"true",
     "SoftDescriptor":"123456789ABCD",
     "CreditCard":{  
         "CardNumber":"1234123412341231",
         "Holder":"Teste Holder",
         "ExpirationDate":"12/2030",
         "SecurityCode":"123",
         "SaveCard":"false",
         "Brand":"Visa",
         "CardOnFile":{
            "Usage": "First",
            "Reason":"Recurring"
         }
     }
   }
}
PROPERTYTYPESIZEREQUIREDDESCRIPTION
MerchantOrderIdText50YesOrder identification number. Warning: Allowed characters are a-z, A-Z, 0-9. Special characters and blank spaces are not allowed.
Customer.NameText255NoCustomer's name.
Customer.StatusText255NoThe customer’s registration status on the store. (NEW / EXISTING)
Customer.EmailText255NoCustomer's email
Customer.BirthdateDate10NoCustomer's birthdate (AAAA/MM/DD).
Payment.TypeText100YesType of the Payment Method.
Payment.AmountNumber15YesOrder Amount (to be sent in cents).
Payment.CurrencyText3NoCurrency in which the payment will be made (BRL).
Payment.CountryText3NoCountry in which the payment will be made.
Payment.SoftDescriptorText13NoThe store’s name that will be on the shopper’s bank invoice. Does not allow special characters.
Payment.InstallmentsNumber2YesNumber of installments. If the transaction is a recurrence, the number of installments will be 1. For installment transactions, the number of installments will be greater than 1.
Payment.InterestText10NoType of installments - Store (ByMerchant) or Card (ByIssuer).
Payment.CaptureBooleanNo (Default false)Boolean that identifies if the authorization should be done by authomatic capture (true) or posterior capture (false).
Payment.RecurrentBoolean-ConditionalIndicates if the transaction is recurring (“true”) or not (“false”). The value “true” won’t originate a new recurrence, it will only allow a transaction without the need to send the security code. Authenticate should be “false” if Recurrent is “true”. Find out more about Recurring Payments
CreditCard.CardNumberText19YesShopper’s card number.
CreditCard.HolderText25YesName of the shopper that’s printed on the card. Does not accept special characters.
CreditCard.ExpirationDateText7YesExpiration date printed on the card. Example: MM/AAAA.
CreditCard.SecurityCodeText4NoSecurity code printed on the back of the card.
CreditCard.SaveCardBooleanNo (Default false)Boolean that identifies if the card will be saved to generate a CardToken. Find out more about Tokenization of Cards
CreditCard.BrandText10YesCard brand. Possible values: Visa / Master / Amex / Elo / Aura / JCB / Diners / Discover / Hipercard / Hiper.
CreditCard.CardOnFile.UsageText-No"First" if the card was stored and it’s your first use. "Used" if the card was stored and has been used for another transaction before.
CreditCard.CardOnFile.ReasonText-ConditionalIndicates the motive for card storage, if the CardOnFile.Usage field is “Used”.
Recurring: programmed recurring transaction (e.g. Subscriptions). If it is a recurring transaction, use Payment.Recurrent = true (merchant recurrence) or Recurrent.Payment = true (scheduled recurrence).
Unscheduled: recurring transaction with no fixed date (e.g. service apps).
Installments: installments through recurring transactions.

Response

{
    "MerchantOrderId": "2014111701",
    "Customer": {
        "Name": "Comprador crédito completo",
        "Email": "[email protected]",
        "Birthdate": "1991-01-02"
    },
    "Payment": {
        "ServiceTaxAmount": 0,
        "Installments": 1,
        "Interest": 0,
        "Capture": true,
        "Authenticate": false,
        "Recurrent": true,
        "CreditCard": {
            "CardNumber": "123412******1231",
            "Holder": "Teste Holder",
            "ExpirationDate": "12/2030",
            "SaveCard": false,
            "Brand": "Visa",
            "CardOnFile": {
                "Usage": "First",
                "Reason": "Recurring"
            },
            "PaymentAccountReference": "JZHOZJHNZH87KQXM3G60B9I21GVZN"
        },
        "Tid": "0928084922246",
        "ProofOfSale": "652515",
        "AuthorizationCode": "927181",
        "SoftDescriptor": "123456789ABCD",
        "Provider": "Simulado",
        "IsQrCode": false,
        "DynamicCurrencyConversion": false,
        "Amount": 15700,
        "ReceivedDate": "2022-09-28 08:49:22",
        "CapturedAmount": 15700,
        "CapturedDate": "2022-09-28 08:49:22",
        "Status": 2,
        "IsSplitted": false,
        "ReturnMessage": "Operation Successful",
        "ReturnCode": "6",
        "PaymentId": "91bad53a-9198-4738-a280-f51dddc34988",
        "Type": "CreditCard",
        "Currency": "BRL",
        "Country": "BRA",
        "Links": [
            {
                "Method": "GET",
                "Rel": "self",
                "Href": "https://apiquerysandbox.cieloecommerce.cielo.com.br/1/sales/91bad53a-9198-4738-a280-f51dddc34988"
            },
            {
                "Method": "PUT",
                "Rel": "void",
                "Href": "https://apisandbox.cieloecommerce.cielo.com.br/1/sales/91bad53a-9198-4738-a280-f51dddc34988/void"
            }
        ]
    }
}
PROPERTYDESCRIPTIONTYPESIZEFORMAT
ProofOfSaleAuthorization number, identical to NSU.Text6Alphanumeric text
TidTransaction Id on the acquirer.Text20Alphanumeric text
AuthorizationCodeAuthorization code.Text6Alphanumeric text
SoftDescriptorText that will be printed on the carrier’s bank invoice. Does not allow special characters.Text13Alphanumeric text
PaymentIdPayment ID number, needed for future operations like Consulting, Capture and Cancellation.Guid36xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
ECIEletronic Commerce Indicator. Indicates how safe a transaction is.Text2Example: 7
StatusTransaction status.Byte2
ReturnCodeAcquiring return code.Text32Alphanumeric text
ReturnMessageAcquiring return message.Text512Alphanumeric text
Payment.MerchantAdviceCodeCard brand’s return code that defines the period for transaction submission retry. Valid only for Mastercard.Text2Numeric
CreditCard.PaymentAccountReferencePAR (payment account reference) is the number that associates different tokens to the same card. It will be returned by the Master and Visa brands and passed on to Cielo e-commerce customers. If the card brand doesn’t send the information the field will not be returned. If it is a debit transaction, include inside the DebitCard node.Alphanumeric29