# Order Approval

Order Approval addon

## Count Pending Order Approvals

> Returns the count of pending order approvals for the current customer (excluding approved, declined, and ordered states). Requires admin permission.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}}},"paths":{"/b2b/order-approval/settings/count-pending":{"get":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Count Pending Order Approvals","description":"Returns the count of pending order approvals for the current customer (excluding approved, declined, and ordered states). Requires admin permission.","operationId":"countPendingOrderApprovals","responses":{"200":{"description":"Count of pending order approvals","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","description":"Number of pending order approvals"}}}}}},"401":{"description":"Employee not logged in"},"403":{"description":"Admin permission required"}}}}}}
```

## Execute Order Approval

> Executes an approved order approval by creating a real Shopware order. Requires employee login and the order approval must be in 'approved' state. Automatically refreshes the cart before execution to ensure latest prices and stock.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}}},"paths":{"/b2b/order-approval/{orderApprovalId}/execute":{"post":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Execute Order Approval","description":"Executes an approved order approval by creating a real Shopware order. Requires employee login and the order approval must be in 'approved' state. Automatically refreshes the cart before execution to ensure latest prices and stock.","operationId":"executeOrderApproval","parameters":[{"name":"orderApprovalId","in":"path","required":true,"schema":{"type":"string"},"description":"Order Approval ID"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"skipRefresh":{"type":"boolean","description":"Skip automatic refresh before execution (default: false). Not recommended unless you know what you're doing.","default":false}}}}}},"responses":{"200":{"description":"Order Approval executed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"executionResult":{"type":"object","properties":{"success":{"type":"boolean"},"orderId":{"type":"string","nullable":true},"orderNumber":{"type":"string","nullable":true},"paymentUrl":{"type":"string","nullable":true},"requiresPaymentAction":{"type":"boolean"},"errorMessage":{"type":"string","nullable":true},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}}}}}},"400":{"description":"Invalid request data or order approval cannot be executed"},"401":{"description":"Employee not logged in"},"403":{"description":"Employee not allowed to execute this order approval"},"404":{"description":"Order Approval not found"}}}}}}
```

## Update Pending Order Approvals with New Settings

> Updates all pending order approvals for the current customer with new approval settings. This ensures that existing open order approvals use the latest approval configuration instead of outdated settings. Requires admin permission.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}}},"paths":{"/b2b/order-approval/settings/update-pending":{"post":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Update Pending Order Approvals with New Settings","description":"Updates all pending order approvals for the current customer with new approval settings. This ensures that existing open order approvals use the latest approval configuration instead of outdated settings. Requires admin permission.","operationId":"updatePendingOrderApprovals","responses":{"200":{"description":"Pending order approvals updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"updatedCount":{"type":"integer","description":"Number of order approvals that were updated"}}}}}},"401":{"description":"Employee not logged in"},"403":{"description":"Admin permission required"}}}}}}
```

## Remind Single Approver

> Sends a reminder email to a specific approver for an order approval.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}}},"paths":{"/b2b/order-approval/{orderApprovalId}/remind":{"post":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Remind Single Approver","description":"Sends a reminder email to a specific approver for an order approval.","operationId":"remindOrderApprovalApprover","parameters":[{"name":"orderApprovalId","in":"path","required":true,"schema":{"type":"string"},"description":"Order Approval ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"approverId":{"type":"string","description":"Employee ID of the approver to remind"}},"required":["approverId"]}}}},"responses":{"200":{"description":"Reminder sent successfully","content":{"application/json":{"schema":{"type":"object","properties":{"remindersSent":{"type":"integer"},"approverId":{"type":"string"}}}}}},"400":{"description":"Invalid request data"},"401":{"description":"Customer not logged in"},"404":{"description":"Order Approval or Approver not found"}}}}}}
```

## Remind All Approvers

> Sends reminder emails to all pending approvers for an order approval.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}}},"paths":{"/b2b/order-approval/{orderApprovalId}/remind/all":{"post":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Remind All Approvers","description":"Sends reminder emails to all pending approvers for an order approval.","operationId":"remindAllOrderApprovalApprovers","parameters":[{"name":"orderApprovalId","in":"path","required":true,"schema":{"type":"string"},"description":"Order Approval ID"}],"responses":{"200":{"description":"Reminders sent successfully","content":{"application/json":{"schema":{"type":"object","properties":{"remindersSent":{"type":"integer"}}}}}},"400":{"description":"Invalid request data"},"401":{"description":"Customer not logged in"},"404":{"description":"Order Approval not found"}}}}}}
```

## Delete Order Approval Line Item

> Deletes a line item from an order approval. Requires employee login and appropriate permissions. Only allowed for order approvals in 'open', 'pending', or 'approved' state.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}}},"paths":{"/b2b/order-approval/{orderApprovalId}/line-items/{lineItemId}/delete":{"post":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Delete Order Approval Line Item","description":"Deletes a line item from an order approval. Requires employee login and appropriate permissions. Only allowed for order approvals in 'open', 'pending', or 'approved' state.","operationId":"deleteOrderApprovalLineItem","parameters":[{"name":"orderApprovalId","in":"path","required":true,"schema":{"type":"string"},"description":"Order Approval ID"},{"name":"lineItemId","in":"path","required":true,"schema":{"type":"string"},"description":"Line Item ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","description":"Reason for deleting the line item"}},"required":["reason"]}}}},"responses":{"200":{"description":"Line item deleted successfully"},"400":{"description":"Invalid request data or line item cannot be deleted"},"401":{"description":"Employee not logged in"},"403":{"description":"Employee not allowed to delete this line item"},"404":{"description":"Order Approval or Line Item not found"}}}}}}
```

## Refresh Order Approval

> Refreshes an order approval by recalculating prices, checking stock availability, and updating shipping costs. Detects changes and may require re-approval if significant price changes are detected.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}}},"paths":{"/b2b/order-approval/{orderApprovalId}/refresh":{"post":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Refresh Order Approval","description":"Refreshes an order approval by recalculating prices, checking stock availability, and updating shipping costs. Detects changes and may require re-approval if significant price changes are detected.","operationId":"refreshOrderApproval","parameters":[{"name":"orderApprovalId","in":"path","required":true,"schema":{"type":"string"},"description":"Order Approval ID"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"force":{"type":"boolean","description":"Force refresh even if minimum time interval has not passed (default: false)","default":false},"sendEmailOnChanges":{"type":"boolean","description":"Send email notification if changes are detected (default: false)","default":false}}}}}},"responses":{"200":{"description":"Order Approval refreshed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"refreshResult":{"type":"object","properties":{"isValid":{"type":"boolean"},"isBlocked":{"type":"boolean"},"blockReasons":{"type":"array","items":{"type":"string"}},"hasChanges":{"type":"boolean"},"changes":{"type":"array","items":{"type":"object"}},"requiresReapproval":{"type":"boolean"}}}}}}}},"400":{"description":"Invalid request data or order approval cannot be refreshed"},"401":{"description":"Customer not logged in"},"403":{"description":"Customer not allowed to refresh this order approval"},"404":{"description":"Order Approval not found"}}}}}}
```

## Create Order Approval from Cart

> Creates a new Order Approval from the current shopping cart. Requires customer login.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}},"schemas":{}},"paths":{"/order-approval/create":{"post":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Create Order Approval from Cart","description":"Creates a new Order Approval from the current shopping cart. Requires customer login.","operationId":"createOrderApproval","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cartToken":{"type":"string","description":"Shopping cart token"},"customerComment":{"type":"string","description":"Optional comment from customer"}},"required":["cartToken"]}}}},"responses":{"200":{"description":"Order Approval created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderApproval"}}}},"400":{"description":"Invalid request data"},"401":{"description":"Customer not logged in"}}}}}}
```

## List Order Approvals

> Returns a list of Order Approvals for the logged-in customer. Supports Shopware Criteria for filtering, sorting, and pagination.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}},"schemas":{}},"paths":{"/order-approval/list":{"post":{"tags":["StoreApi-B2bOrderApproval"],"summary":"List Order Approvals","description":"Returns a list of Order Approvals for the logged-in customer. Supports Shopware Criteria for filtering, sorting, and pagination.","operationId":"listOrderApprovals","requestBody":{"required":false,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Criteria"}]}}}},"responses":{"200":{"description":"Returns a list of Order Approvals","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer","description":"Total count of Order Approvals"},"data":{"type":"array","items":{"$ref":"#/components/schemas/OrderApproval"}}}}}}},"401":{"description":"Customer not logged in"}}}}}}
```

## Get Customer Order Approval Settings

> Retrieves the order approval settings for the current customer, including approver configuration and approval mode.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}}},"paths":{"/b2b/order-approval/customer-settings":{"get":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Get Customer Order Approval Settings","description":"Retrieves the order approval settings for the current customer, including approver configuration and approval mode.","operationId":"getCustomerOrderApprovalSettings","responses":{"200":{"description":"Customer order approval settings","content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"object","properties":{"mode":{"type":"string","enum":["only-admins","everyone","one-of","all-of","n-of"]},"approverEmployeeIds":{"type":"array","items":{"type":"string"}},"nValue":{"type":"integer","nullable":true}}}}}}}},"401":{"description":"Employee not logged in"}}}}}}
```

## Update Customer Order Approval Settings

> Updates the order approval settings for the current customer. Requires employee login.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}}},"paths":{"/b2b/order-approval/customer-settings":{"post":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Update Customer Order Approval Settings","description":"Updates the order approval settings for the current customer. Requires employee login.","operationId":"updateCustomerOrderApprovalSettings","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["only-admins","everyone","one-of","all-of","n-of"],"description":"Approval mode"},"approverEmployeeIds":{"type":"array","items":{"type":"string"},"description":"List of employee IDs who can approve"},"nValue":{"type":"integer","minimum":1,"nullable":true,"description":"Required number of approvals for 'n-of' mode"}},"required":["mode"]}}}},"responses":{"200":{"description":"Settings updated successfully"},"400":{"description":"Invalid request data"},"401":{"description":"Employee not logged in"}}}}}}
```

## Update Order Approval

> Updates an order approval by refreshing prices and stock. This is a convenience endpoint that calls the refresh service. Requires employee login.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}}},"paths":{"/b2b/order-approval/{orderApprovalId}/update":{"post":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Update Order Approval","description":"Updates an order approval by refreshing prices and stock. This is a convenience endpoint that calls the refresh service. Requires employee login.","operationId":"updateOrderApproval","parameters":[{"name":"orderApprovalId","in":"path","required":true,"schema":{"type":"string"},"description":"Order Approval ID"}],"responses":{"200":{"description":"Order Approval updated successfully"},"400":{"description":"Invalid request data or order approval cannot be updated"},"401":{"description":"Employee not logged in"},"403":{"description":"Employee not allowed to update this order approval"},"404":{"description":"Order Approval not found"}}}}}}
```

## Get Order Approval Activity History

> Retrieves the activity history for an order approval, including all actions, comments, and metadata.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}}},"paths":{"/b2b/order-approval/{orderApprovalId}/activity":{"get":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Get Order Approval Activity History","description":"Retrieves the activity history for an order approval, including all actions, comments, and metadata.","operationId":"getOrderApprovalActivity","parameters":[{"name":"orderApprovalId","in":"path","required":true,"schema":{"type":"string"},"description":"Order Approval ID"}],"responses":{"200":{"description":"Order Approval activity history","content":{"application/json":{"schema":{"type":"object","properties":{"activities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string"},"employeeName":{"type":"string"},"comment":{"type":"string","nullable":true},"metadata":{"type":"object"},"createdAt":{"type":"string","format":"date-time"}}}}}}}}},"401":{"description":"Customer not logged in"},"403":{"description":"Customer not allowed to access this order approval"},"404":{"description":"Order Approval not found"}}}}}}
```

## Get Approver Status

> Retrieves the status of all approvers for an order approval, including who has approved, declined, or is still pending.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}}},"paths":{"/b2b/order-approval/{orderApprovalId}/approvers":{"get":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Get Approver Status","description":"Retrieves the status of all approvers for an order approval, including who has approved, declined, or is still pending.","operationId":"getOrderApprovalApproverStatus","parameters":[{"name":"orderApprovalId","in":"path","required":true,"schema":{"type":"string"},"description":"Order Approval ID"}],"responses":{"200":{"description":"Approver status","content":{"application/json":{"schema":{"type":"object","properties":{"approverStatus":{"type":"object","properties":{"approvers":{"type":"array","items":{"type":"object","properties":{"employeeId":{"type":"string"},"employeeName":{"type":"string"},"status":{"type":"string","enum":["pending","approved","declined"]},"canApprove":{"type":"boolean"}}}},"isApproved":{"type":"boolean"},"isDeclined":{"type":"boolean"}}}}}}}},"401":{"description":"Customer not logged in"},"403":{"description":"Customer not allowed to access this order approval"},"404":{"description":"Order Approval not found"}}}}}}
```

## Get Order Approval Details

> Retrieves detailed information about a specific order approval, including line items, approvers, and status.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}},"schemas":{}},"paths":{"/b2b/order-approval/{orderApprovalId}":{"get":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Get Order Approval Details","description":"Retrieves detailed information about a specific order approval, including line items, approvers, and status.","operationId":"getOrderApprovalDetail","parameters":[{"name":"orderApprovalId","in":"path","required":true,"schema":{"type":"string"},"description":"Order Approval ID"}],"responses":{"200":{"description":"Order Approval details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderApproval"}}}},"401":{"description":"Customer not logged in"},"403":{"description":"Customer not allowed to access this order approval"},"404":{"description":"Order Approval not found"}}}}}}
```

## Decline Order Approval

> Declines an order approval request. Requires employee login and appropriate permissions.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}},"schemas":{}},"paths":{"/b2b/order-approval/{orderApprovalId}/decline":{"post":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Decline Order Approval","description":"Declines an order approval request. Requires employee login and appropriate permissions.","operationId":"declineOrderApproval","parameters":[{"name":"orderApprovalId","in":"path","required":true,"schema":{"type":"string"},"description":"Order Approval ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"type":"string","description":"Required comment explaining the decline reason"},"ccEmployeeIds":{"type":"array","items":{"type":"string"},"description":"Optional list of employee IDs to CC in the decline notification"}},"required":["comment"]}}}},"responses":{"200":{"description":"Order Approval declined successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderApproval"}}}},"400":{"description":"Invalid request data or order approval cannot be declined"},"401":{"description":"Employee not logged in"},"403":{"description":"Employee not allowed to decline this order approval"},"404":{"description":"Order Approval not found"}}}}}}
```

## Approve Order Approval

> Approves an order approval request. Requires employee login and appropriate permissions.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}},"schemas":{}},"paths":{"/b2b/order-approval/{orderApprovalId}/approve":{"post":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Approve Order Approval","description":"Approves an order approval request. Requires employee login and appropriate permissions.","operationId":"approveOrderApproval","parameters":[{"name":"orderApprovalId","in":"path","required":true,"schema":{"type":"string"},"description":"Order Approval ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"type":"string","description":"Optional comment for the approval"},"ccEmployeeIds":{"type":"array","items":{"type":"string"},"description":"Optional list of employee IDs to CC in the approval notification"}}}}}},"responses":{"200":{"description":"Order Approval approved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderApproval"}}}},"400":{"description":"Invalid request data or order approval cannot be approved"},"401":{"description":"Employee not logged in"},"403":{"description":"Employee not allowed to approve this order approval"},"404":{"description":"Order Approval not found"}}}}}}
```

## Get Budget Summary for Order Approvals

> Retrieves a summary of order approvals that are using a specific budget, including total reserved amounts and pending approvals.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}}},"paths":{"/b2b/order-approval/budget/{budgetId}/summary":{"get":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Get Budget Summary for Order Approvals","description":"Retrieves a summary of order approvals that are using a specific budget, including total reserved amounts and pending approvals.","operationId":"getOrderApprovalBudgetSummary","parameters":[{"name":"budgetId","in":"path","required":true,"schema":{"type":"string"},"description":"Budget ID"}],"responses":{"200":{"description":"Budget summary","content":{"application/json":{"schema":{"type":"object","properties":{"budgetSummary":{"type":"object","properties":{"budgetId":{"type":"string"},"totalReserved":{"type":"number"},"pendingApprovals":{"type":"integer"},"orderApprovals":{"type":"array","items":{"type":"object"}}}}}}}}},"401":{"description":"Employee not logged in"},"404":{"description":"Budget not found"}}}}}}
```

## Update Order Approval Line Item

> Updates a line item in an order approval (e.g., quantity). Requires employee login and appropriate permissions. Only allowed for order approvals in 'open', 'pending', or 'approved' state.

```json
{"openapi":"3.0.0","info":{"title":"B2Bsellers Suite API","version":"1.0.0"},"tags":[{"name":"StoreApi-B2bOrderApproval","description":"Order Approval addon"}],"security":[{"ApiKey":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"sw-context-token"}}},"paths":{"/b2b/order-approval/{orderApprovalId}/line-items/{lineItemId}":{"patch":{"tags":["StoreApi-B2bOrderApproval"],"summary":"Update Order Approval Line Item","description":"Updates a line item in an order approval (e.g., quantity). Requires employee login and appropriate permissions. Only allowed for order approvals in 'open', 'pending', or 'approved' state.","operationId":"updateOrderApprovalLineItem","parameters":[{"name":"orderApprovalId","in":"path","required":true,"schema":{"type":"string"},"description":"Order Approval ID"},{"name":"lineItemId","in":"path","required":true,"schema":{"type":"string"},"description":"Line Item ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"quantity":{"type":"number","description":"New quantity for the line item"}},"required":["quantity"]}}}},"responses":{"200":{"description":"Line item updated successfully"},"400":{"description":"Invalid request data or line item cannot be updated"},"401":{"description":"Employee not logged in"},"403":{"description":"Employee not allowed to update this line item"},"404":{"description":"Order Approval or Line Item not found"}}}}}}
```


---

# 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:

```
GET https://docs.b2b-sellers.com/b2b-platform/api-reference/store-api/order-approval.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
