> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.yunojuno.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.yunojuno.com/_mcp/server.

# Approve a spend requisition by external ID

POST https://api.yunojuno.com/spend_requests/by_external_id/{external_id}/approve/
Content-Type: application/json

Approve a spend requisition by its external ID.

Approve a spend requisition using your external ID for it. Optionally update custom fields at the point of approval.

Note: Spend Requisition was previously named Spend Request. Some programmatic names use the old terminology.

Reference: https://docs.yunojuno.com/client-api/spend-requisitions/spend-requests-by-external-id-approve-create

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `external_id` (string, required)

### Body (application/json)

This endpoint expects an UpdateSpendRequestCustomFields.

- `custom_fields` (list of CustomField, optional) — An array of custom fields to be updated on the spend requisition.

## Response

### 200

- `data` (SpendRequest, required) — The spend requisition object. This object represents a request to commit spend on the YunoJuno platform. Spend Requisition was previously named Spend Request in the API documentation; some programmatic names use the old terminology.

## Errors

### 400 Bad Request Error

The request body does not match the expected shape: a custom_fields entry is missing name or value, or one of those values is too long.

- `error` (Error, required)

### 401 Unauthorized Error

The access token is missing or invalid.

- `error` (Error, required)

### 404 Not Found Error

No spend requisition with this external ID belongs to the client account the access token was issued for. External IDs are the ones you set yourself at creation time.

- `error` (Error, required)

### 422 Unprocessable Entity Error

The request is well-formed but the requisition cannot be approved: it is not configured for off-platform approval, its approval process is not currently open, or a custom field you sent is unknown to its configuration.

- `error` (Error, required)

## Types

### CustomField

Represents a single custom field.

- `name` (string, required) — The name of the custom field.
- `value` (string, required) — The value of the custom field.

### SpendRequest

The spend requisition object. This object represents a request to commit spend on the YunoJuno platform. Spend Requisition was previously named Spend Request in the API documentation; some programmatic names use the old terminology.

- `spend_request_id` (string, required)
- `url` (string, required, nullable)
- `external_id` (string, required, nullable)
- `title` (string, required)
- `description` (string, required)
- `amount` (string, required)
- `amount_type` (enum, required) — * `DAY_RATE` - Day rate * `TOTAL` - Total
  - Allowed values: `DAY_RATE`, `TOTAL`
- `currency` (enum, required) — * `AUD` - $ AUD * `CAD` - $ CAD * `CHF` - ₣ CHF * `CZK` - Kč CZK * `DKK` - kr DKK * `EUR` - € EUR * `GBP` - £ GBP * `HKD` - $ HKD * `INR` - ₹ INR * `NOK` - kr NOK * `NZD` - $ NZD * `PLN` - zł PLN * `SEK` - kr SEK * `SGD` - $ SGD * `AED` - د.إ AED * `USD` - $ USD * `ZAR` - R ZAR
  - Allowed values: `AUD`, `CAD`, `CHF`, `CZK`, `DKK`, `EUR`, `GBP`, `HKD`, `INR`, `NOK`, `NZD`, `PLN`, `SEK`, `SGD`, `AED`, `USD`, `ZAR`
- `custom_fields` (list of CustomField, required)
- `approval_flow` (ApprovalFlowReference, required, nullable)
- `attachment_url` (string, required, nullable)

### Error

- `code` (string, required) — A machine-readable code, such as AUTH_TOKEN_INVALID.
- `message` (string, required) — A description you can show to a person.
- `details` (list of ErrorDetail, optional) — Present on validation errors, one entry per failing field.
- `sentry_id` (string, optional) — Present on server errors. Quote it when you contact support.

### ApprovalFlowReference

- `approval_flow_id` (string, required)
- `current_approval_step` (CurrentApprovalStepReference, required, nullable)

### ErrorDetail

One field-level problem, listed on a validation error.

- `code` (string, required) — A machine-readable code, such as VALIDATION_REQUIRED.
- `field` (string, required) — The input field at fault. Nested fields and list indexes are dot-separated, such as data.1.contract.
- `message` (string, required) — What is wrong with the field.

### CurrentApprovalStepReference

- `approval_step_id` (string, required)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "data": {
    "spend_request_id": "string",
    "url": "string",
    "external_id": "string",
    "title": "string",
    "description": "string",
    "amount": "string",
    "amount_type": "DAY_RATE",
    "currency": "AUD",
    "custom_fields": [
      {
        "name": "string",
        "value": "string",
        "metadata": null
      }
    ],
    "approval_flow": {
      "approval_flow_id": "string",
      "current_approval_step": {
        "approval_step_id": "string"
      }
    },
    "attachment_url": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.yunojuno.com/spend_requests/by_external_id/external_id/approve/"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.yunojuno.com/spend_requests/by_external_id/external_id/approve/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.yunojuno.com/spend_requests/by_external_id/external_id/approve/"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.yunojuno.com/spend_requests/by_external_id/external_id/approve/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.yunojuno.com/spend_requests/by_external_id/external_id/approve/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.yunojuno.com/spend_requests/by_external_id/external_id/approve/', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.yunojuno.com/spend_requests/by_external_id/external_id/approve/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.yunojuno.com/spend_requests/by_external_id/external_id/approve/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```