API Structure Last updated: 09.09.2023

Create new user - PUT /partner-api/users

Fields:

  • email - required
  • name - required
  • password - required
  • locale - optional

Request:

 {
    "email" => "[email protected]",
    "name" => "test+123",
    "password" => "test123",
    "locale" => "pl"
 }

Response:

{
    "status": "success",
    "user": {
        "id": 2,
        "email": "[email protected]",
        "name": "test+123",
        "phone_number": null,
        "description": "test+123 ([email protected])",
        "managed_companies": [],
        "companies": [],
        "public_key": "66sbo0z98b8vwf0zhky0qtk14iebai8m",
        "private_key": "nc14w9tnoxl161t6hlhegzfyf8jqudez",
        "locale": "pl"
    }
}


Generate OTP login link - POST /partner-api/login-email

Fields:

  • email - required

Request:

 {
    "email" => "[email protected]"
 }

Response:

{
  "status": "success",
  "hash": "bcsou65mae0scgetb6prsjy7zy8yqe76j3w7u5ht4tadv94a01ft5qbvhj2oqyqs",
  "url": "https://cloud.trc.to/login-otp/bcsou65mae0scgetb6prsjy7zy8yqe76j3w7u5ht4tadv94a01ft5qbvhj2oqyqs"
}


Update user back button - PUT /partner-api/users/{id}/back-btn

Request:

 {
    "backBtnTop": true,
    "backBtnFooter": true,
    "backBtn": "https://example.com",
    "backBtnTxt": "Optional text"
}

Response:

{
    "status": "success",
    "user": {
        "id": 2,
        "email": "[email protected]",
        "name": "test+123",
        "phone_number": null,
        "description": "test+123 ([email protected])",
        "managed_companies": [],
        "companies": [],
        "public_key": "66sbo0z98b8vwf0zhky0qtk14iebai8m",
        "private_key": "nc14w9tnoxl161t6hlhegzfyf8jqudez",
        "logo": null,
        "backBtnTop": true,
        "backBtnFooter": true,
        "backBtn": "https://example.com",
        "backBtnTxt": "Optional text"
    }
}


Upload logo - POST /partner-api/users/{id}/logo-upload

Request:

 Upload file as post field “logo” value

Response:

{
    "status": "success",
    "data": {
        "file": "/logo/hut2dlibs84jtgq3f523j9yd41p2tjfy.png"
    }
}


Update user logo - PUT /partner-api/users/{id}/logo

Request:

 {
    "logoWhite" => "/logo/fp2ndye5lyd2jondhq9na4e2q0miib8j.png",
    "logoBlack" => "/logo/fp2ndye5lyd2jondhq9na4e2q0miib8j.png",
 }

Response:

{
    "status": "success",
    "user": {
        "id": 2,
        "email": "[email protected]",
        "name": "test+123",
        "phone_number": null,
        "description": "test+123 ([email protected])",
        "managed_companies": [],
        "companies": [],
        "public_key": "66sbo0z98b8vwf0zhky0qtk14iebai8m",
        "private_key": "nc14w9tnoxl161t6hlhegzfyf8jqudez",
        "logoWhite": "/logo/fp2ndye5lyd2jondhq9na4e2q0miib8j.png",
        "logoBlack": "/logo/fp2ndye5lyd2jondhq9na4e2q0miib8j.png",
        "backBtnTop": true,
        "backBtnFooter": true,
        "backBtn": "https://example.com",
        "backBtnTxt": "Optional text"
    }
}

Change user limit - PUT /partner-api/users/{id}/limit

Request:

 {
    "userLimit": 10,
    "placeLimit": 100
 }

Response:

{
    "status": "success",
    "user": {
        "id": 2,
        "email": "[email protected]",
        "name": "test+123",
        "phone_number": null,
        "description": "test+123 ([email protected])",
        "managed_companies": [],
        "companies": [],
        "public_key": "66sbo0z98b8vwf0zhky0qtk14iebai8m",
        "private_key": "nc14w9tnoxl161t6hlhegzfyf8jqudez",
        "logoWhite": "/logo/fp2ndye5lyd2jondhq9na4e2q0miib8j.png",
        "logoBlack": "/logo/fp2ndye5lyd2jondhq9na4e2q0miib8j.png",
        "backBtnTop": true,
        "backBtnFooter": true,
        "backBtn": "https://example.com",
        "backBtnTxt": "Optional text",
        "userLimit": 10,
        "placeLimit": 100
    }
}

Change billing tab status - PUT /partner-api/users/{id}/billing-tab

User.showBilling:
1 - Inherit from global value
2 - On
3 - Off

Request:

 {
    "showBilling": 1,
 }

Response:

{
    "status": "success",
    "user": {
        "id": 2,
        "email": "[email protected]",
        "name": "test+123",
        "phone_number": null,
        "description": "test+123 ([email protected])",
        "managed_companies": [],
        "companies": [],
        "public_key": "66sbo0z98b8vwf0zhky0qtk14iebai8m",
        "private_key": "nc14w9tnoxl161t6hlhegzfyf8jqudez",
        "logoWhite": "/logo/fp2ndye5lyd2jondhq9na4e2q0miib8j.png",
        "logoBlack": "/logo/fp2ndye5lyd2jondhq9na4e2q0miib8j.png",
        "backBtnTop": true,
        "backBtnFooter": true,
        "backBtn": "https://example.com",
        "backBtnTxt": "Optional text",
        "userLimit": 10,
        "placeLimit": 100,
        "showBilling": 1
    }
}

Dictionary - Currencies - GET /partner-api/dictionary/currency

Response:

{
    "status": "success",
    "data": {
        "USD": "United States dollar",
        "PLN": "Polish zloty",
        "EUR": "Euro"
    }
}

Add company - POST /partner-api/users/{id}/company

Request:

{
    "name": "Name",
    "subdomain": "subdomain",
    "currency": "USD"
}

Response:

{
    "status": "success",
    "company": {
        "id": 8,
        "subdomain": "subdomain",
        "name": "Name",
        "currency": "USD",
        "currency_sign": "$",
        "currency_sign_position": 0,
        "delivery_with_signature": false
    }
}

Invite driver - POST /partner-api/users/{id}/driver/add

Request:

{
    "name": "Testa",
    "email": "[email protected]"
}

Response:

{
    "status": "success",
    "member": {
        "id": 3,
        "name": "test",
        "email": "[email protected]"
    }
}

Remove driver - DELETE /partner-api/users/{id}/driver/{mid}/remove

Response:

{
    "status": "success"
}

Invite member - POST /partner-api/users/{id}/member/add

Request:

{
    "name": "Testa",
    "email": "[email protected]"
}

Response:

{
    "status": "success",
    "member": {
        "id": 3,
        "name": "test",
        "email": "[email protected]"
    }
}

Remove member - DELETE /partner-api/users/{id}/member/{mid}/remove

Response:

{
    "status": "success"
}

Change company logo - PUT /partner-api/company/{id}/logo

Request:

{
    "logo": "https://ui-avatars.com/api/?background=random&bold=true&name=Moja+platforma"
}

Response:

{
    "status": "success",
    "company": {
        "id": 11,
        "subdomain": "test123abaaaz1z",
        "name": "Testa",
        "currency": "PLN",
        "currency_sign": "zł",
        "currency_sign_position": 1,
        "delivery_with_signature": false,
        "logo": "images/logo/gbf4v1mryw251obzwsh0dh02xdlnncpi.png"
    }
}