NuPay Payment Conditions
The /ws/instalmentsPlan endpoint retrieves available funding sources and installment options from a customer's NuPay wallet. The response provides tailored payment conditions that vary based on the customer profile and purchase details.
When used, calling this endpoint before initiating a NuPay or NuPay Recurring payment allows you to verify whether the customer has available payment conditions (e.g., sufficient balance or an eligible credit line). If no conditions are available, you can avoid presenting NuPay as a payment option, resulting in higher effective conversion rates.
Calling this endpoint is optional and is not required to process NuPay payments. It is a recommended optimization step that can improve conversion rates, but it should not block your integration. If you choose not to call this endpoint, NuPay payments will still work normally.
Requirements
- API authentication - All API requests must be authenticated using JWS (JSON Web Signature). The legacy
integration_keyis being deprecated — if you still use it, follow the Migration Guide to transition to JWS. If you don't have credentials yet, complete the Merchant Signup Form.
How it works
There are two query modes depending on your integration:
-
Query with CPF only (NuPay and NuPay Recurring): Use this to check customer eligibility and retrieve installment options before the customer selects a payment method. For NuPay Recurring, this also serves as a pre-validation step before enrollment creation.
-
Query with enrollment code or CPF (NuPay Recurring only): After the customer is enrolled, use this to retrieve the specific installment options available for that enrollment.
This endpoint is currently available only for Brazil (BR) with BRL currency.
The right moment to call /ws/instalmentsPlan depends on your integration flow. For standard Direct API integrations, it is typically called before rendering the checkout so that NuPay only appears as a payment option if the customer is eligible. However, other integration flows (such as Meta) may require a different approach. We strongly recommend reaching out to your EBANX account manager before implementing this endpoint to ensure the integration is optimized for your specific use case.
Instructions
Follow the steps below.
- Select your environment
Select the appropriate environment for your integration. Use the sandbox environment for testing, or the production environment for live transactions. Use the URL for your HTTP requests based on your selection.
-
Production: https://api.ebanxpay.com/ws/instalmentsPlan
- Define your request parameters
To fetch the available plans, the request must include one of the following identifiers:
-
Customer Document (
document): The customer's CPF. -
Merchant Enrollment Code (
enrollment_code): The specific code of the customer's enrollment, for NuPay Recurring active enrollments.
Parameter Requirement Description integration_keyRequired Your EBANX integration key. country_abbreviationRequired Two-letter country code (e.g., BR).currency_codeRequired Three-letter currency code (ISO 4217). Set to BRL.amountRequired Total payment amount (cannot contain comma). payment_typeRequired Payment type code (e.g., nupay,nupay-recurrent).documentConditional Customer's CPF. Required when no enrollment_codeis provided.enrollment_codeConditional Customer's enrollment code. Required when no documentis provided. -
- Send the request
The
/ws/instalmentsPlanendpoint is flexible and can be accessed via two methods depending on your integration needs.- Post (recommended):
curl -X POST \
--location 'https://sandbox.ebanx.com/ws/instalmentsPlan' \
--header 'Content-Type: application/json' \
--data '{
"integration_key": "{{integration_key}}",
"country_abbreviation": "BR",
"currency_code": "BRL",
"amount": 100,
"document": "{{tax_id}}",
"payment_type": "nupay-recurrent",
"enrollment_code": "{{unique_enrollment_code}}"
}'- Get (use this method to retrieve plans by passing parameters directly in the URL query string):
curl -X GET \
--location 'https://sandbox.ebanx.com/ws/instalmentsPlan?integration_key={{integration_key}}&country_abbreviation=BR¤cy_code=BRL&amount=100&document={{tax_id}}&payment_type=nupay-recurrent' - Installments plan response
The response to this call will indicate what are the payment conditions available for the referred customer or enrollment in NuPay.
- Response example:
{
"instalmentsPlan": {
"debit": [
{
"totalAmount": 100,
"quantity": 1,
"instalmentAmount": 100,
"totalAmountWithInterest": 100
}
],
"credit": [
{
"totalAmount": 100,
"quantity": 1,
"instalmentAmount": 100,
"totalAmountWithInterest": 100
},
{
"totalAmount": 100,
"quantity": 2,
"instalmentAmount": 50,
"totalAmountWithInterest": 100
},
{
"totalAmount": 100,
"quantity": 3,
"instalmentAmount": 35.10,
"interest": 0.049,
"interestAmount": 4.90,
"iof": 0.41,
"cet": 77.54,
"totalAmountWithInterest": 105.31
}
],
"credit_with_additional_limit": [
{
"totalAmount": 100,
"quantity": 1,
"instalmentAmount": 376.30,
"interest": 0.11,
"additionalLimit": 833,
"totalAmountWithInterest": 376.30
}
]
}
}Response fieldsEach entry in the
instalmentsPlanobject includes:totalAmount(base payment amount),quantity(number of installments),instalmentAmount(per-installment value), andtotalAmountWithInterest(total amount including fees). Additional fields such asinterest,interestAmount,iof, andcetmay appear for options that include fees. - Use the response
Eligibility check (NuPay and NuPay Recurring): If the
instalmentsPlanobject is empty or the request returns an error, the customer is not eligible for NuPay. In this case, do not render NuPay as a payment option at checkout.Displaying installment options (NuPay Recurring only): Use the response data to render payment conditions in your own checkout. Present each option showing the number of installments (
quantity), the per-installment amount (instalmentAmount), and the total cost (totalAmountWithInterest) so the customer can make an informed choice.Once the customer selects their preferred installment plan, include it in your payment request to
/ws/direct, using the fieldspayment.metadata.funding_sourceandpayment.metadata.installments. - Congratulations!
You have successfully queried the NuPay Payment Conditions.
Still need help?
We hope this article was helpful. If you still have questions, you can explore the following options:
- Merchant support: Contact our support team at sales.engineering@ebanx.com for assistance.
- Not a partner yet? Please complete the Merchant Signup Form, and our commercial team will reach out to you.