mirror of
https://github.com/hanzo-kt/sdk.git
synced 2026-10-30 20:43:57 +00:00
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]>
5.7 KiB
5.7 KiB
TransactionsApi
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| commerceCreateHold | POST /v1/commerce/transaction/hold | Create hold |
| commerceCreateTransaction | POST /v1/commerce/transaction | Create transaction |
| commerceListTransactions | GET /v1/commerce/transaction/{kind}/{id} | List transactions for entity |
| commerceRemoveHold | DELETE /v1/commerce/transaction/hold/{id} | Remove hold |
commerceCreateHold
CommerceTransaction commerceCreateHold(commerceTransaction)
Create hold
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = TransactionsApi()
val commerceTransaction : CommerceTransaction = // CommerceTransaction |
try {
val result : CommerceTransaction = apiInstance.commerceCreateHold(commerceTransaction)
println(result)
} catch (e: ClientException) {
println("4xx response calling TransactionsApi#commerceCreateHold")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling TransactionsApi#commerceCreateHold")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| commerceTransaction | CommerceTransaction |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
commerceCreateTransaction
CommerceTransaction commerceCreateTransaction(commerceTransaction)
Create transaction
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = TransactionsApi()
val commerceTransaction : CommerceTransaction = // CommerceTransaction |
try {
val result : CommerceTransaction = apiInstance.commerceCreateTransaction(commerceTransaction)
println(result)
} catch (e: ClientException) {
println("4xx response calling TransactionsApi#commerceCreateTransaction")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling TransactionsApi#commerceCreateTransaction")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| commerceTransaction | CommerceTransaction |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
commerceListTransactions
kotlin.collections.List<CommerceTransaction> commerceListTransactions(kind, id)
List transactions for entity
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = TransactionsApi()
val kind : kotlin.String = kind_example // kotlin.String |
val id : kotlin.String = id_example // kotlin.String |
try {
val result : kotlin.collections.List<CommerceTransaction> = apiInstance.commerceListTransactions(kind, id)
println(result)
} catch (e: ClientException) {
println("4xx response calling TransactionsApi#commerceListTransactions")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling TransactionsApi#commerceListTransactions")
e.printStackTrace()
}
Parameters
| kind | kotlin.String| | [enum: user, order, wallet] |
| Name | Type | Description | Notes |
|---|---|---|---|
| id | kotlin.String |
Return type
kotlin.collections.List<CommerceTransaction>
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
commerceRemoveHold
commerceRemoveHold(id)
Remove hold
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = TransactionsApi()
val id : kotlin.String = id_example // kotlin.String |
try {
apiInstance.commerceRemoveHold(id)
} catch (e: ClientException) {
println("4xx response calling TransactionsApi#commerceRemoveHold")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling TransactionsApi#commerceRemoveHold")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | 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