Convious Pricing API Client

A Java client library that is meant to simplify communication with the Convious pricing API.

Лицензия

Лицензия

Категории

Категории

CLI Взаимодействие с пользователем
Группа

Группа

com.convious
Идентификатор

Идентификатор

pricing-api-client
Последняя версия

Последняя версия

1.0.8
Дата

Дата

Тип

Тип

jar
Описание

Описание

Convious Pricing API Client
A Java client library that is meant to simplify communication with the Convious pricing API.
Ссылка на сайт

Ссылка на сайт

https://github.com/Convious/pricing-api-client-java
Организация-разработчик

Организация-разработчик

Convious
Система контроля версий

Система контроля версий

https://github.com/Convious/pricing-api-client-java

Скачать pricing-api-client

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.convious/pricing-api-client/ -->
<dependency>
    <groupId>com.convious</groupId>
    <artifactId>pricing-api-client</artifactId>
    <version>1.0.8</version>
</dependency>
// https://jarcasting.com/artifacts/com.convious/pricing-api-client/
implementation 'com.convious:pricing-api-client:1.0.8'
// https://jarcasting.com/artifacts/com.convious/pricing-api-client/
implementation ("com.convious:pricing-api-client:1.0.8")
'com.convious:pricing-api-client:jar:1.0.8'
<dependency org="com.convious" name="pricing-api-client" rev="1.0.8">
  <artifact name="pricing-api-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.convious', module='pricing-api-client', version='1.0.8')
)
libraryDependencies += "com.convious" % "pricing-api-client" % "1.0.8"
[com.convious/pricing-api-client "1.0.8"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
com.google.code.gson : gson jar 2.8.5

test (4)

Идентификатор библиотеки Тип Версия
io.undertow : undertow-core jar [2.0.23,)
org.junit.jupiter : junit-jupiter-api jar 5.5.2
org.junit.jupiter : junit-jupiter-engine jar 5.5.2
org.mockito : mockito-all jar 1.9.5

Модули Проекта

Данный проект не имеет модулей.

Convious Pricing API Java client

A Java client library that is meant to simplify communication with the Convious pricing API.

Installation

Maven

<dependency>
    <groupId>com.convious</groupId>
    <artifactId>pricing-api-client</artifactId>
    <version>1.0</version>
</dependency>

Gradle

implementation 'com.convious:pricing-api-client:1.0.0'

SBT

libraryDependencies += "com.convious" % "pricing-api-client" % "1.0.0"

Usage

Create API client using your clientId and clientSecret:

var client = PricingApiClient.create(clientId, clientSecret);

Then you can use the client to either post events that communicate changes of your inventory or to retrieve the prices for any of the products. The client has 2 flavours of methods: synchronous and asynchronous (methods end with Async suffix and instead of result return CompletableFuture)

Posting inventory events

You can either post a single event using postEvent(Async) or post them in batches using postEvents(Async) (the latter is recommended)`:

client.postEvents(
    new InventoryEvent[] {
        new ProductCreated(
            "productReference",
            "Product name",
            3,
            new ProductPricing(
                new BigDecimal("10.00"),
                new BigDecimal("20.00"),
                new BigDecimal("15.00"),
                new BigDecimal("22.00"),
            )
        ),
        new ProductPricingChanged(
            "productReference",
            new ProductPricing(
                new BigDecimal("10.50"),
                new BigDecimal("20.50"),
                new BigDecimal("15.50"),
                new BigDecimal("22.50"),
            )
        ),
        new ProductAvailabilityChanged(
            "productReference",
            LocalDate.of(2019, 10, 10),
            "10:00:00",
            3
        ),
        new ProductRemoved(
            "productReference"
        ),
    }
);

Getting prices

You can get the prices of your inventory using getPrices(Async):

var request = new PricingRequest(
    "cookie id",
    "127.0.0.1",
    LocalDate.of(2019, 10, 1),
    LocalDate.of(2019, 10, 30),
    "Europe/Amsterdam",
    new PricingRequestProduct[] {
        new PricingRequestProduct("productReference", 2),
        new PricingRequestProduct("productReference2", 1),
    },
    new String[] { "10:00:00", "10:30:00", "12:00:00" }
);
var prices = client.getPrices(request);

License

This library is licensed under MIT. Full license text is available in LICENSE.

com.convious

convious

Версии библиотеки

Версия
1.0.8
1.0.7
1.0.5
1.0.3
1.0.1
1.0