Skip to content

Latest commit

 

History

History
145 lines (108 loc) · 7.33 KB

README.md

File metadata and controls

145 lines (108 loc) · 7.33 KB

Products

(ecommerce().products())

Overview

Available Operations

  • list - List Products
  • get - Get Product

list

List Products

Example Usage

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.EcommerceProductsAllRequest;
import com.apideck.unify.models.operations.EcommerceProductsAllResponse;
import java.lang.Exception;
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_API_KEY_HERE>")
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
            .build();

        EcommerceProductsAllRequest req = EcommerceProductsAllRequest.builder()
                .serviceId("salesforce")
                .passThrough(Map.ofEntries(
                    Map.entry("search", "San Francisco")))
                .fields("id,updated_at")
                .build();

        EcommerceProductsAllResponse res = sdk.ecommerce().products().list()
                .request(req)
                .call();

        if (res.getProductsResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

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

Response

EcommerceProductsAllResponse

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 Product

Example Usage

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.EcommerceProductsOneRequest;
import com.apideck.unify.models.operations.EcommerceProductsOneResponse;
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_API_KEY_HERE>")
                .consumerId("test-consumer")
                .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
            .build();

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

        EcommerceProductsOneResponse res = sdk.ecommerce().products().get()
                .request(req)
                .call();

        if (res.getProductResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

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

Response

EcommerceProductsOneResponse

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