GuidesReference Endpoints
Guides

Putting It All Together (Opt-In)

Now that you have all the components required to submit a successful order, let's put it all together.

Full Request Body:

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  "order_number": "order-number-in-my-system-01",
  "currency": "USD",
  "event": {
    "name": "Awesome Event",
    "start_date": "2027-12-24",
    "start_time": "12:00",
    "end_date": "2027-12-25",
    "end_time": "16:30",
    "location": "Test Location"
  },
  "customer": {
    "first_name": "John",
    "last_name": "Doe",
    "email": "[email protected]",
    "phone": "5555555555"
  },
  "billing_address": {
    "address1": "123 Main St",
    "address2": "Ste 1",
    "city": "Phoenix",
    "zip_code": "85020",
    "state": "AZ",
    "country": "US"
  },
  "items": [
    {
      "name": "Item 1",
      "reference_number": "test-item-1",
      "cost": "50",
      "event": {
        "name": "Awesome Event",
        "start_date": "2027-12-24",
        "start_time": "12:00",
        "end_date": "2027-12-25",
        "end_time": "16:30",
        "location": "Test Location"
      }
    },
    {
      "name": "Item 2",
      "reference_number": "test-item-2",
      "cost": "100",
      "event": {
        "name": "Another Awesome Event",
        "start_date": "2027-01-01",
        "start_time": "12:00",
        "end_date": "2027-01-01",
        "end_time": "13:00",
        "location": "Secret Location"
      }
    }
  ],
  "payment": {
    "type": "invoice"
  }
}

Request Example:

Here is a full example of a request using cURL.

📘

Authenticating This Request

To properly make this API call, the request needs to be authorized by generating a JWT Token sourced from the Authentication API Call using the relevant Client's Public and Secret Key.

curl -X POST \
  https://api.sandbox.helloteak.com/api/v2/orders \
  -H 'Accept: application/json' \
  -H 'Authorization: JWT xxx.yyy.zzz' \
  -H 'Content-Type: application/json' \
  -d '{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  "order_number": "order-number-in-my-system-01",
  "currency": "USD",
  "event": {
    "name": "Awesome Event",
    "start_date": "2027-12-24",
    "start_time": "12:00",
    "end_date": "2027-12-25",
    "end_time": "16:30",
    "location": "Test Location"
  },
  "customer": {
    "first_name": "John",
    "last_name": "Doe",
    "email": "[email protected]",
    "phone": "5555555555"
  },
  "billing_address": {
    "address1": "123 Main St",
    "address2": "Ste 1",
    "city": "Phoenix",
    "zip_code": "85020",
    "state": "AZ",
    "country": "US"
  },
  "items": [
    {
      "name": "Item 1",
      "reference_number": "test-item-1",
      "cost": "50",
      "event": {
        "name": "Awesome Event",
        "start_date": "2027-12-24",
        "start_time": "12:00",
        "end_date": "2027-12-25",
        "end_time": "16:30",
        "location": "Test Location"
      }
    },
    {
      "name": "Item 2",
      "reference_number": "test-item-2",
      "cost": "100",
      "event": {
        "name": "Another Awesome Event",
        "start_date": "2027-01-01",
        "start_time": "12:00",
        "end_date": "2027-01-01",
        "end_time": "13:00",
        "location": "Secret Location"
      }
    }
  ],
  "payment": {
    "type": "invoice"
  }
}'

Response Code:

CodeDescription
201 CreatedOrder successfully created and policy issued

Response Example:

{
  "created": "2024-01-01T18:11:47.062503Z",
  "updated": "2024-01-01T18:11:47.109237Z",
  "order_number": "order-number-in-my-system-01",
  "subtotal": "250",
  "currency": "USD",
  "protecht_order_id": "6523a96a-23c2-4b61-8552-228966f4651d",
  "items": [
    {
      "id": "itm_3M4eN3fv",
      "name": "Item 1",
      "reference_number": "99accd73-4f6a-4d81-9b0c-68d38e3d0e04",
      "cost": "420.00",
      "customer": {
        "id": "cus_1uUixeBO",
        "email": "[email protected]",
        "first_name": "lance",
        "last_name": "local"
      },
      "event": {
        "id": "evnt_7eFvtQNh",
        "name": "Event 1",
        "start_date": "2022-04-30",
        "start_time": "00:00:00",
        "end_date": null,
        "end_time": null,
        "location": "Test Location"
      },
      "event_id": "evnt_7eFvtQNh"
    },
    {
      "id": "itm_3M4eN3fv",
      "name": "Item 1",
      "reference_number": "99accd73-4f6a-4d81-9b0c-68d38e3d0e04",
      "cost": "420.00",
      "customer": {
        "id": "cus_1uUixeBO",
        "email": "[email protected]",
        "first_name": "lance",
        "last_name": "local"
      },
      "event": {
        "id": "evnt_7eFvtQNh",
        "name": "Event 1",
        "start_date": "2022-04-30",
        "start_time": "00:00:00",
        "end_date": null,
        "end_time": null,
        "location": "Test Location"
      },
      "event_id": "evnt_7eFvtQNh"
    }
  ],
  "customer": {
    "id": "cus_1uUixeBO",
    "email": "[email protected]",
    "first_name": "lance",
    "last_name": "local"
  },
  "client": "cl_HX5tUe9m",
  "policies": [
    {
      "policy_number": "TGFS-EQTWFUXTMV",
      "policy_number_new": "54474653-0000-0000-0359-5e3c27422423",
      "currency": "USD",
      "premium": "6.90",
      "coverage_amount": "6.90",
      "item": {
        "id": "itm_3M4eN3fv",
        "name": "Test Ite 2",
        "reference_number": "99accd73-4f6a-4d81-9b0c-68d38e3d0e04",
        "cost": "420.00"
      }
    }
  ]
}

Todo

  • Add complete order request body
  • Send a successful order request