Coroutine-native client covering the full Hanzo /v1 cloud surface, for JVM and Android. Generated with openapi-generator kotlin (library=jvm-okhttp4, useCoroutines=true). Coordinate: ai.hanzo:sdk. Base URL: https://api.hanzo.ai. Co-authored-by: Hanzo Dev <[email protected]>
11 KiB
CartApi
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| commerceCreateCart | POST /v1/commerce/cart | Create cart |
| commerceDeleteCart | DELETE /v1/commerce/cart/{cartid} | Delete cart |
| commerceDiscardCart | POST /v1/commerce/cart/{cartid}/discard | Discard cart |
| commerceGetCart | GET /v1/commerce/cart/{cartid} | Get cart |
| commerceListCarts | GET /v1/commerce/cart | List carts |
| commercePatchCart | PATCH /v1/commerce/cart/{cartid} | Partially update cart |
| commerceSetCartItem | POST /v1/commerce/cart/{cartid}/set | Set item in cart |
| commerceUpdateCart | PUT /v1/commerce/cart/{cartid} | Update cart |
commerceCreateCart
CommerceCart commerceCreateCart(commerceCart)
Create cart
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = CartApi()
val commerceCart : CommerceCart = // CommerceCart |
try {
val result : CommerceCart = apiInstance.commerceCreateCart(commerceCart)
println(result)
} catch (e: ClientException) {
println("4xx response calling CartApi#commerceCreateCart")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling CartApi#commerceCreateCart")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| commerceCart | CommerceCart |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
commerceDeleteCart
commerceDeleteCart(cartid)
Delete cart
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = CartApi()
val cartid : kotlin.String = cartid_example // kotlin.String |
try {
apiInstance.commerceDeleteCart(cartid)
} catch (e: ClientException) {
println("4xx response calling CartApi#commerceDeleteCart")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling CartApi#commerceDeleteCart")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| cartid | kotlin.String |
Return type
null (empty response body)
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
commerceDiscardCart
CommerceCart commerceDiscardCart(cartid)
Discard cart
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = CartApi()
val cartid : kotlin.String = cartid_example // kotlin.String |
try {
val result : CommerceCart = apiInstance.commerceDiscardCart(cartid)
println(result)
} catch (e: ClientException) {
println("4xx response calling CartApi#commerceDiscardCart")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling CartApi#commerceDiscardCart")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| cartid | kotlin.String |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
commerceGetCart
CommerceCart commerceGetCart(cartid)
Get cart
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = CartApi()
val cartid : kotlin.String = cartid_example // kotlin.String |
try {
val result : CommerceCart = apiInstance.commerceGetCart(cartid)
println(result)
} catch (e: ClientException) {
println("4xx response calling CartApi#commerceGetCart")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling CartApi#commerceGetCart")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| cartid | kotlin.String |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
commerceListCarts
CommercePaginatedCarts commerceListCarts(page, display)
List carts
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = CartApi()
val page : kotlin.Int = 56 // kotlin.Int | Page number (1-indexed)
val display : kotlin.Int = 56 // kotlin.Int | Number of items per page
try {
val result : CommercePaginatedCarts = apiInstance.commerceListCarts(page, display)
println(result)
} catch (e: ClientException) {
println("4xx response calling CartApi#commerceListCarts")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling CartApi#commerceListCarts")
e.printStackTrace()
}
Parameters
| page | kotlin.Int| Page number (1-indexed) | [optional] [default to 1] |
| Name | Type | Description | Notes |
|---|---|---|---|
| display | kotlin.Int | Number of items per page | [optional] [default to 20] |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
commercePatchCart
CommerceCart commercePatchCart(cartid, commerceCart)
Partially update cart
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = CartApi()
val cartid : kotlin.String = cartid_example // kotlin.String |
val commerceCart : CommerceCart = // CommerceCart |
try {
val result : CommerceCart = apiInstance.commercePatchCart(cartid, commerceCart)
println(result)
} catch (e: ClientException) {
println("4xx response calling CartApi#commercePatchCart")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling CartApi#commercePatchCart")
e.printStackTrace()
}
Parameters
| cartid | kotlin.String| | |
| Name | Type | Description | Notes |
|---|---|---|---|
| commerceCart | CommerceCart |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
commerceSetCartItem
CommerceCart commerceSetCartItem(cartid, commerceSetCartItemRequest)
Set item in cart
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = CartApi()
val cartid : kotlin.String = cartid_example // kotlin.String |
val commerceSetCartItemRequest : CommerceSetCartItemRequest = // CommerceSetCartItemRequest |
try {
val result : CommerceCart = apiInstance.commerceSetCartItem(cartid, commerceSetCartItemRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling CartApi#commerceSetCartItem")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling CartApi#commerceSetCartItem")
e.printStackTrace()
}
Parameters
| cartid | kotlin.String| | |
| Name | Type | Description | Notes |
|---|---|---|---|
| commerceSetCartItemRequest | CommerceSetCartItemRequest |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
commerceUpdateCart
CommerceCart commerceUpdateCart(cartid, commerceCart)
Update cart
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = CartApi()
val cartid : kotlin.String = cartid_example // kotlin.String |
val commerceCart : CommerceCart = // CommerceCart |
try {
val result : CommerceCart = apiInstance.commerceUpdateCart(cartid, commerceCart)
println(result)
} catch (e: ClientException) {
println("4xx response calling CartApi#commerceUpdateCart")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling CartApi#commerceUpdateCart")
e.printStackTrace()
}
Parameters
| cartid | kotlin.String| | |
| Name | Type | Description | Notes |
|---|---|---|---|
| commerceCart | CommerceCart |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json