|
dolibarr 24.0.0-beta
|


Public Member Functions | |
| __construct () | |
| Constructor. | |
| get ($id) | |
| Get a third party. | |
| getByEmail ($email) | |
| Get properties of a third party by email. | |
| getByBarcode ($barcode) | |
| Get a third party by barcode. | |
| index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $mode=0, $category=0, $sqlfilters='', $properties='', $pagination_data=false) | |
| List third parties. | |
| post ($request_data=null) | |
| Create a third party. | |
| put ($id, $request_data=null) | |
| Update third party. | |
| merge ($id, $idtodelete) | |
| Merge a third party into another third party. | |
| delete ($id) | |
| Delete a third party. | |
| setThirdpartyPriceLevel ($id, $priceLevel) | |
| Set a new price level for the given third party. | |
| addRepresentative ($id, $representative_id) | |
| Add a customer representative to a third party. | |
| deleteRepresentative ($id, $representative_id) | |
| Remove the link between a customer representative and a third party. | |
| getCategories ($id, $sortfield="s.rowid", $sortorder='ASC', $limit=0, $page=0) | |
| Get customer categories for a third party. | |
| addCategory ($id, $category_id) | |
| Add a customer category to a third party. | |
| deleteCategory ($id, $category_id) | |
| Remove the link between a customer category and the third party. | |
| getSupplierCategories ($id, $sortfield="s.rowid", $sortorder='ASC', $limit=0, $page=0) | |
| Get supplier categories for a third party. | |
| addSupplierCategory ($id, $category_id) | |
| Add a supplier category to a third party. | |
| deleteSupplierCategory ($id, $category_id) | |
| Remove the link between a category and the third party. | |
| getOutStandingProposals ($id, $mode='customer') | |
| Get outstanding proposals for a third party. | |
| getOutStandingOrder ($id, $mode='customer') | |
| Get outstanding orders for a third party. | |
| getOutStandingInvoices ($id, $mode='customer') | |
| Get outstanding invoices for a third party. | |
| getSalesRepresentatives ($id, $mode=0) | |
| Get representatives of a third party. | |
| getFixedAmountDiscounts ($id, $mode='customer', $filter="none", $sortfield="f.type", $sortorder='ASC') | |
| Get fixed amount discount of a third party. | |
| createFixedAmountDiscount ($id, $request_data=null) | |
| Create a fixed amount discount for a thirdparty. | |
| splitdiscount ($id, $discountid, $amount_ttc_1, $amount_ttc_2) | |
| Split a discount in 2 smaller discount. | |
| getInvoicesQualifiedForReplacement ($id) | |
| Return invoices qualified to be replaced by another invoice. | |
| getInvoicesQualifiedForCreditNote ($id) | |
| Return invoices qualified to be corrected by a credit note. | |
| getCompanyNotification ($id) | |
| Get company notifications for a third party. | |
| createCompanyNotification ($id, $request_data=null) | |
| Create a company notification for a third party. | |
| createCompanyNotificationByCode ($id, $code, $request_data=null) | |
| Create a company notification for a third party using action trigger code. | |
| deleteCompanyNotification ($id, $notification_id) | |
| Delete a company notification attached to a third party. | |
| updateCompanyNotification ($id, $notification_id, $request_data=null) | |
| Update a company notification for a third party. | |
| getCompanyBankAccount ($id) | |
| Get company bank accounts of a third party. | |
| createCompanyBankAccount ($id, $request_data=null) | |
| Create a company bank account for a third party. | |
| updateCompanyBankAccount ($id, $bankaccount_id, $request_data=null) | |
| Update a company bank account of a third party. | |
| deleteCompanyBankAccount ($id, $bankaccount_id) | |
| Delete a bank account attached to a third party. | |
| generateBankAccountDocument ($id, $companybankid=null, $model='sepamandate') | |
| Generate a document from a bank account record. | |
| getSocieteAccounts ($id, $site=null) | |
| Get a specific account attached to a third party. | |
| getSocieteByAccounts ($site, $key_account) | |
| Get a specific third party by account. | |
| createSocieteAccount ($id, $request_data=null) | |
| Create and attach a new account to an existing third party. | |
| postSocieteAccount ($id, $site, $request_data=null) | |
| Create and attach a new (or replace an existing) specific site account for a third party. | |
| putSocieteAccount ($id, $site, $request_data=null) | |
| Update specified values of a specific account attached to a third party. | |
| deleteSocieteAccount ($id, $site) | |
| Delete a specific site account attached to a third party. | |
| deleteSocieteAccounts ($id) | |
| Delete all accounts attached to a third party. | |
Public Member Functions inherited from DolibarrApi | |
| __construct ($db, $cachedir='', $refreshCache=false) | |
| Constructor. | |
Protected Member Functions | |
| _cleanObjectDatas ($object) | |
| Clean sensible object datas @phpstan-template T. | |
Protected Member Functions inherited from DolibarrApi | |
| _checkValForAPI ($field, $value, $object) | |
| Check and convert a string depending on its type/name. | |
| _checkValExtrafieldsForAPI ($field, $value, $object) | |
| Check and convert a string depending on its type/name. | |
| _filterObjectProperties ($object, $properties) | |
| Filter properties that will be returned on object. | |
| _checkFilters ($sqlfilters, &$error='') | |
| Return if a $sqlfilters parameter is valid Function no more used. | |
Private Member Functions | |
| _validate ($data) | |
| Validate fields before create or update object. | |
| _fetch ($rowid, $ref='', $ref_ext='', $barcode='', $idprof1='', $idprof2='', $idprof3='', $idprof4='', $idprof5='', $idprof6='', $email='', $ref_alias='') | |
| Fetch properties of a thirdparty object. | |
Additional Inherited Members | |
Static Protected Member Functions inherited from DolibarrApi | |
| static | _checkAccessToResource ($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid') |
| Check access by user to a given resource. | |
| static | _forge_criteria_callback ($matches) |
| Function to forge a SQL criteria from a Generic filter string. | |
Definition at line 37 of file api_thirdparties.class.php.
|
protected |
Clean sensible object datas @phpstan-template T.
| Object | $object | Object to clean |
Reimplemented from DolibarrApi.
Definition at line 2634 of file api_thirdparties.class.php.
References $object.
Referenced by _fetch(), addCategory(), addSupplierCategory(), createCompanyBankAccount(), createCompanyNotification(), createCompanyNotificationByCode(), createSocieteAccount(), deleteCategory(), deleteSupplierCategory(), index(), postSocieteAccount(), putSocieteAccount(), setThirdpartyPriceLevel(), updateCompanyBankAccount(), and updateCompanyNotification().
|
private |
Fetch properties of a thirdparty object.
Return an array with thirdparty information
| ?int | $rowid | Id of third party to load (Use 0 to get a specimen record, use null to use other search criteria) |
| string | $ref | Reference of third party, name (Warning, this can return several records) |
| string | $ref_ext | External reference of third party (Warning, this information is a free field not provided by Dolibarr) |
| string | $barcode | Barcode of third party to load |
| string | $idprof1 | Prof id 1 of third party (Warning, this can return several records) |
| string | $idprof2 | Prof id 2 of third party (Warning, this can return several records) |
| string | $idprof3 | Prof id 3 of third party (Warning, this can return several records) |
| string | $idprof4 | Prof id 4 of third party (Warning, this can return several records) |
| string | $idprof5 | Prof id 5 of third party (Warning, this can return several records) |
| string | $idprof6 | Prof id 6 of third party (Warning, this can return several records) |
| string | Email of third party (Warning, this can return several records) | |
| string | $ref_alias | Name_alias of third party (Warning, this can return several records) |
| RestException |
Definition at line 2714 of file api_thirdparties.class.php.
References DolibarrApi\_checkAccessToResource(), _cleanObjectDatas(), getDolGlobalString(), isModEnabled(), and price2num().
Referenced by get(), getByBarcode(), getByEmail(), and getSocieteByAccounts().
|
private |
Validate fields before create or update object.
| ?array<string,string> | $data Data to validate |
| RestException |
Definition at line 2676 of file api_thirdparties.class.php.
Referenced by post().
| Thirdparties::addCategory | ( | $id, | |
| $category_id ) |
Add a customer category to a third party.
| int | $id | ID of the third party |
| int | $category_id | ID of category |
@phan-return Societe @phpstan-return Societe
@url PUT {id}/categories/{category_id}
| RestException |
Definition at line 710 of file api_thirdparties.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Thirdparties::addRepresentative | ( | $id, | |
| $representative_id ) |
Add a customer representative to a third party.
| int | $id | ID of the third party |
| int | $representative_id | ID of representative |
@url POST {id}/representative/{representative_id}
| RestException | 401 Access not allowed for your login |
| RestException | 404 User or Third party not found |
Definition at line 592 of file api_thirdparties.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Thirdparties::addSupplierCategory | ( | $id, | |
| $category_id ) |
Add a supplier category to a third party.
| int | $id | ID of the third party |
| int | $category_id | ID of category |
@phan-return Societe @phpstan-return Societe
@url PUT {id}/supplier_categories/{category_id}
| RestException |
Definition at line 843 of file api_thirdparties.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Thirdparties::createCompanyBankAccount | ( | $id, | |
| $request_data = null ) |
Create a company bank account for a third party.
| int | $id | ID of the third party |
| array | $request_data | Request data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
@url POST {id}/bankaccounts
| RestException |
Definition at line 1944 of file api_thirdparties.class.php.
References $id, DolibarrApi\_checkValForAPI(), _cleanObjectDatas(), dol_now(), and sanitizeVal().
| Thirdparties::createCompanyNotification | ( | $id, | |
| $request_data = null ) |
Create a company notification for a third party.
| int | $id | ID of the third party |
| array | $request_data | Request data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
@url POST {id}/notifications
| RestException |
Definition at line 1642 of file api_thirdparties.class.php.
References $id, DolibarrApi\_checkValForAPI(), and _cleanObjectDatas().
| Thirdparties::createCompanyNotificationByCode | ( | $id, | |
| $code, | |||
| $request_data = null ) |
Create a company notification for a third party using action trigger code.
| int | $id | ID of the third party |
| string | $code | Action Trigger code |
| array | $request_data | Request data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
@url POST {id}/notificationsbycode/{code}
| RestException |
Definition at line 1705 of file api_thirdparties.class.php.
References $id, DolibarrApi\_checkValForAPI(), and _cleanObjectDatas().
| Thirdparties::createFixedAmountDiscount | ( | $id, | |
| $request_data = null ) |
Create a fixed amount discount for a thirdparty.
| int | $id | ID of thirdparty |
| array | $request_data | Request data
|
@url POST {id}/fixedamountdiscounts
| RestException | 400 Bad request |
| RestException | 401 Access not allowed for login |
| RestException | 404 Thirdparty not found |
| RestException | 500 Error creating discount |
Definition at line 1203 of file api_thirdparties.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Thirdparties::createSocieteAccount | ( | $id, | |
| $request_data = null ) |
Create and attach a new account to an existing third party.
Possible fields for request_data (request body) are specified in llx_societe_account table.
See Table llx_societe_account wiki page for more information<br>
Example body payload :
{"key_account": "cus_DAVkLSs1LYyYI", "site": "stripe"}| int | $id | ID of the third party |
| array | $request_data | Request data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
| RestException | 401 Unauthorized: User does not have permission to read thirdparties |
| RestException | 409 Conflict: An Account already exists for this company and site. |
| RestException | 422 Unprocessable Entity: You must pass the site attribute in your request data ! |
| RestException | 500 Internal Server Error: Error creating SocieteAccount account |
@url POST {id}/accounts
Definition at line 2320 of file api_thirdparties.class.php.
References $id, DolibarrApi\_checkValForAPI(), _cleanObjectDatas(), and sanitizeVal().
| Thirdparties::delete | ( | $id | ) |
Delete a third party.
| int | $id | ID of the third party |
| RestException |
Definition at line 487 of file api_thirdparties.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Thirdparties::deleteCategory | ( | $id, | |
| $category_id ) |
Remove the link between a customer category and the third party.
| int | $id | ID of the third party |
| int | $category_id | ID of category |
@url DELETE {id}/categories/{category_id}
| RestException |
Definition at line 754 of file api_thirdparties.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Thirdparties::deleteCompanyBankAccount | ( | $id, | |
| $bankaccount_id ) |
Delete a bank account attached to a third party.
| int | $id | ID of the third party |
| int | $bankaccount_id | ID of CompanyBankAccount |
@url DELETE {id}/bankaccounts/{bankaccount_id}
| RestException |
Definition at line 2057 of file api_thirdparties.class.php.
References $id.
| Thirdparties::deleteCompanyNotification | ( | $id, | |
| $notification_id ) |
Delete a company notification attached to a third party.
| int | $id | ID of the third party |
| int | $notification_id | ID of CompanyNotification |
@url DELETE {id}/notifications/{notification_id}
| RestException |
Definition at line 1775 of file api_thirdparties.class.php.
References $id.
| Thirdparties::deleteRepresentative | ( | $id, | |
| $representative_id ) |
Remove the link between a customer representative and a third party.
| int | $id | ID of the third party |
| int | $representative_id | ID of representative |
@url DELETE {id}/representative/{representative_id}
| RestException | 401 Access not allowed for your login |
| RestException | 404 User or Third party not found |
Definition at line 628 of file api_thirdparties.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Thirdparties::deleteSocieteAccount | ( | $id, | |
| $site ) |
Delete a specific site account attached to a third party.
by account id
| int | $id | ID of the third party |
| string | $site | Site key |
| RestException | 401 Unauthorized: User does not have permission to delete thirdparties accounts |
| RestException | 404 Not Found: Specified thirdparty ID does not belongs to an existing thirdparty |
| RestException | 500 Internal Server Error: Error deleting SocieteAccount entity |
@url DELETE {id}/accounts/{site}
Definition at line 2550 of file api_thirdparties.class.php.
| Thirdparties::deleteSocieteAccounts | ( | $id | ) |
Delete all accounts attached to a third party.
| int | $id | ID of the third party |
| RestException | 401 Unauthorized: User does not have permission to delete thirdparties accounts |
| RestException | 404 Not Found: Specified thirdparty ID does not belongs to an existing thirdparty |
| RestException | 500 Internal Server Error: Error deleting SocieteAccount entity |
@url DELETE {id}/accounts
We select all the records that match the socid
Definition at line 2587 of file api_thirdparties.class.php.
References $id.
| Thirdparties::deleteSupplierCategory | ( | $id, | |
| $category_id ) |
Remove the link between a category and the third party.
| int | $id | ID of the third party |
| int | $category_id | ID of category |
@url DELETE {id}/supplier_categories/{category_id}
| RestException |
Definition at line 887 of file api_thirdparties.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Thirdparties::generateBankAccountDocument | ( | $id, | |
| $companybankid = null, | |||
| $model = 'sepamandate' ) |
Generate a document from a bank account record.
Like SEPA mandate
| int | $id | ID of the third party |
| int | $companybankid | ID of company bank |
| string | $model | Model of document to generate |
@url GET {id}/generateBankAccountDocument/{companybankid}/{model}
| RestException |
Definition at line 2094 of file api_thirdparties.class.php.
References $conf, $id, dol_sanitizeFileName(), and getDolGlobalInt().
| Thirdparties::get | ( | $id | ) |
Get a third party.
Return the third party object
| int | $id | ID of the third party to load |
| RestException |
Definition at line 84 of file api_thirdparties.class.php.
| Thirdparties::getByBarcode | ( | $barcode | ) |
Get a third party by barcode.
Return an array with third party information
| string | $barcode | Barcode of the third party |
@url GET barcode/{barcode}
| RestException |
Definition at line 124 of file api_thirdparties.class.php.
References _fetch().
| Thirdparties::getByEmail | ( | ) |
Get properties of a third party by email.
Return an array with third party information
| string | Email of the third party to load |
@url GET email/{email}
| RestException |
Definition at line 105 of file api_thirdparties.class.php.
References _fetch().
| Thirdparties::getCategories | ( | $id, | |
| $sortfield = "s.rowid", | |||
| $sortorder = 'ASC', | |||
| $limit = 0, | |||
| $page = 0 ) |
Get customer categories for a third party.
| int | $id | ID of the third party |
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | List limit |
| int | $page | Page number |
@url GET {id}/categories
| RestException |
Definition at line 668 of file api_thirdparties.class.php.
References $id.
| Thirdparties::getCompanyBankAccount | ( | $id | ) |
Get company bank accounts of a third party.
| int | $id | ID of the third party |
@url GET {id}/bankaccounts
| RestException |
We select all the records that match the socid
Definition at line 1854 of file api_thirdparties.class.php.
References $id, $object, DolibarrApi\_checkAccessToResource(), and dolDecrypt().
| Thirdparties::getCompanyNotification | ( | $id | ) |
Get company notifications for a third party.
| int | $id | ID of the third party |
@url GET {id}/notifications
| RestException |
We select all the records that match the socid
Definition at line 1563 of file api_thirdparties.class.php.
References $id, $object, and DolibarrApi\_checkAccessToResource().
| Thirdparties::getFixedAmountDiscounts | ( | $id, | |
| $mode = 'customer', | |||
| $filter = "none", | |||
| $sortfield = "f.type", | |||
| $sortorder = 'ASC' ) |
Get fixed amount discount of a third party.
all sources: deposit, credit note, commercial offers, etc.
| int | $id | ID of the third party |
| string | $mode | 'customer' or 'supplier' |
| string | $filter | Filter exceptional discount. "none" will return every discount, "available" returns unapplied discounts, "used" returns applied discounts {@choice none,available,used} |
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
@url GET {id}/fixedamountdiscounts
| RestException | 400 |
| RestException | 401 |
| RestException | 404 |
| RestException | 503 |
Definition at line 1118 of file api_thirdparties.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Thirdparties::getInvoicesQualifiedForCreditNote | ( | $id | ) |
Return invoices qualified to be corrected by a credit note.
Invoices matching the following rules are returned (validated + payment on process) or classified (paid completely or paid partially) + not already replaced + not already a credit note
| int | $id | ID of a third party |
@url GET {id}/getinvoicesqualifiedforcreditnote
| RestException | 400 |
| RestException | 401 |
| RestException | 404 |
| RestException | 405 |
Definition at line 1520 of file api_thirdparties.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Thirdparties::getInvoicesQualifiedForReplacement | ( | $id | ) |
Return invoices qualified to be replaced by another invoice.
| int | $id | ID of a third party |
@url GET {id}/getinvoicesqualifiedforreplacement
| RestException | 400 |
| RestException | 401 |
| RestException | 404 |
| RestException | 405 |
Definition at line 1471 of file api_thirdparties.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Thirdparties::getOutStandingInvoices | ( | $id, | |
| $mode = 'customer' ) |
Get outstanding invoices for a third party.
| int | $id | ID of the third party |
| string | $mode | 'customer' or 'supplier' |
@url GET {id}/outstandinginvoices
| RestException | 400 |
| RestException | 401 |
| RestException | 404 |
Definition at line 1025 of file api_thirdparties.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Thirdparties::getOutStandingOrder | ( | $id, | |
| $mode = 'customer' ) |
Get outstanding orders for a third party.
| int | $id | ID of the third party |
| string | $mode | 'customer' or 'supplier' |
@url GET {id}/outstandingorders
| RestException | 400 |
| RestException | 401 |
| RestException | 404 |
Definition at line 980 of file api_thirdparties.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Thirdparties::getOutStandingProposals | ( | $id, | |
| $mode = 'customer' ) |
Get outstanding proposals for a third party.
| int | $id | ID of the third party |
| string | $mode | 'customer' or 'supplier' |
@url GET {id}/outstandingproposals
| RestException | 400 |
| RestException | 401 |
| RestException | 404 |
Definition at line 934 of file api_thirdparties.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Thirdparties::getSalesRepresentatives | ( | $id, | |
| $mode = 0 ) |
Get representatives of a third party.
| int | $id | ID of the third party |
| int | $mode | 0=Array with properties, 1=Array of id. |
@url GET {id}/representatives
| RestException | 400 |
| RestException | 401 |
| RestException | 404 |
Definition at line 1070 of file api_thirdparties.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Thirdparties::getSocieteAccounts | ( | $id, | |
| $site = null ) |
Get a specific account attached to a third party.
Specify the site key
| int | $id | ID of the third party |
| string | $site | Site key |
| RestException | 401 Unauthorized: User does not have permission to read thirdparties |
| RestException | 404 Not Found: Specified thirdparty ID does not belongs to an existing thirdparty |
@url GET {id}/accounts/
We select all the records that match the socid
Definition at line 2194 of file api_thirdparties.class.php.
References $id, $object, and DolibarrApi\_checkAccessToResource().
| Thirdparties::getSocieteByAccounts | ( | $site, | |
| $key_account ) |
Get a specific third party by account.
| string | $site | Site key |
| string | $key_account | Key of the account |
| RestException | 401 Unauthorized: User does not have permission to read thirdparties |
| RestException | 404 Not Found: Specified thirdparty ID does not belongs to an existing thirdparty |
@url GET /accounts/{site}/{key_account}
| RestException |
Definition at line 2271 of file api_thirdparties.class.php.
References DolibarrApi\_checkAccessToResource(), and _fetch().
| Thirdparties::getSupplierCategories | ( | $id, | |
| $sortfield = "s.rowid", | |||
| $sortorder = 'ASC', | |||
| $limit = 0, | |||
| $page = 0 ) |
Get supplier categories for a third party.
| int | $id | ID of the third party |
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | List limit |
| int | $page | Page number |
@url GET {id}/supplier_categories
| RestException |
Definition at line 801 of file api_thirdparties.class.php.
References $id.
| Thirdparties::index | ( | $sortfield = "t.rowid", | |
| $sortorder = 'ASC', | |||
| $limit = 100, | |||
| $page = 0, | |||
| $mode = 0, | |||
| $category = 0, | |||
| $sqlfilters = '', | |||
| $properties = '', | |||
| $pagination_data = false ) |
List third parties.
Get a list of third parties
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | List limit |
| int | $page | Page number |
| int | $mode | Set to 0 to show all third parties, Set to 1 to show only customers, 2 for prospects, 3 for neither customer nor prospect, 4 for suppliers |
| int | $category | Use this param to filter the list by category |
| string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "((t.nom:like:'TheCompany%') or (t.name_alias:like:'TheCompany%')) and (t.datec:<:'20160101')" |
| string | $properties | Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names |
| bool | $pagination_data | If this parameter is set to true, the response will include pagination data. The default value is false. Page starts from 0* |
| RestException | 400 |
| RestException | 403 |
| RestException | 404 |
| RestException | 503 |
Definition at line 155 of file api_thirdparties.class.php.
References _cleanObjectDatas(), DolibarrApi\_filterObjectProperties(), isModEnabled(), and string.
| Thirdparties::merge | ( | $id, | |
| $idtodelete ) |
Merge a third party into another third party.
Merge content (properties, notes) and objects (like invoices, events, orders, proposals, ...) of a third party into a target third party, then delete the merged third party. If a property has a defined value both in the third party to delete and the third party to keep, the value of the third party to delete will be ignored, the value of the target third party will remain, except for notes (content is concatenated).
| int | $id | ID of thirdparty to keep (the target third party) |
| int | $idtodelete | ID of thirdparty to remove (the third party to delete), once data has been merged into the target third party. |
@phan-return Societe @phpstan-return Societe
@url PUT {id}/merge/{idtodelete}
| RestException |
Definition at line 437 of file api_thirdparties.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Thirdparties::post | ( | $request_data = null | ) |
Create a third party.
| array | $request_data | Request data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
| RestException |
Definition at line 308 of file api_thirdparties.class.php.
References $id, DolibarrApi\_checkValExtrafieldsForAPI(), DolibarrApi\_checkValForAPI(), _validate(), dol_getIdFromCode(), isModEnabled(), and sanitizeVal().
| Thirdparties::postSocieteAccount | ( | $id, | |
| $site, | |||
| $request_data = null ) |
Create and attach a new (or replace an existing) specific site account for a third party.
You MUST pass all values to keep (otherwise, they will be deleted) !
If you just need to update specific fields prefer PUT /thirdparties/{id}/accounts/{site} endpoint.
When a SocieteAccount entity does not exist for the id and site supplied, a new one will be created. In that case fk_soc and site members form request body payload will be ignored and id and site query strings parameters will be used instead.
| int | $id | ID of the third party |
| string | $site | Site key |
| array | $request_data | Request data |
@phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data
| RestException | 401 Unauthorized: User does not have permission to read thirdparties |
| RestException | 422 Unprocessable Entity: You must pass the site attribute in your request data ! |
| RestException | 500 Internal Server Error: Error updating SocieteAccount entity |
@url POST {id}/accounts/{site}
Definition at line 2388 of file api_thirdparties.class.php.
References $id, DolibarrApi\_checkValForAPI(), _cleanObjectDatas(), and sanitizeVal().
| Thirdparties::put | ( | $id, | |
| $request_data = null ) |
Update third party.
| int | $id | ID of thirdparty to update |
| array | $request_data | Data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
| RestException | 401 |
| RestException | 404 |
| RestException | 500 |
Definition at line 372 of file api_thirdparties.class.php.
References $id, DolibarrApi\_checkAccessToResource(), DolibarrApi\_checkValExtrafieldsForAPI(), DolibarrApi\_checkValForAPI(), isModEnabled(), and sanitizeVal().
| Thirdparties::putSocieteAccount | ( | $id, | |
| $site, | |||
| $request_data = null ) |
Update specified values of a specific account attached to a third party.
| int | $id | ID of the third party |
| string | $site | Site key |
| array | $request_data | Request data |
@phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data
| RestException | 401 Unauthorized: User does not have permission to read thirdparties |
| RestException | 404 Not Found: Specified thirdparty ID does not belongs to an existing thirdparty |
| RestException | 409 Conflict: Another SocieteAccount entity already exists for this thirdparty with this site key. |
| RestException | 500 Internal Server Error: Error updating SocieteAccount entity |
@url PUT {id}/accounts/{site}
Definition at line 2486 of file api_thirdparties.class.php.
References $id, DolibarrApi\_checkValForAPI(), _cleanObjectDatas(), and sanitizeVal().
| Thirdparties::setThirdpartyPriceLevel | ( | $id, | |
| $priceLevel ) |
Set a new price level for the given third party.
| int | $id | ID of thirdparty |
| int | $priceLevel | Price level to apply to thirdparty |
@url PUT {id}/setpricelevel/{priceLevel}
| RestException | 400 Price level out of bounds |
| RestException | 401 Access not allowed for your login |
| RestException | 404 Third party not found |
| RestException | 500 Error fetching/setting price level |
| RestException | 501 Request needs modules "Thirdparties" and "Products" and setting Multiprices activated |
Definition at line 533 of file api_thirdparties.class.php.
References $conf, $id, DolibarrApi\_checkAccessToResource(), _cleanObjectDatas(), getDolGlobalString(), and isModEnabled().
| Thirdparties::splitdiscount | ( | $id, | |
| $discountid, | |||
| $amount_ttc_1, | |||
| $amount_ttc_2 ) |
Split a discount in 2 smaller discount.
| int | $id | ID of the thirdparty |
| int | $discountid | ID of a discount coming from a credit note |
| float | $amount_ttc_1 | Amount 1 (inc. tax) |
| float | $amount_ttc_2 | Amount 2 (inc. tax) |
@url POST {id}/splitdiscount/{discountid}
| RestException | 400 |
| RestException | 401 |
| RestException | 403 |
| RestException | 404 |
| RestException | 405 |
| RestException | 409 |
| RestException | 500 |
Definition at line 1310 of file api_thirdparties.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and price2num().
| Thirdparties::updateCompanyBankAccount | ( | $id, | |
| $bankaccount_id, | |||
| $request_data = null ) |
Update a company bank account of a third party.
| int | $id | ID of the third party |
| int | $bankaccount_id | ID of CompanyBankAccount |
| array | $request_data | Request data |
@phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data
@url PUT {id}/bankaccounts/{bankaccount_id}
| RestException |
Definition at line 2001 of file api_thirdparties.class.php.
References $id, DolibarrApi\_checkValForAPI(), _cleanObjectDatas(), dol_now(), and sanitizeVal().
| Thirdparties::updateCompanyNotification | ( | $id, | |
| $notification_id, | |||
| $request_data = null ) |
Update a company notification for a third party.
| int | $id | ID of the third party |
| int | $notification_id | ID of CompanyNotification |
| array | $request_data | Request data |
@phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data
@url PUT {id}/notifications/{notification_id}
| RestException |
Definition at line 1811 of file api_thirdparties.class.php.
References $id, DolibarrApi\_checkValForAPI(), and _cleanObjectDatas().