API: My-Reports

Sharer-Report list

JWT Authorisation

GET /api/v3/my-reports

Request parameter:

No Request parameter

Response data:

Metadata: object.

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

Data:  object.data[array]

ParameterTypeDescription
idintReport id
datestring(date)Report date
amountstring(float)Report db amount (it it calculation base)



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}

/wiki/spaces/BROK/pages/693181 #Authentication defaults 

Request
curl -X GET https://public.brokerstar.biz/api/v3/my-reports --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg'


Response (Success)
200 OK  
{
    "count": "2",
    "data": [
        {
            "id": 2,
            "date": "2022-07-25T00:00:00+02:00",
            "amount": "246.95"
        },
        {
            "id": 17,
            "date": "2022-08-26T00:00:00+02:00",
            "amount": "321.00"
        }
    ],
    "status": 200
}
Response (Error)
403 Forbidden 
{
    "error": "This endpoint is accessible only for sharers",
    "code": 403
}

Or one of 

Single Sharer-Report

JWT Authorisation

GET /api/v3/my-reports/{id}

Request parameter:

ParameterTypeInDescription
idinturlid of requested report


Response data:

Metadata: object.

ParameterTypeDescription
statusintResponse status (same as in http code)

Data:  object.data[array]

ParameterTypeDescription
idintReport id
datestring(date)Report date
contactarrayReport contact (sharer) API: Contact
contact[id]idSharer  id
contact[name]stringSharer name
contact[name_1]stringSharer first name or company name
contact[name_2]string|nullSharer last name or company addiction
amountstring(float)|nullReport db amount (it it calculation base)
retentionstring(float)|nullRetention amount
expensesstring(float)|nullExpenses amount
deduction_namestring|nullDeduction name
deductionstring(float)|nullDeduction amount
deduction_ahvstring(float)|nullDeduction AHV amount
deduction_uvgstring(float)|nullDeduction UVG amount
deduction_alustring(float)|nullDeduction ALU amount



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/my-reports/1 --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg'
Response (Success)
200 OK   
{
    "data": {
        "date": "2022-07-25T00:00:00+02:00",
        "contact": {
            "name": "attentis (Vermittler) Attentis Digital AG",
            "name_1": "attentis (Vermittler)",
            "name_2": "Attentis Digital AG",
            "id": 17035
        },
        "amount": "246.95",
        "retention": "0.00",
        "expenses": null,
        "deduction_name": null,
        "deduction": null,
        "deduction_ahv": "5.30",
        "deduction_uvg": null,
        "deduction_alu": "1.10",
        "id": 2
    },
    "status": 200
}
Response (Error)
403 Forbidden 
{
    "error": "This endpoint is accessible only for sharers",
    "code": 403
}
Response (Error)
404 Not found
{
	"error": "Entity not found",
	"code": 404
}

Or one of 

Download Sharer-Report

JWT Authorisation

ET /api/v3/my-reports/{id}/download

Request parameter:

ParameterTypeInDescription
idinturlid of requested contact
options[logo]int(0|1)queryDownload along with logo paper (if exists) - default 0


Response data:

BINARY FILE RESPONSE


Request
curl -X GET https://public.brokerstar.biz/api/v3/my-reports/1/download --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg'
Request
curl -X GET https://public.brokerstar.biz/api/v3/my-reports/1/download?options[logo]=1 --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg'
Response (Error)
404 Entity not found 
Response (Error)
500 Unable to generate payout