Skip to main content
POST

Convert a document to another type

Scope:sales:invoices.write
https://api.holded.com/api/v2/documents/convert

Converts an existing document into a new document of a different type. For example, convert an estimate into an invoice or a sales order into a waybill. The source document remains unchanged; a new document of the target type is created and linked to the source. Not all conversion pairs are supported — the available conversions depend on the document types configured in your account. This is the only way to create a document that preserves the parent-child relationship with the source. For partial conversions (e.g. invoicing only a portion of a proforma), use this endpoint to create the linked document and then update the resulting document's line quantities or prices accordingly.

Request body

object
source_typestringrequired

Type of the source document to convert from

Enum:invoicecreditnoteestimatesalesordersalesreceiptpurchaseorderproformwaybill
source_idstringrequired

Identifier of the source document

target_typestringrequired

Type of the target document to convert to

Enum:invoicecreditnoteestimatesalesordersalesreceiptpurchaseorderproformwaybill
datestring<date> | nulloptional

Issue date for the new document in ISO 8601 format

due_datestring<date> | nulloptional

Due date for the new document in ISO 8601 format

number_line_idstring | nulloptional

Identifier of the numbering series to use

descriptionstring | nulloptional

Description for the new document

notesstring | nulloptional

Internal notes for the new document

draftboolean | nulloptional

Whether to create the new document as a draft

Request

python
import requests

url = "https://api.holded.com/api/v2/documents/convert"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Accept": "application/json",
}

payload = {
    "source_type": "invoice",
    "source_id": "507f1f77bcf86cd799439011",
    "target_type": "invoice",
    "date": "2024-01-15",
    "due_date": "2024-02-15",
    "number_line_id": "string",
    "description": "string",
    "notes": "string",
    "draft": false
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())

Responses

Response

json
{
  "id": "507f1f77bcf86cd799439011"
}

Success responses

201Document convertedapplication/json
object
idstring

Error responses

400Bad requestapplication/json
401Invalid or missing API keyapplication/json
403Insufficient permissionsapplication/json
404Source document not foundapplication/json
422Conversion not supportedapplication/json
429Rate limit exceededapplication/json