(Accounting.TaxRates)
List Tax Rates. Note: Not all connectors return the actual rate/percentage value. In this case, only the tax code or reference is returned. Connectors Affected: Quickbooks
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
AccountingTaxRatesAllRequest req = new AccountingTaxRatesAllRequest() {
ServiceId = "salesforce",
Filter = new TaxRatesFilter() {
Assets = true,
Equity = true,
Expenses = true,
Liabilities = true,
Revenue = true,
},
PassThrough = new Dictionary<string, object>() {
{ "search", "San Francisco" },
},
Fields = "id,updated_at",
};
AccountingTaxRatesAllResponse? res = await sdk.Accounting.TaxRates.ListAsync(req);
while(res != null)
{
// handle items
res = await res.Next!();
}
AccountingTaxRatesAllResponse
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 Tax Rate
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
AccountingTaxRatesAddRequest req = new AccountingTaxRatesAddRequest() {
TaxRate = new TaxRateInput() {
Id = "1234",
Name = "GST on Purchases",
Code = "ABN",
Description = "Reduced rate GST Purchases",
EffectiveTaxRate = 10D,
TotalTaxRate = 10D,
TaxPayableAccountId = "123456",
TaxRemittedAccountId = "123456",
Components = new List<Components>() {
new Components() {
Id = "10",
Name = "GST",
Rate = 10D,
Compound = true,
},
},
Type = "NONE",
ReportTaxType = "NONE",
OriginalTaxRateId = "12345",
Status = TaxRateStatus.Active,
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" },
} },
},
},
},
},
},
CustomFields = new List<CustomField>() {
new CustomField() {
Id = "2389328923893298",
Name = "employee_level",
Description = "Employee Level",
Value = Value.CreateBoolean(
true
),
},
},
},
ServiceId = "salesforce",
};
var res = await sdk.Accounting.TaxRates.CreateAsync(req);
// handle response
AccountingTaxRatesAddResponse
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 Tax Rate. Note: Not all connectors return the actual rate/percentage value. In this case, only the tax code or reference is returned. Support will soon be added to return the actual rate/percentage by doing additional calls in the background to provide the full view of a given tax rate. Connectors Affected: Quickbooks
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
AccountingTaxRatesOneRequest req = new AccountingTaxRatesOneRequest() {
Id = "<id>",
ServiceId = "salesforce",
Fields = "id,updated_at",
};
var res = await sdk.Accounting.TaxRates.GetAsync(req);
// handle response
AccountingTaxRatesOneResponse
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 Tax Rate
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
AccountingTaxRatesUpdateRequest req = new AccountingTaxRatesUpdateRequest() {
Id = "<id>",
TaxRate = new TaxRateInput() {
Id = "1234",
Name = "GST on Purchases",
Code = "ABN",
Description = "Reduced rate GST Purchases",
EffectiveTaxRate = 10D,
TotalTaxRate = 10D,
TaxPayableAccountId = "123456",
TaxRemittedAccountId = "123456",
Components = new List<Components>() {
new Components() {
Id = "10",
Name = "GST",
Rate = 10D,
Compound = true,
},
},
Type = "NONE",
ReportTaxType = "NONE",
OriginalTaxRateId = "12345",
Status = TaxRateStatus.Active,
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" },
} },
},
},
},
},
},
CustomFields = new List<CustomField>() {
new CustomField() {
Id = "2389328923893298",
Name = "employee_level",
Description = "Employee Level",
Value = Value.CreateArrayOf6(
new List<Six>() {
new Six() {},
}
),
},
},
},
ServiceId = "salesforce",
};
var res = await sdk.Accounting.TaxRates.UpdateAsync(req);
// handle response
AccountingTaxRatesUpdateResponse
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 Tax Rate
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
AccountingTaxRatesDeleteRequest req = new AccountingTaxRatesDeleteRequest() {
Id = "<id>",
ServiceId = "salesforce",
};
var res = await sdk.Accounting.TaxRates.DeleteAsync(req);
// handle response
AccountingTaxRatesDeleteResponse
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 |
*/* |