POST
Send a purchase order by email
Scope:
inventory:purchase-orders.writehttps://api.holded.com/api/v2/purchase-orders/{purchaseOrderId}/sendSends the purchase order by email to the supplier, with an optional custom subject and message; without them, the template configured in your account settings is used. Leave `emails` out to send it to the addresses on the document's contact, as the app's send dialog fills them in; if the contact has none, the request is refused.
Parameters
Path parameters
purchaseOrderId
stringrequiredPurchase Order ID (24-char hex ObjectId)
Request body
object
emails[]string[] | null
List of recipient email addresses. Leave it out to send to the email addresses on the document's contact; an empty list is refused.
subjectstring | null
Custom email subject line
messagestring | null
Custom email body message
mail_template_idstring | null
Identifier of the email template to use
cc[]string[] | null
List of CC email addresses
bcc[]string[] | null
List of BCC email addresses
Request
python
import requests
url = "https://api.holded.com/api/v2/purchase-orders/{purchaseOrderId}/send"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
payload = {
"emails": [
"string"
],
"subject": "string",
"message": "string",
"mail_template_id": "string",
"cc": [
"string"
],
"bcc": [
"string"
]
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())Responses
Success responses
200Purchase order sentError responses
400Bad requestapplication/json401Invalid or missing API keyapplication/json403Insufficient permissionsapplication/json404Purchase order not foundapplication/json429Rate limit exceededapplication/json