- list - List Payments
- create - Create Payment
- get - Get Payment
- update - Update Payment
- delete - Delete Payment
List Payments
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
use Apideck\Unify\Utils;
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$request = new Operations\AccountingPaymentsAllRequest(
serviceId: 'salesforce',
companyId: '12345',
filter: new Components\PaymentsFilter(
updatedSince: Utils\Utils::parseDateTime('2020-09-30T07:43:32.000Z'),
invoiceId: '123',
),
sort: new Components\PaymentsSort(
by: Components\PaymentsSortBy::UpdatedAt,
direction: Components\SortDirection::Desc,
),
passThrough: [
'search' => 'San Francisco',
],
fields: 'id,updated_at',
);
$responses = $sdk->accounting->payments->list(
request: $request
);
foreach ($responses as $response) {
if ($response->httpMeta->response->getStatusCode() === 200) {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\AccountingPaymentsAllRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingPaymentsAllResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestResponse | 400 | application/json |
| Errors\UnauthorizedResponse | 401 | application/json |
| Errors\PaymentRequiredResponse | 402 | application/json |
| Errors\NotFoundResponse | 404 | application/json |
| Errors\UnprocessableResponse | 422 | application/json |
| Errors\APIException | 4XX, 5XX | */* |
Create Payment
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
use Apideck\Unify\Utils;
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$request = new Operations\AccountingPaymentsAddRequest(
serviceId: 'salesforce',
companyId: '12345',
payment: new Components\PaymentInput(
currency: Components\Currency::Usd,
currencyRate: 0.69,
totalAmount: 49.99,
reference: '123456',
paymentMethod: 'cash',
paymentMethodReference: '123456',
paymentMethodId: '12345',
account: new Components\LinkedLedgerAccount(
id: '123456',
nominalCode: 'N091',
code: '453',
),
transactionDate: Utils\Utils::parseDateTime('2021-05-01T12:00:00.000Z'),
customer: new Components\LinkedCustomerInput(
id: '12345',
displayName: 'Windsurf Shop',
email: 'boring@boring.com',
),
companyId: '12345',
reconciled: true,
status: Components\PaymentStatus::Authorised,
type: Components\PaymentType::AccountsReceivable,
allocations: [
new Components\AllocationInput(
id: '123456',
amount: 49.99,
allocationId: '123456',
),
new Components\AllocationInput(
id: '123456',
amount: 49.99,
allocationId: '123456',
),
new Components\AllocationInput(
id: '123456',
amount: 49.99,
allocationId: '123456',
),
],
note: 'Some notes about this transaction',
number: '123456',
trackingCategories: [
new Components\LinkedTrackingCategory(
id: '123456',
name: 'New York',
),
new Components\LinkedTrackingCategory(
id: '123456',
name: 'New York',
),
],
customFields: [
new Components\CustomField1(
id: '2389328923893298',
name: 'employee_level',
description: 'Employee Level',
value: 'Uses Salesforce and Marketo',
),
],
rowVersion: '1-12345',
displayId: '123456',
passThrough: [
new Components\PassThroughBody(
serviceId: '<id>',
extendPaths: [
new Components\ExtendPaths(
path: '$.nested.property',
value: [
'TaxClassificationRef' => [
'value' => 'EUC-99990201-V1-00020000',
],
],
),
new Components\ExtendPaths(
path: '$.nested.property',
value: [
'TaxClassificationRef' => [
'value' => 'EUC-99990201-V1-00020000',
],
],
),
],
),
],
),
);
$response = $sdk->accounting->payments->create(
request: $request
);
if ($response->createPaymentResponse !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\AccountingPaymentsAddRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingPaymentsAddResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestResponse | 400 | application/json |
| Errors\UnauthorizedResponse | 401 | application/json |
| Errors\PaymentRequiredResponse | 402 | application/json |
| Errors\NotFoundResponse | 404 | application/json |
| Errors\UnprocessableResponse | 422 | application/json |
| Errors\APIException | 4XX, 5XX | */* |
Get Payment
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Operations;
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$request = new Operations\AccountingPaymentsOneRequest(
id: '<id>',
serviceId: 'salesforce',
companyId: '12345',
fields: 'id,updated_at',
);
$response = $sdk->accounting->payments->get(
request: $request
);
if ($response->getPaymentResponse !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\AccountingPaymentsOneRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingPaymentsOneResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestResponse | 400 | application/json |
| Errors\UnauthorizedResponse | 401 | application/json |
| Errors\PaymentRequiredResponse | 402 | application/json |
| Errors\NotFoundResponse | 404 | application/json |
| Errors\UnprocessableResponse | 422 | application/json |
| Errors\APIException | 4XX, 5XX | */* |
Update Payment
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
use Apideck\Unify\Utils;
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$request = new Operations\AccountingPaymentsUpdateRequest(
id: '<id>',
serviceId: 'salesforce',
companyId: '12345',
payment: new Components\PaymentInput(
currency: Components\Currency::Usd,
currencyRate: 0.69,
totalAmount: 49.99,
reference: '123456',
paymentMethod: 'cash',
paymentMethodReference: '123456',
paymentMethodId: '12345',
account: new Components\LinkedLedgerAccount(
id: '123456',
nominalCode: 'N091',
code: '453',
),
transactionDate: Utils\Utils::parseDateTime('2021-05-01T12:00:00.000Z'),
customer: new Components\LinkedCustomerInput(
id: '12345',
displayName: 'Windsurf Shop',
email: 'boring@boring.com',
),
companyId: '12345',
reconciled: true,
status: Components\PaymentStatus::Authorised,
type: Components\PaymentType::AccountsReceivable,
allocations: [
new Components\AllocationInput(
id: '123456',
amount: 49.99,
allocationId: '123456',
),
new Components\AllocationInput(
id: '123456',
amount: 49.99,
allocationId: '123456',
),
],
note: 'Some notes about this transaction',
number: '123456',
trackingCategories: [
new Components\LinkedTrackingCategory(
id: '123456',
name: 'New York',
),
new Components\LinkedTrackingCategory(
id: '123456',
name: 'New York',
),
new Components\LinkedTrackingCategory(
id: '123456',
name: 'New York',
),
],
customFields: [
new Components\CustomField1(
id: '2389328923893298',
name: 'employee_level',
description: 'Employee Level',
value: 'Uses Salesforce and Marketo',
),
new Components\CustomField1(
id: '2389328923893298',
name: 'employee_level',
description: 'Employee Level',
value: 'Uses Salesforce and Marketo',
),
],
rowVersion: '1-12345',
displayId: '123456',
passThrough: [
new Components\PassThroughBody(
serviceId: '<id>',
extendPaths: [
new Components\ExtendPaths(
path: '$.nested.property',
value: [
'TaxClassificationRef' => [
'value' => 'EUC-99990201-V1-00020000',
],
],
),
],
),
],
),
);
$response = $sdk->accounting->payments->update(
request: $request
);
if ($response->updatePaymentResponse !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\AccountingPaymentsUpdateRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingPaymentsUpdateResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestResponse | 400 | application/json |
| Errors\UnauthorizedResponse | 401 | application/json |
| Errors\PaymentRequiredResponse | 402 | application/json |
| Errors\NotFoundResponse | 404 | application/json |
| Errors\UnprocessableResponse | 422 | application/json |
| Errors\APIException | 4XX, 5XX | */* |
Delete Payment
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Operations;
$sdk = Unify\Apideck::builder()
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$request = new Operations\AccountingPaymentsDeleteRequest(
id: '<id>',
serviceId: 'salesforce',
companyId: '12345',
);
$response = $sdk->accounting->payments->delete(
request: $request
);
if ($response->deletePaymentResponse !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\AccountingPaymentsDeleteRequest | ✔️ | The request object to use for the request. |
?Operations\AccountingPaymentsDeleteResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestResponse | 400 | application/json |
| Errors\UnauthorizedResponse | 401 | application/json |
| Errors\PaymentRequiredResponse | 402 | application/json |
| Errors\NotFoundResponse | 404 | application/json |
| Errors\UnprocessableResponse | 422 | application/json |
| Errors\APIException | 4XX, 5XX | */* |