Utwórz szablon dokumentu
POST
/api/v2/Templates
const url = 'https://twoja-instancja-renderer-api.enterprise.sellrocket.pl/api/v2/Templates';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"id":1,"name":"example","body":"example","lang":"example","isSystem":true,"tableTemplateType":"example","settings":{"pdfHeight":"example","pdfWidth":"example","pdfMarginTop":"example","pdfMarginBottom":"example","pdfMarginLeftRight":"example","type":"CSV"},"sections":{"order":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"},"orderHistory":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"},"lineItems":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"},"lineItemsList":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"},"lineItemsSummary":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"},"shipment":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"},"invoice":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"},"invoiceItems":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"},"invoiceVat":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"},"receipt":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"},"receiptItems":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"},"return":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"},"returnItems":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"},"message":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"},"payment":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"},"pickpack":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"},"stats":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"},"orderStats":{"body":"example","enabled":true,"orderBy":"example","groupBy":"example"}},"ownedTags":[{"name":"example","value":"example"}],"modifiers":[{"tag":"[waluta]","operator":"replace_if","condition":"USD","newValue":"PLN","position":1}],"shipmentLabelsSettings":{"labelType":"All","marginTopMm":1,"marginLeftMm":1}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://twoja-instancja-renderer-api.enterprise.sellrocket.pl/api/v2/Templates \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "id": 1, "name": "example", "body": "example", "lang": "example", "isSystem": true, "tableTemplateType": "example", "settings": { "pdfHeight": "example", "pdfWidth": "example", "pdfMarginTop": "example", "pdfMarginBottom": "example", "pdfMarginLeftRight": "example", "type": "CSV" }, "sections": { "order": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" }, "orderHistory": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" }, "lineItems": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" }, "lineItemsList": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" }, "lineItemsSummary": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" }, "shipment": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" }, "invoice": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" }, "invoiceItems": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" }, "invoiceVat": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" }, "receipt": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" }, "receiptItems": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" }, "return": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" }, "returnItems": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" }, "message": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" }, "payment": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" }, "pickpack": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" }, "stats": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" }, "orderStats": { "body": "example", "enabled": true, "orderBy": "example", "groupBy": "example" } }, "ownedTags": [ { "name": "example", "value": "example" } ], "modifiers": [ { "tag": "[waluta]", "operator": "replace_if", "condition": "USD", "newValue": "PLN", "position": 1 } ], "shipmentLabelsSettings": { "labelType": "All", "marginTopMm": 1, "marginLeftMm": 1 } }'Tworzy szablon wydruku lub dokumentu (np. faktury proforma, potwierdzenia zamówienia), używany przez endpointy Renderer.
Example
{
"name": "test_template",
"body": "123"
}
Autoryzacja
Dział zatytułowany „Autoryzacja”Treść żądania
Dział zatytułowany „Treść żądania”Typ treściapplication/json
object
id
integer format: int64
name
string
body
string
lang
string
isSystem
boolean
tableTemplateType
string
settings
object
pdfHeight
string
pdfWidth
string
pdfMarginTop
string
pdfMarginBottom
string
pdfMarginLeftRight
string
type
string
sections
object
order
object
body
string
enabled
boolean
orderBy
string
groupBy
string
orderHistory
object
body
string
enabled
boolean
orderBy
string
groupBy
string
lineItems
object
body
string
enabled
boolean
orderBy
string
groupBy
string
lineItemsList
object
body
string
enabled
boolean
orderBy
string
groupBy
string
lineItemsSummary
object
body
string
enabled
boolean
orderBy
string
groupBy
string
shipment
object
body
string
enabled
boolean
orderBy
string
groupBy
string
invoice
object
body
string
enabled
boolean
orderBy
string
groupBy
string
invoiceItems
object
body
string
enabled
boolean
orderBy
string
groupBy
string
invoiceVat
object
body
string
enabled
boolean
orderBy
string
groupBy
string
receipt
object
body
string
enabled
boolean
orderBy
string
groupBy
string
receiptItems
object
body
string
enabled
boolean
orderBy
string
groupBy
string
return
object
body
string
enabled
boolean
orderBy
string
groupBy
string
returnItems
object
body
string
enabled
boolean
orderBy
string
groupBy
string
message
object
body
string
enabled
boolean
orderBy
string
groupBy
string
payment
object
body
string
enabled
boolean
orderBy
string
groupBy
string
pickpack
object
body
string
enabled
boolean
orderBy
string
groupBy
string
stats
object
body
string
enabled
boolean
orderBy
string
groupBy
string
orderStats
object
body
string
enabled
boolean
orderBy
string
groupBy
string
ownedTags
Array<object>
object
name
string
value
string
modifiers
Array<object>
object
tag
wymagane
string
Example
[waluta]operator
wymagane
string
Example
replace_ifcondition
wymagane
string
Example
USDnewValue
wymagane
string
Example
PLNposition
integer format: int64
shipmentLabelsSettings
object
labelType
string
marginTopMm
integer format: int64
marginLeftMm
integer format: int64
Odpowiedzi
Dział zatytułowany „Odpowiedzi”Success
Typ treściapplication/json
integer format: int64
Examplegenerated
1
