# Payment Plans

Payment Plans let a customer pay off a total amount in fixed installments charged automatically to a card on file. A plan created without a payment method collects its deposit (the down payment, or installment 1 when there is none) on a registered Dejavoo terminal and stores that card for the remaining installments. This surface is gated per account and is off by default — contact Chaching to enable it.

 - [POST /payment-plans](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplanscontroller_createpaymentplan.md)
 - [GET /payment-plans](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplanscontroller_listpaymentplans.md)
 - [POST /payment-plans/{id}/payments](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplanscontroller_createpaymentplanpayment.md): Charges a stored payment method, records a payment collected elsewhere (external: true), or takes the payment on one of your registered Dejavoo terminals (payment_method: { "type": "terminal", "termin
 - [GET /payment-plans/{id}/payments](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplanscontroller_listpaymentplanpayments.md): Every payment of the plan, newest first, each the Payment object GET /payment-plans/{id}/payments/{payment_id} returns, with all six statuses. Filter with search={"status":"declined"} (one status). pa
 - [GET /payment-plans/{id}/payments/{payment_id}](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplanscontroller_retrievepaymentplanpayment.md)
 - [POST /payment-plans/{id}/payments/{payment_id}/resolve](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplanscontroller_resolveterminalpayment.md): Continues a terminal payment whose outcome is not known yet (terminal.state resolving) or whose approval was not recorded yet (approved_no_credential, or a payment still processing), and answers 200 w
 - [POST /payment-plans/{id}/payments/{payment_id}/cancel](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplanscontroller_cancelterminalpayment.md): Asks the terminal to cancel the sale that is waiting for the customer and answers 202 with the payment. The sale ends cancelled when the terminal reports the cancellation; poll GET /payment-plans/{id}
 - [POST /payment-plans/{id}/payments/{payment_id}/refunds](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplanscontroller_createpaymentplanrefund.md): Returns all or part of a payment to the card that paid it, with the same share of its credit card surcharge on a Dejavoo account, and answers 201 with the Refund object, status succeeded or pending. O
 - [POST /payment-plans/{id}/payments/{payment_id}/refunds/{refund_id}/forgive](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplanscontroller_forgivepaymentplanrefund.md): Forgives what is still owed from a refund of the payment and answers 200 with the Refund object, forgiven true and amount_due 0. Nothing is returned to the card. Forgiving cannot be undone. Requires a
 - [GET /payment-plans/{id}](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplanscontroller_retrievepaymentplan.md)
 - [PATCH /payment-plans/{id}](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplanscontroller_updatepaymentplan.md): Sets, replaces or removes the card of a running payment plan (status active, past_due or defaulted). A card is the id of a saved card of the plan's customer, saved with the payment gateway of the plan
 - [GET /payment-plans/{id}/installments](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplanscontroller_listinstallments.md)
 - [POST /payment-plans/{id}/cancel](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplanscontroller_cancelpaymentplan.md)
 - [POST /payment-plans/{id}/deposit/terminal](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplanscontroller_startterminaldeposit.md): Sends the deposit of a payment plan created without a payment method (its down payment, or installment 1 when it has none) to a registered Dejavoo terminal and answers 202 with the payment plan. The c
 - [POST /payment-plans/{id}/deposit](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplanscontroller_resolvedeposit.md): Continues a terminal deposit whose outcome is not known yet (deposit.attempt.state resolving) or whose card was charged but not saved (approved_no_credential), and answers 200 with the payment plan. C
 - [POST /payment-plans/{id}/deposit/cancel](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplanscontroller_cancelterminaldeposit.md): Asks the terminal to cancel the sale that is waiting for the customer and answers 202 with the payment plan. The attempt ends cancelled when the terminal reports the cancellation; poll GET /payment-pl
 - [POST /payment-plans/preview](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplanscontroller_previewpaymentplan.md): Answers the schedule the body of POST /payment-plans would produce, without creating anything. payment_method only selects the mode (card_on_file when present, terminal_deposit when absent) and is not
 - [POST /test-helpers/payment-plans/{id}/fail-installment](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplantesthelperscontroller_failinstallment.md): Staging only; production answers 403 TEST_HELPERS_NOT_AVAILABLE. Fails the earliest scheduled or failed installment of the payment plan once more, as a declined charge would: status failed, attempt_co
 - [POST /test-helpers/payment-plans/{id}/mark-past-due](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplantesthelperscontroller_markpastdue.md): Staging only; production answers 403 TEST_HELPERS_NOT_AVAILABLE. Moves an active payment plan that has a failed installment to past_due and sends payment_plan.past_due exactly like the billing engine'
 - [POST /test-helpers/payment-plans/{id}/mark-defaulted](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplantesthelperscontroller_markdefaulted.md): Staging only; production answers 403 TEST_HELPERS_NOT_AVAILABLE. Moves a payment plan that is active or past_due and has a failed installment to defaulted and sends payment_plan.defaulted exactly like
 - [POST /test-helpers/payment-plans/{id}/reactivate](https://chaching.redocly.app/developer-guide/api/payment-plans/paymentplantesthelperscontroller_reactivate.md): Staging only; production answers 403 TEST_HELPERS_NOT_AVAILABLE. Returns a payment plan whose past_due or defaulted status a test helper set to active and sends payment_plan.reactivated, exactly like
