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 policy | Express policy | |
|---|---|---|
policy.type | st (or omitted) | ex - mandatory |
| Who creates it | Distributor / online partner | Vet clinic (practice-management software) |
| Product and price | Chosen by the customer: send productcode and price | Set by PetExpert: do not send productcode or price |
| Clinic login | Optional | Recommended (userName / password), links the policy to the clinic |
| How it becomes active | Customer pays via paylink | Customer activates the policy: <EXPRESS_ACTIVATION_PROCESS> |
GetPolicyStatus before activation | 0 (waiting for payment) | 99 (other state) |
GetPolicyStatus after activation | 1 (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
| Always | Fields |
|---|---|
| Software identity | appid, appVersion, lang (plus affilName when agreed) |
AddNewPolicy objects | policy, animal, customer |
animal | name, type (d/c), chipnr, dob; send breed (or breedid) for quoting and creation |
customer | email, 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
- Breeds. Call
GetBreedsand let the customer pick a breed. Keep itsidand check the animal's age againstagelimit. - Quote. Call
GetProductswithanimaltype(d/c),breedidandage. Show each product with itsprice(monthly) andpriceAnnual, and the cover limits inrisk. - Optional vet. Call
GetVetsif the customer can choose a partner vet; send itsidaspolicy.providerid. - Create. Call
AddNewPolicywith the chosenproductcode,price, yourreferralcode, the animal and the customer. - Pay. Show the policy documents (
applinkonline,apppdfas PDF) and send the customer topaylink. The policy activates automatically once paid. - Check.
GetPolicyStatusreturns0until payment, then1.
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.
- Collect the data. Animal name, type, sex, microchip number and date of birth; customer name, e-mail, phone, address and date of birth.
- Create. Call
AddNewPolicywithpolicy.typeset to"ex"and the clinic'suserName/password. - Store the policy number. Save
pnoon the animal record; you need it for claims (GetActivePolicy,AddNewClaim). - Give the customer the documents. Show or print
applink/apppdf. - Activation. The customer activates the policy: <EXPRESS_ACTIVATION_PROCESS>.
GetPolicyStatusreturns99until then, and1once 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
| Field | Rule |
|---|---|
animal.type | d dog, c cat (Pes, Kočka, Mačka also accepted) |
animal.sex | Code or label, see Code lists |
animal.dob, customer.dob | d.m.yyyy or yyyy-MM-dd |
animal.breed | id from GetBreeds, breed GUID or exact name. Optional for express. |
customer.email | An existing active customer with the same e-mail is reused. |
| Timeout | Synchronous; usually under 15 seconds. Set your client timeout to 60 seconds. |
| Duplicates | Not detected. Do not resubmit after a timeout without checking with PetExpert. |
