(accounting().locations())
- list - List Locations
- create - Create Location
- get - Get Location
- update - Update Location
- delete - Delete Location
List Locations
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.AccountingLocationsFilter;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.AccountingLocationsAllRequest;
import com.apideck.unify.models.operations.AccountingLocationsAllResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
AccountingLocationsAllRequest req = AccountingLocationsAllRequest.builder()
.serviceId("salesforce")
.fields("id,updated_at")
.filter(AccountingLocationsFilter.builder()
.subsidiary("1")
.build())
.build();
AccountingLocationsAllResponse res = sdk.accounting().locations().list()
.request(req)
.call();
if (res.getAccountingLocationsResponse().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
AccountingLocationsAllRequest | ✔️ | The request object to use for the request. |
AccountingLocationsAllResponse
Error Type | Status Code | Content Type |
---|---|---|
models/errors/BadRequestResponse | 400 | application/json |
models/errors/UnauthorizedResponse | 401 | application/json |
models/errors/PaymentRequiredResponse | 402 | application/json |
models/errors/NotFoundResponse | 404 | application/json |
models/errors/UnprocessableResponse | 422 | application/json |
models/errors/APIException | 4XX, 5XX | */* |
Create Location
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.AccountingLocationInput;
import com.apideck.unify.models.components.Address;
import com.apideck.unify.models.components.ExtendPaths;
import com.apideck.unify.models.components.LocationStatus;
import com.apideck.unify.models.components.PassThroughBody;
import com.apideck.unify.models.components.SubsidiaryReferenceInput;
import com.apideck.unify.models.components.Type;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.AccountingLocationsAddRequest;
import com.apideck.unify.models.operations.AccountingLocationsAddResponse;
import java.lang.Exception;
import java.util.List;
import java.util.Map;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
AccountingLocationsAddRequest req = AccountingLocationsAddRequest.builder()
.accountingLocation(AccountingLocationInput.builder()
.parentId("12345")
.companyName("SpaceX")
.displayName("11 UT - South Jordan")
.status(LocationStatus.ACTIVE)
.addresses(List.of(
Address.builder()
.id("123")
.type(Type.PRIMARY)
.string("25 Spring Street, Blackburn, VIC 3130")
.name("HQ US")
.line1("Main street")
.line2("apt #")
.line3("Suite #")
.line4("delivery instructions")
.streetNumber("25")
.city("San Francisco")
.state("CA")
.postalCode("94104")
.country("US")
.latitude("40.759211")
.longitude("-73.984638")
.county("Santa Clara")
.contactName("Elon Musk")
.salutation("Mr")
.phoneNumber("111-111-1111")
.fax("122-111-1111")
.email("[email protected]")
.website("https://elonmusk.com")
.notes("Address notes or delivery instructions.")
.rowVersion("1-12345")
.build()))
.subsidiaries(List.of(
SubsidiaryReferenceInput.builder()
.name("SpaceX")
.build(),
SubsidiaryReferenceInput.builder()
.name("SpaceX")
.build()))
.rowVersion("1-12345")
.passThrough(List.of(
PassThroughBody.builder()
.serviceId("<id>")
.extendPaths(List.of(
ExtendPaths.builder()
.path("$.nested.property")
.value(Map.ofEntries(\n Map.entry("TaxClassificationRef", Map.ofEntries(\n Map.entry("value", "EUC-99990201-V1-00020000")))))
.build()))
.build()))
.build())
.serviceId("salesforce")
.build();
AccountingLocationsAddResponse res = sdk.accounting().locations().create()
.request(req)
.call();
if (res.createAccountingLocationResponse().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
AccountingLocationsAddRequest | ✔️ | The request object to use for the request. |
AccountingLocationsAddResponse
Error Type | Status Code | Content Type |
---|---|---|
models/errors/BadRequestResponse | 400 | application/json |
models/errors/UnauthorizedResponse | 401 | application/json |
models/errors/PaymentRequiredResponse | 402 | application/json |
models/errors/NotFoundResponse | 404 | application/json |
models/errors/UnprocessableResponse | 422 | application/json |
models/errors/APIException | 4XX, 5XX | */* |
Get Location
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.AccountingLocationsOneRequest;
import com.apideck.unify.models.operations.AccountingLocationsOneResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
AccountingLocationsOneRequest req = AccountingLocationsOneRequest.builder()
.id("<id>")
.serviceId("salesforce")
.fields("id,updated_at")
.build();
AccountingLocationsOneResponse res = sdk.accounting().locations().get()
.request(req)
.call();
if (res.getAccountingLocationResponse().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
AccountingLocationsOneRequest | ✔️ | The request object to use for the request. |
AccountingLocationsOneResponse
Error Type | Status Code | Content Type |
---|---|---|
models/errors/BadRequestResponse | 400 | application/json |
models/errors/UnauthorizedResponse | 401 | application/json |
models/errors/PaymentRequiredResponse | 402 | application/json |
models/errors/NotFoundResponse | 404 | application/json |
models/errors/UnprocessableResponse | 422 | application/json |
models/errors/APIException | 4XX, 5XX | */* |
Update Location
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.AccountingLocationInput;
import com.apideck.unify.models.components.Address;
import com.apideck.unify.models.components.ExtendPaths;
import com.apideck.unify.models.components.LocationStatus;
import com.apideck.unify.models.components.PassThroughBody;
import com.apideck.unify.models.components.SubsidiaryReferenceInput;
import com.apideck.unify.models.components.Type;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.AccountingLocationsUpdateRequest;
import com.apideck.unify.models.operations.AccountingLocationsUpdateResponse;
import java.lang.Exception;
import java.util.List;
import java.util.Map;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
AccountingLocationsUpdateRequest req = AccountingLocationsUpdateRequest.builder()
.id("<id>")
.accountingLocation(AccountingLocationInput.builder()
.parentId("12345")
.companyName("SpaceX")
.displayName("11 UT - South Jordan")
.status(LocationStatus.ACTIVE)
.addresses(List.of(
Address.builder()
.id("123")
.type(Type.PRIMARY)
.string("25 Spring Street, Blackburn, VIC 3130")
.name("HQ US")
.line1("Main street")
.line2("apt #")
.line3("Suite #")
.line4("delivery instructions")
.streetNumber("25")
.city("San Francisco")
.state("CA")
.postalCode("94104")
.country("US")
.latitude("40.759211")
.longitude("-73.984638")
.county("Santa Clara")
.contactName("Elon Musk")
.salutation("Mr")
.phoneNumber("111-111-1111")
.fax("122-111-1111")
.email("[email protected]")
.website("https://elonmusk.com")
.notes("Address notes or delivery instructions.")
.rowVersion("1-12345")
.build(),
Address.builder()
.id("123")
.type(Type.PRIMARY)
.string("25 Spring Street, Blackburn, VIC 3130")
.name("HQ US")
.line1("Main street")
.line2("apt #")
.line3("Suite #")
.line4("delivery instructions")
.streetNumber("25")
.city("San Francisco")
.state("CA")
.postalCode("94104")
.country("US")
.latitude("40.759211")
.longitude("-73.984638")
.county("Santa Clara")
.contactName("Elon Musk")
.salutation("Mr")
.phoneNumber("111-111-1111")
.fax("122-111-1111")
.email("[email protected]")
.website("https://elonmusk.com")
.notes("Address notes or delivery instructions.")
.rowVersion("1-12345")
.build(),
Address.builder()
.id("123")
.type(Type.PRIMARY)
.string("25 Spring Street, Blackburn, VIC 3130")
.name("HQ US")
.line1("Main street")
.line2("apt #")
.line3("Suite #")
.line4("delivery instructions")
.streetNumber("25")
.city("San Francisco")
.state("CA")
.postalCode("94104")
.country("US")
.latitude("40.759211")
.longitude("-73.984638")
.county("Santa Clara")
.contactName("Elon Musk")
.salutation("Mr")
.phoneNumber("111-111-1111")
.fax("122-111-1111")
.email("[email protected]")
.website("https://elonmusk.com")
.notes("Address notes or delivery instructions.")
.rowVersion("1-12345")
.build()))
.subsidiaries(List.of(
SubsidiaryReferenceInput.builder()
.name("SpaceX")
.build(),
SubsidiaryReferenceInput.builder()
.name("SpaceX")
.build()))
.rowVersion("1-12345")
.passThrough(List.of(
PassThroughBody.builder()
.serviceId("<id>")
.extendPaths(List.of(
ExtendPaths.builder()
.path("$.nested.property")
.value(Map.ofEntries(\n Map.entry("TaxClassificationRef", Map.ofEntries(\n Map.entry("value", "EUC-99990201-V1-00020000")))))
.build(),
ExtendPaths.builder()
.path("$.nested.property")
.value(Map.ofEntries(\n Map.entry("TaxClassificationRef", Map.ofEntries(\n Map.entry("value", "EUC-99990201-V1-00020000")))))
.build(),
ExtendPaths.builder()
.path("$.nested.property")
.value(Map.ofEntries(\n Map.entry("TaxClassificationRef", Map.ofEntries(\n Map.entry("value", "EUC-99990201-V1-00020000")))))
.build()))
.build()))
.build())
.serviceId("salesforce")
.build();
AccountingLocationsUpdateResponse res = sdk.accounting().locations().update()
.request(req)
.call();
if (res.updateAccountingLocationResponse().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
AccountingLocationsUpdateRequest | ✔️ | The request object to use for the request. |
AccountingLocationsUpdateResponse
Error Type | Status Code | Content Type |
---|---|---|
models/errors/BadRequestResponse | 400 | application/json |
models/errors/UnauthorizedResponse | 401 | application/json |
models/errors/PaymentRequiredResponse | 402 | application/json |
models/errors/NotFoundResponse | 404 | application/json |
models/errors/UnprocessableResponse | 422 | application/json |
models/errors/APIException | 4XX, 5XX | */* |
Delete Location
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.AccountingLocationsDeleteRequest;
import com.apideck.unify.models.operations.AccountingLocationsDeleteResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
AccountingLocationsDeleteRequest req = AccountingLocationsDeleteRequest.builder()
.id("<id>")
.serviceId("salesforce")
.build();
AccountingLocationsDeleteResponse res = sdk.accounting().locations().delete()
.request(req)
.call();
if (res.deleteAccountingLocationResponse().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
AccountingLocationsDeleteRequest | ✔️ | The request object to use for the request. |
AccountingLocationsDeleteResponse
Error Type | Status Code | Content Type |
---|---|---|
models/errors/BadRequestResponse | 400 | application/json |
models/errors/UnauthorizedResponse | 401 | application/json |
models/errors/PaymentRequiredResponse | 402 | application/json |
models/errors/NotFoundResponse | 404 | application/json |
models/errors/UnprocessableResponse | 422 | application/json |
models/errors/APIException | 4XX, 5XX | */* |