Budgets
This topic describes the Budgets API handler in Optimizely Configured Commerce.
HTTP Verb: GET
URL: /api/v1/budgets
Description: Returns a collection of budgets for the current customer
Base: HandlerBase<GetBudgetCollectionParameter, GetBudgetCollectionResult>
Handlers:
Order | Handler | Description |
---|---|---|
500 | ValidateContext | Checks, if BillTo in site context is not null, otherwise returns error. Then tries to find ShipTo by ShipToId parameter and UserProfile by UserProfileId parameter, if none of them is found returns NotSupported error. |
600 | GetBudgetCollection | Retrieves GetBudgetResults by getting BudgetCalendar for BillTo from result with filtering by FiscalYear parameter or all. For each budget result GetCustomerBudgetReview budget pipeline is being called. Currency is being set from BillTo property or website default (if BillTo currency is not set). |
HTTP Verb: GET
URL: /api/v1/budgets/{fiscalYear}
Description: Returns a single budget by fiscal year and current customer
Base: HandlerBase<GetBudgetParameter, GetBudgetResult>
Handlers:
Order | Handler | Description |
---|---|---|
100 | ValidatePunchout | If the current session is a punchout session, returns a forbidden error. |
500 | GetBudget | Calls GetBudgetCollection with FiscalYear, ShipToId, UserProfileId and GetBudgetActualAmounts parameters. If GetBudgetResults count is not equals to 1, then returns not found, otherwise gets first item. |
HTTP Verb: PATCH
URL: /api/v1/budgets/{fiscalYear}
Description: Update a single budget by fiscal year and current customer
Base: HandlerBase<UpdateBudgetParameter, UpdateBudgetResult>
Handlers:
Order | Handler | Description |
---|---|---|
500 | UpdateBudgetHandler | Updates budget. If requester is not signed in then handler returns error result. If both ShipToId and UserProfileId parameters specified then handler returns error result. |
800 | UpdateBudgetPunchOutHandler | If the current session is a punchout session then handler returns error result. |
Updated 4 months ago