Skip to main content
PATCH
/
invoices
/
{id}
Update an invoice
curl --request PATCH \
  --url https://api.bookingshake.io/api/invoices/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "metadata": {
    "external_ref": "MEWS-2026-0042",
    "synced_at": "2026-06-18"
  }
}
'
import requests

url = "https://api.bookingshake.io/api/invoices/{id}"

payload = { "metadata": {
        "external_ref": "MEWS-2026-0042",
        "synced_at": "2026-06-18"
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.text)
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({metadata: {external_ref: 'MEWS-2026-0042', synced_at: '2026-06-18'}})
};

fetch('https://api.bookingshake.io/api/invoices/{id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.bookingshake.io/api/invoices/{id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PATCH",
  CURLOPT_POSTFIELDS => json_encode([
    'metadata' => [
        'external_ref' => 'MEWS-2026-0042',
        'synced_at' => '2026-06-18'
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

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

func main() {

	url := "https://api.bookingshake.io/api/invoices/{id}"

	payload := strings.NewReader("{\n  \"metadata\": {\n    \"external_ref\": \"MEWS-2026-0042\",\n    \"synced_at\": \"2026-06-18\"\n  }\n}")

	req, _ := http.NewRequest("PATCH", 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(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.bookingshake.io/api/invoices/{id}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"metadata\": {\n    \"external_ref\": \"MEWS-2026-0042\",\n    \"synced_at\": \"2026-06-18\"\n  }\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.bookingshake.io/api/invoices/{id}")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"metadata\": {\n    \"external_ref\": \"MEWS-2026-0042\",\n    \"synced_at\": \"2026-06-18\"\n  }\n}"

response = http.request(request)
puts response.read_body
{
  "message": "success",
  "data": {
    "id": "file-789",
    "number": "FAC-2026-0042",
    "type": "balance_invoice",
    "type_code": 380,
    "status": "ongoing",
    "pdf_url": "https://storage.googleapis.com/.../FAC-2026-0042.pdf",
    "metadata": {
      "external_ref": "MEWS-2026-0042",
      "synced_at": "2026-06-18"
    }
  }
}
{
  "message": "no updatable fields provided"
}
{
  "message": "not found"
}
{
  "message": "field 'status' is immutable; only metadata is editable"
}
{
  "message": "Rate limit exceeded",
  "data": {
    "limit": 60,
    "window": "60 seconds",
    "remaining": 0,
    "resetAt": "2025-11-17T14:30:00.000Z",
    "retryAfter": 45
  }
}
{
  "message": "error"
}

Authorizations

Authorization
string
header
required

Bearer authentication using your BookingShake API key. Retrieve your API key from Settings > Integrations in your BookingShake dashboard.

Path Parameters

id
string
required

Invoice document ID (the id field carried by the invoice.created webhook).

Body

application/json

The only writable part of an issued invoice. The legal invoice (amounts, lines, snapshots) is immutable; sending any field other than metadata returns 422.

metadata
object
required

Free-form integration key/value pairs. Merged per key into the existing metadata; pass null as a value to delete that key. Up to 50 keys per invoice, key ≤ 40 chars, value ≤ 500 chars.

Example:
{
  "external_ref": "MEWS-2026-0042",
  "synced_at": "2026-06-18"
}

Response

Invoice metadata updated successfully. Returns the full invoice in its post-update state.

message
string
Example:

"success"

data
object

An issued invoice. Identical to the data block of the invoice.created webhook. All amounts are integer cents; dates are YYYY-MM-DD strings in the Europe/Paris timezone; missing values are explicit null.