API: Policy

Policy list

JWT Authorisation

GET /api/v3/policy

Extra fields:

ParameterTypeINExampleDescription
policy_documentintegerQUERYadd[policy_document]=trueAllow displaying policy_document field

Filtering parameters:

ParameterTypeINExampleDescription
branchintegerQUERYfilters[branch]=34Filtering by branch id = value
insuranceintegerQUERYfilters[insurance]=123Filtering by policy insurance contact id = value
contactintegerQUERYfilters[contact]=123Filtering by policy (policy holder) contact id = value
archivedbooleanQUERYfilters[archived]=trueInclude archived polices in response (default = false)
include_archived_carsbooleanQUERYfilters[include_archived_cars]=truetrue|false - if true and policy contains cars - list will include archived cars

API: _ Default behavior #List defaults


Response data:

Metadata: object.

ParameterTypeDescription
countintNumber of all results matching criteria 
statusintResponse status (same as in http code)

Data:  object.data[array]

ParameterTypeDescription
idintegerPolicy id
nrstring|nullPolicy nr
nr_registerstring|nullPolicy nr registration
start_datestringPolicy start date
end_datestringPolicy end date
archive_datestring|nullPolicy archive date (if archived)
contactarrayPolicy API: Contact data
contact[id]integer|nullContact id
contact[name]string|nullContact name
contact[name_1]string|nullContact first name
contact[name_2]string|nullContact last name
insurancearrayAPI: Contact insurance data
insurance[id]integer|nullInsurance id
insurance[name]string|nullInsurance name
brancharrayAPI: Branch
branch[id]integer|nullBranch id
branch[name]string|nullBranch name in DE language
branch[name_e]string|nullBranch name in EN language
branch[name_i]string|nullBranch name in IT language
branch[name_f]string|nullBranch name in FR language
branch[short_name]string|nullBranch short-name in DE language
branch[short_name_e]string|nullBranch short-name in EN language
branch[short_name_i]string|nullBranch short-name in IT language
branch[short_name_f]string|nullBranch short-name in FR language
statusarrayPolicy status
status[id]integer|nullStatus id
status[name]string|nullStatus name in DE language
status[name_e]string|nullStatus name in EN language
status[name_i]string|nullStatus name in IT language
status[name_f]string|nullStatus name in FR language

Response (Error):

ParameterTypeDescription
codeintegerAn error code
errorstringA message containing some information about the error 
errorsarrayList of errors devided by field in associative array {field_name:error message}

API: _ Default behavior #Authentication defaults 

Request
curl -X GET https://public.brokerstar.biz/api/v3/policy?add[policy_document]=true --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg'


Response (Success)
200 OK  
{
    "count": "14",
    "data": [
        {
            "nr": "75.868.240",
            "nr_register": null,
            "start_date": "2017-05-09T00:00:00+02:00",
            "end_date": "2022-12-31T00:00:00+01:00",
            "archive_date": null,
            "contact": {
                "name": "User Simple",
				"name_1": "User",
                "name_2": "Simple",
                 "id": 9427
            },
            "insurance": {
                "name": "Zurich, Generalagentur Micha Rentsch AG ",
                "id": 230
            },
            "branch": {
                "name_e": "Motor vehicle",
                "name_f": "Véhicule automobile",
                "name_i": "Veicolo a motore",
                "short_name": "MF",
                "short_name_e": "MF",
                "short_name_f": "MF",
                "short_name_i": "MF",
                "id": 34,
                "name": "Motorfahrzeug"
            },
            "status": {
                "name_e": "repealed",
                "name_f": "révoqué",
                "name_i": "sospeso",
                "id": 3,
                "name": "aufgehoben"
            },
            "id": 20285,
			#this field requires requesting it (extra data section)
			"policy_document": {
                "id": 7696,
                "name": "file.pdf",
                "size": 8973,
                "created_at": "2022-12-12 19:38:28 "
            }         
		},
		[...]
    ],
    "status": 200
}

Or one of 

Single Policy

JWT Authorisation

GET /api/v3/policy/{id}

Request parameter:

ParameterTypeInDescription
idinturlid of requested policy

Response data:

Metadata: object.

ParameterTypeDescription
statusintResponse status (same as in http code)

Data:  object.data

ParameterTypeDescription
All columns from single policy +
payment_typearrayPolicy payment type
payment_type[id]integer|nullPayment type id
payment_type[name]string|nullPayment type name in DE language
payment_type[name_e]string|nullPayment type name in EN language
payment_type[name_i]string|nullPayment type name in IT language
payment_type[name_f]string|nullPayment type name in FR language
sub_contactarrayAPI: Contact
sub_contact[id]integer|nullSub-Contact id
sub_contact[name]string|nullSub-Contact name
sub_contact[name_1]string|nullSub-Contact first name
sub_contact[name_2]string|nullSub-Contact last name
Extra fields (additional parameter required)
policy_documentarrayLatest policy document
policy_document[id]int|nullid of API: File
policy_document[name]string|nullname of file
policy_document[size]int|nullsize in bytes
policy_document[created_at]string(date)|nullcreation date

Response (Error):

ParameterTypeDescription
codeintegerAn error code
errorstringA message containing some information about the error 
errorsarrayList of errors devided by field in associative array {field_name:error message}
Request
curl -X GET https://public.brokerstar.biz/api/v3/policy/16448 --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg'


Response (Success)
200 OK 
{
    "data": {
        "nr": "2/496375/V4",
        "nr_register": null,
        "start_date": "2022-07-01T00:00:00+02:00",
        "end_date": "2025-12-31T00:00:00+01:00",
        "breakup_date": "1970-01-01T00:00:00+01:00",
        "cancellation_date": null,
        "archive_date": null,
        "contact": {
            "name": "7 Alps Bio GmbH ",
			"name_1": "7 Alps Bio GmbH ",
			"name_2": null,
            "id": 17556
        },
        "insurance": {
            "name": "AXA ",
            "id": 236
        },
        "branch": {
            "name_e": "BVG/LPP",
            "name_f": "LPP",
            "name_i": "LPP",
            "short_name": "BVG",
            "short_name_e": "BVG",
            "short_name_f": "BVG",
            "short_name_i": "BVG",
            "id": 7,
            "name": "BVG Pensionskasse"
        },
        "status": {
            "name_e": "in force",
            "name_f": "en vigueur",
            "name_i": "in vigore",
            "id": 1,
            "name": "in Kraft"
        },
        "payment_type": {
            "name_e": "Annually",
            "name_f": "Annuel",
            "name_i": "Annuale",
            "id": 1,
            "name": "Jährlich"
        },
        "sub_contact": {
            "name": null,
			"name_1": null,
			"name_2": null,
            "id": null
        },
        "id": 37140,

 		"policy_document": {
                "id": 7696,
                "name": "file.pdf",
                "size": 8973,
                "created_at": "2022-12-12 19:38:28 "
            }               
		},
    "status": 200
}
Response (Error)
404 Not found
{
	"error": "Entity not found",
	"code": 404
}
Response (Error)
403 Forbidden
{
	"error": "You have no access to contact id:123",
	"code": 403
}

Or one of