Commercial Documents
Create a commercial document
Changed onThis endpoint allows you to create a commercial document (proforma, shipping order or purchasing order).
The document number is assigned by Pennylane, based on the numbering configured for this type of document. GET /api/external/v2/numberings lists whether proforma, shipping_order, or purchasing_order is configured.
ℹ️ This endpoint requires the following scope: commercial_documents:all
post/api/external/v2/commercial_documents
Request
- Base URLhttps://app.pennylane.com
- URLhttps://app.pennylane.com/api/external/v2/commercial_documents
- AuthOAuth 2Authorization code: https://app.pennylane.com/oauth/authorizeToken URL: https://app.pennylane.com/oauth/oauth/token scopes: commercial_documents:all
Headers
X-Company-Idstring
Example:12345
Numeric ID of the company to act on. Required when authenticating with a firm token. Ignored when the token is already bound to a company.
Request body
Example request
{
"date": "2023-08-30",
"deadline": "2023-09-02",
"customer_id": 42,
"commercial_document_template_id": 42,
"pdf_invoice_free_text": "Additional free field",
"pdf_invoice_subject": "Document subject",
"pdf_description": "Document description",
"special_mention": "Additional details",
"discount": {
"value": "25"
},
"invoice_line_sections": [
{
"title": "Consulting Services",
"description": "Consulting for August",
"rank": 1
}
],
"external_reference": "FR123",
"invoice_lines": [
{
"product_id": 42,
"quantity": 2,
"label": "Consulting fees",
"raw_currency_unit_price": "33.333334",
"unit": "piece",
"vat_rate": "FR_200",
"description": "Consulting services for August",
"section_rank": 1,
"discount": {
"value": "10"
}
}
]
}Response
Renders the created commercial document
Example response
{
"id": 42,
"label": "Commercial document label",
"document_number": "PLERYGTXYOIMZZ",
"amount": "230.32",
"currency_amount": "230.32",
"currency_amount_before_tax": "196.32",
"exchange_rate": "1.0",
"date": "2020-01-01",
"deadline": "2020-12-31",
"currency_tax": "34.0",
"tax": "34.0",
"discount": {
"value": "25"
},
"public_file_url": "https://app.pennylane.com/.../file.pdf",
"filename": "my_file.pdf",
"special_mention": "Additional details",
"customer": {
"id": 42,
"url": "https://app.pennylane.com/api/external/v2/customers/42"
},
"invoice_line_sections": {
"url": "https://app.pennylane.com/api/external/v2/commercial_documents/42/invoice_line_sections"
},
"invoice_lines": {
"url": "https://app.pennylane.com/api/external/v2/commercial_documents/42/invoice_lines"
},
"quote": {
"id": 201,
"url": "https://app.pennylane.com/api/external/v2/quotes/201"
},
"pdf_invoice_free_text": "Document details",
"pdf_invoice_subject": "Document subject",
"pdf_description": "Document description",
"appendices": {
"url": "https://app.pennylane.com/api/external/v2/commercial_documents/42/appendices"
},
"external_reference": "FR123",
"archived_at": "2023-08-30T10:08:08.146343Z",
"created_at": "2023-08-30T10:08:08.146343Z",
"updated_at": "2023-08-30T10:08:08.146343Z"
}Changes
- info
endpoint added
- info