Approve budget execution
Approves a budget execution that is awaiting an approval decision.
/api/integration/budget/execution/{budgetExecutionId}/approveRequest
curl -X PATCH "https://dev.integration.cl.sodtrack-shared.sodtrack.com/api/integration/budget/execution/{budgetExecutionId}/approve" \
-H "Authorization: Bearer $SODTRACK_TOKEN" \
-H "origin: dev.api.cl.sodtrack.sodtrack.com"Base URL: https://dev.integration.cl.sodtrack-shared.sodtrack.com · other environments
Path parameters
| Name | Type | Description |
|---|---|---|
budgetExecutionIdrequired | string | — |
Headers
| Name | Type | Description |
|---|---|---|
origin | string | —dev.api.cl.sodtrack.sodtrack.com |
Responses
{
"id": "901",
"status": "approved",
"executionBookingIds": [
5372
]
}Error responses for this endpoint follow the shared error reference.
Purpose
Approves a budget execution that is awaiting an approval decision.
Approving is what moves a budget execution forward in the operation. When the budget execution is configured to create its execution bookings automatically on approval, Sodtrack creates those bookings as part of the same request and returns their ids in the response, so the client does not need a second call to discover them.
The budget execution is identified by its Sodtrack id in the URL. This endpoint does not take a request body.
PATCH /api/integration/budget/execution/{budgetExecutionId}/approve
Field Definitions
🔐 Authentication
| Field | Type | Required | Description |
|---|---|---|---|
x-api-key | header | ✅ | Sodtrack integration API key. Requests without a valid key are rejected. |
📦 Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
budgetExecutionId | string | ✅ | Sodtrack id of the budget execution to approve. |
This endpoint does not accept a request body. Any payload sent is ignored.
Example Request
PATCH /api/integration/budget/execution/1234/approve
x-api-key: <your-api-key>
Response Example
Budget execution configured to create its execution bookings automatically:
{
"id": "1234",
"status": "approved",
"executionBookingIds": [8871, 8872]
}
Budget execution that does not create bookings automatically:
{
"id": "1234",
"status": "approved",
"executionBookingIds": []
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Sodtrack id of the approved budget execution. |
status | string | Always "approved" on a successful response. |
executionBookingIds | array[number] | Ids of the execution bookings created by this approval. Empty when the budget execution does not create bookings automatically. |
Error Responses
| HTTP Status | Error | Description |
|---|---|---|
400 Bad Request | INVALID_STATUS_TO_RESOLVE_APPROVAL | The budget execution is not in a status that accepts an approval decision, typically because it was already approved. |
401 Unauthorized | — | The API key is missing, invalid, or the request origin is not authorized. |
404 Not Found | BUDGET_EXECUTION_NOT_FOUND | No budget execution exists for the given id. |
500 Internal Server Error | — | Unexpected server error. Contact Sodtrack support. |
Business Rules & Constraints
Statuses that accept an approval
A budget execution can be approved only while it is still open to a decision. The following statuses are accepted:
| Status | Meaning |
|---|---|
created | Draft, not yet submitted for approval. |
in_progress | Legacy equivalent of created. |
provider_submitted | Submitted by the provider. |
waiting_internal_review | Awaiting internal review. |
waiting_admin_approval | Awaiting administrator approval. |
waiting_customer_approval | Awaiting customer approval. |
rejected | Previously rejected; can be approved afterwards. |
customer_rejected | Legacy equivalent of rejected. |
Any other status, in particular a budget execution that is already approved, is rejected with 400 INVALID_STATUS_TO_RESOLVE_APPROVAL.
Execution booking creation
Whether approving creates bookings depends on the approval policy configured for the service variant of the budget execution, not on anything the client sends.
| Configuration | Behavior |
|---|---|
| Bookings created on approval | Sodtrack creates the execution bookings during the request and returns their ids in executionBookingIds. |
| Bookings created manually | No booking is created. executionBookingIds is empty. The bookings are created later through the Sodtrack back office. |
| No approval configuration | No booking is created. executionBookingIds is empty. |
When the budget execution has milestones, one execution booking is created per milestone, so executionBookingIds can contain several ids. They are returned in the order the bookings were created.