Loading...
Area: Optimizely B2B Commerce

Budget Calendar API handler

Recommended reading 

HTTP Verb: GET

URL: /api/v1/budgetcalendars

Description: Returns a collection of budget calendar for the current customer

Base: HandlerBase<GetBudgetCalendarCollectionParameter, GetBudgetCalendarCollectionResult>

Handlers:

Order Handler Description
500 GetBudgetCalendarCollectionHandler Gets budget calendar collection. If requester is not signed in then handler returns error result.
Order Handler Description
500 ValidateContext Checks, if BillTo in site context is not null, otherwise returns error
600 GetBudgetCalendarCollection Retrieves all BudgetCalendar`s for BillTo with filtering by FiscalYear parameter or all, if FiscalYear property is not set. Put those calendars into GetBudgetCalendarResults.
If FiscalYear property has value and GetBudgetCalendarResults collection is empty, then create new GetBudgetCalendarResult for FiscalYear property and BillTo.

HTTP Verb: PATCH

URL: /api/v1/budgetcalendars/{fiscalYear}

Description: Updates a single budget calendar by fiscal year and current customer

Base: HandlerBase<UpdateBudgetCalendarParameter, UpdateBudgetCalendarResult>

Handlers:

Order Handler Description
500 UpdateBudgetHandler Updates budget calendar. 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.

Order Handler Description
500 UpdateBudgetCalendar Checks, if BillTo in site context is not null, otherwise returns error. Tries to load BudgetCalendar for current BillTo and FiscalYear from parameter, if not exists  - creates new one and inserts into database. Sets BudgetPeriods and FiscalYearEndDate from parameters.

 

HTTP Verb: GET

URL: /api/v1/budgetcalendars/{fiscalYear}

Description: Returns a single budget calendar by fiscal year and current customer

Base: HandlerBase<GetBudgetCalendarParameter, GetBudgetCalendarResult>

Handlers:

Order Handler Description
500 GetBudgetHandler

Gets budget with budget calendar. If requester is not signed in then handler returns error result.

Order Handler Description
500 GetBudgetCalendar Calls GetBudgetCalendarCollection for FiscalYear parameter. If GetBudgetCalendarResults count is not equals to 1, then returns not found, otherwise gets first item.
Do you find this information helpful? Please log in to provide feedback.

Last updated: Dec 11, 2020

Recommended reading