Checkout for Credit Card

Credit Card (One-Time Payment)

Simply change the payment method to CREDIT_CARD:

"billingTypes": ["CREDIT_CARD"]

Example: Credit Card (One-Time Payment)

{
  "billingTypes": ["CREDIT_CARD"],
  "chargeTypes": ["DETACHED"],
  "minutesToExpire": 60,
  "callback": {
    "cancelUrl": "https://mywebsite.com/canceled",
    "expiredUrl": "https://mywebsite.com/expired",
    "successUrl": "https://mywebsite.com/success"
  },
  "items": [
    {
      "name": "Financial Consulting",
      "description": "One-time consulting session",
      "imageBase64": "{{image1}}",
      "quantity": 1,
      "value": 150.00
    },
    {
      "description": "Black T-Shirt",
      "imageBase64": "{{image2}}",
      "name": "test2",
      "quantity": 2,
      "value": 100.00
    }
  ],
  "customerData": {
    "name": "João da Silva",
    "cpfCnpj": "12345678909",
    "email": "[email protected]",
    "phone": "47999998888",
    "address": "Rua das Palmeiras",
    "addressNumber": "100",
    "complement": "Apt 202",
    "postalCode": "89000000",
    "province": "Centro",
    "city": 4205407
  }
}

The customer will see a field to enter credit card details and will make a one-time payment. The charge will be processed for the total item amount, with no installment option available.


Credit Card (Installments)

To allow installment payments, add the INSTALLMENT type:

"billingTypes": ["CREDIT_CARD"],
"chargeTypes": ["DETACHED", "INSTALLMENT"]

You can also set a maximum number of installments with:

"installment": {
  "maxInstallmentCount": 3
}

Example: Credit Card (Installments)

{
  "billingTypes": ["CREDIT_CARD"],
  "chargeTypes": ["INSTALLMENT"],
  "minutesToExpire": 100,
  "callback": {
    "cancelUrl": "https://google.com/cancel",
    "expiredUrl": "https://google.com/expired",
    "successUrl": "https://google.com/success"
  },
  "items": [
    {
      "description": "White T-Shirt",
      "imageBase64": "{{image1}}",
      "name": "test2",
      "quantity": 2,
      "value": 100.00
    },
    {
      "description": "Black T-Shirt",
      "imageBase64": "{{image2}}",
      "name": "test2",
      "quantity": 2,
      "value": 100.00
    }
  ],
  "installment": {
    "maxInstallmentCount": 6
  },
  "customerData": {
    "name": "Maria Oliveira",
    "cpfCnpj": "98765432100",
    "email": "[email protected]",
    "phone": "47988887777",
    "address": "Av. Brasil",
    "addressNumber": "500",
    "complement": "Room 12",
    "postalCode": "89012345",
    "province": "Centro",
    "city": 4205407
  }
}

On the checkout page, the customer will be able to choose between paying in full or splitting the total into up to 6 installments (the number of installments is defined in maxInstallmentCount; in this example, it’s 6) using a credit card. The installment option will appear automatically based on the amount and settings.