Skip to content

Latest commit

 

History

History
571 lines (482 loc) · 30.6 KB

File metadata and controls

571 lines (482 loc) · 30.6 KB

Accounting.BillPayments

Overview

Available Operations

  • list - List Bill Payments
  • create - Create Bill Payment
  • get - Get Bill Payment
  • update - Update Bill Payment
  • delete - Delete Bill Payment

list

List Bill Payments

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.*;
import com.apideck.unify.models.errors.*;
import com.apideck.unify.models.operations.AccountingBillPaymentsAllRequest;
import com.apideck.unify.models.operations.AccountingBillPaymentsAllResponse;
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()
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
                .apiKey(System.getenv().getOrDefault("API_KEY", ""))
            .build();

        AccountingBillPaymentsAllRequest req = AccountingBillPaymentsAllRequest.builder()
                .serviceId("salesforce")
                .companyId("12345")
                .filter(PaymentsFilter.builder()
                    .updatedSince(OffsetDateTime.parse("2020-09-30T07:43:32.000Z"))
                    .invoiceId("123")
                    .build())
                .sort(PaymentsSort.builder()
                    .by(PaymentsSortBy.UPDATED_AT)
                    .direction(SortDirection.DESC)
                    .build())
                .passThrough(Map.ofEntries(
                    Map.entry("search", "San Francisco")))
                .fields("id,updated_at")
                .build();


        sdk.accounting().billPayments().list()
                .callAsStream()
                .forEach((AccountingBillPaymentsAllResponse item) -> {
                   // handle page
                });

    }
}

Parameters

Parameter Type Required Description
request AccountingBillPaymentsAllRequest ✔️ The request object to use for the request.

Response

AccountingBillPaymentsAllResponse

Errors

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

Create Bill Payment

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.*;
import com.apideck.unify.models.errors.*;
import com.apideck.unify.models.operations.AccountingBillPaymentsAddRequest;
import com.apideck.unify.models.operations.AccountingBillPaymentsAddResponse;
import java.lang.Exception;
import java.time.OffsetDateTime;
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()
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
                .apiKey(System.getenv().getOrDefault("API_KEY", ""))
            .build();

        AccountingBillPaymentsAddRequest req = AccountingBillPaymentsAddRequest.builder()
                .billPayment(BillPaymentInput.builder()
                    .totalAmount(49.99)
                    .transactionDate(OffsetDateTime.parse("2021-05-01T12:00:00.000Z"))
                    .currency(Currency.USD)
                    .currencyRate(0.69)
                    .reference("123456")
                    .paymentMethod("cash")
                    .paymentMethodReference("123456")
                    .paymentMethodId("12345")
                    .account(LinkedLedgerAccount.builder()
                        .id("123456")
                        .nominalCode("N091")
                        .code("453")
                        .build())
                    .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")
                    .reconciled(true)
                    .status(PaymentStatus.AUTHORISED)
                    .type(BillPaymentType.ACCOUNTS_PAYABLE)
                    .allocations(List.of(
                        BillPaymentAllocations.builder()
                            .id("12345")
                            .type(BillPaymentAllocationType.BILL)
                            .amount(49.99)
                            .allocationId("123456")
                            .build(),
                        BillPaymentAllocations.builder()
                            .id("12345")
                            .type(BillPaymentAllocationType.BILL)
                            .amount(49.99)
                            .allocationId("123456")
                            .build(),
                        BillPaymentAllocations.builder()
                            .id("12345")
                            .type(BillPaymentAllocationType.BILL)
                            .amount(49.99)
                            .allocationId("123456")
                            .build()))
                    .note("Some notes about this transaction")
                    .number("123456")
                    .trackingCategories(List.of(
                        LinkedTrackingCategory.builder()
                            .id("123456")
                            .name("New York")
                            .build()))
                    .customFields(List.of(
                        CustomField.of(CustomField1.builder()
                            .id("2389328923893298")
                            .name("employee_level")
                            .description("Employee Level")
                            .value(CustomField1Value.of("Uses Salesforce and Marketo"))
                            .build()),
                        CustomField.of(CustomField1.builder()
                            .id("2389328923893298")
                            .name("employee_level")
                            .description("Employee Level")
                            .value(CustomField1Value.of("Uses Salesforce and Marketo"))
                            .build()),
                        CustomField.of(CustomField1.builder()
                            .id("2389328923893298")
                            .name("employee_level")
                            .description("Employee Level")
                            .value(CustomField1Value.of("Uses Salesforce and Marketo"))
                            .build())))
                    .rowVersion("1-12345")
                    .displayId("123456")
                    .passThrough(List.of(
                        PassThroughBody.builder()
                            .serviceId("<id>")
                            .extendPaths(List.of(
                                ExtendPaths.builder()
                                    .path("$.nested.property")
                                    .value(Map.ofEntries(
                                        Map.entry("TaxClassificationRef", Map.ofEntries(
                                            Map.entry("value", "EUC-99990201-V1-00020000")))))
                                    .build(),
                                ExtendPaths.builder()
                                    .path("$.nested.property")
                                    .value(Map.ofEntries(
                                        Map.entry("TaxClassificationRef", Map.ofEntries(
                                            Map.entry("value", "EUC-99990201-V1-00020000")))))
                                    .build(),
                                ExtendPaths.builder()
                                    .path("$.nested.property")
                                    .value(Map.ofEntries(
                                        Map.entry("TaxClassificationRef", Map.ofEntries(
                                            Map.entry("value", "EUC-99990201-V1-00020000")))))
                                    .build()))
                            .build()))
                    .build())
                .serviceId("salesforce")
                .companyId("12345")
                .build();

        AccountingBillPaymentsAddResponse res = sdk.accounting().billPayments().create()
                .request(req)
                .call();

        if (res.createBillPaymentResponse().isPresent()) {
            System.out.println(res.createBillPaymentResponse().get());
        }
    }
}

Parameters

Parameter Type Required Description
request AccountingBillPaymentsAddRequest ✔️ The request object to use for the request.

Response

AccountingBillPaymentsAddResponse

Errors

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

Get Bill Payment

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.*;
import com.apideck.unify.models.operations.AccountingBillPaymentsOneRequest;
import com.apideck.unify.models.operations.AccountingBillPaymentsOneResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {

        Apideck sdk = Apideck.builder()
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
                .apiKey(System.getenv().getOrDefault("API_KEY", ""))
            .build();

        AccountingBillPaymentsOneRequest req = AccountingBillPaymentsOneRequest.builder()
                .id("<id>")
                .serviceId("salesforce")
                .companyId("12345")
                .fields("id,updated_at")
                .build();

        AccountingBillPaymentsOneResponse res = sdk.accounting().billPayments().get()
                .request(req)
                .call();

        if (res.getBillPaymentResponse().isPresent()) {
            System.out.println(res.getBillPaymentResponse().get());
        }
    }
}

Parameters

Parameter Type Required Description
request AccountingBillPaymentsOneRequest ✔️ The request object to use for the request.

Response

AccountingBillPaymentsOneResponse

Errors

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

Update Bill Payment

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.*;
import com.apideck.unify.models.errors.*;
import com.apideck.unify.models.operations.AccountingBillPaymentsUpdateRequest;
import com.apideck.unify.models.operations.AccountingBillPaymentsUpdateResponse;
import java.lang.Exception;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;

public class Application {

    public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {

        Apideck sdk = Apideck.builder()
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
                .apiKey(System.getenv().getOrDefault("API_KEY", ""))
            .build();

        AccountingBillPaymentsUpdateRequest req = AccountingBillPaymentsUpdateRequest.builder()
                .id("<id>")
                .billPayment(BillPaymentInput.builder()
                    .totalAmount(49.99)
                    .transactionDate(OffsetDateTime.parse("2021-05-01T12:00:00.000Z"))
                    .currency(Currency.USD)
                    .currencyRate(0.69)
                    .reference("123456")
                    .paymentMethod("cash")
                    .paymentMethodReference("123456")
                    .paymentMethodId("12345")
                    .account(LinkedLedgerAccount.builder()
                        .id("123456")
                        .nominalCode("N091")
                        .code("453")
                        .build())
                    .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")
                    .reconciled(true)
                    .status(PaymentStatus.AUTHORISED)
                    .type(BillPaymentType.ACCOUNTS_PAYABLE)
                    .allocations(List.of(
                        BillPaymentAllocations.builder()
                            .id("12345")
                            .type(BillPaymentAllocationType.BILL)
                            .amount(49.99)
                            .allocationId("123456")
                            .build(),
                        BillPaymentAllocations.builder()
                            .id("12345")
                            .type(BillPaymentAllocationType.BILL)
                            .amount(49.99)
                            .allocationId("123456")
                            .build(),
                        BillPaymentAllocations.builder()
                            .id("12345")
                            .type(BillPaymentAllocationType.BILL)
                            .amount(49.99)
                            .allocationId("123456")
                            .build()))
                    .note("Some notes about this transaction")
                    .number("123456")
                    .trackingCategories(JsonNullable.of(null))
                    .customFields(List.of(
                        CustomField.of(CustomField1.builder()
                            .id("2389328923893298")
                            .name("employee_level")
                            .description("Employee Level")
                            .value(CustomField1Value.of("Uses Salesforce and Marketo"))
                            .build())))
                    .rowVersion("1-12345")
                    .displayId("123456")
                    .passThrough(List.of(
                        PassThroughBody.builder()
                            .serviceId("<id>")
                            .extendPaths(List.of(
                                ExtendPaths.builder()
                                    .path("$.nested.property")
                                    .value(Map.ofEntries(
                                        Map.entry("TaxClassificationRef", Map.ofEntries(
                                            Map.entry("value", "EUC-99990201-V1-00020000")))))
                                    .build()))
                            .build(),
                        PassThroughBody.builder()
                            .serviceId("<id>")
                            .extendPaths(List.of(
                                ExtendPaths.builder()
                                    .path("$.nested.property")
                                    .value(Map.ofEntries(
                                        Map.entry("TaxClassificationRef", Map.ofEntries(
                                            Map.entry("value", "EUC-99990201-V1-00020000")))))
                                    .build()))
                            .build()))
                    .build())
                .serviceId("salesforce")
                .build();

        AccountingBillPaymentsUpdateResponse res = sdk.accounting().billPayments().update()
                .request(req)
                .call();

        if (res.updateBillPaymentResponse().isPresent()) {
            System.out.println(res.updateBillPaymentResponse().get());
        }
    }
}

Parameters

Parameter Type Required Description
request AccountingBillPaymentsUpdateRequest ✔️ The request object to use for the request.

Response

AccountingBillPaymentsUpdateResponse

Errors

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

Delete Bill Payment

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.*;
import com.apideck.unify.models.operations.AccountingBillPaymentsDeleteRequest;
import com.apideck.unify.models.operations.AccountingBillPaymentsDeleteResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {

        Apideck sdk = Apideck.builder()
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
                .apiKey(System.getenv().getOrDefault("API_KEY", ""))
            .build();

        AccountingBillPaymentsDeleteRequest req = AccountingBillPaymentsDeleteRequest.builder()
                .id("<id>")
                .serviceId("salesforce")
                .build();

        AccountingBillPaymentsDeleteResponse res = sdk.accounting().billPayments().delete()
                .request(req)
                .call();

        if (res.deleteBillPaymentResponse().isPresent()) {
            System.out.println(res.deleteBillPaymentResponse().get());
        }
    }
}

Parameters

Parameter Type Required Description
request AccountingBillPaymentsDeleteRequest ✔️ The request object to use for the request.

Response

AccountingBillPaymentsDeleteResponse

Errors

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 */*