Skip to main content

Sales-Rep

Get sales-rep customers​

This endpoint allows you to get all customers referenced via lngP48SalesRepID on the logged-in user.

URL : /sales-rep/customers

Method :

Auth required : YES

Permissions required : No

Query parameters

None

Success Response​

Condition : If sales-rep customers are found.

Code : 200 OK

Content example

[
{
"lngCustomerID": 123456,
"sCompany1": "TestCompany",
"sStreet": "Teststreet 12",
"sZip": "1234",
"sCity": "TestCity",
"sMatchCode": "TESTMATCHCODE",
"sBlock": "Normal",
"shtBlock": 0
},
{}
]

Start sales-rep mode​

This endpoint allows sales-reps to start sales-reps mode. In this mode the authorized user will be replaced with a generated user for the requested customer.

URL : /sales-rep/:id

Method :

Auth required : Yes

Success Response​

Condition : If sales-rep mode has been started.

Code : 200 OK

Content example

{
"bActive": true,
"dtLastLogin": null,
"dtRegistration": 1643026976000,
"gActiveBookmarkListID": null,
"lngActiveCartID": null,
"lngContactID": 1133,
"lngCustomerID": 123456,
"lngP48SalesRepID": null,
"oP48SalesRepForUser": {
"bActive": true,
"dtLastLogin": null,
"dtRegistration": 1642081676000,
"gActiveBookmarkListID": null,
"lngActiveCartID": null,
"lngContactID": 1122,
"lngCustomerID": 111111,
"lngP48SalesRepID": 1000,
"oP48SalesRepForUser": null,
"sEmail": "",
"sFirstName": "TestFirstName",
"sFormOfAdress": "Herr",
"sLanguageIsoCode": "de",
"sLastName": "TestLastName",
"sMobilePhone": "",
"sP48SalesRepForUser": "",
"sPhone": "",
"sUserName": "test@test.com",
"shtLanguageID": 1,
"shtP48AGB": 0,
"shtRoleID": null,
"shtStockLevel": 7
},
"sEmail": "",
"sFirstName": "TestFirstName",
"sFormOfAdress": "Herr",
"sLanguageIsoCode": "de",
"sLastName": "TestLastName",
"sMobilePhone": "",
"sP48SalesRepForUser": "test@test.com",
"sPhone": "",
"sUserName": "vertreterlogin_a4f0db86bd9e412baf8a5815dd51e1c0",
"shtLanguageID": 1,
"shtP48AGB": 0,
"shtRoleID": null,
"shtStockLevel": 7
}

Error Response​

Condition : If sales-rep is not allowed to start sales-rep mode for requested customer.

Code : 400 BAD REQUEST

Content example

{
"text": "Vertreter 1000 ist nicht berechtigt fΓΌr Kunde 99999999"
}

Reset User​

This endpoint allows you to stop sales-rep mode and reset the user.

URL : /sales-rep/reset

Method :

Auth required : Yes

Success Response​

Condition : If sales-rep mode has been stopped.

Code : 200 OK

Content example

{
"bActive": true,
"dtLastLogin": null,
"dtRegistration": 1642081676000,
"gActiveBookmarkListID": "e8769405-1385-44c4-8fc1-2a0d46a4ad83",
"lngActiveCartID": null,
"lngContactID": 1122,
"lngCustomerID": 111111,
"lngP48SalesRepID": 1000,
"oP48SalesRepForUser": null,
"sEmail": "",
"sFirstName": "TestFirstName",
"sFormOfAdress": "Herr",
"sLanguageIsoCode": "de",
"sLastName": "TestLastName",
"sMobilePhone": "",
"sP48SalesRepForUser": "",
"sPhone": "",
"sUserName": "test@test.com",
"shtLanguageID": 1,
"shtP48AGB": 0,
"shtRoleID": null,
"shtStockLevel": 7
}

Error Response​

Condition : If sales-rep mode is not started.

Code : 400 BAD REQUEST

Content example

{
"text": "kein Vertreter-Benutzer: test@test.com"
}