Installments
Attract more customers by allowing them to split purchases into monthly payments. Learn how to easily implement and manage installment plans to boost conversion and average order value.
Localpayment enables merchants to offer installment plans, allowing customers to split their purchases into multiple monthly payments. This guide outlines the process for creating installment plans through Localpayment's API, detailing required parameters, handling responses, and managing the complete installment lifecycle.
Before You Begin
Ensure you have:
Step 1: Create Installment Plan Quote
Before processing an installment payment, you need to generate an installment plan quote to present payment options to the customer.
To quote an installment plan, you'll need to send a POST request to the Generate Installment Plan Quote endpoint.
Key Request Parameters
| Object | Description | Required |
|---|---|---|
paymentMethod.code | Payment method code. Only CreditCard methods are supported. | ✅ |
amount | Total transaction amount | ✅ |
currency | Transaction currency code | ✅ |
country | Country where payment will be processed | ✅ |
Example Request
Below is an example using curl:
curl --request POST \
--url https://api.stage.localpayment.com/api/installments-plans \
--header 'Authorization: Bearer <your_access_token>' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"paymentMethod": {
"code": "1600"
},
"country": "MEX",
"currency": "MXN",
"amount": 1000,
"accountNumber": "{{accountNumber}}"
}
'See all available parameters in the request.
Step 2: Handle the Quote Response
Successful Response
A successful installment quote includes detailed payment plan information:
{
"installmentsToken": "bc1a1923-fadc-427b-b014-e43eb4462e81",
"creationDate": "2025-01-29T23:53:52.7150456+00:00",
"expirationDate": "2025-01-30T00:03:52.71509+00:00",
"currency": "MXN",
"amount": 1000,
"installments": [
{
"installments": 3,
"installmentAmount": 448.98,
"totalPaymentAmount": 1346.95,
"financingFee": 346.95
},
{
"installments": 6,
"installmentAmount": 275.68,
"totalPaymentAmount": 1654.12,
"financingFee": 654.12
}
]
}Key Response Fields
| Parameter | Description | Use Case |
|---|---|---|
installmentsToken | Unique token identifying the installment quote | Required for processing the selected installment plan. |
creationDate | Timestamp when the quote was generated. | Track quote validity and timing. |
expirationDate | Timestamp when the quote expires. | Ensure customer selects plan before expiration. |
currency | Currency of the transaction. | Display correct currency symbol to customer. |
installments | Array of available installment options. | Present multiple payment plans to customer. |
installments.installments | Number of monthly payments. | Show payment term duration. |
installments.installmentAmount | Monthly payment amount. | Display monthly cost to customer. |
installments.totalPaymentAmount | Total amount including fees. | Show full cost of financing. |
installments.financingFee | Total financing cost. | Display fees and interest separately. |
Error Response
When installment quote generation fails::
{
"status": {
"code": "300",
"detail": "Instalment Payment Plan is only for types of Credit Card methods"
}
}Best Practices for Installment Presentation
- Display all costs clearly (financing fees, total amount)
- Show monthly payment amounts prominently
- Include comparison between different installment options
- Explain automatic payment process for future installments
- Include customer support information
- Handle token expiration gracefully (10-minute window)
Step 3: Process Installment Payment
Once the customer selects an installment plan, process the payment using the installments token.
Example Request
curl --request POST \
--url https://api.stage.localpayment.com/api/payin/ \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--header 'Content-Type: application/json' \
--data '{
"paymentMethod": {
"type": "CreditCard",
"code": "1600",
"flow": "DIRECT"
},
"externalId": "dffbd2a6-6e65-469b-8bbe-dac269882220",
"country": "MEX",
"currency": "MXN",
"amount": 1000,
"accountNumber": "{{accountNumber}}",
"conceptCode": "0001",
"merchant": {
"type": "COMPANY",
"name": "Company",
"document": {
"type": "RFC",
"id": "XXX840510XX1"
},
"email": "[email protected]"
},
"payer": {
"type": "INDIVIDUAL",
"name": "John",
"lastname": "Doe",
"document": {
"type": "RFC",
"id": "YYY180222YY6"
},
"email": "[email protected]"
},
"card": {
"number": "4000000000000002",
"cvv": "123",
"expirationMonth": "12",
"expirationYear": "2029",
"installments": 3,
"installmentsToken": "bc1a1923-fadc-427b-b014-e43eb4462e81"
}
}'Step 4: Track Installment Status
Monitor installment plan progress through these methods:
Webhooks (Recommended)
Receive real-time notifications for each installment payment and plan status changes.
Status API Endpoint
Query transaction status programmatically. Useful for polling or recovering lost webhook notifications.
Dashboard View
Visual interface for monitoring installment plans and payment performance.
Common Status Codes
The Localpayment API provides various status codes for installment plans and payments.
| Code | Status | Description |
|---|---|---|
103 | APPROVED | The payin was confirmed but not credited yet. |
200 | Completed | The payin was completed. |
811 | Rejected | Requested amount is higher or lower than allowed max/min values. |
For complete status code reference, see the Transaction Status documentation.
Step 5: Manage Installment Lifecycle
Installment Payment Flow
sequenceDiagram
participant C as Customer
participant M as Merchant
participant LP as Localpayment
participant B as Bank
C->>M: Initiate payment with installment option
M->>LP: Request installment quote
LP->>M: Return installmentsToken and options
M->>C: Present installment plans
C->>M: Select preferred plan
M->>LP: Process payment with installmentsToken
LP->>B: Authorize first installment
B->>LP: Authorization confirmed
LP->>M: Payment confirmation
M->>C: Display payment result (approved/declined)
Note over C: Customer receives transaction status and payment plan details
Note over LP: Monthly installments processed automatically
LP->>M: Webhook for each installment
Testing Your Integration
Test Scenarios
Verify your integration handles these scenarios:
- Successful Installment: Complete installment payment flow
- Multiple Plan Options: Present different installment terms (2, 3, 6 months)
- Token Expiration: Handle expired installmentsToken (10-minute window)
- Status Updates: Webhook handling and status polling.
Next Steps
After implementing installments, consider these additional capabilities::
Refund the transaction
If necessary, you can refund the payment to the customer. Refer to the documentation for details.
Review transaction details
You can retrieve transaction information using the Localpayment API for detailed insights.
Updated 20 minutes ago
