Policy workflow

Creating policies with the Policy API: standard policies sold to customers, and express policies issued by vet clinics.

Both kinds of policy are created with the same method, AddNewPolicy. The policy.type field decides which kind you get.

Standard policyExpress policy
policy.typest (or omitted)ex - mandatory
Who creates itDistributor / online partnerVet clinic (practice-management software)
Product and priceChosen by the customer: send productcode and priceSet by PetExpert: do not send productcode or price
Clinic loginOptionalRecommended (userName / password), links the policy to the clinic
How it becomes activeCustomer pays via paylinkCustomer activates the policy: <EXPRESS_ACTIVATION_PROCESS>
GetPolicyStatus before activation0 (waiting for payment)99 (other state)
GetPolicyStatus after activation1 (active)1 (active)
If policy.type is missing, PetExpert creates a standard policy that waits for payment, even if you meant to issue an express policy. Always send "type": "ex" for express policies.

Required fields

AlwaysFields
Software identityappid, appVersion, lang (plus affilName when agreed)
AddNewPolicy objectspolicy, animal, customer
animalname, type (d/c), chipnr, dob; send breed (or breedid) for quoting and creation
customeremail, fname, lname, phone
Standard only (type: st)policy.productcode, policy.price (annual)
Express only (type: ex)policy.type must be ex; do not send productcode or price

Full detail: Getting started — Required fields.

Standard policy

  1. Breeds. Call GetBreeds and let the customer pick a breed. Keep its id and check the animal's age against agelimit.
  2. Quote. Call GetProducts with animaltype (d / c), breedid and age. Show each product with its price (monthly) and priceAnnual, and the cover limits in risk.
  3. Optional vet. Call GetVets if the customer can choose a partner vet; send its id as policy.providerid.
  4. Create. Call AddNewPolicy with the chosen productcode, price, your referralcode, the animal and the customer.
  5. Pay. Show the policy documents (applink online, apppdf as PDF) and send the customer to paylink. The policy activates automatically once paid.
  6. Check. GetPolicyStatus returns 0 until payment, then 1.
POST {policyBaseUrl}/AddNewPolicy
{
  "affilName": "[PARTNER]",
  "appid": "[PARTNERAPP]",
  "appVersion": "1.0.0",
  "lang": "sk",
  "policy": {
    "type": "st",
    "productcode": "SKD2009B",
    "price": 372,
    "providerid": "[VETID]",
    "referralcode": "[PARTNERCODE]"
  },
  "animal": {
    "name": "Blue",
    "type": "d",
    "sex": "Pes",
    "chipnr": "123456789012345",
    "dob": "20.6.2020",
    "breed": 101
  },
  "customer": {
    "fname": "Jan",
    "lname": "Tester",
    "email": "jan.tester@example.com",
    "phone": "+421900000000",
    "address": "Testing 123",
    "city": "Testov",
    "zip": "12345",
    "dob": "29.9.1975",
    "personalid": "7509290000"
  }
}

Express policy

An express policy is issued by a vet clinic for an animal at the clinic, typically from the practice-management software. PetExpert sets the product and the vet-cost cover, so the request only needs the animal and the customer.

  1. Collect the data. Animal name, type, sex, microchip number and date of birth; customer name, e-mail, phone, address and date of birth.
  2. Create. Call AddNewPolicy with policy.type set to "ex" and the clinic's userName / password.
  3. Store the policy number. Save pno on the animal record; you need it for claims (GetActivePolicy, AddNewClaim).
  4. Give the customer the documents. Show or print applink / apppdf.
  5. Activation. The customer activates the policy: <EXPRESS_ACTIVATION_PROCESS>. GetPolicyStatus returns 99 until then, and 1 once active.
POST {policyBaseUrl}/AddNewPolicy
{
  "affilName": "[PARTNER]",
  "appid": "[PARTNERAPP]",
  "appVersion": "1.0.0",
  "lang": "en",
  "userName": "<CLINIC_LOGIN>",
  "password": "<CLINIC_PASSWORD>",
  "policy": {
    "type": "ex"
  },
  "animal": {
    "name": "Rex",
    "type": "d",
    "sex": "Pes",
    "chipnr": "967000009876543",
    "dob": "14.3.2023"
  },
  "customer": {
    "fname": "John",
    "lname": "Tester",
    "email": "john.tester@example.com",
    "phone": "+32470000001",
    "address": "Sample Street 123",
    "city": "Brussels",
    "zip": "1000",
    "dob": "2.8.1988"
  }
}

Response:

{
  "result": "OK",
  "resulttext": "Standard insurance 3417251021 created successfully.",
  "pno": "3417251021",
  "paylink": "https://...",
  "applink": "https://...",
  "apppdf": "https://...",
  "formurl": "https://.../klient/prihlaseni",
  "price": null,
  "pid": "7a2b3c4d-5e6f-4a70-8b9c-0d1e2f3a4b5c",
  "aid": "8b3c4d5e-6f7a-4b81-9cad-1e2f3a4b5c6d",
  "cid": "9c4d5e6f-7a8b-4c92-adbe-2f3a4b5c6d7e",
  "trace": "3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b"
}

price is null for express policies. The resulttext wording is the same for both types; use pno, not the text.

Older integration documents call this request /AddEdoPolicy. On Policy API v2 it is /AddNewPolicy with "type": "ex".

Field rules for both types

FieldRule
animal.typed dog, c cat (Pes, Kočka, Mačka also accepted)
animal.sexCode or label, see Code lists
animal.dob, customer.dobd.m.yyyy or yyyy-MM-dd
animal.breedid from GetBreeds, breed GUID or exact name. Optional for express.
customer.emailAn existing active customer with the same e-mail is reused.
TimeoutSynchronous; usually under 15 seconds. Set your client timeout to 60 seconds.
DuplicatesNot detected. Do not resubmit after a timeout without checking with PetExpert.