(accounting().purchaseOrders())
- list - List Purchase Orders
- create - Create Purchase Order
- get - Get Purchase Order
- update - Update Purchase Order
- delete - Delete Purchase Order
List Purchase Orders
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.PurchaseOrdersFilter;
import com.apideck.unify.models.components.PurchaseOrdersSort;
import com.apideck.unify.models.components.PurchaseOrdersSortBy;
import com.apideck.unify.models.components.SortDirection;
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.AccountingPurchaseOrdersAllRequest;
import java.lang.Exception;
import java.time.OffsetDateTime;
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();
AccountingPurchaseOrdersAllRequest req = AccountingPurchaseOrdersAllRequest.builder()
.serviceId("salesforce")
.passThrough(Map.ofEntries(
Map.entry("search", "San Francisco")))
.filter(PurchaseOrdersFilter.builder()
.updatedSince(OffsetDateTime.parse("2020-09-30T07:43:32.000Z"))
.supplierId("1234")
.build())
.sort(PurchaseOrdersSort.builder()
.by(PurchaseOrdersSortBy.UPDATED_AT)
.direction(SortDirection.DESC)
.build())
.build();
sdk.accounting().purchaseOrders().list()
.request(req)
.callAsStream()
.forEach(item -> {
// handle item
});
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
AccountingPurchaseOrdersAllRequest | ✔️ | The request object to use for the request. |
AccountingPurchaseOrdersAllResponse
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 Purchase Order
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.AccountType;
import com.apideck.unify.models.components.Address;
import com.apideck.unify.models.components.BankAccount;
import com.apideck.unify.models.components.Currency;
import com.apideck.unify.models.components.CustomField;
import com.apideck.unify.models.components.ExtendPaths;
import com.apideck.unify.models.components.InvoiceLineItemInput;
import com.apideck.unify.models.components.InvoiceLineItemType;
import com.apideck.unify.models.components.LinkedInvoiceItem;
import com.apideck.unify.models.components.LinkedLedgerAccountInput;
import com.apideck.unify.models.components.LinkedSupplierInput;
import com.apideck.unify.models.components.LinkedTaxRateInput;
import com.apideck.unify.models.components.LinkedTrackingCategory;
import com.apideck.unify.models.components.PassThroughBody;
import com.apideck.unify.models.components.PurchaseOrderInput;
import com.apideck.unify.models.components.PurchaseOrderStatus;
import com.apideck.unify.models.components.Type;
import com.apideck.unify.models.components.Value;
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.AccountingPurchaseOrdersAddRequest;
import com.apideck.unify.models.operations.AccountingPurchaseOrdersAddResponse;
import java.lang.Exception;
import java.time.LocalDate;
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();
AccountingPurchaseOrdersAddRequest req = AccountingPurchaseOrdersAddRequest.builder()
.purchaseOrder(PurchaseOrderInput.builder()
.poNumber("90000117")
.reference("123456")
.supplier(LinkedSupplierInput.builder()
.id("12345")
.displayName("Windsurf Shop")
.address(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("elon@musk.com")
.website("https://elonmusk.com")
.notes("Address notes or delivery instructions.")
.rowVersion("1-12345")
.build())
.build())
.companyId("12345")
.status(PurchaseOrderStatus.OPEN)
.issuedDate(LocalDate.parse("2020-09-30"))
.deliveryDate(LocalDate.parse("2020-09-30"))
.expectedArrivalDate(LocalDate.parse("2020-09-30"))
.currency(Currency.USD)
.currencyRate(0.69d)
.subTotal(27500d)
.totalTax(2500d)
.total(27500d)
.taxInclusive(true)
.lineItems(List.of(
InvoiceLineItemInput.builder()
.id("12345")
.rowId("12345")
.code("120-C")
.lineNumber(1L)
.description("Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.")
.type(InvoiceLineItemType.SALES_ITEM)
.taxAmount(27500d)
.totalAmount(27500d)
.quantity(1d)
.unitPrice(27500.5d)
.unitOfMeasure("pc.")
.discountPercentage(0.01d)
.discountAmount(19.99d)
.locationId("1234")
.departmentId("1234")
.item(LinkedInvoiceItem.builder()
.id("12344")
.code("120-C")
.name("Model Y")
.build())
.taxRate(LinkedTaxRateInput.builder()
.id("123456")
.rate(10d)
.build())
.trackingCategories(List.of(
LinkedTrackingCategory.builder()
.id("123456")
.name("New York")
.build(),
LinkedTrackingCategory.builder()
.id("123456")
.name("New York")
.build()))
.ledgerAccount(LinkedLedgerAccountInput.builder()
.id("123456")
.nominalCode("N091")
.code("453")
.build())
.customFields(List.of(
CustomField.builder()
.id("2389328923893298")
.name("employee_level")
.description("Employee Level")
.value(Value.of("Uses Salesforce and Marketo"))
.build()))
.rowVersion("1-12345")
.build()))
.shippingAddress(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("elon@musk.com")
.website("https://elonmusk.com")
.notes("Address notes or delivery instructions.")
.rowVersion("1-12345")
.build())
.ledgerAccount(LinkedLedgerAccountInput.builder()
.id("123456")
.nominalCode("N091")
.code("453")
.build())
.templateId("123456")
.discountPercentage(5.5d)
.bankAccount(BankAccount.builder()
.bankName("Monzo")
.accountNumber("123465")
.accountName("SPACEX LLC")
.accountType(AccountType.CREDIT_CARD)
.iban("CH2989144532982975332")
.bic("AUDSCHGGXXX")
.routingNumber("012345678")
.bsbNumber("062-001")
.branchIdentifier("001")
.bankCode("BNH")
.currency(Currency.USD)
.build())
.accountingByRow(false)
.dueDate(LocalDate.parse("2020-10-30"))
.paymentMethod("cash")
.taxCode("1234")
.channel("email")
.memo("Thank you for the partnership and have a great day!")
.trackingCategories(List.of(
LinkedTrackingCategory.builder()
.id("123456")
.name("New York")
.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(),
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(),
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();
AccountingPurchaseOrdersAddResponse res = sdk.accounting().purchaseOrders().create()
.request(req)
.call();
if (res.createPurchaseOrderResponse().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
AccountingPurchaseOrdersAddRequest | ✔️ | The request object to use for the request. |
AccountingPurchaseOrdersAddResponse
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 Purchase Order
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.AccountingPurchaseOrdersOneRequest;
import com.apideck.unify.models.operations.AccountingPurchaseOrdersOneResponse;
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();
AccountingPurchaseOrdersOneRequest req = AccountingPurchaseOrdersOneRequest.builder()
.id("<id>")
.serviceId("salesforce")
.build();
AccountingPurchaseOrdersOneResponse res = sdk.accounting().purchaseOrders().get()
.request(req)
.call();
if (res.getPurchaseOrderResponse().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
AccountingPurchaseOrdersOneRequest | ✔️ | The request object to use for the request. |
AccountingPurchaseOrdersOneResponse
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 Purchase Order
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.AccountType;
import com.apideck.unify.models.components.Address;
import com.apideck.unify.models.components.BankAccount;
import com.apideck.unify.models.components.Currency;
import com.apideck.unify.models.components.CustomField;
import com.apideck.unify.models.components.ExtendPaths;
import com.apideck.unify.models.components.InvoiceLineItemInput;
import com.apideck.unify.models.components.InvoiceLineItemType;
import com.apideck.unify.models.components.LinkedInvoiceItem;
import com.apideck.unify.models.components.LinkedLedgerAccountInput;
import com.apideck.unify.models.components.LinkedSupplierInput;
import com.apideck.unify.models.components.LinkedTaxRateInput;
import com.apideck.unify.models.components.LinkedTrackingCategory;
import com.apideck.unify.models.components.PassThroughBody;
import com.apideck.unify.models.components.PurchaseOrderInput;
import com.apideck.unify.models.components.PurchaseOrderStatus;
import com.apideck.unify.models.components.Six;
import com.apideck.unify.models.components.Type;
import com.apideck.unify.models.components.Value;
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.AccountingPurchaseOrdersUpdateRequest;
import com.apideck.unify.models.operations.AccountingPurchaseOrdersUpdateResponse;
import java.lang.Exception;
import java.time.LocalDate;
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();
AccountingPurchaseOrdersUpdateRequest req = AccountingPurchaseOrdersUpdateRequest.builder()
.id("<id>")
.purchaseOrder(PurchaseOrderInput.builder()
.poNumber("90000117")
.reference("123456")
.supplier(LinkedSupplierInput.builder()
.id("12345")
.displayName("Windsurf Shop")
.address(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("elon@musk.com")
.website("https://elonmusk.com")
.notes("Address notes or delivery instructions.")
.rowVersion("1-12345")
.build())
.build())
.companyId("12345")
.status(PurchaseOrderStatus.OPEN)
.issuedDate(LocalDate.parse("2020-09-30"))
.deliveryDate(LocalDate.parse("2020-09-30"))
.expectedArrivalDate(LocalDate.parse("2020-09-30"))
.currency(Currency.USD)
.currencyRate(0.69d)
.subTotal(27500d)
.totalTax(2500d)
.total(27500d)
.taxInclusive(true)
.lineItems(List.of(
InvoiceLineItemInput.builder()
.id("12345")
.rowId("12345")
.code("120-C")
.lineNumber(1L)
.description("Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.")
.type(InvoiceLineItemType.SALES_ITEM)
.taxAmount(27500d)
.totalAmount(27500d)
.quantity(1d)
.unitPrice(27500.5d)
.unitOfMeasure("pc.")
.discountPercentage(0.01d)
.discountAmount(19.99d)
.locationId("1234")
.departmentId("1234")
.item(LinkedInvoiceItem.builder()
.id("12344")
.code("120-C")
.name("Model Y")
.build())
.taxRate(LinkedTaxRateInput.builder()
.id("123456")
.rate(10d)
.build())
.trackingCategories(List.of(
LinkedTrackingCategory.builder()
.id("123456")
.name("New York")
.build(),
LinkedTrackingCategory.builder()
.id("123456")
.name("New York")
.build()))
.ledgerAccount(LinkedLedgerAccountInput.builder()
.id("123456")
.nominalCode("N091")
.code("453")
.build())
.customFields(List.of(
CustomField.builder()
.id("2389328923893298")
.name("employee_level")
.description("Employee Level")
.build()))
.rowVersion("1-12345")
.build(),
InvoiceLineItemInput.builder()
.id("12345")
.rowId("12345")
.code("120-C")
.lineNumber(1L)
.description("Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.")
.type(InvoiceLineItemType.SALES_ITEM)
.taxAmount(27500d)
.totalAmount(27500d)
.quantity(1d)
.unitPrice(27500.5d)
.unitOfMeasure("pc.")
.discountPercentage(0.01d)
.discountAmount(19.99d)
.locationId("1234")
.departmentId("1234")
.item(LinkedInvoiceItem.builder()
.id("12344")
.code("120-C")
.name("Model Y")
.build())
.taxRate(LinkedTaxRateInput.builder()
.id("123456")
.rate(10d)
.build())
.trackingCategories(List.of(
LinkedTrackingCategory.builder()
.id("123456")
.name("New York")
.build()))
.ledgerAccount(LinkedLedgerAccountInput.builder()
.id("123456")
.nominalCode("N091")
.code("453")
.build())
.customFields(List.of(
CustomField.builder()
.id("2389328923893298")
.name("employee_level")
.description("Employee Level")
.value(Value.of("Uses Salesforce and Marketo"))
.build(),
CustomField.builder()
.id("2389328923893298")
.name("employee_level")
.description("Employee Level")
.value(Value.of(true))
.build(),
CustomField.builder()
.id("2389328923893298")
.name("employee_level")
.description("Employee Level")
.value(Value.of(10d))
.build()))
.rowVersion("1-12345")
.build(),
InvoiceLineItemInput.builder()
.id("12345")
.rowId("12345")
.code("120-C")
.lineNumber(1L)
.description("Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.")
.type(InvoiceLineItemType.SALES_ITEM)
.taxAmount(27500d)
.totalAmount(27500d)
.quantity(1d)
.unitPrice(27500.5d)
.unitOfMeasure("pc.")
.discountPercentage(0.01d)
.discountAmount(19.99d)
.locationId("1234")
.departmentId("1234")
.item(LinkedInvoiceItem.builder()
.id("12344")
.code("120-C")
.name("Model Y")
.build())
.taxRate(LinkedTaxRateInput.builder()
.id("123456")
.rate(10d)
.build())
.trackingCategories(List.of(
LinkedTrackingCategory.builder()
.id("123456")
.name("New York")
.build()))
.ledgerAccount(LinkedLedgerAccountInput.builder()
.id("123456")
.nominalCode("N091")
.code("453")
.build())
.customFields(List.of(
CustomField.builder()
.id("2389328923893298")
.name("employee_level")
.description("Employee Level")
.value(Value.of6(List.of(
Six.builder()
.build())))
.build()))
.rowVersion("1-12345")
.build()))
.shippingAddress(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("elon@musk.com")
.website("https://elonmusk.com")
.notes("Address notes or delivery instructions.")
.rowVersion("1-12345")
.build())
.ledgerAccount(LinkedLedgerAccountInput.builder()
.id("123456")
.nominalCode("N091")
.code("453")
.build())
.templateId("123456")
.discountPercentage(5.5d)
.bankAccount(BankAccount.builder()
.bankName("Monzo")
.accountNumber("123465")
.accountName("SPACEX LLC")
.accountType(AccountType.CREDIT_CARD)
.iban("CH2989144532982975332")
.bic("AUDSCHGGXXX")
.routingNumber("012345678")
.bsbNumber("062-001")
.branchIdentifier("001")
.bankCode("BNH")
.currency(Currency.USD)
.build())
.accountingByRow(false)
.dueDate(LocalDate.parse("2020-10-30"))
.paymentMethod("cash")
.taxCode("1234")
.channel("email")
.memo("Thank you for the partnership and have a great day!")
.trackingCategories(List.of(
LinkedTrackingCategory.builder()
.id("123456")
.name("New York")
.build(),
LinkedTrackingCategory.builder()
.id("123456")
.name("New York")
.build(),
LinkedTrackingCategory.builder()
.id("123456")
.name("New York")
.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(),
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(),
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();
AccountingPurchaseOrdersUpdateResponse res = sdk.accounting().purchaseOrders().update()
.request(req)
.call();
if (res.updatePurchaseOrderResponse().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
AccountingPurchaseOrdersUpdateRequest | ✔️ | The request object to use for the request. |
AccountingPurchaseOrdersUpdateResponse
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 Purchase Order
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.AccountingPurchaseOrdersDeleteRequest;
import com.apideck.unify.models.operations.AccountingPurchaseOrdersDeleteResponse;
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();
AccountingPurchaseOrdersDeleteRequest req = AccountingPurchaseOrdersDeleteRequest.builder()
.id("<id>")
.serviceId("salesforce")
.build();
AccountingPurchaseOrdersDeleteResponse res = sdk.accounting().purchaseOrders().delete()
.request(req)
.call();
if (res.deletePurchaseOrderResponse().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
AccountingPurchaseOrdersDeleteRequest | ✔️ | The request object to use for the request. |
AccountingPurchaseOrdersDeleteResponse
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 | */* |