Access the new E-commerce developers portal at docs.cielo.com.br.
Warning: The content on this page is being discontinued and will not receive updates after 09/16/2024. Please visit the new documentation at docs.cielo.br.
E-wallets are electronic safes (repositories) of cards and payment data for the physical and e-commerce customers. Digital wallets allow a customer to register their payment details, making the purchase process more convenient and secure.
Contact the provider of your choice for further information on how to contract the service.
API E-commerce Cielo supports the following digital wallets:
Card brands supported by the wallets
Vist the wallet website to know more about supported card brands:
GooglePay
ApplePay
SamsungPay
There are two options for sending an authorization request using the payment method e-wallet:
Wallet
, the parameter WalletKey
(used by Cielo to decrypt e-wallet data) and additional tokens provided by each e-wallet. This type of integration is recommended for merchants who are not PCI DSS compliant;Wallet
and the merchant themselves decrypt e-wallet data and send the open data to authorization. This type of integration is recommended for merchants who are PCI DSS compliant.See below the representation of a standard transactional flow in the integration of an e-wallet, using an encrypted card:
{
"MerchantOrderId": "2014111708",
"Customer": {
"Name": "Exemplo Wallet Padrão",
"Identity": "11225468954",
"IdentityType": "CPF"
},
"Payment": {
"Type": "CreditCard",
"Amount": 100,
"Installments": 1,
"Currency": "BRL",
"Payment.Capture": "false",
"Wallet": {
"Type": "TIPO DE WALLET",
"WalletKey": "IDENTIFICADOR DA LOJA NA WALLET",
"AdditionalData": {
"EphemeralPublicKey": "TOKEN INFORMADO PELA WALLET"
}
}
}
}
--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": "2014111708",
"Customer": {
"Name": "Exemplo Wallet Padrão",
"Identity": "11225468954",
"IdentityType": "CPF"
},
"Payment": {
"Type": "CreditCard",
"Amount": 100,
"Installments": 1,
"Currency": "BRL",
"Payment.Capture": "false",
"Wallet": {
"Type": "TIPO DE WALLET",
"WalletKey": "IDENTIFICADOR DA LOJA NA WALLET",
"AdditionalData": {
"EphemeralPublicKey": "TOKEN INFORMADO PELA WALLET"
}
}
}
}
Property | Description | Type | Size | Required |
---|---|---|---|---|
MerchantId |
Merchant identifier at Cielo | GUID | 36 | Yes (sent in header) |
MerchantKey |
Public key for dual authentication at Cielo. | Text | 40 | Yes (sent in header) |
RequestId |
Request identifier, used when the merchant uses different servers for each GET/POST/PUT. | GUID | 36 | No (send in header) |
MerchantOrderId |
Order ID number. | Text | 50 | Yes |
Customer.Name |
Customer’s name. | Text | 255 | No |
Customer.Status |
Customer’s registration status (“NEW” / “EXISTING”). | Text | 255 | No |
Payment.Type |
Payment method type. | Text | 100 | Yes |
Payment.Amount |
Order amount in cents. | Number | 15 | Yes |
Payment.Installments |
Number of installments. | Number | 2 | Yes |
Payment.Capture |
Indicates whether the authorization will use automatic capture (“true”) or not (“false”). If “false”, a capture request must be sent - please, check with the acquirer if pre-authorization is available. | Boolean | - | No (default “false”) |
Wallet.Type |
Wallet type: “ApplePay” / “SamsungPay” / “GooglePay”. | Text | – | Yes |
Wallet.WalletKey |
Cryptographic key that identifies stores in wallets. Consult the table WalletKey for more information. | Text | – | Yes |
Wallet.AdditionalData.EphemeralPublicKey |
Token returned by wallet. Must be submitted in ApplePay integrations. | Text | – | Yes |
Wallet.AdditionalData.Signature |
Token returned by wallet. Must be submitted in GooglePay integrations. | Text | – | Yes |
WalletKey is the identifier used by Cielo to decrypt the payloads returned by an e-wallet.
The WalletKey
formats that must be sent to the API E-commerce Cielo are:
Wallet | Example | |
---|---|---|
Apple Pay | 9zcCAciwoTS+qBx8jWb++64eHT2QZTWBs6qMVJ0GO+AqpcDVkxGPNpOR/D1bv5AZ62+5lKvucati0+eu7hdilwUYT3n5swkHuIzX2KO80Apx/ SkhoVM5dqgyKrak5VD2/drcGh9xqEanWkyd7wl200sYj4QUMbeLhyaY7bCdnnpKDJgpOY6J883fX3TiHoZorb/QlEEOpvYcbcFYs3ELZ7QVtjxyr O2LmPsIkz2BgNm5f+JaJUSAOectahgLZnZR+easdhghrsa/E9A6DwjMd0fDYnxjj0bQDfaZpBPeGGPFLu5YYn1IDc |
|
Samsung Pay | eyJhbGciOiJSU0ExXzUiLCJraWQiOiIvam1iMU9PL2hHdFRVSWxHNFpxY2VYclVEbmFOUFV1ZUR5M2FWeHBzYXVRPS IsInR5cCI6IkpPU0UiLCJjaGFubmVsU2VjdXJpdHlDb250ZXh0IjoiUlNBX1BLSSIsImVuYyI6IkExMjhHQ00ifQ.cCsGbqgFdzVb1jhXNR –gApzoXH-fdafddfa-Bo_utsmDN_DuGm69Kk2_nh6txa7ML9PCI59LFfOMniAf7ZwoZUBDCY7Oh8kx3wsZ0kxNBwfy LBCMEYzET0qcIYxePezQpkNcaZ4oogmdNSpYY-KbZGMcWpo1DKhWphDVp0lZcLxA6Q25K78e5AtarR5whN4HUAkurQ.CFjWpHkAVoLCG8q0.NcsTuauebemJXmos_mLMTyLhEHL- p5Wv6J88WkgzyjAt_DW7laiPMYw2sqRXkOiMJLwhifRzbSp8ZgJBM25IX05dKKSS4XfFjJQQjOBHw6PYtEF5pUDMLHML3jcddCrX07abfef_DuP41PqOQYsjwesLZ8XsRj- R0TH4diOZ_GQop8_oawjRIo9eJr9Wbtho0h8kAzHYpfuhamOPT718EaGAY6SSrR7t6nBkzGNkrKAmHkC7aRwe.AbZG53wRqgF0XRG3wUK_UQ |
|
Google Pay | {“encryptedMessage”:”0mXBb94Cy9JZhMuwtrBhMjXb8pDslrNsN5KhcEqnowOINqJgjXHD36KcCuzpQQ4cDAe64ZLmk2N3UBGXsN9hMMyeMakXlidVmteE +QMaNZIor048oJqlUIFPD54B/ic8zCdqq3xnefUmyKQe0I03x57TcEA9xAT/E4x3rYfyqLFUAEtu2lT0GwTdwgrsT8pKoTldHIgP+wVNTjrKvJrB4xM/Bhn6JfcSmOzFyI6w37 mBU71/TK761nYOSxt7z1bNWSLZ4b8xBu1dlRgen2BSlqdafuQjV3UZjr6ubSvaJ8NiCh5FD/X013kAwLuLALMS2uAFS9j8cZ6R6zNIi13fK6Fe4ACbFTHw LzSNZjQiaRDb6MlMnY8/amncPIOXzpirb5ScIz8EZUL05xd+3YWVTVfpqgFo1eaaS+wZdUyRG0QEgOsr6eLBoH8d5lfV9Rx6XdioorUuT7s1Yqc0OJZO +fhBt6X0izE9hBGTexdZyg\u003d\u003d”,”ephemeralPublicKey”:”BMdwrkJeEgCOtLevYsN3MbdP8xbOItXiTejoB6vXy0Kn0ZM10jy4Aasd6jTSxtoxo TpFydLhj5kzoOhbw2OzZu0\u003d”,”tag”:”yAQIjWZ0VuCC7SWyYwc4eXOzpSUKhZduF9ip0Ji+Gj8\u003d”} |
This is the EphemeralPublicKey
format to be sent to API E-commerce Cielo:
Wallet | Example |
---|---|
Apple Pay | MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEoedz1NqI6hs9hEO6dBsnn0X0xp5/DKj3gXirjEqxNIJ8JyhGxVB3ITd0E+6uG4W6Evt+kugG8gOhCBrdUU6JwQ== |
Signature
format that must be sent to the API E-commerce Cielo:
Wallet | Example |
---|---|
Google Pay | MEUCIQCGQLOmwxe5eFMSuTcr4EcwSZu35fB0KlCWcVop6ZxxhgIgbdtNHThSlynOopfxMIxkDs0cLh2NFh5es+J5uDmaViA= |
{
"MerchantOrderId": "2014111703",
"Customer": {
"Name": "[Guest]"
},
"Payment": {
"ServiceTaxAmount": 0,
"Installments": 1,
"Interest": 0,
"Capture": false,
"Authenticate": false,
"Recurrent": false,
"CreditCard": {
"CardNumber": "453211******1521",
"Holder": "BJORN IRONSIDE",
"ExpirationDate": "08/2020",
"SaveCard": false,
"Brand": "Visa"
},
"Tid": "0319040817883",
"ProofOfSale": "817883",
"AuthorizationCode": "027795",
"Wallet": {
"Type": "TIPO DE WALLET",
"WalletKey": "IDENTIFICADOR DA LOJA NA WALLET",
"Eci": 0,
"AdditionalData": {
"EphemeralPublicKey": "TOKEN INFORMADO PELA WALLET"
}
},
"SoftDescriptor": "123456789ABCD",
"Amount": 100,
"ReceivedDate": "2018-03-19 16:08:16",
"Status": 1,
"IsSplitted": false,
"ReturnMessage": "Operation Successful",
"ReturnCode": "4",
"PaymentId": "e57b09eb-475b-44b6-ac71-01b9b82f2491",
"Type": "CreditCard",
"Currency": "BRL",
"Country": "BRA",
"Links": [
{
"Method": "GET",
"Rel": "self",
"Href": "https://apiquerysandbox.cieloecommerce.cielo.com.br/1/sales/{PaymentId}"
},
{
"Method": "PUT",
"Rel": "capture",
"Href": "https://apisandbox.cieloecommerce.cielo.com.br/1/sales/{paymentId}/capture"
},
{
"Method": "PUT",
"Rel": "void",
"Href": "https://apisandbox.cieloecommerce.cielo.com.br/1/sales/{PaymentId}/void"
}
]
}
}
--header "Content-Type: application/json"
--header "RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
--data-binary
{
"MerchantOrderId": "2014111703",
"Customer": {
"Name": "[Guest]"
},
"Payment": {
"ServiceTaxAmount": 0,
"Installments": 1,
"Interest": 0,
"Capture": false,
"Authenticate": false,
"Recurrent": false,
"CreditCard": {
"CardNumber": "453211******1521",
"Holder": "BJORN IRONSIDE",
"ExpirationDate": "08/2020",
"SaveCard": false,
"Brand": "Visa"
},
"Tid": "0319040817883",
"ProofOfSale": "817883",
"AuthorizationCode": "027795",
"Wallet": {
"Type": "TIPO DE WALLET",
"WalletKey": "IDENTIFICADOR DA LOJA NA WALLET",
"Eci": 0,
"AdditionalData": {
"EphemeralPublicKey": "TOKEN INFORMADO PELA WALLET"
},
},
"SoftDescriptor": "123456789ABCD",
"Amount": 100,
"ReceivedDate": "2018-03-19 16:08:16",
"Status": 1,
"IsSplitted": false,
"ReturnMessage": "Operation Successful",
"ReturnCode": "4",
"PaymentId": "e57b09eb-475b-44b6-ac71-01b9b82f2491",
"Type": "CreditCard",
"Currency": "BRL",
"Country": "BRA",
"Links": [
{
"Method": "GET",
"Rel": "self",
"Href": "https://apiquerysandbox.cieloecommerce.cielo.com.br/1/sales/{PaymentId}"
},
{
"Method": "PUT",
"Rel": "capture",
"Href": "https://apisandbox.cieloecommerce.cielo.com.br/1/sales/{paymentId}/capture"
},
{
"Method": "PUT",
"Rel": "void",
"Href": "https://apisandbox.cieloecommerce.cielo.com.br/1/sales/{PaymentId}/void"
}
]
}
}
Property | Description | Type | Size | Format |
---|---|---|---|---|
ProofOfSale |
Authorization number, identical to NSU. | Text | 6 | Alphanumeric text |
Tid |
Transaction ID in the acquirer. | Text | 20 | Alphanumeric text |
AuthorizationCode |
Authorization code. | Text | 6 | Alphanumeric text |
SoftDescriptor |
Text to be printed on the bearer bank statement. Available for VISA/MASTER only - no special characters allowed. | Text | 13 | Alphanumeric text |
PaymentId |
Order identifier field. | GUID | 36 | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
ECI |
Electronic Commerce Indicator. Represents how secure a transaction is. | Text | 2 | E.g.: 7 |
Status |
Transaction status. | Byte | 2 | E.g.: 1 |
ReturnCode |
Return code from the acquirer. | Text | 32 | Alphanmeric text. |
ReturnMessage |
Return message from the acquirer. | Text | – | Alphanumeric text. |
Type |
Wallet type: “ApplePay” / “SamsungPay” / “GooglePay” | Text | – | Alphanumeric text |
WalletKey |
Cryptographic key that identifies stores in wallets. Consult the table WalletKey for more information | Text | – | See table WalletKey |
AdditionalData.EphemeralPublicKey |
Token returned by the wallet. Must be submitted in ApplePay integrations. | Text | – | See table EphemeralPublicKey |
AdditionalData.Signature |
Token returned by wallet. Must be submitted in GooglePay integrations. | Text | – | See table Signature |
If the merchant decrypts the payload received from the wallet and sends it to the API E-commerce Cielo for processing and authorization, they must use the following request model:
-- Envio de cartão
{
"MerchantOrderId": "6242-642-723",
"Customer": {
"Name": "Guilherme Gama",
"Identity": "11225468954",
"IdentityType": "CPF"
},
"Payment": {
"Type": "CreditCard",
"Amount": 1100,
"Provider": "Cielo",
"Installments": 1,
"CreditCard": {
"CardNumber":"4532********6521",
"Holder":"Guilherme Gama",
"ExpirationDate":"12/2021",
"SecurityCode":"123",
"Brand":"Master"
},
"Wallet": {
"Type": "Tipo de wallet",
"Eci":"7",
"Cavv":"AM1mbqehL24XAAa0J04CAoABFA=="
}
}
}
Property | Type | Size | Required | Description |
---|---|---|---|---|
MerchantId |
Guid | 36 | Yes | Store identifier atCielo. |
MerchantKey |
Text | 40 | Yes | Public key for dual authentication at Cielo. |
RequestId |
Guid | 36 | No | Request identifier, used when the merchant uses different servers for each GET/POST/PUT. |
MerchantOrderId |
Text | 50 | Yes | Order ID number. |
Customer.Name |
Text | 255 | No | Customer’s name. |
Customer.Status |
Text | 255 | No | Customer’s registration status (“NEW” / “EXISTING”). |
Payment.Type |
Text | 100 | Yes | Payment method type. |
Payment.Amount |
Number | 15 | Yes | Order amount in cents. |
Payment.Installments |
Number | 2 | Yes | Number of installments. |
CreditCard.CardNumber. |
Text | 19 | Yes | Customer’s card number |
CreditCard.SecurityCode |
Texto | 4 | Não | Security code printed on the back of the card. |
CreditCard.Brand |
Text | 10 | Yes | Card brand (Visa / Master / Amex / Elo / Aura / JCB / Diners / Discover / Hipercard / Hiper). |
Wallet.Type |
Text | 255 | Yes | Wallet type: AndroidPay / ApplePay / SamsungPay |
Wallet.Walletkey |
Text | 255 | Yes | Cryptographic key representing card data. Consult the table WalletKey for more information. |
Wallet.Eci |
Text | 3 | Yes | The ECI (Electronic Commerce Indicator) represents how safe a transaction is. This value must be taken into account by the merchant when deciding on capturing the transaction. |
Wallet.Cavv |
Text | 255 | Yes | Validation field returned by Wallet and used as authorization basis. |
{
"MerchantOrderId": "2014111703",
"Customer": {
"Name": "[Guest]"
},
"Payment": {
"ServiceTaxAmount": 0,
"Installments": 1,
"Interest": 0,
"Capture": false,
"Authenticate": false,
"Recurrent": false,
"CreditCard": {
"CardNumber": "453211******1521",
"Holder": "Gama Gama",
"ExpirationDate": "08/2020",
"SaveCard": false,
"Brand": "Visa"
},
"Tid": "0319040817883",
"ProofOfSale": "817883",
"AuthorizationCode": "027795",
"Wallet": {
"Type": "TIPO DE WALLET",
"Eci": 0
},
"SoftDescriptor": "123456789ABCD",
"Amount": 100,
"ReceivedDate": "2018-03-19 16:08:16",
"Status": 1,
"IsSplitted": false,
"ReturnMessage": "Operation Successful",
"ReturnCode": "4",
"PaymentId": "e57b09eb-475b-44b6-ac71-01b9b82f2491",
"Type": "CreditCard",
"Currency": "BRL",
"Country": "BRA",
"Links": [
{
"Method": "GET",
"Rel": "self",
"Href": "https://apiquerysandbox.cieloecommerce.cielo.com.br/1/sales/e57b09eb-475b-44b6-ac71-01b9b82f2491"
},
{
"Method": "PUT",
"Rel": "capture",
"Href": "https://apisandbox.cieloecommerce.cielo.com.br/1/sales/e57b09eb-475b-44b6-ac71-01b9b82f2491/capture"
},
{
"Method": "PUT",
"Rel": "void",
"Href": "https://apisandbox.cieloecommerce.cielo.com.br/1/sales/e57b09eb-475b-44b6-ac71-01b9b82f2491/void"
}
]
}
}
Property | Description | Type | Size | Format |
---|---|---|---|---|
ProofOfSale |
Authorization number, identical to NSU. | Text | 6 | Alphanumeric |
Tid |
Transaction ID in the acquirer. | Text | 20 | Alphanumeric |
AuthorizationCode |
Authorization code. | Text | 6 | Alphanumeric |
SoftDescriptor |
Text to be printed on customer’s invoice. Note: Does not allow special characters. Available for VISA/MASTER only. | Text | 13 | Alphanumeric |
PaymentId |
Order identifier field. | Guid | 36 | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
ECI |
Eletronic Commerce Indicator. Represents how secure a transaction is. | Text | 2 | E.g.: 7 |
Status |
Transaction status. | Byte | — | 2 |
ReturnCode |
Return code from acquirer. | Text | 32 | Alphanumeric |
ReturnMessage |
Return message from acquirer. | Text | 512 | Alphanumeric |
Type |
Wallet type: ApplePay , GooglePay or SamsungPay |
Text | 255 | Alphanumeric |
Walletkey |
Cryptographic key representing card data. Consult the table WalletKey for more information. | Text | 255 | Check the WalletKey table |
Zero Auth allows the merchant to check whether a card is valid for making a purchase before the order is completed. Zero Auth simulates an authorization without affecting the credit limit or alerting the cardholder about the test. Please refer to Zero Auth for further information.
In this topic, we present integration examples with the main e-wallets available on the market. The examples comprehend the scenario for encrypted cards, in which WalletKey
and other token identifiers are required in the authorization.
If the merchant will send the authorization request with decrypted card data, please refer to Decrypted card.
Apple Pay is a virtual wallet. It allows the shopper to make payments in e-commerce stores and apps using, in a practical and safe way, their credit and debit cards stored in their Apple accounts and devices.
In order to use Apple Pay, your store must be previously registered in the AppleID program. In addition to that, you must also:
Notice: The following integration should be used when sending encrypted card data. If the merchant sends the authorization request with decrypted card data, please refer to Decrypted card.
In this initial step, you will need to create a merchant identifier for your store. Once created, the merchant identifier must be sent to Cielo in a request for a “.CSR” certificate. The “.CSR” certificate created by Cielo must be used to create a new certificate with Apple, the “.CER” certificate, which will serve as a follow-up to the second stage of the process.
The merchant identifier must be created through the Apple Developer website as follows:
(+)
button next to the title:
Continue
:
Continue
:
Register
:
To request Cielo to generate the certificate in “.CSR” format, contact our Support Team and enter:
Our team will return with the “.CSR” file within 48 business hours.
Create Certificate
button right after the short description:
Choose File
and choose the “.CSR” certificate sent by Cielo:
Continue
:
Download
and save the “.CER” file:
For more details on the process, access Apple’s Developer Account Help.
Most of the process of enabling the “Pay with Apple Pay” button in your app or site is performed during your wallet integration. For that reason, we recommend you to follow the instructions available in the Apple Developer Documentation website for Apple’s self-service implementation.
At the end of the process performed in the Apple API, you will receive a JSON containing two important fields that will be used in “PART 3”: the paymentData.data
and the ephemeralPublicKey.header.EphemeralPublicKey
fields.
{
"applePayData": {
"paymentData": {
"version": "EC_v1",
"data": "as01vRj+n9crY2vome7zc+u7Tz0+qg2La/8IUHpJIjFN6ThhUqLnSrskQHTrEbcYPiMksFK0+ddo9sZu70uJQJH1I+44N6PrVhilNDem97vOXq2VYDXiVJ27F/Q9wGQDgZBeGcZ6Pml9SIelHqUauBcQoOatrlnWPUL8kbdpT8WqgzXyaCh7oeTz=z6++rp/ofjvSjnGtOqAUsnrzvw4uzkcyKUSsfROdJ6B/Xzgu/T9fMIr5UxXD2DPF1SNh3ydEJABKz4HFjDW7ObvbQeua4GYxJdpQLpI3NgUbJy91E/LOyb/+PcCtO+0=a41tBrfnTTF9qsPuCIw8HWIEEKSRofn27NTofxev/i+nHEfqEtqNrN/epIvhzceD/gDiGetfiLKMzf94ARmpWUAMC==",
"signature": "(…)",
"header": {
"ephemeralPublicKey": "MFkwEwZJKoZIzj0CAQYIKo12zj0DAQcDQgAEo+ReGClSmQ4hDJD1yh9nci3V4l7kPm2AQtKZMMvuNS0iK5sn/1A9l3kw1B1xCqOycZmnPSng7p5hpTvrei1BCA==",
"publicKeyHash": "KXN06+BtJu6yEfF9zDhr7f4M/2HwVybnx0FGfC520gB=",
"transactionId": "71c5b61c3791546e94d2b4893a6c69aaac2ab86b5c113c83a7d89057906a9b5f"
}
},
"paymentMethod": {
"displayName": "MasterCard 1212",
"network": "MasterCard",
"type": "credit"
},
"transactionIdentifier": "81C5B61C3791646E94D2B4893A6C69BBBC2AB86B5C363C83A7D89057906A9BAC"
},
"x_document": "24562608994",
"x_name": "João da Silva"
}
Authorization with the Apple Pay token happens in the same way as standard credit card authorization. However, instead of providing card details openly, the token received by Apple Pay must be provided, as in the example below:
{
"MerchantOrderId": "2017051002",
"Customer": {
(…)
},
"Payment": {
"Type": "CreditCard",
"Amount": 1000,
"Installments": 1,
"Currency": "BRL",
"Wallet": {
"Type": "ApplePay",
"WalletKey":"['paymentData.data']",
"AdditionalData": {
"EphemeralPublicKey": "['ephemeralPublicKey.header.EphemeralPublicKey']"
}
}
}
}
Header Parameters | Description | Type and Size |
---|---|---|
MerchantId |
Store ID in API E-commerce Cielo. | GUID (36) |
MerchantKey |
API key in API E-commerce Cielo. | String (24) |
Parameter | Description | Type and Size |
---|---|---|
MerchantOrderId |
Order ID number. | String (50) |
Customer |
Node with customer’s data. | Refer to API E-commerce Cielo. |
Payment.Type |
Payment method type. Possibilities: “CreditCard” / “DebitCard”. | String (100) |
Payment.Amount |
Order amount in cents. | Number (15) |
Payment.Installments |
Number of installments. | Number (2) |
Payment.Wallet.Type |
Name of payment method provider. For Apple Pay transactions, use “ApplePay”. | String (15) |
Payment.Wallet.WalletKey |
Fill with the paymentData.data parameter value returned by Apple Pay. |
String |
Payment.Wallet.AdditionalData.EphemeralPublicKey |
Fill with the ephemeralPublicKey.header.EphemeralPublicKey parameter value returned by Apple Pay. |
String |
{
"MerchantOrderId": "2017051002",
"Customer": {(…)
},
"Payment": {
(…)
"CreditCard": {
(…)
},
(…)
"Wallet": {
"Type": "ApplePay",
"WalletKey": "as01vRj+n9crY2vome7zc+u7Tz0+qg2La/8IUHpJIjFN6ThhUqLnSrskQHTrEbcYPiMksFK0+ddo9sZu70uJQJH1I+44N6PrVhilNDem97vOXq2VYDXiVJ27F/Q9wGQDgZBeGcZ6Pml9SIelHqUauBcQoOatrlnWPUL8kbdpT8WqgzXyaCh7oeTz=z6++rp/ofjvSjnGtOqAUsnrzvw4uzkcyKUSsfROdJ6B/Xzgu/T9fMIr5UxXD2DPF1SNh3ydEJABKz4HFjDW7ObvbQeua4GYxJdpQLpI3NgUbJy91E/LOyb/+PcCtO+0=a41tBrfnTTF9qsPuCIw8HWIEEKSRofn27NTofxev/i+nHEfqEtqNrN/epIvhzceD/gDiGetfiLKMzf94ARmpWUAMC==",
"AdditionalData": {
"EphemeralPublicKey": "MFkwEwZJKoZIzj0CAQYIKo12zj0DAQcDQgAEo+ReGClSmQ4hDJD1yh9nci3V4l7kPm2AQtKZMMvuNS0iK5sn/1A9l3kw1B1xCqOycZmnPSng7p5hpTvrei1BCA=="
}
},
(…)
"Links": [
(…)
]
}
}
The wallet authorization response will have the same fields presented in the documentation of API E-commerce Cielo, however with the addition of the Payment.Wallet
node repeating the same fields used in the authorization, as described above.
Google Pay is an e-wallet that allows shoppers to make payments in e-commerce stores and apps using their credit and debit cards stored in their Google Accounts and Android devices in a safe and easy way.
In order to use Google Pay, your store must be previously registered and integrated with Google Pay. In addition to that, you must also:
In this initial step, must set up your project and implement Google Pay in your Android application.
To set up your project, follow the instructions described in the Google Pay Setup Guide.
In this step, you must add dependencies either by importing the library from Google Play Services or choosing the APIs you want to compile. And then, to enable Google Pay in your Android application, you will have to modify the “AndroidManifest.xml” file of your project according to the instructions given on the page.
To integrate Google Play into your app, follow all the steps described in the Google Pay Tutorial Guide.
For the correct integration of Google Pay via Cielo, it is necessary to pay attention to the points below:
In step “Step 2: Request a payment token for your payment provider”, follow the model indicated as “GATEWAY” and assign the value “PAYMENT_GATEWAY” to the type
parameter and the value “cielo” to the gateway
parameter, according to the given example:
private static JSONObject getTokenizationSpecification() {
JSONObject tokenizationSpecification = new JSONObject();
tokenizationSpecification.put("type", "PAYMENT_GATEWAY");
tokenizationSpecification.put(
"parameters",
new JSONObject()
.put("gateway", "cielo")
.put("gatewayMerchantId", "exampleMerchantId"));
return tokenizationSpecification;
}
Fill in the gatewayMerchantId
parameter with your store’s identifier, generated by the gateway. The store identifier follows the format “XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX” (type GUID / size 36).
In “Step 3: Define supported payment card networks”, configure according to the flags accepted by the wallet.
In “Step 5: Create a PaymentsClient instance”, use the value “WalletConstants.ENVIRONMENT_TEST” for the test environment.
In “Step 7: Create a PaymentDataRequest object”, use the “BRL” value for the currencyCode
parameter. The merchantName
field is the name that the shopper will see throughout the Google Pay payment process. Thus, the use of a recognizable friendly name is recommended.
In “Step 9: Handle the response object”, the Activity.RESULT_OK
event is described, in which an object is returned with all the payment data, including payment tokens.
From the PaymentData
, the PaymentMethodToken
object is obtained, by calling the getPaymentMethodToken()
method. Click here for more information.
Next, you must get the string that contains payment tokens from the GetToken()
method of the PaymentMethodToken
object. Click here for more information.
The string obtained in the previous step has a structure like the one shown below. Click here for more information.
{
"protocolVersion": "ECv1",
"signature": "TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ",
"signedMessage": "{\"encryptedMessage\":
\"ZW5jcnlwdGVkTWVzc2FnZQ==\",\"ephemeralPublicKey\":
\"ZXBoZW1lcmFsUHVibGljS2V5\",\"tag\": \"c2lnbmF0dXJl\"}"
}
Parameter | Type | Description |
---|---|---|
signedMessage |
string | Signed message. |
signature |
string | Message signature. |
Save the signedMessage
and signature
data, which will be required for authorization via the API E-commerce Cielo in STEP 2, described below.
Authorization with the Google Pay token happens in the same way as standard credit card authorization. However, instead of providing card details openly, the token received by Google Pay must be provided, as shown in the example:
Notice: The following integration should be used when sending encrypted card data. If the merchant sends the authorization request with decrypted card data, please refer to Decrypted card.
{
"MerchantOrderId": "2014111708",
"Customer": {
(…)
},
"Payment": {
"Type": "CreditCard",
"Amount": 100,
"Installments": 1,
"Wallet": {
"Type": "AndroidPay",
"WalletKey": "{\"encryptedMessage\": \"ZW5jcnlwdGVkTWVzc2FnZQ==\",\"ephemeralPublicKey\": \"ZXBoZW1lcmFsUHVibGljS2V5\",\"tag\": \"c2lnbmF0dXJl\"}",
"AdditionalData": {
"Signature": "ZXBoZW1lcmFsUHVibGljS2V5"
}
}
}
}
Header Parameters | Description | Type and Size |
---|---|---|
MerchantId |
Store identifier at Cielo 3.0. For the Sandbox environment, use 63D6ACCB-2734-4236-AB5D-843A9DAC44C7. | GUID (36) |
MerchantKey |
API key for Cielo 3.0. For the Sandbox environment, use ZCVHDJWKTGOZXADDYJFURIDIKHEMRYQAQDYEJMQK. | String (24) |
Parameters | Description | Type and size |
---|---|---|
MerchantOrderId |
Order identification number. | String (50) |
Customer |
Node with the shopper’s data. | Refer to API E-commerce Cielo. |
Payment.Type |
Payment method type. Possible values: “CreditCard” / “DebitCard”. | String (100) |
Payment.Amount |
Transaction amount in cents. | Number (15) |
Payment.Installments |
Number of installments. | Number (2) |
Payment.Wallet.Type |
allet provider name. For Google Pay, use “AndroidPay”. | String (15) |
Payment.Wallet.WalletKey |
Provide the signedMessage received from Google Pay. |
String |
Payment.Wallet.AdditionalData.Signature |
Provide the signature received from Google Pay. |
String |
For further information, refer to API E-commerce Cielo.
The wallet authorization response will have the same fields presented in our API E-commerce Cielo documentation, however with the addition of the Payment.Wallet
node repeating the same fields used in the authorization, as described above.
In order to complete the process, first validate the steps performed in PARTS 1 and 2. Then, request your access credentials for deployment.
Verify whether the branding guidelines have been thoroughly followed.
Check that all items in the integration checklist have been attended. After everything is validated, request your access credentials for the production environment.
Below is the prerequisite for using Samsung Pay and also an example of a request to make it available in your store.
Notice: The following integration should be used when sending encrypted card data. If the merchant sends the authorization request with decrypted card data, please refer to Decrypted card.
Example of a standard Samsung Pay request:
{
"MerchantOrderId": "6242-642-723",
"Customer": {
"Name": "Exemplo Wallet Padrão",
"Identity": "11225468954",
"IdentityType": "CPF"
},
"Payment": {
"Type": "CreditCard",
"Amount": 1,
"Installments": 1,
"Currency": "BRL",
"Wallet": {
"Type": "SamsungPay",
"WalletKey": "IDENTIFICADOR DA LOJA NA WALLET"
}
}
}
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":"6242-642-723",
"Customer":{
"Name":"Exemplo Wallet Padrão",
"Identity":"11225468954",
"IdentityType":"CPF"
},
"Payment":{
"Type":"CreditCard",
"Amount":1,
"Installments":1,
"Currency":"BRL",
"Wallet":{
"Type":"SamsungPay",
"WalletKey":"IDENTIFICADOR DA LOJA NA WALLET"
}
}
}
Property | Description | Type | Size | Required |
---|---|---|---|---|
MerchantId |
Store identifier at Cielo. | GUID | 36 | Yes (sent in header) |
MerchantKey |
Public key for dual authentication at Cielo. | Text | 40 | Yes (sent in header) |
RequestId |
Request identifier, used when the merchant uses different servers for each GET/POST/PUT. | GUID | 36 | No (sent in header) |
MerchantOrderId |
Order ID number. | Text | 50 | Yes |
Customer.Name |
Customer’s name. | Text | 255 | No |
Customer.Status |
Customer’s registration status (“NEW” / “EXISTING”). | Text | 255 | No |
Payment.Type |
Payment method type. | Text | 100 | Yes |
Payment.Amount |
Order amount in cents. | Number | 15 | Yes |
Payment.Installments |
Number of installments. | Number | 2 | Yes |
Wallet.Type |
Wallet type: “SamsungPay”. | Text | 255 | Yes |
Wallet.WalletKey |
Cryptographic key representing card data. Consult the table WalletKey for more information. | Text | 255 | Yes |
{
"MerchantOrderId": "2014111703",
"Customer": {
"Name": "[Guest]"
},
"Payment": {
"ServiceTaxAmount": 0,
"Installments": 1,
"Interest": 0,
"Capture": false,
"Authenticate": false,
"Recurrent": false,
"CreditCard": {
"CardNumber": "453211******1521",
"Holder": "BJORN IRONSIDE",
"ExpirationDate": "08/2020",
"SaveCard": false,
"Brand": "Visa"
},
"Tid": "0319040817883",
"ProofOfSale": "817883",
"AuthorizationCode": "027795",
"Wallet": {
"Type": "SamsungPay",
"WalletKey": "IDENTIFICADOR DA LOJA NA WALLET",
"Eci": 0
},
"SoftDescriptor": "123456789ABCD",
"Amount": 100,
"ReceivedDate": "2018-03-19 16:08:16",
"Status": 1,
"IsSplitted": false,
"ReturnMessage": "Operation Successful",
"ReturnCode": "4",
"PaymentId": "e57b09eb-475b-44b6-ac71-01b9b82f2491",
"Type": "CreditCard",
"Currency": "BRL",
"Country": "BRA",
"Links": [
{
"Method": "GET",
"Rel": "self",
"Href": "https://apiquerysandbox.cieloecommerce.cielo.com.br/1/sales/{PaymentId}"
},
{
"Method": "PUT",
"Rel": "capture",
"Href": "https://apisandbox.cieloecommerce.cielo.com.br/1/sales/{paymentId}/capture"
},
{
"Method": "PUT",
"Rel": "void",
"Href": "https://apisandbox.cieloecommerce.cielo.com.br/1/sales/{PaymentId}/void"
}
]
}
}
--header "Content-Type: application/json"
--header "RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
--data-binary
{
"MerchantOrderId": "2014111703",
"Customer": {
"Name": "[Guest]"
},
"Payment": {
"ServiceTaxAmount": 0,
"Installments": 1,
"Interest": 0,
"Capture": false,
"Authenticate": false,
"Recurrent": false,
"CreditCard": {
"CardNumber": "453211******1521",
"Holder": "BJORN IRONSIDE",
"ExpirationDate": "08/2020",
"SaveCard": false,
"Brand": "Visa"
},
"Tid": "0319040817883",
"ProofOfSale": "817883",
"AuthorizationCode": "027795",
"Wallet": {
"Type": "SamsungPay",
"WalletKey": "IDENTIFICADOR DA LOJA NA WALLET",
"Eci": 0
},
"SoftDescriptor": "123456789ABCD",
"Amount": 100,
"ReceivedDate": "2018-03-19 16:08:16",
"Status": 1,
"IsSplitted": false,
"ReturnMessage": "Operation Successful",
"ReturnCode": "4",
"PaymentId": "e57b09eb-475b-44b6-ac71-01b9b82f2491",
"Type": "CreditCard",
"Currency": "BRL",
"Country": "BRA",
"Links": [
{
"Method": "GET",
"Rel": "self",
"Href": "https://apiquerysandbox.cieloecommerce.cielo.com.br/1/sales/{PaymentId}"
},
{
"Method": "PUT",
"Rel": "capture",
"Href": "https://apisandbox.cieloecommerce.cielo.com.br/1/sales/{paymentId}/capture"
},
{
"Method": "PUT",
"Rel": "void",
"Href": "https://apisandbox.cieloecommerce.cielo.com.br/1/sales/{PaymentId}/void"
}
]
}
}
Property | Description | Type | Size | Format |
---|---|---|---|---|
ProofOfSale |
Authorization number, identical to the NSU. | Text | 6 | Alphanumeric |
Tid |
Transaction ID on the acquirer. | Text | 20 | Alphanumeric |
AuthorizationCode |
Authorization code. | Text | 6 | Alphanumeric |
SoftDescriptor |
Text to be printed on the bearer’s bank statement. Note: Does not allow special characters. Available for VISA/MASTER only. | Text | 13 | Alphanumeric |
PaymentId |
Order identifier field. | GUID | 36 | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
ECI |
Electronic Commerce Indicator. Represents how secure a transaction is. | Text | 2 | E.g.: 7 |
Status |
Transaction status. | Byte | 2 | E.g.: 1 |
ReturnCode |
Return code from the acquirer. | Text | 32 | Alphanumeric |
ReturnMessage |
Return message from acquirer. | Text | 512 | Alphanumeric |
Type |
Wallet type: “SamsungPay” | Text | 255 | Alphanumeric |
WalletKey |
Cryptographic key representing card data. Consult the table WalletKey for more information. | Text | 255 | Refer to WalletKey. |
List of statuses returned by the API:
Code | Payment status | Payment method | Description |
---|---|---|---|
0 | NotFinished | All | Failed to process the payment. Possible causes: incorrect data, error in the request, acquirer timeout, some processing instability. In case of debit transaction, the buyer may have abandoned the purchase. |
1 | Authorized | All | Payment methods able to be captured or paid (boleto). For a boleto transaction, it means that the boleto was successfully generated. For a card transaction, it means that there was approval by the issuing bank. However, this does not mean that the transaction has been completed - for this, a second step is required, capturing the transaction or making the payment. |
2 | PaymentConfirmed | All | Payment confirmed and completed. |
3 | Denied | Credit and debit cards (electronic transfer) and e-wallets. | Payment denied by authorizer. Possible causes: insufficient limit, lack of payment on the card, unavailable brand, blocking due to fraud, among others. To find out the real reason for the denial, it is necessary to look at the return code generated during the transaction. |
10 | Voided | All, except boleto | Payment canceled. It is the suspension of the transaction, exempting from fees or amounts charged. Pre-authorized transactions can be canceled even after 23:59 on the authorization date. Captured transactions can be canceled up to 11:59 pm on the same day of authorization, after which time the amount will be reversed. |
11 | Refunded | Credit and debit cards and e-wallets. | Payment cancelled/reversed. Means that the cancellation of the transaction was requested, which may occur from 0:00 am on the day after the creation of the transaction. Regardless of the amount, it is only possible to make one reversal request per transaction. This can happen due to incorrect data or at the request of the shopper. |
12 | Pending | Credit and debit cards (electronic transfer), e-wallets and pix. | Awaiting return from financial institution. Means that the transaction was sent to Cielo in the pre-authorization process, awaiting a response from the issuing bank to validate it. |
13 | Aborted | All | Payment canceled due to processing failure. Means that the transaction was canceled due to processing failure. It can also be aborted if Anti-Fraud denies the transaction before authorization. |
20 | Scheduled | Credit card and e-wallets. | Scheduled recurrence. Means that the transaction will have a scheduled recurrence, that is, the purchase amount will be collected on the day it was scheduled by the store. |