> For the complete documentation index, see [llms.txt](https://docs.xplorpay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xplorpay.com/api-reference/api/payments/recurring-payments-service/forecast.md).

# Forecast

## Get forecast plan

> Retrieve a forecast of upcoming plan payments based on the specified schedule parameters.

```json
{"openapi":"3.0.1","info":{"title":"Recurring Payments API","version":"2.0"},"paths":{"/rest/v2/plan-forecast":{"get":{"tags":["Forecast"],"summary":"Get forecast plan","description":"Retrieve a forecast of upcoming plan payments based on the specified schedule parameters.","operationId":"get","parameters":[{"name":"api-key","in":"header","description":"An access API key issued to you by Xplor Pay.","required":true,"schema":{"type":"string"}},{"name":"start-date","in":"query","description":"Specifies the start date for the forecast period. \r\nFormat: YYYY-MM-DD.","required":true},{"name":"frequency","in":"query","description":"Specifies how often the plan is billed. Supported values include day, week, and monthly.","required":true,"schema":{"type":"string","enum":["WEEKLY,MONTHLY,YEARLY"]}},{"name":"frequency-day","in":"query","description":"\t\r\nSpecifies the billing day based on the frequency.\r\n\r\nWeekly: Day of the week (1-7).\r\n\r\nMonthly/Yearly: Day of the month (1-31).","required":true,"schema":{"type":"string","enum":["range[1,28]"]}},{"name":"frequency-week","in":"query","description":"Required when frequency is weekly. Specifies the weeks between payments.","schema":{"type":"string","enum":["range[1,52]"]}},{"name":"frequency-month","in":"query","description":"Specifies the month interval based on frequency.\r\n\r\nMonthly: Number of months between payments.\r\n\r\nYearly: Month of the year (1-12) when the payment occurs.","schema":{"type":"string","enum":["range[1,12]"]}},{"name":"end-date","in":"query","description":"Specifies the end date for the forecast period. Required when forecasting monthly plans.\r\nFormat: YYYY-MM-DD."}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ForecastResponsePayload"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}}}}}},"components":{"schemas":{"ForecastResponsePayload":{"type":"object","properties":{"forecast":{"$ref":"#/components/schemas/forecast"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"payload","xml":{"name":"payload"}},"forecast":{"type":"object","properties":{"dates":{"type":"array","description":"List of scheduled payment dates included in the forecast.","items":{"type":"string","description":"List of scheduled payment dates included in the forecast."}}},"description":"forecast","xml":{"name":"forecast"}},"ErrorPayloadResponsePayload":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorPayload"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"Payload","xml":{"name":"payload"}},"ErrorPayload":{"type":"object","properties":{"error-message":{"type":"string","description":"Describes the reason for the error."},"result-code":{"type":"string","description":"Numeric code that identifies the type of error returned by the request."},"time-stamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}},"xml":{"name":"error"}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xplorpay.com/api-reference/api/payments/recurring-payments-service/forecast.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
