API Documentation

API Endpoint

Document Types

Document Types

Supported filter params

  • subsidiary_id (array)

  • exportable_type_id (array) (1: invoice, 2: deal, 3: budget)

  • status (1: active, 2: archived)

GET /api/v2/document_types
Requestsreturns, :aggregate_failures document_typesreturns error when document templates feature not available

GET  /api/v2/document_types

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "400",
      "type": "document_types",
      "attributes": {
        "name": "normal invoice",
        "tax1_name": "VAT",
        "tax1_value": "25.0",
        "tax2_name": null,
        "tax2_value": null,
        "locale": "en_US",
        "document_template_id": 1,
        "exportable_type_id": 1,
        "note": null,
        "footer": null,
        "template_options": {},
        "archived_at": null,
        "header_template": null,
        "body_template": null,
        "footer_template": null,
        "scss_template": null,
        "exporter_options": {},
        "email_template": null,
        "email_subject": null,
        "email_data": {},
        "dual_currency": false
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": "464"
          }
        },
        "subsidiary": {
          "meta": {
            "included": false
          }
        },
        "document_style": {
          "meta": {
            "included": false
          }
        },
        "attachments": {
          "meta": {
            "included": false
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://api-test.productive.io/api/v2/document_types?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://api-test.productive.io/api/v2/document_types?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200
  }
}

GET  /api/v2/document_types

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses403
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "403",
      "code": "document_templates_unavailable",
      "title": "Access Denied",
      "detail": "Feature document templates unavailable",
      "source": {}
    }
  ]
}

Get document_types
GET/api/v2/document_types


GET /api/v2/document_types/1
Requestsreturns, :aggregate_failures document_typereturns error when document templates feature not available

GET  /api/v2/document_types/402

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "402",
    "type": "document_types",
    "attributes": {
      "name": "normal invoice",
      "tax1_name": "VAT",
      "tax1_value": "25.0",
      "tax2_name": null,
      "tax2_value": null,
      "locale": "en_US",
      "document_template_id": 1,
      "exportable_type_id": 1,
      "note": null,
      "footer": null,
      "template_options": {},
      "archived_at": null,
      "header_template": null,
      "body_template": null,
      "footer_template": null,
      "scss_template": null,
      "exporter_options": {},
      "email_template": null,
      "email_subject": null,
      "email_data": {},
      "dual_currency": false
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "466"
        }
      },
      "subsidiary": {
        "meta": {
          "included": false
        }
      },
      "document_style": {
        "meta": {
          "included": false
        }
      },
      "attachments": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

GET  /api/v2/document_types/403

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses403
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "403",
      "code": "document_templates_unavailable",
      "title": "Access Denied",
      "detail": "Feature document templates unavailable",
      "source": {}
    }
  ]
}

Gets a document_type
GET/api/v2/document_types/{id}

URI Parameters
HideShow
id
number (required) Example: 1

document type id


POST /api/v2/document_types
Requestsreturns error when document templates feature not availablecreates, :aggregate_failures document_typereturns errorcreates, :aggregate_failures document_type

POST  /api/v2/document_types

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses403
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "403",
      "title": "Access Denied",
      "detail": "You are not authorized to access this resource",
      "source": {}
    }
  ]
}

POST  /api/v2/document_types

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "document_types",
    "attributes": {
      "name": "test name",
      "locale": "hr_HR",
      "exportable_type_id": 1
    },
    "relationships": {
      "subsidiary": {
        "data": {
          "type": "subsidiaries",
          "id": "456"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "406",
    "type": "document_types",
    "attributes": {
      "name": "test name",
      "tax1_name": null,
      "tax1_value": null,
      "tax2_name": null,
      "tax2_value": null,
      "locale": "hr_HR",
      "document_template_id": null,
      "exportable_type_id": 1,
      "note": null,
      "footer": null,
      "template_options": {},
      "archived_at": null,
      "header_template": null,
      "body_template": null,
      "footer_template": null,
      "scss_template": null,
      "exporter_options": {},
      "email_template": null,
      "email_subject": null,
      "email_data": {
        "subject": null,
        "template": null
      },
      "dual_currency": false
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "469"
        }
      },
      "subsidiary": {
        "meta": {
          "included": false
        }
      },
      "document_style": {
        "meta": {
          "included": false
        }
      },
      "attachments": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

POST  /api/v2/document_types

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "document_types",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    },
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/locale"
      }
    },
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "is not included in the list",
      "source": {
        "pointer": "data/attributes/exportable_type_id"
      }
    }
  ]
}

POST  /api/v2/document_types

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "document_types",
    "attributes": {
      "name": "test name",
      "locale": "hr_HR",
      "exportable_type_id": 1,
      "tax1_value": 2.34567,
      "tax2_value": 5.12345
    },
    "relationships": {
      "subsidiary": {
        "data": {
          "type": "subsidiaries",
          "id": "458"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "409",
    "type": "document_types",
    "attributes": {
      "name": "test name",
      "tax1_name": null,
      "tax1_value": "2.35",
      "tax2_name": null,
      "tax2_value": "5.12",
      "locale": "hr_HR",
      "document_template_id": null,
      "exportable_type_id": 1,
      "note": null,
      "footer": null,
      "template_options": {},
      "archived_at": null,
      "header_template": null,
      "body_template": null,
      "footer_template": null,
      "scss_template": null,
      "exporter_options": {},
      "email_template": null,
      "email_subject": null,
      "email_data": {
        "subject": null,
        "template": null
      },
      "dual_currency": false
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "471"
        }
      },
      "subsidiary": {
        "meta": {
          "included": false
        }
      },
      "document_style": {
        "meta": {
          "included": false
        }
      },
      "attachments": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

Create a document_type
POST/api/v2/document_types

URI Parameters
HideShow
name
string (required) Example: Name

name

locale
string (required) Example: en_US

locale

subsidiary_id
number (required) Example: 1

subsidiary id


PATCH /api/v2/document_types/1
Requestsreturns error when document templates feature not availableupdates, :aggregate_failures document_typeupdates, :aggregate_failures document_typeupdates, :aggregate_failures document_typereturns errorupdates, :aggregate_failures document_typeupdates, :aggregate_failures document_type

PATCH  /api/v2/document_types/410

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses403
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "403",
      "code": "document_templates_unavailable",
      "title": "Access Denied",
      "detail": "Feature document templates unavailable",
      "source": {}
    }
  ]
}

PATCH  /api/v2/document_types/411

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "document_types",
    "attributes": {
      "name": "new name"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "411",
    "type": "document_types",
    "attributes": {
      "name": "new name",
      "tax1_name": "VAT",
      "tax1_value": "25.0",
      "tax2_name": null,
      "tax2_value": null,
      "locale": "en_US",
      "document_template_id": 1,
      "exportable_type_id": 1,
      "note": null,
      "footer": null,
      "template_options": {},
      "archived_at": null,
      "header_template": null,
      "body_template": null,
      "footer_template": null,
      "scss_template": null,
      "exporter_options": {},
      "email_template": null,
      "email_subject": null,
      "email_data": {
        "subject": null,
        "template": null
      },
      "dual_currency": false
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "473"
        }
      },
      "subsidiary": {
        "meta": {
          "included": false
        }
      },
      "document_style": {
        "meta": {
          "included": false
        }
      },
      "attachments": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

PATCH  /api/v2/document_types/412

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "document_types",
    "attributes": {
      "tax1_value": 0,
      "tax2_value": null
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "412",
    "type": "document_types",
    "attributes": {
      "name": "Standard Document Type",
      "tax1_name": "VAT",
      "tax1_value": "0.0",
      "tax2_name": null,
      "tax2_value": null,
      "locale": "en_US",
      "document_template_id": 1,
      "exportable_type_id": 1,
      "note": null,
      "footer": null,
      "template_options": {},
      "archived_at": null,
      "header_template": null,
      "body_template": null,
      "footer_template": null,
      "scss_template": null,
      "exporter_options": {},
      "email_template": null,
      "email_subject": null,
      "email_data": {
        "subject": null,
        "template": null
      },
      "dual_currency": false
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "474"
        }
      },
      "subsidiary": {
        "meta": {
          "included": false
        }
      },
      "document_style": {
        "meta": {
          "included": false
        }
      },
      "attachments": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

PATCH  /api/v2/document_types/413

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "document_types",
    "attributes": {
      "document_style_id": null
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "413",
    "type": "document_types",
    "attributes": {
      "name": "Standard Document Type",
      "tax1_name": "VAT",
      "tax1_value": "25.0",
      "tax2_name": null,
      "tax2_value": null,
      "locale": "en_US",
      "document_template_id": 1,
      "exportable_type_id": 1,
      "note": null,
      "footer": null,
      "template_options": {},
      "archived_at": null,
      "header_template": null,
      "body_template": null,
      "footer_template": null,
      "scss_template": null,
      "exporter_options": {},
      "email_template": null,
      "email_subject": null,
      "email_data": {
        "subject": null,
        "template": null
      },
      "dual_currency": false
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "475"
        }
      },
      "subsidiary": {
        "meta": {
          "included": false
        }
      },
      "document_style": {
        "meta": {
          "included": false
        }
      },
      "attachments": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

PATCH  /api/v2/document_types/414

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "document_types",
    "attributes": {
      "name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/name"
      }
    }
  ]
}

PATCH  /api/v2/document_types/415

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "document_types",
    "attributes": {
      "name": "new name"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "415",
    "type": "document_types",
    "attributes": {
      "name": "new name",
      "tax1_name": "VAT",
      "tax1_value": "5.12345",
      "tax2_name": null,
      "tax2_value": "2.34567",
      "locale": "en_US",
      "document_template_id": 1,
      "exportable_type_id": 1,
      "note": null,
      "footer": null,
      "template_options": {},
      "archived_at": null,
      "header_template": null,
      "body_template": null,
      "footer_template": null,
      "scss_template": null,
      "exporter_options": {},
      "email_template": null,
      "email_subject": null,
      "email_data": {
        "subject": null,
        "template": null
      },
      "dual_currency": false
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "477"
        }
      },
      "subsidiary": {
        "meta": {
          "included": false
        }
      },
      "document_style": {
        "meta": {
          "included": false
        }
      },
      "attachments": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

PATCH  /api/v2/document_types/416

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "document_types",
    "attributes": {
      "name": "new name",
      "tax1_value": 3.45678,
      "tax2_value": 6.12345
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "416",
    "type": "document_types",
    "attributes": {
      "name": "new name",
      "tax1_name": "VAT",
      "tax1_value": "3.46",
      "tax2_name": null,
      "tax2_value": "6.12",
      "locale": "en_US",
      "document_template_id": 1,
      "exportable_type_id": 1,
      "note": null,
      "footer": null,
      "template_options": {},
      "archived_at": null,
      "header_template": null,
      "body_template": null,
      "footer_template": null,
      "scss_template": null,
      "exporter_options": {},
      "email_template": null,
      "email_subject": null,
      "email_data": {
        "subject": null,
        "template": null
      },
      "dual_currency": false
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "478"
        }
      },
      "subsidiary": {
        "meta": {
          "included": false
        }
      },
      "document_style": {
        "meta": {
          "included": false
        }
      },
      "attachments": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

Update a document_type
PATCH/api/v2/document_types/{id}

URI Parameters
HideShow
id
number (required) Example: 1

document type id


PATCH /api/v2/document_types/1/archive
Requestsarchives, :aggregate_failures document typereturns error when document templates feature not available

PATCH  /api/v2/document_types/417/archive

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "417",
    "type": "document_types",
    "attributes": {
      "name": "normal invoice",
      "tax1_name": "VAT",
      "tax1_value": "25.0",
      "tax2_name": null,
      "tax2_value": null,
      "locale": "en_US",
      "document_template_id": 1,
      "exportable_type_id": 1,
      "note": null,
      "footer": null,
      "template_options": {},
      "archived_at": "2025-08-01T06:05:15.000+02:00",
      "header_template": null,
      "body_template": null,
      "footer_template": null,
      "scss_template": null,
      "exporter_options": {},
      "email_template": null,
      "email_subject": null,
      "email_data": {},
      "dual_currency": false
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "479"
        }
      },
      "subsidiary": {
        "meta": {
          "included": false
        }
      },
      "document_style": {
        "meta": {
          "included": false
        }
      },
      "attachments": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

PATCH  /api/v2/document_types/418/archive

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses403
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "403",
      "title": "Access Denied",
      "detail": "You are not authorized to access this resource",
      "source": {}
    }
  ]
}

Archives a document type
PATCH/api/v2/document_types/{id}/archive

URI Parameters
HideShow
id
number (required) Example: 1

document type id


POST /api/v2/document_types/copy
Requestsreturns error when document templates feature not availablecreates duplicated document_typereturns error

POST  /api/v2/document_types/copy

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses403
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "403",
      "title": "Access Denied",
      "detail": "You are not authorized to access this resource",
      "source": {}
    }
  ]
}

POST  /api/v2/document_types/copy

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "document_type",
    "attributes": {
      "template_id": 420
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "421",
    "type": "document_types",
    "attributes": {
      "name": "[DUPLICATE] normal invoice",
      "tax1_name": "VAT",
      "tax1_value": "25.0",
      "tax2_name": null,
      "tax2_value": null,
      "locale": "en_US",
      "document_template_id": 1,
      "exportable_type_id": 1,
      "note": null,
      "footer": null,
      "template_options": {},
      "archived_at": null,
      "header_template": null,
      "body_template": null,
      "footer_template": null,
      "scss_template": null,
      "exporter_options": {},
      "email_template": null,
      "email_subject": null,
      "email_data": {},
      "dual_currency": false
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "482"
        }
      },
      "subsidiary": {
        "meta": {
          "included": false
        }
      },
      "document_style": {
        "meta": {
          "included": false
        }
      },
      "attachments": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

POST  /api/v2/document_types/copy

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/template_id"
      }
    }
  ]
}

Duplicates a document type
POST/api/v2/document_types/copy

URI Parameters
HideShow
template_id
number (required) Example: 1

id of the document type to be copied


Generated by aglio on 01 Aug 2025