Invoice template API

create new entry

POST /api/rest/admin/invoice-template

Parameters

Name Description
data[type] Resource type (invoice-templates)
data[attributes][name] Name
data[attributes][html-template] Html template
data[attributes][filename-template] Filename template

Request

Headers

Accept: application/vnd.api+json
Content-Type: application/vnd.api+json
Authorization: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEzOSwiYXVkIjpbImFkbWluIl0sImV4cCI6MTc4ODYwNjUxNH0.rWVid2V2B7KU9Y-XdnTnFYwQiYhg0OqQ6-KXId79yOY
Host: example.org
Cookie: 

Route

POST /api/rest/admin/invoice-template

Body

{"data":{"type":"invoice-templates","attributes":{"name":"Daily","html-template":"\u003cp\u003e{{ invoice.reference }}\u003c/p\u003e","filename-template":"invoice-{{invoice.reference}}"}}}

Response

Headers

x-frame-options: SAMEORIGIN
x-xss-protection: 0
x-content-type-options: nosniff
x-permitted-cross-domain-policies: none
referrer-policy: strict-origin-when-cross-origin
content-type: application/vnd.api+json
location: http://example.org/api/rest/admin/invoice-templates/6
vary: Accept
etag: W/"b87cb4d9cebf3bcdf6841bde371d1d01"
cache-control: max-age=0, private, must-revalidate
x-request-id: 6dfa46c4-f19d-4229-972c-8d006e10b54d
x-runtime: 0.011849
content-length: 250

Status

201 Created

Body

{
  "data": {
    "id": "6",
    "type": "invoice-templates",
    "links": {
      "self": "http://example.org/api/rest/admin/invoice-templates/6"
    },
    "attributes": {
      "name": "Daily",
      "html-template": "<p>{{ invoice.reference }}</p>",
      "filename-template": "invoice-{{invoice.reference}}"
    }
  }
}