Payment Terms API

Retrieve conversion rates, payment method options, and installment plans for a given currency pair and amount.

Get Payment Terms

GET/merchant-api/payment-terms/{currencyPair}/{amount}

Returns the available payment methods, converted amounts, and installment plans for a specific currency pair and amount. Use this endpoint to display pricing information to your customers before they enter the checkout flow.

Path Parameters

Name Type Required Description
currencyPairstringCurrency pair code formed by source and target currencies (e.g. "USDBRL" for USD to BRL conversion).
amountnumberPayment amount in the source currency.

The currency pair is formed by concatenating the source and target currency codes. For example, USDBRL converts from US Dollars to Brazilian Reais.

Example Request

cURL
curl --request GET \
  --url https://pay.staging.glin.com.br/merchant-api/payment-terms/USDBRL/500 \
  --header 'Authorization: Bearer YOUR_API_KEY'

Response

json
{
  "amount": 500.00,
  "currency": "USD",
  "paymentCurrency": "BRL",
  "convertedAmount": 2845.00,
  "conversionRate": 5.69,
  "options": [
    {
      "method": "pix",
      "totalDueAmount": 2845.00,
      "installmentPlans": []
    },
    {
      "method": "card",
      "totalDueAmount": 2987.25,
      "installmentPlans": [
        { "installments": 1, "installmentAmount": 2987.25, "totalAmount": 2987.25 },
        { "installments": 2, "installmentAmount": 1521.50, "totalAmount": 3043.00 },
        { "installments": 3, "installmentAmount": 1032.75, "totalAmount": 3098.25 },
        { "installments": 6, "installmentAmount": 533.82, "totalAmount": 3202.92 },
        { "installments": 12, "installmentAmount": 282.55, "totalAmount": 3390.60 },
        { "installments": 18, "installmentAmount": 199.33, "totalAmount": 3588.00 }
      ]
    }
  ]
}

Response Fields

Top-Level Fields

Name Type Required Description
amountnumberOriginal payment amount in the source currency.
currencystringSource currency code (e.g. "USD").
paymentCurrencystringTarget currency code the customer pays in (e.g. "BRL").
convertedAmountnumberBase converted amount before payment method fees.
conversionRatenumberExchange rate applied for the conversion.
optionsarrayAvailable payment method options with their respective costs.

Payment Option Object

Each entry in the options array represents a payment method.

Name Type Required Description
methodstringPayment method identifier: "pix" or "card".
totalDueAmountnumberTotal amount due for a single payment (no installments) in the payment currency.
installmentPlansarrayAvailable installment plans for this payment method. Empty array for PIX. These are the plans your contract prices, up to what the card acquirer currently accepts, for the amount asked about — a charge created with maxInstallments offers fewer, and this endpoint is not scoped to a charge, so it does not reflect that.

Installment Plan Object

Each entry in the installmentPlans array represents an available installment option.

Name Type Required Description
installmentsnumberNumber of installments.
installmentAmountnumberAmount per installment in the payment currency.
totalAmountnumberTotal amount including any installment fees.

Notes

Conversion rates are indicative and may change between the time you fetch payment terms and when the customer completes payment. The final rate is locked when the payment is confirmed.

PIX payments typically have lower fees than card payments and do not support installments. Card payments support installment plans, but the total amount increases with more installments due to financing fees.