Deductions
Get Deduction Template Definitions
Retrieve the JSON schema definition for a deduction type, describing every field allowed when creating a Deduction Template.
GET
/
deductionTemplateDefinitions
Get Deduction Template Definitions
curl --request GET \
--url https://api.zeal.com/deductionTemplateDefinitions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"success": true,
"data": {
"type": "object",
"required": [
"employee_contribution",
"additional_fields"
],
"properties": {
"required_template_fields": {
"const": [
"employee_contribution"
]
},
"custom_name": {
"type": "string"
},
"deduction_type": {
"const": "hsa"
},
"employee_contribution": {
"type": "object",
"properties": {
"contribution_type": {
"enum": [
"dollars"
]
},
"value": {
"type": "number"
},
"override_type": {
"enum": [
"overridable",
"needs_input",
"final"
]
},
"required_template_fields": {
"const": [
"value"
]
}
},
"allOf": [
{
"if": {
"properties": {
"override_type": {
"const": "final"
}
},
"required": [
"override_type"
]
},
"then": {
"required": [
"value"
]
}
},
{
"if": {
"properties": {
"override_type": {
"const": "overridable"
}
},
"required": [
"override_type"
]
},
"then": {
"required": [
"value"
]
}
}
],
"required": [
"override_type",
"contribution_type"
]
},
"employer_contribution": {
"type": "object",
"properties": {
"contribution_type": {
"enum": [
"dollars"
]
},
"value": {
"type": "number"
},
"override_type": {
"enum": [
"overridable",
"needs_input",
"final"
]
},
"required_template_fields": {
"const": [
"value"
]
}
},
"allOf": [
{
"if": {
"properties": {
"override_type": {
"const": "final"
}
},
"required": [
"override_type"
]
},
"then": {
"required": [
"value"
]
}
},
{
"if": {
"properties": {
"override_type": {
"const": "overridable"
}
},
"required": [
"override_type"
]
},
"then": {
"required": [
"value"
]
}
}
],
"required": [
"override_type",
"contribution_type"
]
},
"additional_fields": {
"type": "object",
"properties": {
"hsa_type": {
"enum": [
"family",
"individual"
]
}
},
"required": [
"hsa_type"
]
}
}
}
}
'import requests
url = "https://api.zeal.com/deductionTemplateDefinitions"
payload = {
"success": True,
"data": {
"type": "object",
"required": ["employee_contribution", "additional_fields"],
"properties": {
"required_template_fields": { "const": ["employee_contribution"] },
"custom_name": { "type": "string" },
"deduction_type": { "const": "hsa" },
"employee_contribution": {
"type": "object",
"properties": {
"contribution_type": { "enum": ["dollars"] },
"value": { "type": "number" },
"override_type": { "enum": ["overridable", "needs_input", "final"] },
"required_template_fields": { "const": ["value"] }
},
"allOf": [
{
"if": {
"properties": { "override_type": { "const": "final" } },
"required": ["override_type"]
},
"then": { "required": ["value"] }
},
{
"if": {
"properties": { "override_type": { "const": "overridable" } },
"required": ["override_type"]
},
"then": { "required": ["value"] }
}
],
"required": ["override_type", "contribution_type"]
},
"employer_contribution": {
"type": "object",
"properties": {
"contribution_type": { "enum": ["dollars"] },
"value": { "type": "number" },
"override_type": { "enum": ["overridable", "needs_input", "final"] },
"required_template_fields": { "const": ["value"] }
},
"allOf": [
{
"if": {
"properties": { "override_type": { "const": "final" } },
"required": ["override_type"]
},
"then": { "required": ["value"] }
},
{
"if": {
"properties": { "override_type": { "const": "overridable" } },
"required": ["override_type"]
},
"then": { "required": ["value"] }
}
],
"required": ["override_type", "contribution_type"]
},
"additional_fields": {
"type": "object",
"properties": { "hsa_type": { "enum": ["family", "individual"] } },
"required": ["hsa_type"]
}
}
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
success: true,
data: {
type: 'object',
required: ['employee_contribution', 'additional_fields'],
properties: {
required_template_fields: {const: ['employee_contribution']},
custom_name: {type: 'string'},
deduction_type: {const: 'hsa'},
employee_contribution: {
type: 'object',
properties: {
contribution_type: {enum: ['dollars']},
value: {type: 'number'},
override_type: {enum: ['overridable', 'needs_input', 'final']},
required_template_fields: {const: ['value']}
},
allOf: [
{
if: {properties: {override_type: {const: 'final'}}, required: ['override_type']},
then: {required: ['value']}
},
{
if: {
properties: {override_type: {const: 'overridable'}},
required: ['override_type']
},
then: {required: ['value']}
}
],
required: ['override_type', 'contribution_type']
},
employer_contribution: {
type: 'object',
properties: {
contribution_type: {enum: ['dollars']},
value: {type: 'number'},
override_type: {enum: ['overridable', 'needs_input', 'final']},
required_template_fields: {const: ['value']}
},
allOf: [
{
if: {properties: {override_type: {const: 'final'}}, required: ['override_type']},
then: {required: ['value']}
},
{
if: {
properties: {override_type: {const: 'overridable'}},
required: ['override_type']
},
then: {required: ['value']}
}
],
required: ['override_type', 'contribution_type']
},
additional_fields: {
type: 'object',
properties: {hsa_type: {enum: ['family', 'individual']}},
required: ['hsa_type']
}
}
}
})
};
fetch('https://api.zeal.com/deductionTemplateDefinitions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zeal.com/deductionTemplateDefinitions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'success' => true,
'data' => [
'type' => 'object',
'required' => [
'employee_contribution',
'additional_fields'
],
'properties' => [
'required_template_fields' => [
'const' => [
'employee_contribution'
]
],
'custom_name' => [
'type' => 'string'
],
'deduction_type' => [
'const' => 'hsa'
],
'employee_contribution' => [
'type' => 'object',
'properties' => [
'contribution_type' => [
'enum' => [
'dollars'
]
],
'value' => [
'type' => 'number'
],
'override_type' => [
'enum' => [
'overridable',
'needs_input',
'final'
]
],
'required_template_fields' => [
'const' => [
'value'
]
]
],
'allOf' => [
[
'if' => [
'properties' => [
'override_type' => [
'const' => 'final'
]
],
'required' => [
'override_type'
]
],
'then' => [
'required' => [
'value'
]
]
],
[
'if' => [
'properties' => [
'override_type' => [
'const' => 'overridable'
]
],
'required' => [
'override_type'
]
],
'then' => [
'required' => [
'value'
]
]
]
],
'required' => [
'override_type',
'contribution_type'
]
],
'employer_contribution' => [
'type' => 'object',
'properties' => [
'contribution_type' => [
'enum' => [
'dollars'
]
],
'value' => [
'type' => 'number'
],
'override_type' => [
'enum' => [
'overridable',
'needs_input',
'final'
]
],
'required_template_fields' => [
'const' => [
'value'
]
]
],
'allOf' => [
[
'if' => [
'properties' => [
'override_type' => [
'const' => 'final'
]
],
'required' => [
'override_type'
]
],
'then' => [
'required' => [
'value'
]
]
],
[
'if' => [
'properties' => [
'override_type' => [
'const' => 'overridable'
]
],
'required' => [
'override_type'
]
],
'then' => [
'required' => [
'value'
]
]
]
],
'required' => [
'override_type',
'contribution_type'
]
],
'additional_fields' => [
'type' => 'object',
'properties' => [
'hsa_type' => [
'enum' => [
'family',
'individual'
]
]
],
'required' => [
'hsa_type'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zeal.com/deductionTemplateDefinitions"
payload := strings.NewReader("{\n \"success\": true,\n \"data\": {\n \"type\": \"object\",\n \"required\": [\n \"employee_contribution\",\n \"additional_fields\"\n ],\n \"properties\": {\n \"required_template_fields\": {\n \"const\": [\n \"employee_contribution\"\n ]\n },\n \"custom_name\": {\n \"type\": \"string\"\n },\n \"deduction_type\": {\n \"const\": \"hsa\"\n },\n \"employee_contribution\": {\n \"type\": \"object\",\n \"properties\": {\n \"contribution_type\": {\n \"enum\": [\n \"dollars\"\n ]\n },\n \"value\": {\n \"type\": \"number\"\n },\n \"override_type\": {\n \"enum\": [\n \"overridable\",\n \"needs_input\",\n \"final\"\n ]\n },\n \"required_template_fields\": {\n \"const\": [\n \"value\"\n ]\n }\n },\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"final\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"overridable\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n }\n ],\n \"required\": [\n \"override_type\",\n \"contribution_type\"\n ]\n },\n \"employer_contribution\": {\n \"type\": \"object\",\n \"properties\": {\n \"contribution_type\": {\n \"enum\": [\n \"dollars\"\n ]\n },\n \"value\": {\n \"type\": \"number\"\n },\n \"override_type\": {\n \"enum\": [\n \"overridable\",\n \"needs_input\",\n \"final\"\n ]\n },\n \"required_template_fields\": {\n \"const\": [\n \"value\"\n ]\n }\n },\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"final\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"overridable\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n }\n ],\n \"required\": [\n \"override_type\",\n \"contribution_type\"\n ]\n },\n \"additional_fields\": {\n \"type\": \"object\",\n \"properties\": {\n \"hsa_type\": {\n \"enum\": [\n \"family\",\n \"individual\"\n ]\n }\n },\n \"required\": [\n \"hsa_type\"\n ]\n }\n }\n }\n}")
req, _ := http.NewRequest("GET", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.zeal.com/deductionTemplateDefinitions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"success\": true,\n \"data\": {\n \"type\": \"object\",\n \"required\": [\n \"employee_contribution\",\n \"additional_fields\"\n ],\n \"properties\": {\n \"required_template_fields\": {\n \"const\": [\n \"employee_contribution\"\n ]\n },\n \"custom_name\": {\n \"type\": \"string\"\n },\n \"deduction_type\": {\n \"const\": \"hsa\"\n },\n \"employee_contribution\": {\n \"type\": \"object\",\n \"properties\": {\n \"contribution_type\": {\n \"enum\": [\n \"dollars\"\n ]\n },\n \"value\": {\n \"type\": \"number\"\n },\n \"override_type\": {\n \"enum\": [\n \"overridable\",\n \"needs_input\",\n \"final\"\n ]\n },\n \"required_template_fields\": {\n \"const\": [\n \"value\"\n ]\n }\n },\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"final\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"overridable\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n }\n ],\n \"required\": [\n \"override_type\",\n \"contribution_type\"\n ]\n },\n \"employer_contribution\": {\n \"type\": \"object\",\n \"properties\": {\n \"contribution_type\": {\n \"enum\": [\n \"dollars\"\n ]\n },\n \"value\": {\n \"type\": \"number\"\n },\n \"override_type\": {\n \"enum\": [\n \"overridable\",\n \"needs_input\",\n \"final\"\n ]\n },\n \"required_template_fields\": {\n \"const\": [\n \"value\"\n ]\n }\n },\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"final\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"overridable\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n }\n ],\n \"required\": [\n \"override_type\",\n \"contribution_type\"\n ]\n },\n \"additional_fields\": {\n \"type\": \"object\",\n \"properties\": {\n \"hsa_type\": {\n \"enum\": [\n \"family\",\n \"individual\"\n ]\n }\n },\n \"required\": [\n \"hsa_type\"\n ]\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zeal.com/deductionTemplateDefinitions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"success\": true,\n \"data\": {\n \"type\": \"object\",\n \"required\": [\n \"employee_contribution\",\n \"additional_fields\"\n ],\n \"properties\": {\n \"required_template_fields\": {\n \"const\": [\n \"employee_contribution\"\n ]\n },\n \"custom_name\": {\n \"type\": \"string\"\n },\n \"deduction_type\": {\n \"const\": \"hsa\"\n },\n \"employee_contribution\": {\n \"type\": \"object\",\n \"properties\": {\n \"contribution_type\": {\n \"enum\": [\n \"dollars\"\n ]\n },\n \"value\": {\n \"type\": \"number\"\n },\n \"override_type\": {\n \"enum\": [\n \"overridable\",\n \"needs_input\",\n \"final\"\n ]\n },\n \"required_template_fields\": {\n \"const\": [\n \"value\"\n ]\n }\n },\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"final\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"overridable\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n }\n ],\n \"required\": [\n \"override_type\",\n \"contribution_type\"\n ]\n },\n \"employer_contribution\": {\n \"type\": \"object\",\n \"properties\": {\n \"contribution_type\": {\n \"enum\": [\n \"dollars\"\n ]\n },\n \"value\": {\n \"type\": \"number\"\n },\n \"override_type\": {\n \"enum\": [\n \"overridable\",\n \"needs_input\",\n \"final\"\n ]\n },\n \"required_template_fields\": {\n \"const\": [\n \"value\"\n ]\n }\n },\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"final\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"overridable\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n }\n ],\n \"required\": [\n \"override_type\",\n \"contribution_type\"\n ]\n },\n \"additional_fields\": {\n \"type\": \"object\",\n \"properties\": {\n \"hsa_type\": {\n \"enum\": [\n \"family\",\n \"individual\"\n ]\n }\n },\n \"required\": [\n \"hsa_type\"\n ]\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"type": "object",
"required": [
"employee_contribution",
"additional_fields"
],
"properties": {
"required_template_fields": {
"const": [
"employee_contribution"
]
},
"custom_name": {
"type": "string"
},
"deduction_type": {
"const": "hsa"
},
"employee_contribution": {
"type": "object",
"properties": {
"contribution_type": {
"enum": [
"dollars"
]
},
"value": {
"type": "number"
},
"override_type": {
"enum": [
"overridable",
"needs_input",
"final"
]
},
"required_template_fields": {
"const": [
"value"
]
}
},
"allOf": [
{
"if": {
"properties": {
"override_type": {
"const": "final"
}
},
"required": [
"override_type"
]
},
"then": {
"required": [
"value"
]
}
},
{
"if": {
"properties": {
"override_type": {
"const": "overridable"
}
},
"required": [
"override_type"
]
},
"then": {
"required": [
"value"
]
}
}
],
"required": [
"override_type",
"contribution_type"
]
},
"employer_contribution": {
"type": "object",
"properties": {
"contribution_type": {
"enum": [
"dollars"
]
},
"value": {
"type": "number"
},
"override_type": {
"enum": [
"overridable",
"needs_input",
"final"
]
},
"required_template_fields": {
"const": [
"value"
]
}
},
"allOf": [
{
"if": {
"properties": {
"override_type": {
"const": "final"
}
},
"required": [
"override_type"
]
},
"then": {
"required": [
"value"
]
}
},
{
"if": {
"properties": {
"override_type": {
"const": "overridable"
}
},
"required": [
"override_type"
]
},
"then": {
"required": [
"value"
]
}
}
],
"required": [
"override_type",
"contribution_type"
]
},
"additional_fields": {
"type": "object",
"properties": {
"hsa_type": {
"enum": [
"family",
"individual"
]
}
},
"required": [
"hsa_type"
]
}
}
}
}{
"success": false,
"errors": [
{
"message": "Unsupported deduction type",
"code": 13
}
]
}Zeal’s deduction system lets you model additional withholding - 401(k), HSA, garnishments, and more - on top of standard tax withholdings. First define the rules by creating a Deduction Template, then attach a Deduction to a specific employee check. Each deduction type has a corresponding JSON-schema definition that tells you exactly which fields are required and what values are accepted.
The Understanding
Contribution objects typically include an
Reading the JSON Schema
The definition schema uses three value constraint types:| Constraint | Meaning |
|---|---|
const | The field must be exactly that value |
enum | The field must be one of the listed values |
type | The field must match the given JSON type (e.g., "number") |
required_template_fields property is not included in the Deduction Template request body. Instead, it tells you which fields will be required later when you create an actual Deduction using that template.
Understanding override_type
Contribution objects typically include an override_type field that controls how the value is handled at check time:
| Value | Behavior |
|---|---|
final | The value set in the template is locked and cannot be changed when creating a deduction. |
needs_input | No default value is stored in the template. You must supply the value each time you create a deduction. |
overridable | A default value is stored in the template but can be overridden when creating a deduction. |
Authorizations
Query Parameters
Deduction type for which Deduction Template Definition is required
Available options:
401k, section_125, hsa, miscellaneous, garnishment, 403b, roth_ira, simple_ira, roth_401k Body
application/json
The body is of type any.
⌘I
Get Deduction Template Definitions
curl --request GET \
--url https://api.zeal.com/deductionTemplateDefinitions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"success": true,
"data": {
"type": "object",
"required": [
"employee_contribution",
"additional_fields"
],
"properties": {
"required_template_fields": {
"const": [
"employee_contribution"
]
},
"custom_name": {
"type": "string"
},
"deduction_type": {
"const": "hsa"
},
"employee_contribution": {
"type": "object",
"properties": {
"contribution_type": {
"enum": [
"dollars"
]
},
"value": {
"type": "number"
},
"override_type": {
"enum": [
"overridable",
"needs_input",
"final"
]
},
"required_template_fields": {
"const": [
"value"
]
}
},
"allOf": [
{
"if": {
"properties": {
"override_type": {
"const": "final"
}
},
"required": [
"override_type"
]
},
"then": {
"required": [
"value"
]
}
},
{
"if": {
"properties": {
"override_type": {
"const": "overridable"
}
},
"required": [
"override_type"
]
},
"then": {
"required": [
"value"
]
}
}
],
"required": [
"override_type",
"contribution_type"
]
},
"employer_contribution": {
"type": "object",
"properties": {
"contribution_type": {
"enum": [
"dollars"
]
},
"value": {
"type": "number"
},
"override_type": {
"enum": [
"overridable",
"needs_input",
"final"
]
},
"required_template_fields": {
"const": [
"value"
]
}
},
"allOf": [
{
"if": {
"properties": {
"override_type": {
"const": "final"
}
},
"required": [
"override_type"
]
},
"then": {
"required": [
"value"
]
}
},
{
"if": {
"properties": {
"override_type": {
"const": "overridable"
}
},
"required": [
"override_type"
]
},
"then": {
"required": [
"value"
]
}
}
],
"required": [
"override_type",
"contribution_type"
]
},
"additional_fields": {
"type": "object",
"properties": {
"hsa_type": {
"enum": [
"family",
"individual"
]
}
},
"required": [
"hsa_type"
]
}
}
}
}
'import requests
url = "https://api.zeal.com/deductionTemplateDefinitions"
payload = {
"success": True,
"data": {
"type": "object",
"required": ["employee_contribution", "additional_fields"],
"properties": {
"required_template_fields": { "const": ["employee_contribution"] },
"custom_name": { "type": "string" },
"deduction_type": { "const": "hsa" },
"employee_contribution": {
"type": "object",
"properties": {
"contribution_type": { "enum": ["dollars"] },
"value": { "type": "number" },
"override_type": { "enum": ["overridable", "needs_input", "final"] },
"required_template_fields": { "const": ["value"] }
},
"allOf": [
{
"if": {
"properties": { "override_type": { "const": "final" } },
"required": ["override_type"]
},
"then": { "required": ["value"] }
},
{
"if": {
"properties": { "override_type": { "const": "overridable" } },
"required": ["override_type"]
},
"then": { "required": ["value"] }
}
],
"required": ["override_type", "contribution_type"]
},
"employer_contribution": {
"type": "object",
"properties": {
"contribution_type": { "enum": ["dollars"] },
"value": { "type": "number" },
"override_type": { "enum": ["overridable", "needs_input", "final"] },
"required_template_fields": { "const": ["value"] }
},
"allOf": [
{
"if": {
"properties": { "override_type": { "const": "final" } },
"required": ["override_type"]
},
"then": { "required": ["value"] }
},
{
"if": {
"properties": { "override_type": { "const": "overridable" } },
"required": ["override_type"]
},
"then": { "required": ["value"] }
}
],
"required": ["override_type", "contribution_type"]
},
"additional_fields": {
"type": "object",
"properties": { "hsa_type": { "enum": ["family", "individual"] } },
"required": ["hsa_type"]
}
}
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
success: true,
data: {
type: 'object',
required: ['employee_contribution', 'additional_fields'],
properties: {
required_template_fields: {const: ['employee_contribution']},
custom_name: {type: 'string'},
deduction_type: {const: 'hsa'},
employee_contribution: {
type: 'object',
properties: {
contribution_type: {enum: ['dollars']},
value: {type: 'number'},
override_type: {enum: ['overridable', 'needs_input', 'final']},
required_template_fields: {const: ['value']}
},
allOf: [
{
if: {properties: {override_type: {const: 'final'}}, required: ['override_type']},
then: {required: ['value']}
},
{
if: {
properties: {override_type: {const: 'overridable'}},
required: ['override_type']
},
then: {required: ['value']}
}
],
required: ['override_type', 'contribution_type']
},
employer_contribution: {
type: 'object',
properties: {
contribution_type: {enum: ['dollars']},
value: {type: 'number'},
override_type: {enum: ['overridable', 'needs_input', 'final']},
required_template_fields: {const: ['value']}
},
allOf: [
{
if: {properties: {override_type: {const: 'final'}}, required: ['override_type']},
then: {required: ['value']}
},
{
if: {
properties: {override_type: {const: 'overridable'}},
required: ['override_type']
},
then: {required: ['value']}
}
],
required: ['override_type', 'contribution_type']
},
additional_fields: {
type: 'object',
properties: {hsa_type: {enum: ['family', 'individual']}},
required: ['hsa_type']
}
}
}
})
};
fetch('https://api.zeal.com/deductionTemplateDefinitions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zeal.com/deductionTemplateDefinitions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'success' => true,
'data' => [
'type' => 'object',
'required' => [
'employee_contribution',
'additional_fields'
],
'properties' => [
'required_template_fields' => [
'const' => [
'employee_contribution'
]
],
'custom_name' => [
'type' => 'string'
],
'deduction_type' => [
'const' => 'hsa'
],
'employee_contribution' => [
'type' => 'object',
'properties' => [
'contribution_type' => [
'enum' => [
'dollars'
]
],
'value' => [
'type' => 'number'
],
'override_type' => [
'enum' => [
'overridable',
'needs_input',
'final'
]
],
'required_template_fields' => [
'const' => [
'value'
]
]
],
'allOf' => [
[
'if' => [
'properties' => [
'override_type' => [
'const' => 'final'
]
],
'required' => [
'override_type'
]
],
'then' => [
'required' => [
'value'
]
]
],
[
'if' => [
'properties' => [
'override_type' => [
'const' => 'overridable'
]
],
'required' => [
'override_type'
]
],
'then' => [
'required' => [
'value'
]
]
]
],
'required' => [
'override_type',
'contribution_type'
]
],
'employer_contribution' => [
'type' => 'object',
'properties' => [
'contribution_type' => [
'enum' => [
'dollars'
]
],
'value' => [
'type' => 'number'
],
'override_type' => [
'enum' => [
'overridable',
'needs_input',
'final'
]
],
'required_template_fields' => [
'const' => [
'value'
]
]
],
'allOf' => [
[
'if' => [
'properties' => [
'override_type' => [
'const' => 'final'
]
],
'required' => [
'override_type'
]
],
'then' => [
'required' => [
'value'
]
]
],
[
'if' => [
'properties' => [
'override_type' => [
'const' => 'overridable'
]
],
'required' => [
'override_type'
]
],
'then' => [
'required' => [
'value'
]
]
]
],
'required' => [
'override_type',
'contribution_type'
]
],
'additional_fields' => [
'type' => 'object',
'properties' => [
'hsa_type' => [
'enum' => [
'family',
'individual'
]
]
],
'required' => [
'hsa_type'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zeal.com/deductionTemplateDefinitions"
payload := strings.NewReader("{\n \"success\": true,\n \"data\": {\n \"type\": \"object\",\n \"required\": [\n \"employee_contribution\",\n \"additional_fields\"\n ],\n \"properties\": {\n \"required_template_fields\": {\n \"const\": [\n \"employee_contribution\"\n ]\n },\n \"custom_name\": {\n \"type\": \"string\"\n },\n \"deduction_type\": {\n \"const\": \"hsa\"\n },\n \"employee_contribution\": {\n \"type\": \"object\",\n \"properties\": {\n \"contribution_type\": {\n \"enum\": [\n \"dollars\"\n ]\n },\n \"value\": {\n \"type\": \"number\"\n },\n \"override_type\": {\n \"enum\": [\n \"overridable\",\n \"needs_input\",\n \"final\"\n ]\n },\n \"required_template_fields\": {\n \"const\": [\n \"value\"\n ]\n }\n },\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"final\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"overridable\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n }\n ],\n \"required\": [\n \"override_type\",\n \"contribution_type\"\n ]\n },\n \"employer_contribution\": {\n \"type\": \"object\",\n \"properties\": {\n \"contribution_type\": {\n \"enum\": [\n \"dollars\"\n ]\n },\n \"value\": {\n \"type\": \"number\"\n },\n \"override_type\": {\n \"enum\": [\n \"overridable\",\n \"needs_input\",\n \"final\"\n ]\n },\n \"required_template_fields\": {\n \"const\": [\n \"value\"\n ]\n }\n },\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"final\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"overridable\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n }\n ],\n \"required\": [\n \"override_type\",\n \"contribution_type\"\n ]\n },\n \"additional_fields\": {\n \"type\": \"object\",\n \"properties\": {\n \"hsa_type\": {\n \"enum\": [\n \"family\",\n \"individual\"\n ]\n }\n },\n \"required\": [\n \"hsa_type\"\n ]\n }\n }\n }\n}")
req, _ := http.NewRequest("GET", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.zeal.com/deductionTemplateDefinitions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"success\": true,\n \"data\": {\n \"type\": \"object\",\n \"required\": [\n \"employee_contribution\",\n \"additional_fields\"\n ],\n \"properties\": {\n \"required_template_fields\": {\n \"const\": [\n \"employee_contribution\"\n ]\n },\n \"custom_name\": {\n \"type\": \"string\"\n },\n \"deduction_type\": {\n \"const\": \"hsa\"\n },\n \"employee_contribution\": {\n \"type\": \"object\",\n \"properties\": {\n \"contribution_type\": {\n \"enum\": [\n \"dollars\"\n ]\n },\n \"value\": {\n \"type\": \"number\"\n },\n \"override_type\": {\n \"enum\": [\n \"overridable\",\n \"needs_input\",\n \"final\"\n ]\n },\n \"required_template_fields\": {\n \"const\": [\n \"value\"\n ]\n }\n },\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"final\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"overridable\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n }\n ],\n \"required\": [\n \"override_type\",\n \"contribution_type\"\n ]\n },\n \"employer_contribution\": {\n \"type\": \"object\",\n \"properties\": {\n \"contribution_type\": {\n \"enum\": [\n \"dollars\"\n ]\n },\n \"value\": {\n \"type\": \"number\"\n },\n \"override_type\": {\n \"enum\": [\n \"overridable\",\n \"needs_input\",\n \"final\"\n ]\n },\n \"required_template_fields\": {\n \"const\": [\n \"value\"\n ]\n }\n },\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"final\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"overridable\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n }\n ],\n \"required\": [\n \"override_type\",\n \"contribution_type\"\n ]\n },\n \"additional_fields\": {\n \"type\": \"object\",\n \"properties\": {\n \"hsa_type\": {\n \"enum\": [\n \"family\",\n \"individual\"\n ]\n }\n },\n \"required\": [\n \"hsa_type\"\n ]\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zeal.com/deductionTemplateDefinitions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"success\": true,\n \"data\": {\n \"type\": \"object\",\n \"required\": [\n \"employee_contribution\",\n \"additional_fields\"\n ],\n \"properties\": {\n \"required_template_fields\": {\n \"const\": [\n \"employee_contribution\"\n ]\n },\n \"custom_name\": {\n \"type\": \"string\"\n },\n \"deduction_type\": {\n \"const\": \"hsa\"\n },\n \"employee_contribution\": {\n \"type\": \"object\",\n \"properties\": {\n \"contribution_type\": {\n \"enum\": [\n \"dollars\"\n ]\n },\n \"value\": {\n \"type\": \"number\"\n },\n \"override_type\": {\n \"enum\": [\n \"overridable\",\n \"needs_input\",\n \"final\"\n ]\n },\n \"required_template_fields\": {\n \"const\": [\n \"value\"\n ]\n }\n },\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"final\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"overridable\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n }\n ],\n \"required\": [\n \"override_type\",\n \"contribution_type\"\n ]\n },\n \"employer_contribution\": {\n \"type\": \"object\",\n \"properties\": {\n \"contribution_type\": {\n \"enum\": [\n \"dollars\"\n ]\n },\n \"value\": {\n \"type\": \"number\"\n },\n \"override_type\": {\n \"enum\": [\n \"overridable\",\n \"needs_input\",\n \"final\"\n ]\n },\n \"required_template_fields\": {\n \"const\": [\n \"value\"\n ]\n }\n },\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"final\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n },\n {\n \"if\": {\n \"properties\": {\n \"override_type\": {\n \"const\": \"overridable\"\n }\n },\n \"required\": [\n \"override_type\"\n ]\n },\n \"then\": {\n \"required\": [\n \"value\"\n ]\n }\n }\n ],\n \"required\": [\n \"override_type\",\n \"contribution_type\"\n ]\n },\n \"additional_fields\": {\n \"type\": \"object\",\n \"properties\": {\n \"hsa_type\": {\n \"enum\": [\n \"family\",\n \"individual\"\n ]\n }\n },\n \"required\": [\n \"hsa_type\"\n ]\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"type": "object",
"required": [
"employee_contribution",
"additional_fields"
],
"properties": {
"required_template_fields": {
"const": [
"employee_contribution"
]
},
"custom_name": {
"type": "string"
},
"deduction_type": {
"const": "hsa"
},
"employee_contribution": {
"type": "object",
"properties": {
"contribution_type": {
"enum": [
"dollars"
]
},
"value": {
"type": "number"
},
"override_type": {
"enum": [
"overridable",
"needs_input",
"final"
]
},
"required_template_fields": {
"const": [
"value"
]
}
},
"allOf": [
{
"if": {
"properties": {
"override_type": {
"const": "final"
}
},
"required": [
"override_type"
]
},
"then": {
"required": [
"value"
]
}
},
{
"if": {
"properties": {
"override_type": {
"const": "overridable"
}
},
"required": [
"override_type"
]
},
"then": {
"required": [
"value"
]
}
}
],
"required": [
"override_type",
"contribution_type"
]
},
"employer_contribution": {
"type": "object",
"properties": {
"contribution_type": {
"enum": [
"dollars"
]
},
"value": {
"type": "number"
},
"override_type": {
"enum": [
"overridable",
"needs_input",
"final"
]
},
"required_template_fields": {
"const": [
"value"
]
}
},
"allOf": [
{
"if": {
"properties": {
"override_type": {
"const": "final"
}
},
"required": [
"override_type"
]
},
"then": {
"required": [
"value"
]
}
},
{
"if": {
"properties": {
"override_type": {
"const": "overridable"
}
},
"required": [
"override_type"
]
},
"then": {
"required": [
"value"
]
}
}
],
"required": [
"override_type",
"contribution_type"
]
},
"additional_fields": {
"type": "object",
"properties": {
"hsa_type": {
"enum": [
"family",
"individual"
]
}
},
"required": [
"hsa_type"
]
}
}
}
}{
"success": false,
"errors": [
{
"message": "Unsupported deduction type",
"code": 13
}
]
}