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.eyJzdWIiOjEzOSwiYXVkIjpbImFkbWluIl0sImV4cCI6MTc4NjM2MDI5M30.KJ82sgy2xI3aYxF562YL2KJ4sndvp7WhI9H11kPtoHI
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: fa4742eb-2fce-4977-891f-7d7d3aa25b23
x-runtime: 0.007593
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}}"
    }
  }
}