Skip to main content

Enrollment with First Payment

Use Enrollment with First Payment when the customer needs to authorize recurring charges and make an initial payment at sign-up or checkout. Send the enrollment and the first payment in a single /ws/direct request. To obtain authorization without initiating a payment, see Single Enrollment. For a comparison, see Ways to create an enrollment.

Requirements​

  • API authentication - All API requests must be authenticated using JWS (JSON Web Signature). The legacy integration_key is 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.
  • Familiarity with EBANX Direct - See the Direct API reference for details.
  • Notification URL - Configure your Notification URL in the Merchant Area to receive payment and enrollment notifications. See Notifications.
  • Recurring payment method enabled - The payment method must be enabled for your account. Contact your EBANX Integration Specialist.

How it works​

  1. You send one request - Call /ws/direct with the payment data and an enrollment object that contains a new merchant_enrollment_code.
  2. EBANX creates the enrollment and the payment - The enrollment starts as pending. The payment is created in the same request.
  3. The customer approves - Depending on the payment method, the customer approves the enrollment in the provider's app or on a redirect page returned in the response.
  4. The first payment is processed - With a Single provider operation, the customer authorizes the enrollment and the first payment in the same approval flow (for example, one Pix QR code). With Charge after approval, EBANX charges the first payment only after the enrollment is accepted. See Execution models.
  5. You receive notifications - EBANX sends an enrollment notification when the enrollment status changes and a payment notification when the payment status changes.
  6. You charge later payments - Send new /ws/direct requests that reference the same merchant_enrollment_code. Each charge uses the existing authorization.
New code, new enrollment

Enrollment with First Payment applies only when the merchant_enrollment_code is new. A request that references an existing enrollment is a regular recurring charge. Use a unique merchant_enrollment_code for each enrollment.

Request and response​

The request is a regular /ws/direct payment request with an enrollment object inside payment. The payment fields and the method-specific enrollment fields are described in the guide of each method.

ParameterRequirementDescription
payment.payment_type_codeRequiredThe recurring payment method.
payment.amount_totalRequiredAmount of the first payment.
payment.merchant_payment_codeRequiredYour unique code for the first payment.
payment.enrollment.merchant_enrollment_codeRequiredA new, unique code for the enrollment. Reuse it in later charges.
payment.enrollment.*Depends on the methodMethod-specific enrollment fields, such as subscription or back_urls. See the table below.

The response returns status: SUCCESS and the payment with status PE. Depending on the payment method, it can also include:

  • redirect_url - Redirect the customer to this URL to approve the enrollment.
  • payment.enrollment - The enrollment status (pending) and its merchant_enrollment_code.
Payment methodMethod-specific enrollment fieldsCustomer approvalEnrollment in response
Capitec Pay Recurringsubscription (frequency, amount limits, and dates)Capitec Bank appYes
Card Recurringsubscription, back_urls (card data goes in payment.card)3-D Secure authentication, using threeds_redirect_urlNo
Maya Recurringsubscription, back_urlsredirect_urlNo
Nequi Recurringemail, phone_numberPush notification in the Nequi appYes
OPay Recurringsubscription, back_urlsredirect_urlYes
Pix AutomáticoCustomer data and subscriptionPix QR codeYes
UPI AutoPaysubscription, back_urlsUPI app link or QR codeNo
Yape RecurringsubscriptionYape app, using the redirect_urlYes

To compare the requests of each method side by side, see Compare requests by payment method.

Execution models​

The provider behind each payment method defines how the first payment is executed. Your integration sends the same single request in both models.

ModelWhat happensWhat you see
Single provider operationThe provider creates the enrollment and charges the first payment in the same operation.The payment follows the regular payment flow of the method.
Charge after approvalThe provider has no single operation for both steps. EBANX creates the enrollment and holds the first payment. After the customer approves the enrollment, EBANX requests the first charge automatically.The payment remains PE (pending) while the enrollment awaits approval. After approval, EBANX submits the charge. You do not send a second request.

Status outcomes​

With Charge after approval, the first payment depends on the enrollment status while the payment is PE. With a Single provider operation, the first payment follows the regular payment flow of the method.

Enrollment statusFirst payment (Charge after approval)
pendingStays PE (pending).
acceptedSent to the provider. It moves to CO (confirmed) if the charge is paid, or to CA (canceled) if it is not.
not_acceptedCanceled (CA). No charge is sent to the provider.
cancelledCanceled (CA). No charge is sent to the provider.
expiredCanceled (CA). No charge is sent to the provider.
revokedCanceled (CA). No charge is sent to the provider.

A later change to the enrollment, such as revoked or cancelled after the first payment is processed, does not change the first payment.

Payment method support​

Payment methodCountryExecution modelGuide
Capitec Pay RecurringSouth AfricaCharge after approvalCapitec Pay Recurring
Card RecurringIndiaFollows the card flow, with 3-D Secure authenticationCard Recurring
Maya RecurringPhilippinesCharge after approvalMaya Recurring
Nequi RecurringColombiaCharge after approvalNequi Recurring
OPay RecurringNigeriaSingle provider operationOPay Recurring
Pix Automático (with an instant payment)BrazilSingle provider operationPix Automático
UPI AutoPay (Intent or QR code)IndiaSingle provider operationUPI AutoPay
Yape RecurringPeruCharge after approvalYape Recurring

The guide of each payment method is the reference for its request fields, limits, and customer experience.

Compare requests by payment method​

Select two payment methods to see their requests and responses side by side. The lines that differ are highlighted.

Select an API Payload
Select a reference payment type
A code example for this payment method will be available soon.
Select a payment type to compare
A code example for this payment method will be available soon.

Notifications​

Use the payment notification to update the order and the enrollment notification to update the subscription. You can also query both statuses with /ws/userenrollments/query and /ws/query. Do not charge later payments until the enrollment is accepted.

For more information, refer to the
Payment Notificationschevron_right
For more information, refer to the
Enrollment Notificationschevron_right

Testing in sandbox​

In the sandbox, payment methods with the Charge after approval model return a redirect_url in the /ws/direct response. Open it to simulate the customer's decision and check the resulting enrollment and payment statuses. See Sandbox Simulator.

Resources​

Use the following resources when testing in your sandbox environment.

Still need help?

Help Image

We hope this article was helpful. If you still have questions, you can explore the following options: