Skip to content

Files

Latest commit

 

History

History
234 lines (171 loc) · 6.65 KB

ProductsApi.md

File metadata and controls

234 lines (171 loc) · 6.65 KB

ProductsApi

All URIs are relative to https://{customerId}.billabear.cloud/api/v1

Method HTTP request Description
createProduct POST /product Create
listProduct GET /product List
showProductById GET /product/{productId} Detail
updateProduct PUT /product/{productId} Update

createProduct

createProduct(body)

Create

Create a product

Example

// Import classes:
//import com.billabear.sdk.invoker.ApiClient;
//import com.billabear.sdk.invoker.ApiException;
//import com.billabear.sdk.invoker.Configuration;
//import com.billabear.sdk.invoker.auth.*;
//import com.billabear.sdk.api.ProductsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

ProductsApi apiInstance = new ProductsApi();
Product body = new Product(); // Product | 
try {
    apiInstance.createProduct(body);
} catch (ApiException e) {
    System.err.println("Exception when calling ProductsApi#createProduct");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body Product

Return type

null (empty response body)

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

listProduct

InlineResponse20010 listProduct(limit, lastKey, name)

List

List all products

Example

// Import classes:
//import com.billabear.sdk.invoker.ApiClient;
//import com.billabear.sdk.invoker.ApiException;
//import com.billabear.sdk.invoker.Configuration;
//import com.billabear.sdk.invoker.auth.*;
//import com.billabear.sdk.api.ProductsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

ProductsApi apiInstance = new ProductsApi();
Integer limit = 56; // Integer | How many items to return at one time (max 100)
String lastKey = "lastKey_example"; // String | The key to be used in pagination to say what the last key of the previous page was
String name = "name_example"; // String | The name to search for
try {
    InlineResponse20010 result = apiInstance.listProduct(limit, lastKey, name);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ProductsApi#listProduct");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
limit Integer How many items to return at one time (max 100) [optional]
lastKey String The key to be used in pagination to say what the last key of the previous page was [optional]
name String The name to search for [optional]

Return type

InlineResponse20010

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

showProductById

Product showProductById(productId)

Detail

Info for a specific product

Example

// Import classes:
//import com.billabear.sdk.invoker.ApiClient;
//import com.billabear.sdk.invoker.ApiException;
//import com.billabear.sdk.invoker.Configuration;
//import com.billabear.sdk.invoker.auth.*;
//import com.billabear.sdk.api.ProductsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

ProductsApi apiInstance = new ProductsApi();
String productId = "productId_example"; // String | The id of the product to retrieve
try {
    Product result = apiInstance.showProductById(productId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ProductsApi#showProductById");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
productId String The id of the product to retrieve

Return type

Product

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

updateProduct

Product updateProduct(productId)

Update

Update a product

Example

// Import classes:
//import com.billabear.sdk.invoker.ApiClient;
//import com.billabear.sdk.invoker.ApiException;
//import com.billabear.sdk.invoker.Configuration;
//import com.billabear.sdk.invoker.auth.*;
//import com.billabear.sdk.api.ProductsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");

ProductsApi apiInstance = new ProductsApi();
String productId = "productId_example"; // String | The id of the product to retrieve
try {
    Product result = apiInstance.updateProduct(productId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ProductsApi#updateProduct");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
productId String The id of the product to retrieve

Return type

Product

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json