Skip to content

Latest commit

 

History

History
502 lines (361 loc) · 16.2 KB

CustomerApi.md

File metadata and controls

502 lines (361 loc) · 16.2 KB

Swagger\Client\CustomerApi

All URIs are relative to /

Method HTTP request Description
deleteDeleteCustomer DELETE /api/customers/{id} Delete an existing customer
deleteDeleteCustomerRate DELETE /api/customers/{id}/rates/{rateId} Deletes one rate for a customer
getGetCustomer GET /api/customers/{id} Returns one customer
getGetCustomerRates GET /api/customers/{id}/rates Returns a collection of all rates for one customer
getGetCustomers GET /api/customers Returns a collection of customers (which are visible to the user)
patchAppApiCustomerMeta PATCH /api/customers/{id}/meta Sets the value of a meta-field for an existing customer
patchPatchCustomer PATCH /api/customers/{id} Update an existing customer
postPostCustomer POST /api/customers Creates a new customer
postPostCustomerRate POST /api/customers/{id}/rates Adds a new rate to a customer

deleteDeleteCustomer

deleteDeleteCustomer($id)

Delete an existing customer

[DANGER] This will also delete ALL linked projects, project activities and timesheets. Maybe use PATCH instead and mark it as inactive with visible=false?

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Swagger\Client\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Swagger\Client\Api\CustomerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "id_example"; // string | Customer ID to delete

try {
    $apiInstance->deleteDeleteCustomer($id);
} catch (Exception $e) {
    echo 'Exception when calling CustomerApi->deleteDeleteCustomer: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id string Customer ID to delete

Return type

void (empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteDeleteCustomerRate

deleteDeleteCustomerRate($id, $rate_id)

Deletes one rate for a customer

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Swagger\Client\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Swagger\Client\Api\CustomerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "id_example"; // string | The customer whose rate will be removed
$rate_id = "rate_id_example"; // string | The rate to remove

try {
    $apiInstance->deleteDeleteCustomerRate($id, $rate_id);
} catch (Exception $e) {
    echo 'Exception when calling CustomerApi->deleteDeleteCustomerRate: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id string The customer whose rate will be removed
rate_id string The rate to remove

Return type

void (empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getGetCustomer

\Swagger\Client\Model\CustomerEntity getGetCustomer($id)

Returns one customer

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Swagger\Client\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Swagger\Client\Api\CustomerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "id_example"; // string | 

try {
    $result = $apiInstance->getGetCustomer($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerApi->getGetCustomer: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id string

Return type

\Swagger\Client\Model\CustomerEntity

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getGetCustomerRates

\Swagger\Client\Model\CustomerRate[] getGetCustomerRates($id)

Returns a collection of all rates for one customer

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Swagger\Client\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Swagger\Client\Api\CustomerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "id_example"; // string | The customer whose rates will be returned

try {
    $result = $apiInstance->getGetCustomerRates($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerApi->getGetCustomerRates: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id string The customer whose rates will be returned

Return type

\Swagger\Client\Model\CustomerRate[]

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getGetCustomers

\Swagger\Client\Model\CustomerCollection[] getGetCustomers($visible, $order, $order_by, $term)

Returns a collection of customers (which are visible to the user)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Swagger\Client\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Swagger\Client\Api\CustomerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$visible = "1"; // string | Visibility status to filter customers: 1=visible, 2=hidden, 3=both
$order = "order_example"; // string | The result order. Allowed values: ASC, DESC (default: ASC)
$order_by = "order_by_example"; // string | The field by which results will be ordered. Allowed values: id, name (default: name)
$term = "term_example"; // string | Free search term

try {
    $result = $apiInstance->getGetCustomers($visible, $order, $order_by, $term);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerApi->getGetCustomers: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
visible string Visibility status to filter customers: 1=visible, 2=hidden, 3=both [optional] [default to 1]
order string The result order. Allowed values: ASC, DESC (default: ASC) [optional]
order_by string The field by which results will be ordered. Allowed values: id, name (default: name) [optional]
term string Free search term [optional]

Return type

\Swagger\Client\Model\CustomerCollection[]

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

patchAppApiCustomerMeta

\Swagger\Client\Model\CustomerEntity patchAppApiCustomerMeta($id, $body)

Sets the value of a meta-field for an existing customer

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Swagger\Client\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Swagger\Client\Api\CustomerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "id_example"; // string | Customer record ID to set the meta-field value for
$body = new \Swagger\Client\Model\IdMetaBody3(); // \Swagger\Client\Model\IdMetaBody3 | 

try {
    $result = $apiInstance->patchAppApiCustomerMeta($id, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerApi->patchAppApiCustomerMeta: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id string Customer record ID to set the meta-field value for
body \Swagger\Client\Model\IdMetaBody3 [optional]

Return type

\Swagger\Client\Model\CustomerEntity

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

patchPatchCustomer

\Swagger\Client\Model\CustomerEntity patchPatchCustomer($body, $id)

Update an existing customer

Update an existing customer, you can pass all or just a subset of all attributes

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Swagger\Client\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Swagger\Client\Api\CustomerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$body = new \Swagger\Client\Model\CustomerEditForm(); // \Swagger\Client\Model\CustomerEditForm | 
$id = "id_example"; // string | Customer ID to update

try {
    $result = $apiInstance->patchPatchCustomer($body, $id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerApi->patchPatchCustomer: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Swagger\Client\Model\CustomerEditForm
id string Customer ID to update

Return type

\Swagger\Client\Model\CustomerEntity

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postPostCustomer

\Swagger\Client\Model\CustomerEntity postPostCustomer($body)

Creates a new customer

Creates a new customer and returns it afterwards

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Swagger\Client\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Swagger\Client\Api\CustomerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$body = new \Swagger\Client\Model\CustomerEditForm(); // \Swagger\Client\Model\CustomerEditForm | 

try {
    $result = $apiInstance->postPostCustomer($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerApi->postPostCustomer: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Swagger\Client\Model\CustomerEditForm

Return type

\Swagger\Client\Model\CustomerEntity

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postPostCustomerRate

\Swagger\Client\Model\CustomerRate postPostCustomerRate($body, $id)

Adds a new rate to a customer

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Swagger\Client\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Swagger\Client\Api\CustomerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$body = new \Swagger\Client\Model\CustomerRateForm(); // \Swagger\Client\Model\CustomerRateForm | 
$id = "id_example"; // string | The customer to add the rate for

try {
    $result = $apiInstance->postPostCustomerRate($body, $id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerApi->postPostCustomerRate: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Swagger\Client\Model\CustomerRateForm
id string The customer to add the rate for

Return type

\Swagger\Client\Model\CustomerRate

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]