Skip to content

Commit 630de51

Browse files
committed
initial commit
1 parent e5bedbb commit 630de51

File tree

352 files changed

+140060
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

352 files changed

+140060
-2
lines changed

Diff for: README.md

+447-2
Large diffs are not rendered by default.

Diff for: composer.json

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "XeroAPI/xero-php-oauth2",
3+
"description": "Experimental PHP SDK for Xero API generated by OpenAPI spec for oAuth2",
4+
"keywords": [
5+
"openapispec",
6+
"xero",
7+
"php",
8+
"sdk",
9+
"rest",
10+
"api"
11+
],
12+
"homepage": "https://github.com/XeroAPI/xero-php-oauth2",
13+
"license": "MIT",
14+
"authors": [
15+
{
16+
"name": "Xero API Team",
17+
"homepage": "https://developer.xero.com"
18+
}
19+
],
20+
"require": {
21+
"php": ">=5.6",
22+
"ext-curl": "*",
23+
"ext-json": "*",
24+
"ext-mbstring": "*",
25+
"guzzlehttp/guzzle": "^6.2",
26+
"league/oauth2-client": "^2.4"
27+
},
28+
"require-dev": {
29+
"phpunit/phpunit": "^4.8",
30+
"squizlabs/php_codesniffer": "~2.6",
31+
"friendsofphp/php-cs-fixer": "~2.12"
32+
},
33+
"autoload": {
34+
"psr-4": { "XeroAPI\\XeroPHP\\" : "lib/" }
35+
},
36+
"autoload-dev": {
37+
"psr-4": { "XeroAPI\\XeroPHP\\" : "test/" }
38+
}
39+
}

Diff for: docs/Api/AccountingApi.md

+10,699
Large diffs are not rendered by default.

Diff for: docs/Api/IdentityApi.md

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# SidneyAllen\XeroPHP\IdentityApi
2+
3+
All URIs are relative to *https://api.xero.com/api.xro/2.0*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**getConnections**](IdentityApi.md#getConnections) | **GET** /connections | Allows you to retrieve the connections for this users
8+
[**refreshToken**](IdentityApi.md#refreshToken) | **POST** /connect/token | Allows you to refresh your access token
9+
10+
11+
# **getConnections**
12+
> \SidneyAllen\XeroPHP\Models\Identity\Connection[] getConnections()
13+
14+
Allows you to retrieve the connections for this users
15+
16+
Override the base server url that include version
17+
18+
### Example
19+
```php
20+
<?php
21+
require_once(__DIR__ . '/vendor/autoload.php');
22+
23+
// Configure OAuth2 access token for authorization: oAuth2AuthCode
24+
$config = SidneyAllen\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
25+
26+
$apiInstance = new SidneyAllen\XeroPHP\Api\IdentityApi(
27+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
28+
// This is optional, `GuzzleHttp\Client` will be used as default.
29+
new GuzzleHttp\Client(),
30+
$config
31+
);
32+
33+
try {
34+
$result = $apiInstance->getConnections();
35+
print_r($result);
36+
} catch (Exception $e) {
37+
echo 'Exception when calling IdentityApi->getConnections: ', $e->getMessage(), PHP_EOL;
38+
}
39+
?>
40+
```
41+
42+
### Parameters
43+
This endpoint does not need any parameter.
44+
45+
### Return type
46+
47+
[**\SidneyAllen\XeroPHP\Models\Identity\Connection[]**](../Model/Connection.md)
48+
49+
### Authorization
50+
51+
[oAuth2AuthCode](../../README.md#oAuth2AuthCode)
52+
53+
### HTTP request headers
54+
55+
- **Content-Type**: Not defined
56+
- **Accept**: application/json
57+
58+
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
59+
60+
# **refreshToken**
61+
> \SidneyAllen\XeroPHP\Models\Identity\AccessToken refreshToken($grant_type, $grant_type, $refresh_token, $client_id, $client_secret)
62+
63+
Allows you to refresh your access token
64+
65+
### Example
66+
```php
67+
<?php
68+
require_once(__DIR__ . '/vendor/autoload.php');
69+
70+
// Configure OAuth2 access token for authorization: oAuth2AuthCode
71+
$config = SidneyAllen\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
72+
73+
$apiInstance = new SidneyAllen\XeroPHP\Api\IdentityApi(
74+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
75+
// This is optional, `GuzzleHttp\Client` will be used as default.
76+
new GuzzleHttp\Client(),
77+
$config
78+
);
79+
$grant_type = 'grant_type_example'; // string | the grant type for token
80+
$grant_type = 'grant_type_example'; // string | Xero grant type
81+
$refresh_token = 'refresh_token_example'; // string | refresh token provided during authentication flow
82+
$client_id = 'client_id_example'; // string | client id for Xero app
83+
$client_secret = 'client_secret_example'; // string | client secret for Xero app 2
84+
85+
try {
86+
$result = $apiInstance->refreshToken($grant_type, $grant_type, $refresh_token, $client_id, $client_secret);
87+
print_r($result);
88+
} catch (Exception $e) {
89+
echo 'Exception when calling IdentityApi->refreshToken: ', $e->getMessage(), PHP_EOL;
90+
}
91+
?>
92+
```
93+
94+
### Parameters
95+
96+
Name | Type | Description | Notes
97+
------------- | ------------- | ------------- | -------------
98+
**grant_type** | **string**| the grant type for token | [optional]
99+
**grant_type** | **string**| Xero grant type | [optional]
100+
**refresh_token** | **string**| refresh token provided during authentication flow | [optional]
101+
**client_id** | **string**| client id for Xero app | [optional]
102+
**client_secret** | **string**| client secret for Xero app 2 | [optional]
103+
104+
### Return type
105+
106+
[**\SidneyAllen\XeroPHP\Models\Identity\AccessToken**](../Model/AccessToken.md)
107+
108+
### Authorization
109+
110+
[oAuth2AuthCode](../../README.md#oAuth2AuthCode)
111+
112+
### HTTP request headers
113+
114+
- **Content-Type**: application/x-www-form-urlencoded
115+
- **Accept**: application/json
116+
117+
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
118+

Diff for: docs/Model/AccessToken.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# AccessToken
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**id_token** | **string** | Xero unique identifier | [optional]
7+
**access_token** | **string** | access token provided during authentication flow | [optional]
8+
**expires_in** | **double** | time in milliseconds until access token expires. | [optional]
9+
**token_type** | **string** | type of token i.e. Bearer | [optional]
10+
**refresh_token** | **string** | token used to refresh an expired access token | [optional]
11+
12+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
13+
14+

Diff for: docs/Model/Account.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Account
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**code** | **string** | Customer defined alpha numeric account code e.g 200 or SALES (max length &#x3D; 10) | [optional]
7+
**name** | **string** | Name of account (max length &#x3D; 150) | [optional]
8+
**account_id** | **string** | The Xero identifier for an account – specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 | [optional]
9+
**type** | [**\XeroAPI\XeroPHP\Models\Accounting\AccountType**](AccountType.md) | | [optional]
10+
**bank_account_number** | **string** | For bank accounts only (Account Type BANK) | [optional]
11+
**status** | **string** | Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes | [optional]
12+
**description** | **string** | Description of the Account. Valid for all types of accounts except bank accounts (max length &#x3D; 4000) | [optional]
13+
**bank_account_type** | **string** | For bank accounts only. See Bank Account types | [optional]
14+
**currency_code** | [**\XeroAPI\XeroPHP\Models\Accounting\CurrencyCode**](CurrencyCode.md) | | [optional]
15+
**tax_type** | **string** | The tax type from TaxRates | [optional]
16+
**enable_payments_to_account** | **bool** | Boolean – describes whether account can have payments applied to it | [optional]
17+
**show_in_expense_claims** | **bool** | Boolean – describes whether account code is available for use with expense claims | [optional]
18+
**class** | **string** | See Account Class Types | [optional]
19+
**system_account** | **string** | If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either “” or null. | [optional]
20+
**reporting_code** | **string** | Shown if set | [optional]
21+
**reporting_code_name** | **string** | Shown if set | [optional]
22+
**has_attachments** | **bool** | boolean to indicate if an account has an attachment (read only) | [optional]
23+
**updated_date_utc** | [**\DateTime**](\DateTime.md) | Last modified date UTC format | [optional]
24+
**validation_errors** | [**\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]**](ValidationError.md) | Displays array of validation error messages from the API | [optional]
25+
26+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
27+
28+

Diff for: docs/Model/AccountType.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# AccountType
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
7+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
8+
9+

Diff for: docs/Model/Accounts.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Accounts
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**accounts** | [**\XeroAPI\XeroPHP\Models\Accounting\Account[]**](Account.md) | | [optional]
7+
8+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
9+
10+

Diff for: docs/Model/AccountsPayable.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# AccountsPayable
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**outstanding** | **double** | | [optional]
7+
**overdue** | **double** | | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

Diff for: docs/Model/AccountsReceivable.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# AccountsReceivable
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**outstanding** | **double** | | [optional]
7+
**overdue** | **double** | | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

Diff for: docs/Model/Address.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Address
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**address_type** | **string** | define the type of address | [optional]
7+
**address_line1** | **string** | max length &#x3D; 500 | [optional]
8+
**address_line2** | **string** | max length &#x3D; 500 | [optional]
9+
**address_line3** | **string** | max length &#x3D; 500 | [optional]
10+
**address_line4** | **string** | max length &#x3D; 500 | [optional]
11+
**city** | **string** | max length &#x3D; 255 | [optional]
12+
**region** | **string** | max length &#x3D; 255 | [optional]
13+
**postal_code** | **string** | max length &#x3D; 50 | [optional]
14+
**country** | **string** | max length &#x3D; 50, [A-Z], [a-z] only | [optional]
15+
**attention_to** | **string** | max length &#x3D; 255 | [optional]
16+
17+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
18+
19+

Diff for: docs/Model/Allocation.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Allocation
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**invoice** | [**\XeroAPI\XeroPHP\Models\Accounting\Invoice**](Invoice.md) | |
7+
**amount** | **double** | the amount being applied to the invoice |
8+
**date** | [**\DateTime**](\DateTime.md) | the date the allocation is applied YYYY-MM-DD. |
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+

Diff for: docs/Model/Allocations.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Allocations
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**allocations** | [**\XeroAPI\XeroPHP\Models\Accounting\Allocation[]**](Allocation.md) | | [optional]
7+
8+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
9+
10+

Diff for: docs/Model/Attachment.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Attachment
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**attachment_id** | **string** | Unique ID for the file | [optional]
7+
**file_name** | **string** | Name of the file | [optional]
8+
**url** | **string** | URL to the file on xero.com | [optional]
9+
**mime_type** | **string** | Type of file | [optional]
10+
**content_length** | **float** | Length of the file content | [optional]
11+
**include_online** | **bool** | Include the file with the online invoice | [optional]
12+
13+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
14+
15+

Diff for: docs/Model/Attachments.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Attachments
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**attachments** | [**\XeroAPI\XeroPHP\Models\Accounting\Attachment[]**](Attachment.md) | | [optional]
7+
8+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
9+
10+

Diff for: docs/Model/Balances.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Balances
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**accounts_receivable** | [**\XeroAPI\XeroPHP\Models\Accounting\AccountsReceivable**](AccountsReceivable.md) | | [optional]
7+
**accounts_payable** | [**\XeroAPI\XeroPHP\Models\Accounting\AccountsPayable**](AccountsPayable.md) | | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

Diff for: docs/Model/BankTransaction.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# BankTransaction
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**type** | **string** | See Bank Transaction Types |
7+
**contact** | [**\XeroAPI\XeroPHP\Models\Accounting\Contact**](Contact.md) | |
8+
**line_items** | [**\XeroAPI\XeroPHP\Models\Accounting\LineItem[]**](LineItem.md) | See LineItems |
9+
**bank_account** | [**\XeroAPI\XeroPHP\Models\Accounting\Account**](Account.md) | |
10+
**is_reconciled** | **bool** | Boolean to show if transaction is reconciled | [optional]
11+
**date** | [**\DateTime**](\DateTime.md) | Date of transaction – YYYY-MM-DD | [optional]
12+
**reference** | **string** | Reference for the transaction. Only supported for SPEND and RECEIVE transactions. | [optional]
13+
**currency_code** | [**\XeroAPI\XeroPHP\Models\Accounting\CurrencyCode**](CurrencyCode.md) | | [optional]
14+
**currency_rate** | **double** | Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn’t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. | [optional]
15+
**url** | **string** | URL link to a source document – shown as “Go to App Name” | [optional]
16+
**status** | **string** | See Bank Transaction Status Codes | [optional]
17+
**line_amount_types** | [**\XeroAPI\XeroPHP\Models\Accounting\LineAmountTypes**](LineAmountTypes.md) | | [optional]
18+
**sub_total** | **double** | Total of bank transaction excluding taxes | [optional]
19+
**total_tax** | **double** | Total tax on bank transaction | [optional]
20+
**total** | **double** | Total of bank transaction tax inclusive | [optional]
21+
**bank_transaction_id** | **string** | Xero generated unique identifier for bank transaction | [optional]
22+
**prepayment_id** | **string** | Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT | [optional]
23+
**overpayment_id** | **string** | Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT | [optional]
24+
**updated_date_utc** | [**\DateTime**](\DateTime.md) | Last modified date UTC format | [optional]
25+
**has_attachments** | **bool** | Boolean to indicate if a bank transaction has an attachment | [optional]
26+
**status_attribute_string** | **string** | A string to indicate if a invoice status | [optional]
27+
**validation_errors** | [**\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]**](ValidationError.md) | Displays array of validation error messages from the API | [optional]
28+
29+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
30+
31+

Diff for: docs/Model/BankTransactions.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# BankTransactions
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**bank_transactions** | [**\XeroAPI\XeroPHP\Models\Accounting\BankTransaction[]**](BankTransaction.md) | | [optional]
7+
8+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
9+
10+

Diff for: docs/Model/BankTransfer.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# BankTransfer
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**from_bank_account** | [**\XeroAPI\XeroPHP\Models\Accounting\Account**](Account.md) | |
7+
**to_bank_account** | [**\XeroAPI\XeroPHP\Models\Accounting\Account**](Account.md) | |
8+
**amount** | **string** | amount of the transaction |
9+
**date** | [**\DateTime**](\DateTime.md) | The date of the Transfer YYYY-MM-DD | [optional]
10+
**bank_transfer_id** | **string** | The identifier of the Bank Transfer | [optional]
11+
**currency_rate** | **double** | The currency rate | [optional]
12+
**from_bank_transaction_id** | **string** | The Bank Transaction ID for the source account | [optional]
13+
**to_bank_transaction_id** | **string** | The Bank Transaction ID for the destination account | [optional]
14+
**has_attachments** | **bool** | Boolean to indicate if a Bank Transfer has an attachment | [optional]
15+
**created_date_utc** | [**\DateTime**](\DateTime.md) | UTC timestamp of creation date of bank transfer | [optional]
16+
**validation_errors** | [**\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]**](ValidationError.md) | Displays array of validation error messages from the API | [optional]
17+
18+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
19+
20+

0 commit comments

Comments
 (0)