Approve budget execution

Approves a budget execution that is awaiting an approval decision.

PATCH/api/integration/budget/execution/{budgetExecutionId}/approve

Request

cURL
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

NameTypeDescription
budgetExecutionIdrequiredstring

Headers

NameTypeDescription
originstring
dev.api.cl.sodtrack.sodtrack.com

Responses

Approve budget execution
{
  "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.

code
PATCH /api/integration/budget/execution/{budgetExecutionId}/approve

Field Definitions

🔐 Authentication

FieldTypeRequiredDescription
x-api-keyheaderSodtrack integration API key. Requests without a valid key are rejected.

📦 Path parameters

FieldTypeRequiredDescription
budgetExecutionIdstringSodtrack id of the budget execution to approve.

This endpoint does not accept a request body. Any payload sent is ignored.


Example Request

code
PATCH /api/integration/budget/execution/1234/approve
x-api-key: <your-api-key>

Response Example

Budget execution configured to create its execution bookings automatically:

json
{
  "id": "1234",
  "status": "approved",
  "executionBookingIds": [8871, 8872]
}

Budget execution that does not create bookings automatically:

json
{
  "id": "1234",
  "status": "approved",
  "executionBookingIds": []
}

Response Fields

FieldTypeDescription
idstringSodtrack id of the approved budget execution.
statusstringAlways "approved" on a successful response.
executionBookingIdsarray[number]Ids of the execution bookings created by this approval. Empty when the budget execution does not create bookings automatically.

Error Responses

HTTP StatusErrorDescription
400 Bad RequestINVALID_STATUS_TO_RESOLVE_APPROVALThe budget execution is not in a status that accepts an approval decision, typically because it was already approved.
401 UnauthorizedThe API key is missing, invalid, or the request origin is not authorized.
404 Not FoundBUDGET_EXECUTION_NOT_FOUNDNo budget execution exists for the given id.
500 Internal Server ErrorUnexpected 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:

StatusMeaning
createdDraft, not yet submitted for approval.
in_progressLegacy equivalent of created.
provider_submittedSubmitted by the provider.
waiting_internal_reviewAwaiting internal review.
waiting_admin_approvalAwaiting administrator approval.
waiting_customer_approvalAwaiting customer approval.
rejectedPreviously rejected; can be approved afterwards.
customer_rejectedLegacy 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.

ConfigurationBehavior
Bookings created on approvalSodtrack creates the execution bookings during the request and returns their ids in executionBookingIds.
Bookings created manuallyNo booking is created. executionBookingIds is empty. The bookings are created later through the Sodtrack back office.
No approval configurationNo 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.