Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In

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:

OrderHandlerDescription
500ValidateContextChecks, 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.
600GetBudgetCollectionRetrieves 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:

OrderHandlerDescription
100ValidatePunchoutIf the current session is a punchout session, returns a forbidden error.
500GetBudgetCalls 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:

OrderHandlerDescription
500UpdateBudgetHandlerUpdates budget. If requester is not signed in then handler returns error result. If both ShipToId and UserProfileId parameters specified then handler returns error result.
800UpdateBudgetPunchOutHandlerIf the current session is a punchout session then handler returns error result.