API Reference

Payment Plan object

A Payment Plan consists of a group of installments personalized for a Buyer which are flexible in their expiration date, the amount and the type of currency. Unlike a Subscription, the installments are created manually, not automatically. In the responses to the payment plan queries there are two urls, the client_portal_url which is the link for the Payment Plan customer to enter the Zafepay Client Portal, where the customers can see the installments to pay, manage their payment methods and see all payments made. And the second url is the payment_url, a payment view where the customer can directly pay the corresponding installment.

A Payment Plan has 4 possible statuses: up_to_date, in_debt, canceled and finished. And his installments have 4 possible statuses: pending, paid, expired, refunded and processing_payment.

Installments that have already been paid cannot be edited.

{
    "payment_plan": {
        "buyer_id": "0d27afe0-7a02-41e1-9494-a955c21c0a3a",
        "name": "Departamento 65B",
        "client_portal_url": "http://app.zafepay.com/client/login?company_id=4a0gz20-33ec-422e-b41b-0a51e6611c9i",
        "description": "Proyecto Santa Rosa",
        "external_id": "pp001",
        "extra_fields": {
            "rut": "11.111.111-1"
        },
        "installments": [
            {
                "amount": 120000,
                "currency": "CLP",
                "due_date": "2023-09-01"
            },
            {
                "amount": 130000,
                "currency": "CLP",
                "due_date": "2023-10-01"
            },
            {
                "amount": 140000,
                "currency": "CLP",
                "due_date": "2023-11-01"
            },
            {
                "amount": 150000,
                "currency": "CLP",
                "due_date": "2023-12-01"
            },
            {
                "amount": 3.2,
                "currency": "UF",
                "due_date": "2024-01-01"
            }
        ],
        "payment_url": "http://app.zafepay.com/payment_plans/1ca6ecc9-86d4-4128-93f4-50b032c44e36"
    }
}

Attributes

The attributes available to a Payment Plan object are:

NameTypeDescriptionRequired
idstringPayment Plan unique identifier.false
buyer_idstringId of the Buyer for the Payment Plan.true
namestringName of the Payment Plan.true
descriptionstringA description for the Payment Planfalse
installmentsarray of jsonA list with all the installments for the Payment Plan. An installlment has:

- amount* (number): value of the installment.
- currency* (string): currency of the installment.
- due_date* (date): expiration date of the installment in ISO 8601 format.
- name (string): a custom name for the installment.
- external_id (string): a custom id for the installment.
- is_paid (boolean): create the installment with status "paid".
true
external_idstringAn external id to identify the Payment Plan.false
collection_company_refstringAn id to identify a project or group to which the payment plan belongs.false
notify_buyerbooleanField that defines the sending of an email to the buyer to enroll an automatic payment method to the payment plan. (default: true)false
imagefileAn image for the Payment Plan.false
extra_fieldsjsonExtra fields for the Payment Plan.false