(Accounting.Expenses)
List Expenses
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
AccountingExpensesAllRequest req = new AccountingExpensesAllRequest() {
ServiceId = "salesforce",
};
AccountingExpensesAllResponse? res = await sdk.Accounting.Expenses.ListAsync(req);
while(res != null)
{
// handle items
res = await res.Next!();
}
AccountingExpensesAllResponse
Error Type |
Status Code |
Content Type |
ApideckUnifySdk.Models.Errors.BadRequestResponse |
400 |
application/json |
ApideckUnifySdk.Models.Errors.UnauthorizedResponse |
401 |
application/json |
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse |
402 |
application/json |
ApideckUnifySdk.Models.Errors.NotFoundResponse |
404 |
application/json |
ApideckUnifySdk.Models.Errors.UnprocessableResponse |
422 |
application/json |
ApideckUnifySdk.Models.Errors.APIException |
4XX, 5XX |
*/* |
Create Expense
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System;
using System.Collections.Generic;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
AccountingExpensesAddRequest req = new AccountingExpensesAddRequest() {
Expense = new ExpenseInput() {
Number = "OIT00546",
TransactionDate = System.DateTime.Parse("2021-05-01T12:00:00.000Z"),
AccountId = "123456",
CustomerId = "12345",
SupplierId = "12345",
CompanyId = "12345",
DepartmentId = "12345",
PaymentType = ExpensePaymentType.Cash,
Currency = Currency.Usd,
CurrencyRate = 0.69D,
Type = ExpenseType.Expense,
Memo = "For travel expenses incurred on 2024-05-15",
TaxRate = new LinkedTaxRateInput() {
Id = "123456",
Rate = 10D,
},
TotalAmount = 275D,
LineItems = new List<ExpenseLineItemInput>() {
new ExpenseLineItemInput() {
TrackingCategories = new List<LinkedTrackingCategory>() {
new LinkedTrackingCategory() {
Id = "123456",
Name = "New York",
},
},
AccountId = "123456",
CustomerId = "12345",
DepartmentId = "12345",
LocationId = "12345",
TaxRate = new LinkedTaxRateInput() {
Id = "123456",
Rate = 10D,
},
Description = "Travel US.",
TotalAmount = 275D,
Billable = true,
},
},
CustomFields = new List<CustomField>() {
new CustomField() {
Id = "2389328923893298",
Name = "employee_level",
Description = "Employee Level",
Value = Value.CreateBoolean(
true
),
},
},
RowVersion = "1-12345",
PassThrough = new List<PassThroughBody>() {
new PassThroughBody() {
ServiceId = "<id>",
ExtendPaths = new List<ExtendPaths>() {
new ExtendPaths() {
Path = "$.nested.property",
Value = new Dictionary<string, object>() {
{ "TaxClassificationRef", new Dictionary<string, object>() {
{ "value", "EUC-99990201-V1-00020000" },
} },
},
},
},
},
},
},
ServiceId = "salesforce",
};
var res = await sdk.Accounting.Expenses.CreateAsync(req);
// handle response
AccountingExpensesAddResponse
Error Type |
Status Code |
Content Type |
ApideckUnifySdk.Models.Errors.BadRequestResponse |
400 |
application/json |
ApideckUnifySdk.Models.Errors.UnauthorizedResponse |
401 |
application/json |
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse |
402 |
application/json |
ApideckUnifySdk.Models.Errors.NotFoundResponse |
404 |
application/json |
ApideckUnifySdk.Models.Errors.UnprocessableResponse |
422 |
application/json |
ApideckUnifySdk.Models.Errors.APIException |
4XX, 5XX |
*/* |
Get Expense
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
AccountingExpensesOneRequest req = new AccountingExpensesOneRequest() {
Id = "<id>",
ServiceId = "salesforce",
};
var res = await sdk.Accounting.Expenses.GetAsync(req);
// handle response
AccountingExpensesOneResponse
Error Type |
Status Code |
Content Type |
ApideckUnifySdk.Models.Errors.BadRequestResponse |
400 |
application/json |
ApideckUnifySdk.Models.Errors.UnauthorizedResponse |
401 |
application/json |
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse |
402 |
application/json |
ApideckUnifySdk.Models.Errors.NotFoundResponse |
404 |
application/json |
ApideckUnifySdk.Models.Errors.UnprocessableResponse |
422 |
application/json |
ApideckUnifySdk.Models.Errors.APIException |
4XX, 5XX |
*/* |
Update Expense
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System;
using System.Collections.Generic;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
AccountingExpensesUpdateRequest req = new AccountingExpensesUpdateRequest() {
Id = "<id>",
Expense = new ExpenseInput() {
Number = "OIT00546",
TransactionDate = System.DateTime.Parse("2021-05-01T12:00:00.000Z"),
AccountId = "123456",
CustomerId = "12345",
SupplierId = "12345",
CompanyId = "12345",
DepartmentId = "12345",
PaymentType = ExpensePaymentType.Cash,
Currency = Currency.Usd,
CurrencyRate = 0.69D,
Type = ExpenseType.Expense,
Memo = "For travel expenses incurred on 2024-05-15",
TaxRate = new LinkedTaxRateInput() {
Id = "123456",
Rate = 10D,
},
TotalAmount = 275D,
LineItems = new List<ExpenseLineItemInput>() {
new ExpenseLineItemInput() {
TrackingCategories = new List<LinkedTrackingCategory>() {
new LinkedTrackingCategory() {
Id = "123456",
Name = "New York",
},
},
AccountId = "123456",
CustomerId = "12345",
DepartmentId = "12345",
LocationId = "12345",
TaxRate = new LinkedTaxRateInput() {
Id = "123456",
Rate = 10D,
},
Description = "Travel US.",
TotalAmount = 275D,
Billable = true,
},
},
CustomFields = new List<CustomField>() {
new CustomField() {
Id = "2389328923893298",
Name = "employee_level",
Description = "Employee Level",
Value = Value.CreateArrayOf6(
new List<Six>() {
new Six() {},
}
),
},
},
RowVersion = "1-12345",
PassThrough = new List<PassThroughBody>() {
new PassThroughBody() {
ServiceId = "<id>",
ExtendPaths = new List<ExtendPaths>() {
new ExtendPaths() {
Path = "$.nested.property",
Value = new Dictionary<string, object>() {
{ "TaxClassificationRef", new Dictionary<string, object>() {
{ "value", "EUC-99990201-V1-00020000" },
} },
},
},
},
},
},
},
ServiceId = "salesforce",
};
var res = await sdk.Accounting.Expenses.UpdateAsync(req);
// handle response
AccountingExpensesUpdateResponse
Error Type |
Status Code |
Content Type |
ApideckUnifySdk.Models.Errors.BadRequestResponse |
400 |
application/json |
ApideckUnifySdk.Models.Errors.UnauthorizedResponse |
401 |
application/json |
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse |
402 |
application/json |
ApideckUnifySdk.Models.Errors.NotFoundResponse |
404 |
application/json |
ApideckUnifySdk.Models.Errors.UnprocessableResponse |
422 |
application/json |
ApideckUnifySdk.Models.Errors.APIException |
4XX, 5XX |
*/* |
Delete Expense
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
AccountingExpensesDeleteRequest req = new AccountingExpensesDeleteRequest() {
Id = "<id>",
ServiceId = "salesforce",
};
var res = await sdk.Accounting.Expenses.DeleteAsync(req);
// handle response
AccountingExpensesDeleteResponse
Error Type |
Status Code |
Content Type |
ApideckUnifySdk.Models.Errors.BadRequestResponse |
400 |
application/json |
ApideckUnifySdk.Models.Errors.UnauthorizedResponse |
401 |
application/json |
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse |
402 |
application/json |
ApideckUnifySdk.Models.Errors.NotFoundResponse |
404 |
application/json |
ApideckUnifySdk.Models.Errors.UnprocessableResponse |
422 |
application/json |
ApideckUnifySdk.Models.Errors.APIException |
4XX, 5XX |
*/* |