Payment Terms API
Retrieve conversion rates, payment method options, and installment plans for a given currency pair and amount.
Get Payment Terms
/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 |
|---|---|---|---|
currencyPair | string | Currency pair code formed by source and target currencies (e.g. "USDBRL" for USD to BRL conversion). | |
amount | number | Payment 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 --request GET \
--url https://pay.staging.glin.com.br/merchant-api/payment-terms/USDBRL/500 \
--header 'Authorization: Bearer YOUR_API_KEY'Response
{
"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 |
|---|---|---|---|
amount | number | Original payment amount in the source currency. | |
currency | string | Source currency code (e.g. "USD"). | |
paymentCurrency | string | Target currency code the customer pays in (e.g. "BRL"). | |
convertedAmount | number | Base converted amount before payment method fees. | |
conversionRate | number | Exchange rate applied for the conversion. | |
options | array | Available payment method options with their respective costs. |
Payment Option Object
Each entry in the options array represents a payment method.
| Name | Type | Required | Description |
|---|---|---|---|
method | string | Payment method identifier: "pix" or "card". | |
totalDueAmount | number | Total amount due for a single payment (no installments) in the payment currency. | |
installmentPlans | array | Available 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 |
|---|---|---|---|
installments | number | Number of installments. | |
installmentAmount | number | Amount per installment in the payment currency. | |
totalAmount | number | Total 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.