> For the complete documentation index, see [llms.txt](https://developers.spiffy.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.spiffy.co/api/paymentplans.md).

# Paymentplans

Payment plan management

## List paymentplans

> Retrieve a paginated list of paymentplans

```json
{"openapi":"3.0.3","info":{"title":"Spiffy API","version":"2.0.0"},"tags":[{"name":"paymentplans","description":"Payment plan management"}],"servers":[{"url":"https://api.spiffy.co","description":"Production"}],"security":[{"ApiKeyAuth":[]},{"OAuth2":["paymentplans"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Account API key authentication. Pass an API key as a Bearer token in the `Authorization` header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes."},"OAuth2":{"type":"oauth2","description":"OAuth 2.0 authentication for third-party integrations. Access is limited to the scopes granted by the merchant during authorization.","flows":{"authorizationCode":{"authorizationUrl":"https://app.spiffy.co/oauth/authorize","tokenUrl":"https://api.spiffy.co/oauth/token","refreshUrl":"https://api.spiffy.co/oauth/token","scopes":{"account":"Access account details and settings","users":"Manage users","customers":"Read and manage customers","checkouts":"Read and manage checkouts","subscriptions":"Read and manage subscriptions","subscription_metered_billing":"Manage metered billing for subscriptions","integrations":"Manage integrations","orders":"Read and manage orders","payments":"Read and manage payments","paymentplans":"Read and manage payment plans","webhooks":"Manage webhook endpoints and view event logs","promos":"Read and manage promo/discount codes","affiliates":"Read and manage affiliates and programs","products":"Read and manage products","analytics":"Read analytics data (revenue, orders, subscriptions, MRR)","reports":"Create, run, and read saved reports and their results"}}}}},"schemas":{"Paymentplan":{"type":"object","properties":{"id":{"type":"integer","description":"Payment plan ID"},"order_id":{"type":"integer","description":"Associated order ID"},"card_id":{"type":"integer","description":"Card used for payments"},"status":{"type":"string","enum":["active","past_due","unpaid","completed","defaulted"],"description":"Payment plan status. 'defaulted' is a terminal write-off state set via the pay endpoint with payoff_outcome='defaulted'."},"next_payment_at":{"type":"string","nullable":true,"format":"date-time","description":"Next scheduled payment date"},"finished_at":{"type":"string","nullable":true,"format":"date-time","description":"Timestamp when the plan reached a terminal state (completed or defaulted). Null for active plans."},"frequency":{"type":"string","enum":["day","week","month","year"],"description":"Payment frequency"},"frequency_count":{"type":"integer","description":"Frequency multiplier (e.g., 2 for bi-weekly)"},"is_finance_hidden":{"type":"boolean","nullable":true,"description":"Whether finance details are hidden"},"unpaid_at":{"type":"string","nullable":true,"format":"date-time","description":"When payment plan became unpaid"},"is_scheduled":{"type":"boolean","description":"Whether plan is scheduled"},"created_at":{"type":"string","nullable":true,"format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","nullable":true,"format":"date-time","description":"Last update timestamp"},"remaining_balance":{"type":"integer","description":"Remaining balance in cents"},"paid_amount":{"type":"integer","description":"Total paid amount in cents"},"total_amount":{"type":"integer","description":"Total plan amount in cents"},"defaulted_amount":{"type":"integer","description":"Magnitude of write-off adjustments tied to this plan from a payoff_outcome='defaulted' request, in cents (positive). Zero for plans that were never defaulted."},"payments_made":{"type":"integer","description":"Number of payments made"},"payments_remaining":{"type":"integer","description":"Number of payments remaining"},"item_ids":{"type":"array","items":{"type":"integer"},"description":"Order item IDs in this plan"},"current_payment_status":{"type":"string","nullable":true,"description":"Status of most recent payment"},"payment_ids":{"type":"array","items":{"type":"integer"},"description":"Payment IDs for this plan"},"retry_schedule":{"type":"array","items":{"type":"string"},"description":"Pending retry schedule for past_due plans (array of date strings)"},"detail":{"type":"object","additionalProperties":{"nullable":true},"description":"Calculated payment plan details"},"items":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"description":"Payment plan items (expansion: items)"},"payments":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"description":"Payments for this plan (expansion: payments)"},"order":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Order data (expansion: order)"},"customer":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Customer data (expansion: customer)"},"custom_fields":{"type":"array","items":{"nullable":true},"description":"Custom fields (expansion: custom_fields)"},"card":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Payment card (expansion: card)"},"gateway":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Payment gateway info (expansion: gateway)"}},"required":["id","order_id","card_id","status","frequency"]},"Error401":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error403":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error500":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}},"paths":{"/v2/paymentplans":{"get":{"tags":["paymentplans"],"summary":"List paymentplans","description":"Retrieve a paginated list of paymentplans","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"Page number"},"required":false,"description":"Page number","name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"description":"Items per page (max 100)"},"required":false,"description":"Items per page (max 100)","name":"per_page","in":"query"},{"schema":{"type":"string","description":"Comma-separated list of expansions: items, payments, order, customer, custom_fields, card, gateway"},"required":false,"description":"Comma-separated list of expansions: items, payments, order, customer, custom_fields, card, gateway","name":"include","in":"query"},{"schema":{"type":"string","description":"Filter by id (exact match)."},"required":false,"description":"Filter by id (exact match).","name":"filter[id]","in":"query"},{"schema":{"type":"string","description":"Filter by id (greater than or equal)"},"required":false,"description":"Filter by id (greater than or equal)","name":"filter[id.gte]","in":"query"},{"schema":{"type":"string","description":"Filter by id (less than or equal)"},"required":false,"description":"Filter by id (less than or equal)","name":"filter[id.lte]","in":"query"},{"schema":{"type":"string","description":"Filter by id (comma-separated list). Fetches many records in one request instead of one request per id."},"required":false,"description":"Filter by id (comma-separated list). Fetches many records in one request instead of one request per id.","name":"filter[id.in]","in":"query"},{"schema":{"type":"string","description":"Filter by id (excluding a comma-separated list)"},"required":false,"description":"Filter by id (excluding a comma-separated list)","name":"filter[id.nin]","in":"query"},{"schema":{"type":"string","description":"Filter by status (exact match). Valid values: active, past_due, unpaid, completed, defaulted."},"required":false,"description":"Filter by status (exact match). Valid values: active, past_due, unpaid, completed, defaulted.","name":"filter[status]","in":"query"},{"schema":{"type":"string","description":"Filter by status (comma-separated list). Fetches many records in one request instead of one request per id."},"required":false,"description":"Filter by status (comma-separated list). Fetches many records in one request instead of one request per id.","name":"filter[status.in]","in":"query"},{"schema":{"type":"string","description":"Filter by status (excluding a comma-separated list)"},"required":false,"description":"Filter by status (excluding a comma-separated list)","name":"filter[status.nin]","in":"query"},{"schema":{"type":"string","description":"Filter by order_id (exact match)."},"required":false,"description":"Filter by order_id (exact match).","name":"filter[order_id]","in":"query"},{"schema":{"type":"string","description":"Filter by order_id (greater than or equal)"},"required":false,"description":"Filter by order_id (greater than or equal)","name":"filter[order_id.gte]","in":"query"},{"schema":{"type":"string","description":"Filter by order_id (less than or equal)"},"required":false,"description":"Filter by order_id (less than or equal)","name":"filter[order_id.lte]","in":"query"},{"schema":{"type":"string","description":"Filter by order_id (comma-separated list). Fetches many records in one request instead of one request per id."},"required":false,"description":"Filter by order_id (comma-separated list). Fetches many records in one request instead of one request per id.","name":"filter[order_id.in]","in":"query"},{"schema":{"type":"string","description":"Filter by order_id (excluding a comma-separated list)"},"required":false,"description":"Filter by order_id (excluding a comma-separated list)","name":"filter[order_id.nin]","in":"query"},{"schema":{"type":"string","description":"Filter by customer_id (exact match)."},"required":false,"description":"Filter by customer_id (exact match).","name":"filter[customer_id]","in":"query"},{"schema":{"type":"string","description":"Filter by customer_id (greater than or equal)"},"required":false,"description":"Filter by customer_id (greater than or equal)","name":"filter[customer_id.gte]","in":"query"},{"schema":{"type":"string","description":"Filter by customer_id (less than or equal)"},"required":false,"description":"Filter by customer_id (less than or equal)","name":"filter[customer_id.lte]","in":"query"},{"schema":{"type":"string","description":"Filter by customer_id (comma-separated list). Fetches many records in one request instead of one request per id."},"required":false,"description":"Filter by customer_id (comma-separated list). Fetches many records in one request instead of one request per id.","name":"filter[customer_id.in]","in":"query"},{"schema":{"type":"string","description":"Filter by customer_id (excluding a comma-separated list)"},"required":false,"description":"Filter by customer_id (excluding a comma-separated list)","name":"filter[customer_id.nin]","in":"query"},{"schema":{"type":"string","description":"Filter by email (exact match)."},"required":false,"description":"Filter by email (exact match).","name":"filter[email]","in":"query"},{"schema":{"type":"string","description":"Filter by email (contains)"},"required":false,"description":"Filter by email (contains)","name":"filter[email.contains]","in":"query"},{"schema":{"type":"string","description":"Filter by created_at (exact match)."},"required":false,"description":"Filter by created_at (exact match).","name":"filter[created_at]","in":"query"},{"schema":{"type":"string","description":"Filter by created_at (greater than or equal)"},"required":false,"description":"Filter by created_at (greater than or equal)","name":"filter[created_at.gte]","in":"query"},{"schema":{"type":"string","description":"Filter by created_at (less than or equal)"},"required":false,"description":"Filter by created_at (less than or equal)","name":"filter[created_at.lte]","in":"query"},{"schema":{"type":"string","description":"Filter by updated_at (exact match)."},"required":false,"description":"Filter by updated_at (exact match).","name":"filter[updated_at]","in":"query"},{"schema":{"type":"string","description":"Filter by updated_at (greater than or equal)"},"required":false,"description":"Filter by updated_at (greater than or equal)","name":"filter[updated_at.gte]","in":"query"},{"schema":{"type":"string","description":"Filter by updated_at (less than or equal)"},"required":false,"description":"Filter by updated_at (less than or equal)","name":"filter[updated_at.lte]","in":"query"},{"schema":{"type":"string","description":"Filter by next_payment_at (exact match)."},"required":false,"description":"Filter by next_payment_at (exact match).","name":"filter[next_payment_at]","in":"query"},{"schema":{"type":"string","description":"Filter by next_payment_at (greater than or equal)"},"required":false,"description":"Filter by next_payment_at (greater than or equal)","name":"filter[next_payment_at.gte]","in":"query"},{"schema":{"type":"string","description":"Filter by next_payment_at (less than or equal)"},"required":false,"description":"Filter by next_payment_at (less than or equal)","name":"filter[next_payment_at.lte]","in":"query"},{"schema":{"type":"string","description":"Sort field (prefix with - for descending)"},"required":false,"description":"Sort field (prefix with - for descending)","name":"sort","in":"query"}],"responses":{"200":{"description":"Successful response with paginated list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Paymentplan"}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"Current page number"},"limit":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"Items per page"},"total":{"type":"integer","description":"Total number of items"},"pages":{"type":"integer","description":"Total number of pages"}},"required":["page","limit","total","pages"]}},"required":["data","pagination"]}}}},"401":{"description":"Unauthorized - Authentication is required or has failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error401"}}}},"403":{"description":"Forbidden - You do not have permission to access this resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error403"}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error500"}}}}}}}}}
```

## Get paymentplans

> Retrieve a single paymentplans by ID

```json
{"openapi":"3.0.3","info":{"title":"Spiffy API","version":"2.0.0"},"tags":[{"name":"paymentplans","description":"Payment plan management"}],"servers":[{"url":"https://api.spiffy.co","description":"Production"}],"security":[{"ApiKeyAuth":[]},{"OAuth2":["paymentplans"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Account API key authentication. Pass an API key as a Bearer token in the `Authorization` header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes."},"OAuth2":{"type":"oauth2","description":"OAuth 2.0 authentication for third-party integrations. Access is limited to the scopes granted by the merchant during authorization.","flows":{"authorizationCode":{"authorizationUrl":"https://app.spiffy.co/oauth/authorize","tokenUrl":"https://api.spiffy.co/oauth/token","refreshUrl":"https://api.spiffy.co/oauth/token","scopes":{"account":"Access account details and settings","users":"Manage users","customers":"Read and manage customers","checkouts":"Read and manage checkouts","subscriptions":"Read and manage subscriptions","subscription_metered_billing":"Manage metered billing for subscriptions","integrations":"Manage integrations","orders":"Read and manage orders","payments":"Read and manage payments","paymentplans":"Read and manage payment plans","webhooks":"Manage webhook endpoints and view event logs","promos":"Read and manage promo/discount codes","affiliates":"Read and manage affiliates and programs","products":"Read and manage products","analytics":"Read analytics data (revenue, orders, subscriptions, MRR)","reports":"Create, run, and read saved reports and their results"}}}}},"schemas":{"Paymentplan":{"type":"object","properties":{"id":{"type":"integer","description":"Payment plan ID"},"order_id":{"type":"integer","description":"Associated order ID"},"card_id":{"type":"integer","description":"Card used for payments"},"status":{"type":"string","enum":["active","past_due","unpaid","completed","defaulted"],"description":"Payment plan status. 'defaulted' is a terminal write-off state set via the pay endpoint with payoff_outcome='defaulted'."},"next_payment_at":{"type":"string","nullable":true,"format":"date-time","description":"Next scheduled payment date"},"finished_at":{"type":"string","nullable":true,"format":"date-time","description":"Timestamp when the plan reached a terminal state (completed or defaulted). Null for active plans."},"frequency":{"type":"string","enum":["day","week","month","year"],"description":"Payment frequency"},"frequency_count":{"type":"integer","description":"Frequency multiplier (e.g., 2 for bi-weekly)"},"is_finance_hidden":{"type":"boolean","nullable":true,"description":"Whether finance details are hidden"},"unpaid_at":{"type":"string","nullable":true,"format":"date-time","description":"When payment plan became unpaid"},"is_scheduled":{"type":"boolean","description":"Whether plan is scheduled"},"created_at":{"type":"string","nullable":true,"format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","nullable":true,"format":"date-time","description":"Last update timestamp"},"remaining_balance":{"type":"integer","description":"Remaining balance in cents"},"paid_amount":{"type":"integer","description":"Total paid amount in cents"},"total_amount":{"type":"integer","description":"Total plan amount in cents"},"defaulted_amount":{"type":"integer","description":"Magnitude of write-off adjustments tied to this plan from a payoff_outcome='defaulted' request, in cents (positive). Zero for plans that were never defaulted."},"payments_made":{"type":"integer","description":"Number of payments made"},"payments_remaining":{"type":"integer","description":"Number of payments remaining"},"item_ids":{"type":"array","items":{"type":"integer"},"description":"Order item IDs in this plan"},"current_payment_status":{"type":"string","nullable":true,"description":"Status of most recent payment"},"payment_ids":{"type":"array","items":{"type":"integer"},"description":"Payment IDs for this plan"},"retry_schedule":{"type":"array","items":{"type":"string"},"description":"Pending retry schedule for past_due plans (array of date strings)"},"detail":{"type":"object","additionalProperties":{"nullable":true},"description":"Calculated payment plan details"},"items":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"description":"Payment plan items (expansion: items)"},"payments":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"description":"Payments for this plan (expansion: payments)"},"order":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Order data (expansion: order)"},"customer":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Customer data (expansion: customer)"},"custom_fields":{"type":"array","items":{"nullable":true},"description":"Custom fields (expansion: custom_fields)"},"card":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Payment card (expansion: card)"},"gateway":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Payment gateway info (expansion: gateway)"}},"required":["id","order_id","card_id","status","frequency"]},"Error401":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error403":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error404":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error500":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}},"paths":{"/v2/paymentplans/{id}":{"get":{"tags":["paymentplans"],"summary":"Get paymentplans","description":"Retrieve a single paymentplans by ID","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"paymentplans ID"},"required":true,"description":"paymentplans ID","name":"id","in":"path"},{"schema":{"type":"string","description":"Comma-separated list of expansions: items, payments, order, customer, custom_fields, card, gateway"},"required":false,"description":"Comma-separated list of expansions: items, payments, order, customer, custom_fields, card, gateway","name":"include","in":"query"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Paymentplan"}}}},"401":{"description":"Unauthorized - Authentication is required or has failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error401"}}}},"403":{"description":"Forbidden - You do not have permission to access this resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error403"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error404"}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error500"}}}}}}}}}
```

## Cancel a payment plan

> Cancel a payment plan by setting its status to unpaid.

```json
{"openapi":"3.0.3","info":{"title":"Spiffy API","version":"2.0.0"},"tags":[{"name":"paymentplans","description":"Payment plan management"}],"servers":[{"url":"https://api.spiffy.co","description":"Production"}],"security":[{"ApiKeyAuth":[]},{"OAuth2":["paymentplans"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Account API key authentication. Pass an API key as a Bearer token in the `Authorization` header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes."},"OAuth2":{"type":"oauth2","description":"OAuth 2.0 authentication for third-party integrations. Access is limited to the scopes granted by the merchant during authorization.","flows":{"authorizationCode":{"authorizationUrl":"https://app.spiffy.co/oauth/authorize","tokenUrl":"https://api.spiffy.co/oauth/token","refreshUrl":"https://api.spiffy.co/oauth/token","scopes":{"account":"Access account details and settings","users":"Manage users","customers":"Read and manage customers","checkouts":"Read and manage checkouts","subscriptions":"Read and manage subscriptions","subscription_metered_billing":"Manage metered billing for subscriptions","integrations":"Manage integrations","orders":"Read and manage orders","payments":"Read and manage payments","paymentplans":"Read and manage payment plans","webhooks":"Manage webhook endpoints and view event logs","promos":"Read and manage promo/discount codes","affiliates":"Read and manage affiliates and programs","products":"Read and manage products","analytics":"Read analytics data (revenue, orders, subscriptions, MRR)","reports":"Create, run, and read saved reports and their results"}}}}},"schemas":{"Error400":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error401":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error403":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error404":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error500":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}},"paths":{"/v2/paymentplans/{id}/cancel":{"put":{"tags":["paymentplans"],"summary":"Cancel a payment plan","description":"Cancel a payment plan by setting its status to unpaid.","parameters":[{"schema":{"type":"string","description":"Payment plan ID"},"required":true,"description":"Payment plan ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"nullable":true}}}},"400":{"description":"Bad Request - The request was invalid or malformed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error400"}}}},"401":{"description":"Unauthorized - Authentication is required or has failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error401"}}}},"403":{"description":"Forbidden - You do not have permission to access this resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error403"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error404"}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error500"}}}}}}}}}
```

## Add notes to payment plan

> Add a note to a payment plan. Notes are stored as user events.

```json
{"openapi":"3.0.3","info":{"title":"Spiffy API","version":"2.0.0"},"tags":[{"name":"paymentplans","description":"Payment plan management"}],"servers":[{"url":"https://api.spiffy.co","description":"Production"}],"security":[{"ApiKeyAuth":[]},{"OAuth2":["paymentplans"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Account API key authentication. Pass an API key as a Bearer token in the `Authorization` header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes."},"OAuth2":{"type":"oauth2","description":"OAuth 2.0 authentication for third-party integrations. Access is limited to the scopes granted by the merchant during authorization.","flows":{"authorizationCode":{"authorizationUrl":"https://app.spiffy.co/oauth/authorize","tokenUrl":"https://api.spiffy.co/oauth/token","refreshUrl":"https://api.spiffy.co/oauth/token","scopes":{"account":"Access account details and settings","users":"Manage users","customers":"Read and manage customers","checkouts":"Read and manage checkouts","subscriptions":"Read and manage subscriptions","subscription_metered_billing":"Manage metered billing for subscriptions","integrations":"Manage integrations","orders":"Read and manage orders","payments":"Read and manage payments","paymentplans":"Read and manage payment plans","webhooks":"Manage webhook endpoints and view event logs","promos":"Read and manage promo/discount codes","affiliates":"Read and manage affiliates and programs","products":"Read and manage products","analytics":"Read analytics data (revenue, orders, subscriptions, MRR)","reports":"Create, run, and read saved reports and their results"}}}}},"schemas":{"Error400":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error401":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error403":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error404":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error500":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}},"paths":{"/v2/paymentplans/{id}/notes":{"post":{"tags":["paymentplans"],"summary":"Add notes to payment plan","description":"Add a note to a payment plan. Notes are stored as user events.","parameters":[{"schema":{"type":"string","description":"Payment plan ID"},"required":true,"description":"Payment plan ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"type":"string"}},"required":["notes"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"nullable":true}}}},"400":{"description":"Bad Request - The request was invalid or malformed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error400"}}}},"401":{"description":"Unauthorized - Authentication is required or has failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error401"}}}},"403":{"description":"Forbidden - You do not have permission to access this resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error403"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error404"}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error500"}}}}}}}}}
```

## Add new card to payment plan

> Create a new payment card and assign it to the payment plan.

```json
{"openapi":"3.0.3","info":{"title":"Spiffy API","version":"2.0.0"},"tags":[{"name":"paymentplans","description":"Payment plan management"}],"servers":[{"url":"https://api.spiffy.co","description":"Production"}],"security":[{"ApiKeyAuth":[]},{"OAuth2":["paymentplans"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Account API key authentication. Pass an API key as a Bearer token in the `Authorization` header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes."},"OAuth2":{"type":"oauth2","description":"OAuth 2.0 authentication for third-party integrations. Access is limited to the scopes granted by the merchant during authorization.","flows":{"authorizationCode":{"authorizationUrl":"https://app.spiffy.co/oauth/authorize","tokenUrl":"https://api.spiffy.co/oauth/token","refreshUrl":"https://api.spiffy.co/oauth/token","scopes":{"account":"Access account details and settings","users":"Manage users","customers":"Read and manage customers","checkouts":"Read and manage checkouts","subscriptions":"Read and manage subscriptions","subscription_metered_billing":"Manage metered billing for subscriptions","integrations":"Manage integrations","orders":"Read and manage orders","payments":"Read and manage payments","paymentplans":"Read and manage payment plans","webhooks":"Manage webhook endpoints and view event logs","promos":"Read and manage promo/discount codes","affiliates":"Read and manage affiliates and programs","products":"Read and manage products","analytics":"Read analytics data (revenue, orders, subscriptions, MRR)","reports":"Create, run, and read saved reports and their results"}}}}},"schemas":{"Error400":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error401":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error403":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error404":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error500":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}},"paths":{"/v2/paymentplans/{id}/card":{"post":{"tags":["paymentplans"],"summary":"Add new card to payment plan","description":"Create a new payment card and assign it to the payment plan.","parameters":[{"schema":{"type":"string","description":"Payment plan ID"},"required":true,"description":"Payment plan ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"nullable":true,"description":"Payment token from the gateway (e.g. Stripe payment method)"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"nullable":true}}}},"400":{"description":"Bad Request - The request was invalid or malformed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error400"}}}},"401":{"description":"Unauthorized - Authentication is required or has failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error401"}}}},"403":{"description":"Forbidden - You do not have permission to access this resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error403"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error404"}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error500"}}}}}}}}}
```

## Update payment plan card

> Update a payment plan to use an existing card on file.

```json
{"openapi":"3.0.3","info":{"title":"Spiffy API","version":"2.0.0"},"tags":[{"name":"paymentplans","description":"Payment plan management"}],"servers":[{"url":"https://api.spiffy.co","description":"Production"}],"security":[{"ApiKeyAuth":[]},{"OAuth2":["paymentplans"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Account API key authentication. Pass an API key as a Bearer token in the `Authorization` header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes."},"OAuth2":{"type":"oauth2","description":"OAuth 2.0 authentication for third-party integrations. Access is limited to the scopes granted by the merchant during authorization.","flows":{"authorizationCode":{"authorizationUrl":"https://app.spiffy.co/oauth/authorize","tokenUrl":"https://api.spiffy.co/oauth/token","refreshUrl":"https://api.spiffy.co/oauth/token","scopes":{"account":"Access account details and settings","users":"Manage users","customers":"Read and manage customers","checkouts":"Read and manage checkouts","subscriptions":"Read and manage subscriptions","subscription_metered_billing":"Manage metered billing for subscriptions","integrations":"Manage integrations","orders":"Read and manage orders","payments":"Read and manage payments","paymentplans":"Read and manage payment plans","webhooks":"Manage webhook endpoints and view event logs","promos":"Read and manage promo/discount codes","affiliates":"Read and manage affiliates and programs","products":"Read and manage products","analytics":"Read analytics data (revenue, orders, subscriptions, MRR)","reports":"Create, run, and read saved reports and their results"}}}}},"schemas":{"Error400":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error401":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error403":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error404":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error500":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}},"paths":{"/v2/paymentplans/{id}/card":{"put":{"tags":["paymentplans"],"summary":"Update payment plan card","description":"Update a payment plan to use an existing card on file.","parameters":[{"schema":{"type":"string","description":"Payment Plan ID"},"required":true,"description":"Payment Plan ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"card_id":{"type":"number","description":"ID of the existing card to use"}},"required":["card_id"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"nullable":true}}}},"400":{"description":"Bad Request - The request was invalid or malformed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error400"}}}},"401":{"description":"Unauthorized - Authentication is required or has failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error401"}}}},"403":{"description":"Forbidden - You do not have permission to access this resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error403"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error404"}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error500"}}}}}}}}}
```

## Update next billing date

> Update the next billing date for a payment plan. Date must be in the future.

```json
{"openapi":"3.0.3","info":{"title":"Spiffy API","version":"2.0.0"},"tags":[{"name":"paymentplans","description":"Payment plan management"}],"servers":[{"url":"https://api.spiffy.co","description":"Production"}],"security":[{"ApiKeyAuth":[]},{"OAuth2":["paymentplans"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Account API key authentication. Pass an API key as a Bearer token in the `Authorization` header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes."},"OAuth2":{"type":"oauth2","description":"OAuth 2.0 authentication for third-party integrations. Access is limited to the scopes granted by the merchant during authorization.","flows":{"authorizationCode":{"authorizationUrl":"https://app.spiffy.co/oauth/authorize","tokenUrl":"https://api.spiffy.co/oauth/token","refreshUrl":"https://api.spiffy.co/oauth/token","scopes":{"account":"Access account details and settings","users":"Manage users","customers":"Read and manage customers","checkouts":"Read and manage checkouts","subscriptions":"Read and manage subscriptions","subscription_metered_billing":"Manage metered billing for subscriptions","integrations":"Manage integrations","orders":"Read and manage orders","payments":"Read and manage payments","paymentplans":"Read and manage payment plans","webhooks":"Manage webhook endpoints and view event logs","promos":"Read and manage promo/discount codes","affiliates":"Read and manage affiliates and programs","products":"Read and manage products","analytics":"Read analytics data (revenue, orders, subscriptions, MRR)","reports":"Create, run, and read saved reports and their results"}}}}},"schemas":{"Error400":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error401":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error403":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error404":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error500":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}},"paths":{"/v2/paymentplans/{id}/nextbillingdate":{"put":{"tags":["paymentplans"],"summary":"Update next billing date","description":"Update the next billing date for a payment plan. Date must be in the future.","parameters":[{"schema":{"type":"string","description":"Payment plan ID"},"required":true,"description":"Payment plan ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"next_payment_at":{"type":"string","description":"Next billing date (ISO 8601)"},"notes":{"type":"string"}},"required":["next_payment_at"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"nullable":true}}}},"400":{"description":"Bad Request - The request was invalid or malformed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error400"}}}},"401":{"description":"Unauthorized - Authentication is required or has failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error401"}}}},"403":{"description":"Forbidden - You do not have permission to access this resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error403"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error404"}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error500"}}}}}}}}}
```

## Update payment plan terms

> Update the payment amount, remaining balance, and/or frequency of a payment plan.

```json
{"openapi":"3.0.3","info":{"title":"Spiffy API","version":"2.0.0"},"tags":[{"name":"paymentplans","description":"Payment plan management"}],"servers":[{"url":"https://api.spiffy.co","description":"Production"}],"security":[{"ApiKeyAuth":[]},{"OAuth2":["paymentplans"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Account API key authentication. Pass an API key as a Bearer token in the `Authorization` header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes."},"OAuth2":{"type":"oauth2","description":"OAuth 2.0 authentication for third-party integrations. Access is limited to the scopes granted by the merchant during authorization.","flows":{"authorizationCode":{"authorizationUrl":"https://app.spiffy.co/oauth/authorize","tokenUrl":"https://api.spiffy.co/oauth/token","refreshUrl":"https://api.spiffy.co/oauth/token","scopes":{"account":"Access account details and settings","users":"Manage users","customers":"Read and manage customers","checkouts":"Read and manage checkouts","subscriptions":"Read and manage subscriptions","subscription_metered_billing":"Manage metered billing for subscriptions","integrations":"Manage integrations","orders":"Read and manage orders","payments":"Read and manage payments","paymentplans":"Read and manage payment plans","webhooks":"Manage webhook endpoints and view event logs","promos":"Read and manage promo/discount codes","affiliates":"Read and manage affiliates and programs","products":"Read and manage products","analytics":"Read analytics data (revenue, orders, subscriptions, MRR)","reports":"Create, run, and read saved reports and their results"}}}}},"schemas":{"Error400":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error401":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error403":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error404":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error500":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}},"paths":{"/v2/paymentplans/{id}/terms":{"put":{"tags":["paymentplans"],"summary":"Update payment plan terms","description":"Update the payment amount, remaining balance, and/or frequency of a payment plan.","parameters":[{"schema":{"type":"string","description":"Payment plan ID"},"required":true,"description":"Payment plan ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"payment_amount":{"type":"integer","minimum":0,"description":"New payment amount per cycle in the smallest currency unit ($10.00 USD = 1000; ¥1500 JPY = 1500). Must be a non-negative integer."},"remaining_balance":{"type":"integer","minimum":0,"description":"New remaining balance in the smallest currency unit ($10.00 USD = 1000; ¥1500 JPY = 1500). Must be a non-negative integer."},"frequency":{"type":"string","enum":["day","week","month","year"],"description":"Billing unit. For \"every 2 weeks\" pass frequency: \"week\" with frequency_count: 2."},"frequency_count":{"type":"integer","minimum":1,"description":"Number of frequency units per billing cycle. Defaults to 1."},"notes":{"type":"string"}},"required":["payment_amount","remaining_balance"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"nullable":true}}}},"400":{"description":"Bad Request - The request was invalid or malformed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error400"}}}},"401":{"description":"Unauthorized - Authentication is required or has failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error401"}}}},"403":{"description":"Forbidden - You do not have permission to access this resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error403"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error404"}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error500"}}}}}}}}}
```

## Make a payment on payment plan

> Process a manual payment on a payment plan. Can be a partial payment or a full payoff.

```json
{"openapi":"3.0.3","info":{"title":"Spiffy API","version":"2.0.0"},"tags":[{"name":"paymentplans","description":"Payment plan management"}],"servers":[{"url":"https://api.spiffy.co","description":"Production"}],"security":[{"ApiKeyAuth":[]},{"OAuth2":["paymentplans"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Account API key authentication. Pass an API key as a Bearer token in the `Authorization` header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes."},"OAuth2":{"type":"oauth2","description":"OAuth 2.0 authentication for third-party integrations. Access is limited to the scopes granted by the merchant during authorization.","flows":{"authorizationCode":{"authorizationUrl":"https://app.spiffy.co/oauth/authorize","tokenUrl":"https://api.spiffy.co/oauth/token","refreshUrl":"https://api.spiffy.co/oauth/token","scopes":{"account":"Access account details and settings","users":"Manage users","customers":"Read and manage customers","checkouts":"Read and manage checkouts","subscriptions":"Read and manage subscriptions","subscription_metered_billing":"Manage metered billing for subscriptions","integrations":"Manage integrations","orders":"Read and manage orders","payments":"Read and manage payments","paymentplans":"Read and manage payment plans","webhooks":"Manage webhook endpoints and view event logs","promos":"Read and manage promo/discount codes","affiliates":"Read and manage affiliates and programs","products":"Read and manage products","analytics":"Read analytics data (revenue, orders, subscriptions, MRR)","reports":"Create, run, and read saved reports and their results"}}}}},"schemas":{"Error400":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error401":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error403":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error404":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Error500":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}},"paths":{"/v2/paymentplans/{id}/pay":{"post":{"tags":["paymentplans"],"summary":"Make a payment on payment plan","description":"Process a manual payment on a payment plan. Can be a partial payment or a full payoff.","parameters":[{"schema":{"type":"string","description":"Payment plan ID"},"required":true,"description":"Payment plan ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","description":"Payment amount in the smallest currency unit ($10.00 USD = 1000; ¥1500 JPY = 1500)."},"payoff_outcome":{"type":"string","nullable":true,"enum":["completed","defaulted",null],"description":"If set, treats this request as a payoff: 'completed' marks the plan paid in full, 'defaulted' marks it as a write-off. When null/omitted, this is a regular partial payment."},"notes":{"type":"string"}},"required":["amount"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"nullable":true}}}},"400":{"description":"Bad Request - The request was invalid or malformed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error400"}}}},"401":{"description":"Unauthorized - Authentication is required or has failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error401"}}}},"403":{"description":"Forbidden - You do not have permission to access this resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error403"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error404"}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error500"}}}}}}}}}
```
