mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The lock sat at 574d1f1d while the product moved on. The team surface stopped at rooms — no messages path, no way to open one — so anything built on this client had to reach past it with its own HTTP calls, which is the duplication a generated client exists to prevent.
7697 lines
566 KiB
Swift
7697 lines
566 KiB
Swift
//
|
|
// CommerceAPI.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
open class CommerceAPI {
|
|
|
|
/**
|
|
Delete a collection, keeping a recoverable copy
|
|
|
|
- parameter collectionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceCollectionByCollectionid(collectionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceCollectionByCollectionidWithRequestBuilder(collectionid: collectionid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a collection, keeping a recoverable copy
|
|
- DELETE /v1/commerce/collection/{collectionid}
|
|
- A collection is a merchandising group a storefront renders — a slug and name, copy and media, flat lists of the product and variant ids it holds, published, preorder and out-of-stock flags, and an availability window. Membership lives on the collection as those id lists rather than as a join, so putting a product into a collection is a write here and not on the product. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or WriteCollection.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter collectionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceCollectionByCollectionidWithRequestBuilder(collectionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/collection/{collectionid}"
|
|
let collectionidPreEscape = "\(APIHelper.mapValueToPathItem(collectionid))"
|
|
let collectionidPostEscape = collectionidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{collectionid}", with: collectionidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Delete a disclosure, keeping a recoverable copy
|
|
|
|
- parameter disclosureid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceDisclosureByDisclosureid(disclosureid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceDisclosureByDisclosureidWithRequestBuilder(disclosureid: disclosureid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a disclosure, keeping a recoverable copy
|
|
- DELETE /v1/commerce/disclosure/{disclosureid}
|
|
- A disclosure is a published-document record — a publication body, a content hash, a type and a named receiver. The hash LOOKS like a field you set and is in fact derived, but only on update: a freshly created disclosure keeps whatever hash the caller sent until the first replace or patch recomputes it, so a new row's hash attests to nothing. This kind lives in commerce's demo tree — a live writable resource in your tenant's real store that nothing else in commerce reads. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The per-kind permission table has no entry for disclosure, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter disclosureid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceDisclosureByDisclosureidWithRequestBuilder(disclosureid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/disclosure/{disclosureid}"
|
|
let disclosureidPreEscape = "\(APIHelper.mapValueToPathItem(disclosureid))"
|
|
let disclosureidPostEscape = disclosureidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{disclosureid}", with: disclosureidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Delete a discount, keeping a recoverable copy
|
|
|
|
- parameter discountid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceDiscountByDiscountid(discountid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceDiscountByDiscountidWithRequestBuilder(discountid: discountid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a discount, keeping a recoverable copy
|
|
- DELETE /v1/commerce/discount/{discountid}
|
|
- A discount is a price rule: a type (flat, percent, free-shipping, free-item or bulk), a window, a scope naming the store, collection, product or variant it applies to, a target, and rules pairing a trigger — a price or quantity threshold — with an action, an amount off or a percentage. It is ENABLED BY DEFAULT, so a bare create makes a live discount rather than a draft. The rule engine caches per replica for about thirty seconds, so a discount switched off here can keep applying briefly on other replicas. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for discount, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter discountid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceDiscountByDiscountidWithRequestBuilder(discountid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/discount/{discountid}"
|
|
let discountidPreEscape = "\(APIHelper.mapValueToPathItem(discountid))"
|
|
let discountidPostEscape = discountidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{discountid}", with: discountidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Delete a movie, keeping a recoverable copy
|
|
|
|
- parameter movieid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceMovieByMovieid(movieid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceMovieByMovieidWithRequestBuilder(movieid: movieid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a movie, keeping a recoverable copy
|
|
- DELETE /v1/commerce/movie/{movieid}
|
|
- A movie is a film catalog record — a slug plus EIDR and IMDB ids, all three required, with title and synopsis copy, artwork, screenshots, trailers, cast and crew, and available and hidden flags. It carries NO price: the money for a film lives on the product that sells it. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The per-kind permission table has no entry for movie, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter movieid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceMovieByMovieidWithRequestBuilder(movieid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/movie/{movieid}"
|
|
let movieidPreEscape = "\(APIHelper.mapValueToPathItem(movieid))"
|
|
let movieidPostEscape = movieidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{movieid}", with: movieidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Delete a note, keeping a recoverable copy
|
|
|
|
- parameter noteid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceNoteByNoteid(noteid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceNoteByNoteidWithRequestBuilder(noteid: noteid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a note, keeping a recoverable copy
|
|
- DELETE /v1/commerce/note/{noteid}
|
|
- A note is a timestamped free-text log line — a caller-supplied time, a source, a message and an enabled flag. That time is the caller's own field and is distinct from the row's creation stamp; the note search filters on it, so a note written without one is a zero-time note the ops log will never surface. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The per-kind permission table has no entry for note, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter noteid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceNoteByNoteidWithRequestBuilder(noteid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/note/{noteid}"
|
|
let noteidPreEscape = "\(APIHelper.mapValueToPathItem(noteid))"
|
|
let noteidPostEscape = noteidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{noteid}", with: noteidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Remove a plan from the authority
|
|
|
|
- parameter slug: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommercePlansEntriesBySlug(slug: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommercePlansEntriesBySlugWithRequestBuilder(slug: slug, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Remove a plan from the authority
|
|
- DELETE /v1/commerce/plans/entries/{slug}
|
|
- Deletes the addressed plan and answers 204. It removes the plan from the catalog buyers choose from; it does not touch subscriptions already sold against it, which keep their stored plan id. PLATFORM admin only — an org-level admin is refused 403 — and an unknown slug is 404.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter slug: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommercePlansEntriesBySlugWithRequestBuilder(slug: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/plans/entries/{slug}"
|
|
let slugPreEscape = "\(APIHelper.mapValueToPathItem(slug))"
|
|
let slugPostEscape = slugPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{slug}", with: slugPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Delete a product, keeping a recoverable copy
|
|
|
|
- parameter productid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceProductByProductid(productid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceProductByProductidWithRequestBuilder(productid: productid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a product, keeping a recoverable copy
|
|
- DELETE /v1/commerce/product/{productid}
|
|
- A product is a sellable catalog item: slug, SKU and UPC, name and copy, media, availability and preorder flags, a reservation block, and its money — currency, price, MSRP, list price and inventory cost in minor units, inventory count, taxability, and the subscription interval when it is subscribeable. Its variants and options are carried as a denormalized JSON snapshot inside the product, separate from the standalone variant rows, and nothing keeps the two in step for you. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or WriteProduct.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter productid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceProductByProductidWithRequestBuilder(productid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/product/{productid}"
|
|
let productidPreEscape = "\(APIHelper.mapValueToPathItem(productid))"
|
|
let productidPostEscape = productidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{productid}", with: productidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Remove a rate outright
|
|
|
|
- parameter product: (path)
|
|
- parameter meter: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceRatesEntriesByProductByMeter(product: String, meter: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceRatesEntriesByProductByMeterWithRequestBuilder(product: product, meter: meter, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Remove a rate outright
|
|
- DELETE /v1/commerce/rates/entries/{product}/{meter}
|
|
- Deletes the row. ARCHIVING is usually what is wanted instead — a deleted rate cannot price a historical charge, so a past invoice that has to re-resolve its rate finds nothing to read. Reach for status=archived unless the rate never priced anything. SuperAdmin only.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter product: (path)
|
|
- parameter meter: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceRatesEntriesByProductByMeterWithRequestBuilder(product: String, meter: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/rates/entries/{product}/{meter}"
|
|
let productPreEscape = "\(APIHelper.mapValueToPathItem(product))"
|
|
let productPostEscape = productPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{product}", with: productPostEscape, options: .literal, range: nil)
|
|
let meterPreEscape = "\(APIHelper.mapValueToPathItem(meter))"
|
|
let meterPostEscape = meterPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{meter}", with: meterPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Delete a return, keeping a recoverable copy
|
|
|
|
- parameter returnid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceReturnByReturnid(returnid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceReturnByReturnidWithRequestBuilder(returnid: returnid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a return, keeping a recoverable copy
|
|
- DELETE /v1/commerce/return/{returnid}
|
|
- A return is an RMA — the store, user and order it belongs to, the line items coming back, a fulfillment block carrying its own type, status and pricing, a summary, and eight lifecycle timestamps from submitted through delivered and processed. Its status is a FREE STRING with no enumeration behind it, and there is no refund amount on the return itself: the money sits inside the line items and the fulfillment pricing. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The token must also carry Admin or WriteReturn.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter returnid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceReturnByReturnidWithRequestBuilder(returnid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/return/{returnid}"
|
|
let returnidPreEscape = "\(APIHelper.mapValueToPathItem(returnid))"
|
|
let returnidPostEscape = returnidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{returnid}", with: returnidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Delete a sales channel, keeping a recoverable copy
|
|
|
|
- parameter saleschannelid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceSaleschannelBySaleschannelid(saleschannelid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceSaleschannelBySaleschannelidWithRequestBuilder(saleschannelid: saleschannelid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a sales channel, keeping a recoverable copy
|
|
- DELETE /v1/commerce/saleschannel/{saleschannelid}
|
|
- A sales channel is a named selling surface — a name, a description, a disabled flag and metadata. The flag is NEGATIVE, so a channel created from an empty body is enabled. Nothing on this row links products, prices or stock to the channel; here it is a label other surfaces scope themselves by. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for saleschannel, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter saleschannelid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceSaleschannelBySaleschannelidWithRequestBuilder(saleschannelid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/saleschannel/{saleschannelid}"
|
|
let saleschannelidPreEscape = "\(APIHelper.mapValueToPathItem(saleschannelid))"
|
|
let saleschannelidPostEscape = saleschannelidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{saleschannelid}", with: saleschannelidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Delete a stock location, keeping a recoverable copy
|
|
|
|
- parameter stocklocationid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceStocklocationByStocklocationid(stocklocationid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceStocklocationByStocklocationidWithRequestBuilder(stocklocationid: stocklocationid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a stock location, keeping a recoverable copy
|
|
- DELETE /v1/commerce/stocklocation/{stocklocationid}
|
|
- A stock location is a physical address inventory can be held at — a name, street lines, city, province, country, postal code and a phone. None of it is validated, there are no coordinates, and the row carries no enabled flag and no inventory link, so deleting it is the only way to retire one. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for stocklocation, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter stocklocationid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceStocklocationByStocklocationidWithRequestBuilder(stocklocationid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/stocklocation/{stocklocationid}"
|
|
let stocklocationidPreEscape = "\(APIHelper.mapValueToPathItem(stocklocationid))"
|
|
let stocklocationidPostEscape = stocklocationidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{stocklocationid}", with: stocklocationidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Delete a storefront, keeping a recoverable copy
|
|
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceStoreByStoreid(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceStoreByStoreidWithRequestBuilder(storeid: storeid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a storefront, keeping a recoverable copy
|
|
- DELETE /v1/commerce/store/{storeid}
|
|
- Removes the addressed store and answers 204 with no body. Before the live row goes, the entity is written once more under a tombstone kind, so the deletion leaves a recoverable copy rather than destroying the record outright; the store's listing overrides live inside that row and go with it. The id is resolved inside the caller org's own namespace, so an unknown or foreign id is 404. Requires an admin or store-write token.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceStoreByStoreidWithRequestBuilder(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Remove a listing override
|
|
|
|
- parameter storeid: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceStoreByStoreidListingByKey(storeid: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceStoreByStoreidListingByKeyWithRequestBuilder(storeid: storeid, key: key, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Remove a listing override
|
|
- DELETE /v1/commerce/store/{storeid}/listing/{key}
|
|
- Drops the key from the store's listing map and re-saves the store, answering 204 with no body. It UN-OVERRIDES rather than deletes: the product, variant or bundle itself is untouched and simply reverts to its catalog values on this storefront. A key that is not present is 404, and so is a store id outside the caller org's namespace. Admin-gated.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceStoreByStoreidListingByKeyWithRequestBuilder(storeid: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/listing/{key}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let keyPreEscape = "\(APIHelper.mapValueToPathItem(key))"
|
|
let keyPostEscape = keyPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{key}", with: keyPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Delete a submission, keeping a recoverable copy
|
|
|
|
- parameter submissionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceSubmissionBySubmissionid(submissionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceSubmissionBySubmissionidWithRequestBuilder(submissionid: submissionid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a submission, keeping a recoverable copy
|
|
- DELETE /v1/commerce/submission/{submissionid}
|
|
- A submission is one filled-in form from a site visitor — an email, an optional user id, the client details the server observed (user agent, referer, geography) and the form's own fields as free metadata. It carries no form id, so the link back to the form that produced it is not stored on the row. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The per-kind permission table has no entry for submission, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter submissionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceSubmissionBySubmissionidWithRequestBuilder(submissionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/submission/{submissionid}"
|
|
let submissionidPreEscape = "\(APIHelper.mapValueToPathItem(submissionid))"
|
|
let submissionidPostEscape = submissionidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{submissionid}", with: submissionidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Delete a subscriber, keeping a recoverable copy
|
|
|
|
- parameter subscriberid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceSubscriberBySubscriberid(subscriberid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceSubscriberBySubscriberidWithRequestBuilder(subscriberid: subscriberid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a subscriber, keeping a recoverable copy
|
|
- DELETE /v1/commerce/subscriber/{subscriberid}
|
|
- A subscriber is a mailing-list member — name, email, the form id that captured them, unsubscribed state and date, client details, tags and metadata. Writing one FIRES A WEBHOOK: subscriber.created on create and subscriber.updated on replace or patch, emitted BEFORE the write is known to have succeeded and carrying the row as sent, so the payload holds the raw email rather than the normalized one that gets stored. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The token must also carry Admin or WriteSubscriber.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter subscriberid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceSubscriberBySubscriberidWithRequestBuilder(subscriberid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/subscriber/{subscriberid}"
|
|
let subscriberidPreEscape = "\(APIHelper.mapValueToPathItem(subscriberid))"
|
|
let subscriberidPostEscape = subscriberidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{subscriberid}", with: subscriberidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Delete a token transaction, keeping a recoverable copy
|
|
|
|
- parameter tokentransactionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceTokentransactionByTokentransactionid(tokentransactionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceTokentransactionByTokentransactionidWithRequestBuilder(tokentransactionid: tokentransactionid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a token transaction, keeping a recoverable copy
|
|
- DELETE /v1/commerce/tokentransaction/{tokentransactionid}
|
|
- A token transaction records a transfer between two identified parties — amount and fees, a timestamp, sending and receiving addresses, names, user ids, states and countries, a flag per side, a protocol name and a transaction hash. Nothing here touches a chain: the hash is an unvalidated string and the flags are plain writable booleans with no screening behind them. Amounts are floating-point rather than the exact minor units every real money field in commerce uses, and there is no currency field at all — this kind lives in commerce's demo tree, so it is a live writable resource in your tenant's store that nothing else in commerce reads, and it must never carry real money. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The per-kind permission table has no entry for tokentransaction, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter tokentransactionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceTokentransactionByTokentransactionidWithRequestBuilder(tokentransactionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/tokentransaction/{tokentransactionid}"
|
|
let tokentransactionidPreEscape = "\(APIHelper.mapValueToPathItem(tokentransactionid))"
|
|
let tokentransactionidPostEscape = tokentransactionidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{tokentransactionid}", with: tokentransactionidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Delete a transfer, keeping a recoverable copy
|
|
|
|
- parameter transferid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceTransferByTransferid(transferid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceTransferByTransferidWithRequestBuilder(transferid: transferid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a transfer, keeping a recoverable copy
|
|
- DELETE /v1/commerce/transfer/{transferid}
|
|
- A transfer records that a payable WAS PAID — the annotation a human writes after paying out of band. Commerce executes no payout: creating one moves no money, and it marks the referenced payable settled. It carries the payable and payee ids, the amount it settles and the amount actually sent (which may be a different asset), a type of eth, wire or other, the transaction hash or wire reference, when it was paid and who recorded it; amounts are exact decimal strings with an asset, not cents. It is admin-gated because writing one settles money we owe, and nothing enforces uniqueness on the reference — so posting the same transfer twice settles the payable twice. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for transfer, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter transferid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceTransferByTransferidWithRequestBuilder(transferid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/transfer/{transferid}"
|
|
let transferidPreEscape = "\(APIHelper.mapValueToPathItem(transferid))"
|
|
let transferidPostEscape = transferidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{transferid}", with: transferidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Delete a variant, keeping a recoverable copy
|
|
|
|
- parameter variantid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceVariantByVariantid(variantid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceVariantByVariantidWithRequestBuilder(variantid: variantid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a variant, keeping a recoverable copy
|
|
- DELETE /v1/commerce/variant/{variantid}
|
|
- A variant is one purchasable SKU of a product — its product id, SKU and UPC, name, media, availability, the option name and value pairs that distinguish it, a sold counter, and its own money and stock: currency, price, MSRP, inventory cost, inventory count and taxability. Inventory and sold are plain writable numbers with no decrement logic behind them here. The same variant also exists as a JSON copy inside its product, and writing one does not update the other. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or WriteVariant.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter variantid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceVariantByVariantidWithRequestBuilder(variantid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/variant/{variantid}"
|
|
let variantidPreEscape = "\(APIHelper.mapValueToPathItem(variantid))"
|
|
let variantidPostEscape = variantidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{variantid}", with: variantidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Delete a wallet, keeping a recoverable copy
|
|
|
|
- parameter walletid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceWalletByWalletid(walletid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceWalletByWalletidWithRequestBuilder(walletid: walletid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a wallet, keeping a recoverable copy
|
|
- DELETE /v1/commerce/wallet/{walletid}
|
|
- A wallet is a container of custodial blockchain accounts, and its only field is that account list — each account carrying a name, an address, a chain type, and the ENCRYPTED private key with its salt. Creating a wallet through this table generates NO KEYS: key generation lives on the account routes, so a wallet made here is an empty shell and an account posted into one is stored exactly as sent, with no key generation and no validation behind it. Know what a read renders: the plaintext private key is never marshalled and never stored, but the encrypted blob and its salt ARE returned, so whoever can read a wallet can attack it offline down to the strength of the owner's passphrase. That is why this kind is admin-gated. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for wallet, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter walletid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceWalletByWalletidWithRequestBuilder(walletid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/wallet/{walletid}"
|
|
let walletidPreEscape = "\(APIHelper.mapValueToPathItem(walletid))"
|
|
let walletidPostEscape = walletidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{walletid}", with: walletidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Delete a watchlist, keeping a recoverable copy
|
|
|
|
- parameter watchlistid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceWatchlistByWatchlistid(watchlistid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceWatchlistByWatchlistidWithRequestBuilder(watchlistid: watchlistid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a watchlist, keeping a recoverable copy
|
|
- DELETE /v1/commerce/watchlist/{watchlistid}
|
|
- A watchlist is a viewer's saved list of movies — a user id, an email, and the movies themselves. It stores WHOLE MOVIE SNAPSHOTS rather than movie ids, so a list goes stale the moment a film record changes and grows without bound as it fills. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. Any valid access token reaches it. The per-kind permission table has no entry for watchlist, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter watchlistid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceWatchlistByWatchlistidWithRequestBuilder(watchlistid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/watchlist/{watchlistid}"
|
|
let watchlistidPreEscape = "\(APIHelper.mapValueToPathItem(watchlistid))"
|
|
let watchlistidPostEscape = watchlistidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{watchlistid}", with: watchlistidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Delete a webhook, keeping a recoverable copy
|
|
|
|
- parameter webhookid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCommerceWebhookByWebhookid(webhookid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteCommerceWebhookByWebhookidWithRequestBuilder(webhookid: webhookid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Delete a webhook, keeping a recoverable copy
|
|
- DELETE /v1/commerce/webhook/{webhookid}
|
|
- A webhook is a merchant-registered endpoint that receives commerce event callbacks — a name, a URL, live and all flags, a per-event map, an enabled flag, and the shared access token each delivery posts IN THE BODY. Two things to know before registering one: that token is a plainly readable field, so anyone who may read webhooks reads every endpoint's secret, and delivery consults only the all flag and the event map — it does NOT consult enabled or live, so setting enabled false does not stop delivery and deleting the row is the only thing that does. Delivery is a single POST with a twenty-second timeout and no retry. Removes the addressed row and answers 204 with no body. Before the live row goes it is written once more under a deleted tombstone kind, so a deletion leaves a recoverable copy rather than destroying the record outright — and a tombstone that cannot be written fails the call with 500 before anything is removed. The id is resolved inside the caller org's own namespace, so an absent or foreign id is 404. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for webhook, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter webhookid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteCommerceWebhookByWebhookidWithRequestBuilder(webhookid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/webhook/{webhookid}"
|
|
let webhookidPreEscape = "\(APIHelper.mapValueToPathItem(webhookid))"
|
|
let webhookidPostEscape = webhookidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{webhookid}", with: webhookidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Discard a cart the shopper abandoned
|
|
|
|
- parameter id: (path) ID is the cart's id, as the open call answered it.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Cart
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func discardCart(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Cart {
|
|
return try await discardCartWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Discard a cart the shopper abandoned
|
|
- POST /v1/commerce/cart/{id}/discard
|
|
- Discards a cart the shopper abandoned, and answers it in its final state. A discarded cart is CLOSED, not deleted: the row stays, so abandoned-basket reporting and any follow-up that keys on it still have something to read. It stops being a cart anything will check out, which is the point — it is how a storefront says \"this basket is over\" without destroying the evidence that it existed. Discarding is idempotent: a cart already discarded answers its stored state rather than failing, so a retry is safe. The cart is resolved inside the caller's own org namespace, so another tenant's id answers 404. A named handler, not a closure, so zipdoc can lift this prose into the registry.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter id: (path) ID is the cart's id, as the open call answered it.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Cart>
|
|
*/
|
|
open class func discardCartWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Cart> {
|
|
var localVariablePath = "/v1/commerce/cart/{id}/discard"
|
|
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
|
|
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Cart>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Read one cart with its lines and totals
|
|
|
|
- parameter id: (path) ID is the cart's id, as the open call answered it.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Cart
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCart(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Cart {
|
|
return try await getCartWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Read one cart with its lines and totals
|
|
- GET /v1/commerce/cart/{id}
|
|
- Reads one cart: its lines, its status and what it comes to. This is what a storefront calls to render the basket, and what a support agent calls to see what a shopper is looking at. The totals are the cart's STORED tally — shipping and tax stay zero until checkout resolves a shipping option and a tax region, so a cart total before checkout is the merchandise total and is meant to be. The org scopes the read by construction: the store is namespaced to it, so a cart id belonging to another tenant is simply not found rather than found and then filtered, and answers 404 rather than 403 so the id space cannot be probed. A named handler, not a closure, so zipdoc can lift this prose into the registry.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter id: (path) ID is the cart's id, as the open call answered it.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Cart>
|
|
*/
|
|
open class func getCartWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Cart> {
|
|
var localVariablePath = "/v1/commerce/cart/{id}"
|
|
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
|
|
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Cart>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
The catalog projection with cost and margin included
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceAdminCatalog(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceAdminCatalogWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
The catalog projection with cost and margin included
|
|
- GET /v1/commerce/admin/catalog
|
|
- Returns the brand-scoped catalog carrying the administrative economics the public projection withholds — upstream cost and margin percentage — for the margin surface the platform console administrates. The brand comes from the query and defaults to hanzo. PLATFORM admin only, enforced by the handler on top of the route's IAM gate: an ORG-level admin is refused 403 precisely so upstream cost and margin never reach a tenant.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceAdminCatalogWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/admin/catalog"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
The public product catalog projection for a brand
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceCatalog(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceCatalogWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
The public product catalog projection for a brand
|
|
- GET /v1/commerce/catalog
|
|
- Returns the brand's published catalog — the shared source docs, the console sidebar and the pricing pages all read — with the brand taken from the query and defaulting to hanzo. It is public and cacheable, and it is the projection that deliberately omits cost and margin; those live only on the platform-admin projection.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceCatalogWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/catalog"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
The raw catalog entries, including the unpublished ones
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceCatalogEntries(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceCatalogEntriesWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
The raw catalog entries, including the unpublished ones
|
|
- GET /v1/commerce/catalog/entries
|
|
- Returns every catalog row as stored — the admin view, which unlike the public projection includes entries that are not published. It is cross-tenant platform data, so the gate is a PLATFORM admin: an org-level admin is refused 403 no matter how privileged they are inside their own org, enforced by the handler itself and not only by the route's token middleware.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceCatalogEntriesWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/catalog/entries"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's collections, as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceCollection(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceCollectionWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's collections, as a page
|
|
- GET /v1/commerce/collection/
|
|
- A collection is a merchandising group a storefront renders — a slug and name, copy and media, flat lists of the product and variant ids it holds, published, preorder and out-of-stock flags, and an availability window. Membership lives on the collection as those id lists rather than as a join, so putting a product into a collection is a write here and not on the product. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the slug and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or the Collection list scope.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceCollectionWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/collection/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one collection
|
|
|
|
- parameter collectionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceCollectionByCollectionid(collectionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceCollectionByCollectionidWithRequestBuilder(collectionid: collectionid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one collection
|
|
- GET /v1/commerce/collection/{collectionid}
|
|
- A collection is a merchandising group a storefront renders — a slug and name, copy and media, flat lists of the product and variant ids it holds, published, preorder and out-of-stock flags, and an availability window. Membership lives on the collection as those id lists rather than as a join, so putting a product into a collection is a write here and not on the product. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or ReadCollection.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter collectionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceCollectionByCollectionidWithRequestBuilder(collectionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/collection/{collectionid}"
|
|
let collectionidPreEscape = "\(APIHelper.mapValueToPathItem(collectionid))"
|
|
let collectionidPostEscape = collectionidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{collectionid}", with: collectionidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
The reference currency list the price and settings pickers render
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceCurrencies(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceCurrenciesWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
The reference currency list the price and settings pickers render
|
|
- GET /v1/commerce/currencies
|
|
- Returns every reference currency as one global list, so a store settings form or a product price picker binds real rows instead of a hardcoded array. It is a default-namespace read shared by every tenant rather than per-org data, and it is public and cacheable.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceCurrenciesWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/currencies"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Read the crypto deposit watcher's runtime state, asset by asset
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceDeposits(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceDepositsWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Read the crypto deposit watcher's runtime state, asset by asset
|
|
- GET /v1/commerce/deposits
|
|
- Reports whether the deposit watcher is running, its poll interval, and one row per armed asset: chain, token, contract, pooled address and the last block that asset's cursor reached. That last block is the only way to see a watcher that is up but no longer advancing, which is what a stalled deposit rail looks like from outside. SuperAdmin only — the reserved admin org's owner claim; an authenticated caller without it is refused 403 and an anonymous one 401. It is READ-ONLY by design: arming an asset stays a CRYPTO_DEPOSIT_* deployment act and is deliberately not a button here, so there is nothing on this surface that can start crediting a customer's balance. The asset's RPC endpoint is reduced to scheme://host before it is returned, because a managed node URL carries its API key in the path or query and echoing it verbatim would publish that credential to every reader of this status.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceDepositsWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/deposits"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's disclosures, as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceDisclosure(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceDisclosureWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's disclosures, as a page
|
|
- GET /v1/commerce/disclosure/
|
|
- A disclosure is a published-document record — a publication body, a content hash, a type and a named receiver. The hash LOOKS like a field you set and is in fact derived, but only on update: a freshly created disclosure keeps whatever hash the caller sent until the first replace or patch recomputes it, so a new row's hash attests to nothing. This kind lives in commerce's demo tree — a live writable resource in your tenant's real store that nothing else in commerce reads. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The per-kind permission table has no entry for disclosure, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceDisclosureWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/disclosure/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one disclosure
|
|
|
|
- parameter disclosureid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceDisclosureByDisclosureid(disclosureid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceDisclosureByDisclosureidWithRequestBuilder(disclosureid: disclosureid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one disclosure
|
|
- GET /v1/commerce/disclosure/{disclosureid}
|
|
- A disclosure is a published-document record — a publication body, a content hash, a type and a named receiver. The hash LOOKS like a field you set and is in fact derived, but only on update: a freshly created disclosure keeps whatever hash the caller sent until the first replace or patch recomputes it, so a new row's hash attests to nothing. This kind lives in commerce's demo tree — a live writable resource in your tenant's real store that nothing else in commerce reads. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The per-kind permission table has no entry for disclosure, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter disclosureid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceDisclosureByDisclosureidWithRequestBuilder(disclosureid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/disclosure/{disclosureid}"
|
|
let disclosureidPreEscape = "\(APIHelper.mapValueToPathItem(disclosureid))"
|
|
let disclosureidPostEscape = disclosureidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{disclosureid}", with: disclosureidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's discounts, as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceDiscount(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceDiscountWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's discounts, as a page
|
|
- GET /v1/commerce/discount/
|
|
- A discount is a price rule: a type (flat, percent, free-shipping, free-item or bulk), a window, a scope naming the store, collection, product or variant it applies to, a target, and rules pairing a trigger — a price or quantity threshold — with an action, an amount off or a percentage. It is ENABLED BY DEFAULT, so a bare create makes a live discount rather than a draft. The rule engine caches per replica for about thirty seconds, so a discount switched off here can keep applying briefly on other replicas. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for discount, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceDiscountWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/discount/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one discount
|
|
|
|
- parameter discountid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceDiscountByDiscountid(discountid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceDiscountByDiscountidWithRequestBuilder(discountid: discountid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one discount
|
|
- GET /v1/commerce/discount/{discountid}
|
|
- A discount is a price rule: a type (flat, percent, free-shipping, free-item or bulk), a window, a scope naming the store, collection, product or variant it applies to, a target, and rules pairing a trigger — a price or quantity threshold — with an action, an amount off or a percentage. It is ENABLED BY DEFAULT, so a bare create makes a live discount rather than a draft. The rule engine caches per replica for about thirty seconds, so a discount switched off here can keep applying briefly on other replicas. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for discount, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter discountid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceDiscountByDiscountidWithRequestBuilder(discountid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/discount/{discountid}"
|
|
let discountidPreEscape = "\(APIHelper.mapValueToPathItem(discountid))"
|
|
let discountidPostEscape = discountidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{discountid}", with: discountidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Answers ok whenever the commerce subsystem is mounted.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Liveness
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceHealth(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Liveness {
|
|
return try await getCommerceHealthWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Answers ok whenever the commerce subsystem is mounted.
|
|
- GET /v1/commerce/health
|
|
- Answers ok whenever the commerce subsystem is mounted. It is registered before the module embed boots, so it keeps answering even when the embed failed and every business route serves the fail-closed 503 — which is the point: it reports that the process is reachable, never that the money plane is healthy. Unauthenticated: a probe that needs a credential is a probe that reports the credential. A named handler, not a closure, so zipdoc can lift this prose into the registry.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Liveness>
|
|
*/
|
|
open class func getCommerceHealthWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Liveness> {
|
|
let localVariablePath = "/v1/commerce/health"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Liveness>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's movies, as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceMovie(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceMovieWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's movies, as a page
|
|
- GET /v1/commerce/movie/
|
|
- A movie is a film catalog record — a slug plus EIDR and IMDB ids, all three required, with title and synopsis copy, artwork, screenshots, trailers, cast and crew, and available and hidden flags. It carries NO price: the money for a film lives on the product that sells it. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the slug and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The per-kind permission table has no entry for movie, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceMovieWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/movie/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one movie
|
|
|
|
- parameter movieid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceMovieByMovieid(movieid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceMovieByMovieidWithRequestBuilder(movieid: movieid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one movie
|
|
- GET /v1/commerce/movie/{movieid}
|
|
- A movie is a film catalog record — a slug plus EIDR and IMDB ids, all three required, with title and synopsis copy, artwork, screenshots, trailers, cast and crew, and available and hidden flags. It carries NO price: the money for a film lives on the product that sells it. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The per-kind permission table has no entry for movie, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter movieid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceMovieByMovieidWithRequestBuilder(movieid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/movie/{movieid}"
|
|
let movieidPreEscape = "\(APIHelper.mapValueToPathItem(movieid))"
|
|
let movieidPostEscape = movieidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{movieid}", with: movieidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's notes, as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceNote(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceNoteWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's notes, as a page
|
|
- GET /v1/commerce/note/
|
|
- A note is a timestamped free-text log line — a caller-supplied time, a source, a message and an enabled flag. That time is the caller's own field and is distinct from the row's creation stamp; the note search filters on it, so a note written without one is a zero-time note the ops log will never surface. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The per-kind permission table has no entry for note, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceNoteWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/note/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one note
|
|
|
|
- parameter noteid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceNoteByNoteid(noteid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceNoteByNoteidWithRequestBuilder(noteid: noteid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one note
|
|
- GET /v1/commerce/note/{noteid}
|
|
- A note is a timestamped free-text log line — a caller-supplied time, a source, a message and an enabled flag. That time is the caller's own field and is distinct from the row's creation stamp; the note search filters on it, so a note written without one is a zero-time note the ops log will never surface. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The per-kind permission table has no entry for note, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter noteid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceNoteByNoteidWithRequestBuilder(noteid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/note/{noteid}"
|
|
let noteidPreEscape = "\(APIHelper.mapValueToPathItem(noteid))"
|
|
let noteidPostEscape = noteidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{noteid}", with: noteidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
The public org configuration a checkout page boots from
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceOrg(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceOrgWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
The public org configuration a checkout page boots from
|
|
- GET /v1/commerce/org
|
|
- Answers the branding, identity issuer and client id, identity-verification config, enabled payment providers, return-URL allowlist and public payment application config for the org the request HOST resolves to. It is genuinely public and unauthenticated — a checkout page calls it before anyone has signed in — and it carries the same public payment config the authenticated config read does, so the card iframe can never initialize against a different application than the one that will be charged. Only ENABLED providers are listed and no credential path is ever projected. An unresolvable host answers a constant 404 that does not echo the host, so the endpoint cannot be used to enumerate orgs; a successful answer is cacheable for a minute.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceOrgWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/org"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
The raw plan authority rows
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommercePlansEntries(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommercePlansEntriesWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
The raw plan authority rows
|
|
- GET /v1/commerce/plans/entries
|
|
- Returns every plan row as stored — the administrative view behind the public plan catalog. The plan authority is cross-tenant pricing data, so the gate is a PLATFORM admin enforced by the handler itself: an org-level admin is refused 403 no matter what they may do inside their own org.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommercePlansEntriesWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/plans/entries"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's products, as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceProduct(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceProductWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's products, as a page
|
|
- GET /v1/commerce/product/
|
|
- A product is a sellable catalog item: slug, SKU and UPC, name and copy, media, availability and preorder flags, a reservation block, and its money — currency, price, MSRP, list price and inventory cost in minor units, inventory count, taxability, and the subscription interval when it is subscribeable. Its variants and options are carried as a denormalized JSON snapshot inside the product, separate from the standalone variant rows, and nothing keeps the two in step for you. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the slug and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or the Product list scope.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceProductWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/product/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one product
|
|
|
|
- parameter productid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceProductByProductid(productid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceProductByProductidWithRequestBuilder(productid: productid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one product
|
|
- GET /v1/commerce/product/{productid}
|
|
- A product is a sellable catalog item: slug, SKU and UPC, name and copy, media, availability and preorder flags, a reservation block, and its money — currency, price, MSRP, list price and inventory cost in minor units, inventory count, taxability, and the subscription interval when it is subscribeable. Its variants and options are carried as a denormalized JSON snapshot inside the product, separate from the standalone variant rows, and nothing keeps the two in step for you. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or ReadProduct.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter productid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceProductByProductidWithRequestBuilder(productid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/product/{productid}"
|
|
let productidPreEscape = "\(APIHelper.mapValueToPathItem(productid))"
|
|
let productidPostEscape = productidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{productid}", with: productidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List what one unit of each metered thing costs
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceRatesEntries(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceRatesEntriesWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List what one unit of each metered thing costs
|
|
- GET /v1/commerce/rates/entries
|
|
- Returns the rate authority's rows — the prices every metered charge resolves against. Narrow with ?product= to show one surface at a time rather than every rate at once. SuperAdmin only: a rate is cross-tenant money, so the handler asks for the reserved admin org's owner claim itself rather than trusting the bundle's token gate.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceRatesEntriesWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/rates/entries"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's returns, as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceReturn(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceReturnWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's returns, as a page
|
|
- GET /v1/commerce/return/
|
|
- A return is an RMA — the store, user and order it belongs to, the line items coming back, a fulfillment block carrying its own type, status and pricing, a summary, and eight lifecycle timestamps from submitted through delivered and processed. Its status is a FREE STRING with no enumeration behind it, and there is no refund amount on the return itself: the money sits inside the line items and the fulfillment pricing. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The token must also carry Admin or the Return list scope.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceReturnWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/return/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one return
|
|
|
|
- parameter returnid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceReturnByReturnid(returnid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceReturnByReturnidWithRequestBuilder(returnid: returnid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one return
|
|
- GET /v1/commerce/return/{returnid}
|
|
- A return is an RMA — the store, user and order it belongs to, the line items coming back, a fulfillment block carrying its own type, status and pricing, a summary, and eight lifecycle timestamps from submitted through delivered and processed. Its status is a FREE STRING with no enumeration behind it, and there is no refund amount on the return itself: the money sits inside the line items and the fulfillment pricing. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The token must also carry Admin or ReadReturn.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter returnid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceReturnByReturnidWithRequestBuilder(returnid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/return/{returnid}"
|
|
let returnidPreEscape = "\(APIHelper.mapValueToPathItem(returnid))"
|
|
let returnidPostEscape = returnidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{returnid}", with: returnidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's sales channels, as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceSaleschannel(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceSaleschannelWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's sales channels, as a page
|
|
- GET /v1/commerce/saleschannel/
|
|
- A sales channel is a named selling surface — a name, a description, a disabled flag and metadata. The flag is NEGATIVE, so a channel created from an empty body is enabled. Nothing on this row links products, prices or stock to the channel; here it is a label other surfaces scope themselves by. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for saleschannel, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceSaleschannelWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/saleschannel/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one sales channel
|
|
|
|
- parameter saleschannelid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceSaleschannelBySaleschannelid(saleschannelid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceSaleschannelBySaleschannelidWithRequestBuilder(saleschannelid: saleschannelid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one sales channel
|
|
- GET /v1/commerce/saleschannel/{saleschannelid}
|
|
- A sales channel is a named selling surface — a name, a description, a disabled flag and metadata. The flag is NEGATIVE, so a channel created from an empty body is enabled. Nothing on this row links products, prices or stock to the channel; here it is a label other surfaces scope themselves by. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for saleschannel, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter saleschannelid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceSaleschannelBySaleschannelidWithRequestBuilder(saleschannelid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/saleschannel/{saleschannelid}"
|
|
let saleschannelidPreEscape = "\(APIHelper.mapValueToPathItem(saleschannelid))"
|
|
let saleschannelidPostEscape = saleschannelidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{saleschannelid}", with: saleschannelidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's stock locations, as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceStocklocation(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceStocklocationWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's stock locations, as a page
|
|
- GET /v1/commerce/stocklocation/
|
|
- A stock location is a physical address inventory can be held at — a name, street lines, city, province, country, postal code and a phone. None of it is validated, there are no coordinates, and the row carries no enabled flag and no inventory link, so deleting it is the only way to retire one. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for stocklocation, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceStocklocationWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/stocklocation/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one stock location
|
|
|
|
- parameter stocklocationid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceStocklocationByStocklocationid(stocklocationid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceStocklocationByStocklocationidWithRequestBuilder(stocklocationid: stocklocationid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one stock location
|
|
- GET /v1/commerce/stocklocation/{stocklocationid}
|
|
- A stock location is a physical address inventory can be held at — a name, street lines, city, province, country, postal code and a phone. None of it is validated, there are no coordinates, and the row carries no enabled flag and no inventory link, so deleting it is the only way to retire one. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for stocklocation, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter stocklocationid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceStocklocationByStocklocationidWithRequestBuilder(stocklocationid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/stocklocation/{stocklocationid}"
|
|
let stocklocationidPreEscape = "\(APIHelper.mapValueToPathItem(stocklocationid))"
|
|
let stocklocationidPostEscape = stocklocationidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{stocklocationid}", with: stocklocationidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's storefronts as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceStore(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceStoreWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's storefronts as a page
|
|
- GET /v1/commerce/store/
|
|
- Answers a pagination envelope — page, display, the rows, and a total count — read from the caller org's OWN namespaced database, so one tenant can never list another's stores. Sorting defaults to the store slug and is overridable with sort; display is the page size and page applies only alongside it, and either one that is not a positive integer is refused rather than silently ignored. The limit query overrides the reported COUNT only and never the rows returned. A request that resolves no org namespace is served an empty page, never an unscoped scan. Readable with an admin token, a store-scoped token, or the anonymous published storefront key.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceStoreWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/store/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Whether a store is entitled to trade, and why
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceStoreAccess(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceStoreAccessWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Whether a store is entitled to trade, and why
|
|
- GET /v1/commerce/store/access
|
|
- Answers allowed, the store id, and a status of trial, active, payment_required, store_required or unavailable — the entitlement check a merchant surface gates on. The rule that surprises people is that entitlement is PER STORE, not per org: the store needs its own current subscription on the entry plan, either trialing with a trial end still ahead or active with a period end still ahead, so an org-wide balance or a sibling store's plan unlocks nothing here. The store comes from the X-Store-Id header and otherwise falls back to the org's first store; neither resolving is store_required with allowed false, and a backing-store failure is 503 with status unavailable — a retry signal, not a denial.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceStoreAccessWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/store/access"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one storefront
|
|
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceStoreByStoreid(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceStoreByStoreidWithRequestBuilder(storeid: storeid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one storefront
|
|
- GET /v1/commerce/store/{storeid}
|
|
- Reads the addressed store from the caller org's own namespaced database, so an id belonging to another tenant is simply absent there and answers 404 rather than leaking its existence. The body is the stored entity including its embedded listing override map. Readable with an admin or store-read token and also with the anonymous published storefront key, which is what lets a logged-out storefront resolve the store it is rendering.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceStoreByStoreidWithRequestBuilder(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch a bundle as this storefront sells it
|
|
|
|
- parameter storeid: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceStoreByStoreidBundleByKey(storeid: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceStoreByStoreidBundleByKeyWithRequestBuilder(storeid: storeid, key: key, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch a bundle as this storefront sells it
|
|
- GET /v1/commerce/store/{storeid}/bundle/{key}
|
|
- Returns the stored bundle with the store's listing for it laid over the top — every non-empty listing field wins, and the currency is forced to the store's own — so the caller reads what this storefront actually sells rather than the catalog-wide record. The overlay is keyed by the item's ID: a listing filed only under a slug or SKU does not reach it, unlike the listing reads, which do fall back to those. An unknown store or key is 404. Readable with an admin token or the anonymous published storefront key.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceStoreByStoreidBundleByKeyWithRequestBuilder(storeid: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/bundle/{key}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let keyPreEscape = "\(APIHelper.mapValueToPathItem(key))"
|
|
let keyPostEscape = keyPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{key}", with: keyPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
The storefront's whole listing override map
|
|
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceStoreByStoreidListing(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceStoreByStoreidListingWithRequestBuilder(storeid: storeid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
The storefront's whole listing override map
|
|
- GET /v1/commerce/store/{storeid}/listing
|
|
- Returns every override this store applies to catalog items — name, price, list price, media, availability and the hidden flag — keyed by product or variant id, in one read. A listing is an OVERRIDE, not a product: the catalog item exists independently and this map only says how this storefront presents it. Read from the caller org's own namespaced database, so a store id belonging to another tenant is 404. Readable with an admin token or the anonymous published storefront key.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceStoreByStoreidListingWithRequestBuilder(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/listing"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one listing override, by item id or by its slug or SKU
|
|
|
|
- parameter storeid: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceStoreByStoreidListingByKey(storeid: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceStoreByStoreidListingByKeyWithRequestBuilder(storeid: storeid, key: key, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one listing override, by item id or by its slug or SKU
|
|
- GET /v1/commerce/store/{storeid}/listing/{key}
|
|
- Looks the key up in the store's listing map first and, failing that, matches it against each listing's slug and then its SKU — so a storefront holding only a product's URL slug can still resolve the override. That fallback is unique to the listing reads; the item overlay routes match by id alone. A key matching none of the three is 404, as is a store id outside the caller org's namespace. Readable with an admin token or the anonymous published storefront key.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceStoreByStoreidListingByKeyWithRequestBuilder(storeid: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/listing/{key}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let keyPreEscape = "\(APIHelper.mapValueToPathItem(key))"
|
|
let keyPostEscape = keyPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{key}", with: keyPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch a product as this storefront sells it
|
|
|
|
- parameter storeid: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceStoreByStoreidProductByKey(storeid: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceStoreByStoreidProductByKeyWithRequestBuilder(storeid: storeid, key: key, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch a product as this storefront sells it
|
|
- GET /v1/commerce/store/{storeid}/product/{key}
|
|
- Returns the stored product with the store's listing for it laid over the top — non-empty listing fields replace the catalog values and the currency is forced to the store's own — which is what lets two storefronts sell the same catalog product at their own price, name and media. The overlay is keyed by the product's ID, so a listing filed only under a slug or SKU does not apply here. An unknown store or key is 404. Readable with an admin token or the anonymous published storefront key.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceStoreByStoreidProductByKeyWithRequestBuilder(storeid: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/product/{key}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let keyPreEscape = "\(APIHelper.mapValueToPathItem(key))"
|
|
let keyPostEscape = keyPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{key}", with: keyPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch a variant as this storefront sells it
|
|
|
|
- parameter storeid: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceStoreByStoreidVariantByKey(storeid: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceStoreByStoreidVariantByKeyWithRequestBuilder(storeid: storeid, key: key, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch a variant as this storefront sells it
|
|
- GET /v1/commerce/store/{storeid}/variant/{key}
|
|
- Returns the stored variant with the store's listing for it overlaid — non-empty listing fields replace the catalog values and the currency is forced to the store's own — which is what makes per-storefront pricing of a shared variant possible. The overlay is keyed by the variant's ID, never by its slug or SKU. An unknown store or key is 404. Readable with an admin token or the anonymous published storefront key.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceStoreByStoreidVariantByKeyWithRequestBuilder(storeid: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/variant/{key}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let keyPreEscape = "\(APIHelper.mapValueToPathItem(key))"
|
|
let keyPostEscape = keyPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{key}", with: keyPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Resolve your org's active storefront without naming an id
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceStoreCurrent(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceStoreCurrentWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Resolve your org's active storefront without naming an id
|
|
- GET /v1/commerce/store/current
|
|
- Returns the caller org's store resolved FROM THE AUTHENTICATED ORG rather than from a path id — which is how an admin dashboard or a storefront edge learns the store id it should then read and write against. An X-Store-Id header selects a specific store, resolved only inside the caller's own namespace, so a foreign id cannot cross the tenant boundary and answers 404 instead. With no header the org's first store is returned, and an org that has none yet has its canonical default provisioned lazily and idempotently, carrying no payment credentials. Only when there is no org in context, or provisioning fails, does it fall back to a placeholder store literally named default, which a storefront edge should treat as unconfigured.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceStoreCurrentWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/store/current"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's submissions, as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceSubmission(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceSubmissionWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's submissions, as a page
|
|
- GET /v1/commerce/submission/
|
|
- A submission is one filled-in form from a site visitor — an email, an optional user id, the client details the server observed (user agent, referer, geography) and the form's own fields as free metadata. It carries no form id, so the link back to the form that produced it is not stored on the row. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The per-kind permission table has no entry for submission, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceSubmissionWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/submission/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one submission
|
|
|
|
- parameter submissionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceSubmissionBySubmissionid(submissionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceSubmissionBySubmissionidWithRequestBuilder(submissionid: submissionid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one submission
|
|
- GET /v1/commerce/submission/{submissionid}
|
|
- A submission is one filled-in form from a site visitor — an email, an optional user id, the client details the server observed (user agent, referer, geography) and the form's own fields as free metadata. It carries no form id, so the link back to the form that produced it is not stored on the row. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The per-kind permission table has no entry for submission, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter submissionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceSubmissionBySubmissionidWithRequestBuilder(submissionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/submission/{submissionid}"
|
|
let submissionidPreEscape = "\(APIHelper.mapValueToPathItem(submissionid))"
|
|
let submissionidPostEscape = submissionidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{submissionid}", with: submissionidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's subscribers, as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceSubscriber(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceSubscriberWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's subscribers, as a page
|
|
- GET /v1/commerce/subscriber/
|
|
- A subscriber is a mailing-list member — name, email, the form id that captured them, unsubscribed state and date, client details, tags and metadata. Writing one FIRES A WEBHOOK: subscriber.created on create and subscriber.updated on replace or patch, emitted BEFORE the write is known to have succeeded and carrying the row as sent, so the payload holds the raw email rather than the normalized one that gets stored. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The token must also carry Admin or the Subscriber list scope.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceSubscriberWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/subscriber/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one subscriber
|
|
|
|
- parameter subscriberid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceSubscriberBySubscriberid(subscriberid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceSubscriberBySubscriberidWithRequestBuilder(subscriberid: subscriberid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one subscriber
|
|
- GET /v1/commerce/subscriber/{subscriberid}
|
|
- A subscriber is a mailing-list member — name, email, the form id that captured them, unsubscribed state and date, client details, tags and metadata. Writing one FIRES A WEBHOOK: subscriber.created on create and subscriber.updated on replace or patch, emitted BEFORE the write is known to have succeeded and carrying the row as sent, so the payload holds the raw email rather than the normalized one that gets stored. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The token must also carry Admin or ReadSubscriber.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter subscriberid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceSubscriberBySubscriberidWithRequestBuilder(subscriberid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/subscriber/{subscriberid}"
|
|
let subscriberidPreEscape = "\(APIHelper.mapValueToPathItem(subscriberid))"
|
|
let subscriberidPostEscape = subscriberidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{subscriberid}", with: subscriberidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's token transactions, as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceTokentransaction(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceTokentransactionWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's token transactions, as a page
|
|
- GET /v1/commerce/tokentransaction/
|
|
- A token transaction records a transfer between two identified parties — amount and fees, a timestamp, sending and receiving addresses, names, user ids, states and countries, a flag per side, a protocol name and a transaction hash. Nothing here touches a chain: the hash is an unvalidated string and the flags are plain writable booleans with no screening behind them. Amounts are floating-point rather than the exact minor units every real money field in commerce uses, and there is no currency field at all — this kind lives in commerce's demo tree, so it is a live writable resource in your tenant's store that nothing else in commerce reads, and it must never carry real money. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The per-kind permission table has no entry for tokentransaction, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceTokentransactionWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/tokentransaction/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one token transaction
|
|
|
|
- parameter tokentransactionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceTokentransactionByTokentransactionid(tokentransactionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceTokentransactionByTokentransactionidWithRequestBuilder(tokentransactionid: tokentransactionid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one token transaction
|
|
- GET /v1/commerce/tokentransaction/{tokentransactionid}
|
|
- A token transaction records a transfer between two identified parties — amount and fees, a timestamp, sending and receiving addresses, names, user ids, states and countries, a flag per side, a protocol name and a transaction hash. Nothing here touches a chain: the hash is an unvalidated string and the flags are plain writable booleans with no screening behind them. Amounts are floating-point rather than the exact minor units every real money field in commerce uses, and there is no currency field at all — this kind lives in commerce's demo tree, so it is a live writable resource in your tenant's store that nothing else in commerce reads, and it must never carry real money. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The per-kind permission table has no entry for tokentransaction, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter tokentransactionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceTokentransactionByTokentransactionidWithRequestBuilder(tokentransactionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/tokentransaction/{tokentransactionid}"
|
|
let tokentransactionidPreEscape = "\(APIHelper.mapValueToPathItem(tokentransactionid))"
|
|
let tokentransactionidPostEscape = tokentransactionidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{tokentransactionid}", with: tokentransactionidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's transfers, as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceTransfer(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceTransferWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's transfers, as a page
|
|
- GET /v1/commerce/transfer/
|
|
- A transfer records that a payable WAS PAID — the annotation a human writes after paying out of band. Commerce executes no payout: creating one moves no money, and it marks the referenced payable settled. It carries the payable and payee ids, the amount it settles and the amount actually sent (which may be a different asset), a type of eth, wire or other, the transaction hash or wire reference, when it was paid and who recorded it; amounts are exact decimal strings with an asset, not cents. It is admin-gated because writing one settles money we owe, and nothing enforces uniqueness on the reference — so posting the same transfer twice settles the payable twice. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for transfer, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceTransferWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/transfer/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one transfer
|
|
|
|
- parameter transferid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceTransferByTransferid(transferid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceTransferByTransferidWithRequestBuilder(transferid: transferid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one transfer
|
|
- GET /v1/commerce/transfer/{transferid}
|
|
- A transfer records that a payable WAS PAID — the annotation a human writes after paying out of band. Commerce executes no payout: creating one moves no money, and it marks the referenced payable settled. It carries the payable and payee ids, the amount it settles and the amount actually sent (which may be a different asset), a type of eth, wire or other, the transaction hash or wire reference, when it was paid and who recorded it; amounts are exact decimal strings with an asset, not cents. It is admin-gated because writing one settles money we owe, and nothing enforces uniqueness on the reference — so posting the same transfer twice settles the payable twice. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for transfer, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter transferid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceTransferByTransferidWithRequestBuilder(transferid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/transfer/{transferid}"
|
|
let transferidPreEscape = "\(APIHelper.mapValueToPathItem(transferid))"
|
|
let transferidPostEscape = transferidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{transferid}", with: transferidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's variants, as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceVariant(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceVariantWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's variants, as a page
|
|
- GET /v1/commerce/variant/
|
|
- A variant is one purchasable SKU of a product — its product id, SKU and UPC, name, media, availability, the option name and value pairs that distinguish it, a sold counter, and its own money and stock: currency, price, MSRP, inventory cost, inventory count and taxability. Inventory and sold are plain writable numbers with no decrement logic behind them here. The same variant also exists as a JSON copy inside its product, and writing one does not update the other. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the SKU and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or the Variant list scope.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceVariantWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/variant/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one variant
|
|
|
|
- parameter variantid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceVariantByVariantid(variantid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceVariantByVariantidWithRequestBuilder(variantid: variantid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one variant
|
|
- GET /v1/commerce/variant/{variantid}
|
|
- A variant is one purchasable SKU of a product — its product id, SKU and UPC, name, media, availability, the option name and value pairs that distinguish it, a sold counter, and its own money and stock: currency, price, MSRP, inventory cost, inventory count and taxability. Inventory and sold are plain writable numbers with no decrement logic behind them here. The same variant also exists as a JSON copy inside its product, and writing one does not update the other. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or ReadVariant.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter variantid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceVariantByVariantidWithRequestBuilder(variantid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/variant/{variantid}"
|
|
let variantidPreEscape = "\(APIHelper.mapValueToPathItem(variantid))"
|
|
let variantidPostEscape = variantidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{variantid}", with: variantidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's wallets, as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceWallet(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceWalletWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's wallets, as a page
|
|
- GET /v1/commerce/wallet/
|
|
- A wallet is a container of custodial blockchain accounts, and its only field is that account list — each account carrying a name, an address, a chain type, and the ENCRYPTED private key with its salt. Creating a wallet through this table generates NO KEYS: key generation lives on the account routes, so a wallet made here is an empty shell and an account posted into one is stored exactly as sent, with no key generation and no validation behind it. Know what a read renders: the plaintext private key is never marshalled and never stored, but the encrypted blob and its salt ARE returned, so whoever can read a wallet can attack it offline down to the strength of the owner's passphrase. That is why this kind is admin-gated. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for wallet, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceWalletWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/wallet/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one wallet
|
|
|
|
- parameter walletid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceWalletByWalletid(walletid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceWalletByWalletidWithRequestBuilder(walletid: walletid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one wallet
|
|
- GET /v1/commerce/wallet/{walletid}
|
|
- A wallet is a container of custodial blockchain accounts, and its only field is that account list — each account carrying a name, an address, a chain type, and the ENCRYPTED private key with its salt. Creating a wallet through this table generates NO KEYS: key generation lives on the account routes, so a wallet made here is an empty shell and an account posted into one is stored exactly as sent, with no key generation and no validation behind it. Know what a read renders: the plaintext private key is never marshalled and never stored, but the encrypted blob and its salt ARE returned, so whoever can read a wallet can attack it offline down to the strength of the owner's passphrase. That is why this kind is admin-gated. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for wallet, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter walletid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceWalletByWalletidWithRequestBuilder(walletid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/wallet/{walletid}"
|
|
let walletidPreEscape = "\(APIHelper.mapValueToPathItem(walletid))"
|
|
let walletidPostEscape = walletidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{walletid}", with: walletidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's watchlists, as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceWatchlist(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceWatchlistWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's watchlists, as a page
|
|
- GET /v1/commerce/watchlist/
|
|
- A watchlist is a viewer's saved list of movies — a user id, an email, and the movies themselves. It stores WHOLE MOVIE SNAPSHOTS rather than movie ids, so a list goes stale the moment a film record changes and grows without bound as it fills. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. Any valid access token reaches it. The per-kind permission table has no entry for watchlist, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceWatchlistWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/watchlist/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one watchlist
|
|
|
|
- parameter watchlistid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceWatchlistByWatchlistid(watchlistid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceWatchlistByWatchlistidWithRequestBuilder(watchlistid: watchlistid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one watchlist
|
|
- GET /v1/commerce/watchlist/{watchlistid}
|
|
- A watchlist is a viewer's saved list of movies — a user id, an email, and the movies themselves. It stores WHOLE MOVIE SNAPSHOTS rather than movie ids, so a list goes stale the moment a film record changes and grows without bound as it fills. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. Any valid access token reaches it. The per-kind permission table has no entry for watchlist, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter watchlistid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceWatchlistByWatchlistidWithRequestBuilder(watchlistid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/watchlist/{watchlistid}"
|
|
let watchlistidPreEscape = "\(APIHelper.mapValueToPathItem(watchlistid))"
|
|
let watchlistidPostEscape = watchlistidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{watchlistid}", with: watchlistidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
List your org's webhooks, as a page
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceWebhook(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceWebhookWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List your org's webhooks, as a page
|
|
- GET /v1/commerce/webhook/
|
|
- A webhook is a merchant-registered endpoint that receives commerce event callbacks — a name, a URL, live and all flags, a per-event map, an enabled flag, and the shared access token each delivery posts IN THE BODY. Two things to know before registering one: that token is a plainly readable field, so anyone who may read webhooks reads every endpoint's secret, and delivery consults only the all flag and the event map — it does NOT consult enabled or live, so setting enabled false does not stop delivery and deleting the row is the only thing that does. Delivery is a single POST with a twenty-second timeout and no retry. Answers a pagination envelope — the page and display echoed back, the rows under models, a total count and a facets array — read from the caller org's own namespaced store, so one tenant can never list another's. Sorting defaults to the last-updated time and is overridable with sort. display is the page size and page applies only alongside it; either one that is not a positive integer is refused with 500 rather than silently ignored, and the limit query overrides the reported COUNT only, never the rows returned. No search backend is wired, so the datastore is the one and only list path and facets is always empty. A request resolving no org namespace is served an EMPTY page rather than an unscoped scan: the namespace IS the tenant filter, so without one there is nothing safe to return. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for webhook, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceWebhookWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/webhook/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Fetch one webhook
|
|
|
|
- parameter webhookid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCommerceWebhookByWebhookid(webhookid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCommerceWebhookByWebhookidWithRequestBuilder(webhookid: webhookid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Fetch one webhook
|
|
- GET /v1/commerce/webhook/{webhookid}
|
|
- A webhook is a merchant-registered endpoint that receives commerce event callbacks — a name, a URL, live and all flags, a per-event map, an enabled flag, and the shared access token each delivery posts IN THE BODY. Two things to know before registering one: that token is a plainly readable field, so anyone who may read webhooks reads every endpoint's secret, and delivery consults only the all flag and the event map — it does NOT consult enabled or live, so setting enabled false does not stop delivery and deleting the row is the only thing that does. Delivery is a single POST with a twenty-second timeout and no retry. Reads the addressed row from the caller org's own namespaced store. An id that is not there is 404 — and another tenant's id is not there by construction, so it reads exactly like a typo instead of confirming the row exists somewhere else. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for webhook, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter webhookid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCommerceWebhookByWebhookidWithRequestBuilder(webhookid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/webhook/{webhookid}"
|
|
let webhookidPreEscape = "\(APIHelper.mapValueToPathItem(webhookid))"
|
|
let webhookidPostEscape = webhookidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{webhookid}", with: webhookidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Open a cart for a shopper to fill
|
|
|
|
- parameter cartOpen: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Cart
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func openCart(cartOpen: CartOpen, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Cart {
|
|
return try await openCartWithRequestBuilder(cartOpen: cartOpen, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Open a cart for a shopper to fill
|
|
- POST /v1/commerce/cart
|
|
- Opens an empty cart for a shopper to fill, and answers it with its new id. This is the first step of a sale: hold the id, add items to it with setCartItem, then hand it to checkout. Every field of the request is optional — an empty body opens a perfectly good anonymous cart — and the fields exist only to pre-fill what is already known about the shopper. The STORE defaults to the org's own default storefront, so a merchant selling through one storefront never has to name it. The CURRENCY defaults to usd; note that checkout overrides it with the store's own currency when the sale is authorized, so a currency set here is a hint rather than a commitment. The cart is created in the CALLER'S OWN org namespace, taken from the validated principal and never from the body, so a cart can never be opened on another tenant's books. A named handler, not a closure, so zipdoc can lift this prose into the registry.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter cartOpen: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Cart>
|
|
*/
|
|
open class func openCartWithRequestBuilder(cartOpen: CartOpen, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Cart> {
|
|
let localVariablePath = "/v1/commerce/cart"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: cartOpen, codableHelper: apiConfiguration.codableHelper)
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
"Content-Type": "application/json",
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Cart>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a collection
|
|
|
|
- parameter collectionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceCollectionByCollectionid(collectionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceCollectionByCollectionidWithRequestBuilder(collectionid: collectionid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a collection
|
|
- PATCH /v1/commerce/collection/{collectionid}
|
|
- A collection is a merchandising group a storefront renders — a slug and name, copy and media, flat lists of the product and variant ids it holds, published, preorder and out-of-stock flags, and an availability window. Membership lives on the collection as those id lists rather than as a join, so putting a product into a collection is a write here and not on the product. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin, or ReadCollection and WriteCollection together.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter collectionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceCollectionByCollectionidWithRequestBuilder(collectionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/collection/{collectionid}"
|
|
let collectionidPreEscape = "\(APIHelper.mapValueToPathItem(collectionid))"
|
|
let collectionidPostEscape = collectionidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{collectionid}", with: collectionidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a disclosure
|
|
|
|
- parameter disclosureid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceDisclosureByDisclosureid(disclosureid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceDisclosureByDisclosureidWithRequestBuilder(disclosureid: disclosureid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a disclosure
|
|
- PATCH /v1/commerce/disclosure/{disclosureid}
|
|
- A disclosure is a published-document record — a publication body, a content hash, a type and a named receiver. The hash LOOKS like a field you set and is in fact derived, but only on update: a freshly created disclosure keeps whatever hash the caller sent until the first replace or patch recomputes it, so a new row's hash attests to nothing. This kind lives in commerce's demo tree — a live writable resource in your tenant's real store that nothing else in commerce reads. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The per-kind permission table has no entry for disclosure, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter disclosureid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceDisclosureByDisclosureidWithRequestBuilder(disclosureid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/disclosure/{disclosureid}"
|
|
let disclosureidPreEscape = "\(APIHelper.mapValueToPathItem(disclosureid))"
|
|
let disclosureidPostEscape = disclosureidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{disclosureid}", with: disclosureidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a discount
|
|
|
|
- parameter discountid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceDiscountByDiscountid(discountid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceDiscountByDiscountidWithRequestBuilder(discountid: discountid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a discount
|
|
- PATCH /v1/commerce/discount/{discountid}
|
|
- A discount is a price rule: a type (flat, percent, free-shipping, free-item or bulk), a window, a scope naming the store, collection, product or variant it applies to, a target, and rules pairing a trigger — a price or quantity threshold — with an action, an amount off or a percentage. It is ENABLED BY DEFAULT, so a bare create makes a live discount rather than a draft. The rule engine caches per replica for about thirty seconds, so a discount switched off here can keep applying briefly on other replicas. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for discount, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter discountid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceDiscountByDiscountidWithRequestBuilder(discountid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/discount/{discountid}"
|
|
let discountidPreEscape = "\(APIHelper.mapValueToPathItem(discountid))"
|
|
let discountidPostEscape = discountidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{discountid}", with: discountidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a movie
|
|
|
|
- parameter movieid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceMovieByMovieid(movieid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceMovieByMovieidWithRequestBuilder(movieid: movieid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a movie
|
|
- PATCH /v1/commerce/movie/{movieid}
|
|
- A movie is a film catalog record — a slug plus EIDR and IMDB ids, all three required, with title and synopsis copy, artwork, screenshots, trailers, cast and crew, and available and hidden flags. It carries NO price: the money for a film lives on the product that sells it. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The per-kind permission table has no entry for movie, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter movieid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceMovieByMovieidWithRequestBuilder(movieid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/movie/{movieid}"
|
|
let movieidPreEscape = "\(APIHelper.mapValueToPathItem(movieid))"
|
|
let movieidPostEscape = movieidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{movieid}", with: movieidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a note
|
|
|
|
- parameter noteid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceNoteByNoteid(noteid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceNoteByNoteidWithRequestBuilder(noteid: noteid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a note
|
|
- PATCH /v1/commerce/note/{noteid}
|
|
- A note is a timestamped free-text log line — a caller-supplied time, a source, a message and an enabled flag. That time is the caller's own field and is distinct from the row's creation stamp; the note search filters on it, so a note written without one is a zero-time note the ops log will never surface. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The per-kind permission table has no entry for note, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter noteid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceNoteByNoteidWithRequestBuilder(noteid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/note/{noteid}"
|
|
let noteidPreEscape = "\(APIHelper.mapValueToPathItem(noteid))"
|
|
let noteidPostEscape = noteidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{noteid}", with: noteidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a product
|
|
|
|
- parameter productid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceProductByProductid(productid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceProductByProductidWithRequestBuilder(productid: productid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a product
|
|
- PATCH /v1/commerce/product/{productid}
|
|
- A product is a sellable catalog item: slug, SKU and UPC, name and copy, media, availability and preorder flags, a reservation block, and its money — currency, price, MSRP, list price and inventory cost in minor units, inventory count, taxability, and the subscription interval when it is subscribeable. Its variants and options are carried as a denormalized JSON snapshot inside the product, separate from the standalone variant rows, and nothing keeps the two in step for you. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin, or ReadProduct and WriteProduct together.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter productid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceProductByProductidWithRequestBuilder(productid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/product/{productid}"
|
|
let productidPreEscape = "\(APIHelper.mapValueToPathItem(productid))"
|
|
let productidPostEscape = productidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{productid}", with: productidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a return
|
|
|
|
- parameter returnid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceReturnByReturnid(returnid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceReturnByReturnidWithRequestBuilder(returnid: returnid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a return
|
|
- PATCH /v1/commerce/return/{returnid}
|
|
- A return is an RMA — the store, user and order it belongs to, the line items coming back, a fulfillment block carrying its own type, status and pricing, a summary, and eight lifecycle timestamps from submitted through delivered and processed. Its status is a FREE STRING with no enumeration behind it, and there is no refund amount on the return itself: the money sits inside the line items and the fulfillment pricing. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The token must also carry Admin, or ReadReturn and WriteReturn together.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter returnid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceReturnByReturnidWithRequestBuilder(returnid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/return/{returnid}"
|
|
let returnidPreEscape = "\(APIHelper.mapValueToPathItem(returnid))"
|
|
let returnidPostEscape = returnidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{returnid}", with: returnidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a sales channel
|
|
|
|
- parameter saleschannelid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceSaleschannelBySaleschannelid(saleschannelid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceSaleschannelBySaleschannelidWithRequestBuilder(saleschannelid: saleschannelid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a sales channel
|
|
- PATCH /v1/commerce/saleschannel/{saleschannelid}
|
|
- A sales channel is a named selling surface — a name, a description, a disabled flag and metadata. The flag is NEGATIVE, so a channel created from an empty body is enabled. Nothing on this row links products, prices or stock to the channel; here it is a label other surfaces scope themselves by. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for saleschannel, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter saleschannelid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceSaleschannelBySaleschannelidWithRequestBuilder(saleschannelid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/saleschannel/{saleschannelid}"
|
|
let saleschannelidPreEscape = "\(APIHelper.mapValueToPathItem(saleschannelid))"
|
|
let saleschannelidPostEscape = saleschannelidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{saleschannelid}", with: saleschannelidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a stock location
|
|
|
|
- parameter stocklocationid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceStocklocationByStocklocationid(stocklocationid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceStocklocationByStocklocationidWithRequestBuilder(stocklocationid: stocklocationid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a stock location
|
|
- PATCH /v1/commerce/stocklocation/{stocklocationid}
|
|
- A stock location is a physical address inventory can be held at — a name, street lines, city, province, country, postal code and a phone. None of it is validated, there are no coordinates, and the row carries no enabled flag and no inventory link, so deleting it is the only way to retire one. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for stocklocation, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter stocklocationid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceStocklocationByStocklocationidWithRequestBuilder(stocklocationid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/stocklocation/{stocklocationid}"
|
|
let stocklocationidPreEscape = "\(APIHelper.mapValueToPathItem(stocklocationid))"
|
|
let stocklocationidPostEscape = stocklocationidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{stocklocationid}", with: stocklocationidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a storefront
|
|
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceStoreByStoreid(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceStoreByStoreidWithRequestBuilder(storeid: storeid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a storefront
|
|
- PATCH /v1/commerce/store/{storeid}
|
|
- Loads the stored store and decodes the body over it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged entity. The id is resolved inside the caller org's own namespace, so an unknown or foreign id is 404. Requires an admin token, or one holding both store read and store write.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceStoreByStoreidWithRequestBuilder(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Confirm a listing override exists and re-save the store
|
|
|
|
- parameter storeid: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceStoreByStoreidListingByKey(storeid: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceStoreByStoreidListingByKeyWithRequestBuilder(storeid: storeid, key: key, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Confirm a listing override exists and re-save the store
|
|
- PATCH /v1/commerce/store/{storeid}/listing/{key}
|
|
- Requires the key to already be present — an absent one is 404 — and answers the store's listing map at 200. Read the behaviour before relying on it: the decoded body is applied to a COPY taken out of the map and is never assigned back, so the stored listing is unchanged and the map returned is exactly the map that was already there. An actual edit to an existing listing has to go through the upsert, which does write its result back into the store. A body that fails to decode is still 400. Admin-gated and namespaced to the caller's org.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceStoreByStoreidListingByKeyWithRequestBuilder(storeid: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/listing/{key}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let keyPreEscape = "\(APIHelper.mapValueToPathItem(key))"
|
|
let keyPostEscape = keyPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{key}", with: keyPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a submission
|
|
|
|
- parameter submissionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceSubmissionBySubmissionid(submissionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceSubmissionBySubmissionidWithRequestBuilder(submissionid: submissionid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a submission
|
|
- PATCH /v1/commerce/submission/{submissionid}
|
|
- A submission is one filled-in form from a site visitor — an email, an optional user id, the client details the server observed (user agent, referer, geography) and the form's own fields as free metadata. It carries no form id, so the link back to the form that produced it is not stored on the row. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The per-kind permission table has no entry for submission, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter submissionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceSubmissionBySubmissionidWithRequestBuilder(submissionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/submission/{submissionid}"
|
|
let submissionidPreEscape = "\(APIHelper.mapValueToPathItem(submissionid))"
|
|
let submissionidPostEscape = submissionidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{submissionid}", with: submissionidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a subscriber
|
|
|
|
- parameter subscriberid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceSubscriberBySubscriberid(subscriberid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceSubscriberBySubscriberidWithRequestBuilder(subscriberid: subscriberid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a subscriber
|
|
- PATCH /v1/commerce/subscriber/{subscriberid}
|
|
- A subscriber is a mailing-list member — name, email, the form id that captured them, unsubscribed state and date, client details, tags and metadata. Writing one FIRES A WEBHOOK: subscriber.created on create and subscriber.updated on replace or patch, emitted BEFORE the write is known to have succeeded and carrying the row as sent, so the payload holds the raw email rather than the normalized one that gets stored. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The token must also carry Admin, or ReadSubscriber and WriteSubscriber together.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter subscriberid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceSubscriberBySubscriberidWithRequestBuilder(subscriberid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/subscriber/{subscriberid}"
|
|
let subscriberidPreEscape = "\(APIHelper.mapValueToPathItem(subscriberid))"
|
|
let subscriberidPostEscape = subscriberidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{subscriberid}", with: subscriberidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a token transaction
|
|
|
|
- parameter tokentransactionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceTokentransactionByTokentransactionid(tokentransactionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceTokentransactionByTokentransactionidWithRequestBuilder(tokentransactionid: tokentransactionid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a token transaction
|
|
- PATCH /v1/commerce/tokentransaction/{tokentransactionid}
|
|
- A token transaction records a transfer between two identified parties — amount and fees, a timestamp, sending and receiving addresses, names, user ids, states and countries, a flag per side, a protocol name and a transaction hash. Nothing here touches a chain: the hash is an unvalidated string and the flags are plain writable booleans with no screening behind them. Amounts are floating-point rather than the exact minor units every real money field in commerce uses, and there is no currency field at all — this kind lives in commerce's demo tree, so it is a live writable resource in your tenant's store that nothing else in commerce reads, and it must never carry real money. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The per-kind permission table has no entry for tokentransaction, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter tokentransactionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceTokentransactionByTokentransactionidWithRequestBuilder(tokentransactionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/tokentransaction/{tokentransactionid}"
|
|
let tokentransactionidPreEscape = "\(APIHelper.mapValueToPathItem(tokentransactionid))"
|
|
let tokentransactionidPostEscape = tokentransactionidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{tokentransactionid}", with: tokentransactionidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a transfer
|
|
|
|
- parameter transferid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceTransferByTransferid(transferid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceTransferByTransferidWithRequestBuilder(transferid: transferid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a transfer
|
|
- PATCH /v1/commerce/transfer/{transferid}
|
|
- A transfer records that a payable WAS PAID — the annotation a human writes after paying out of band. Commerce executes no payout: creating one moves no money, and it marks the referenced payable settled. It carries the payable and payee ids, the amount it settles and the amount actually sent (which may be a different asset), a type of eth, wire or other, the transaction hash or wire reference, when it was paid and who recorded it; amounts are exact decimal strings with an asset, not cents. It is admin-gated because writing one settles money we owe, and nothing enforces uniqueness on the reference — so posting the same transfer twice settles the payable twice. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for transfer, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter transferid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceTransferByTransferidWithRequestBuilder(transferid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/transfer/{transferid}"
|
|
let transferidPreEscape = "\(APIHelper.mapValueToPathItem(transferid))"
|
|
let transferidPostEscape = transferidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{transferid}", with: transferidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a variant
|
|
|
|
- parameter variantid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceVariantByVariantid(variantid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceVariantByVariantidWithRequestBuilder(variantid: variantid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a variant
|
|
- PATCH /v1/commerce/variant/{variantid}
|
|
- A variant is one purchasable SKU of a product — its product id, SKU and UPC, name, media, availability, the option name and value pairs that distinguish it, a sold counter, and its own money and stock: currency, price, MSRP, inventory cost, inventory count and taxability. Inventory and sold are plain writable numbers with no decrement logic behind them here. The same variant also exists as a JSON copy inside its product, and writing one does not update the other. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin, or ReadVariant and WriteVariant together.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter variantid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceVariantByVariantidWithRequestBuilder(variantid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/variant/{variantid}"
|
|
let variantidPreEscape = "\(APIHelper.mapValueToPathItem(variantid))"
|
|
let variantidPostEscape = variantidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{variantid}", with: variantidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a wallet
|
|
|
|
- parameter walletid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceWalletByWalletid(walletid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceWalletByWalletidWithRequestBuilder(walletid: walletid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a wallet
|
|
- PATCH /v1/commerce/wallet/{walletid}
|
|
- A wallet is a container of custodial blockchain accounts, and its only field is that account list — each account carrying a name, an address, a chain type, and the ENCRYPTED private key with its salt. Creating a wallet through this table generates NO KEYS: key generation lives on the account routes, so a wallet made here is an empty shell and an account posted into one is stored exactly as sent, with no key generation and no validation behind it. Know what a read renders: the plaintext private key is never marshalled and never stored, but the encrypted blob and its salt ARE returned, so whoever can read a wallet can attack it offline down to the strength of the owner's passphrase. That is why this kind is admin-gated. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for wallet, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter walletid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceWalletByWalletidWithRequestBuilder(walletid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/wallet/{walletid}"
|
|
let walletidPreEscape = "\(APIHelper.mapValueToPathItem(walletid))"
|
|
let walletidPostEscape = walletidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{walletid}", with: walletidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a watchlist
|
|
|
|
- parameter watchlistid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceWatchlistByWatchlistid(watchlistid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceWatchlistByWatchlistidWithRequestBuilder(watchlistid: watchlistid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a watchlist
|
|
- PATCH /v1/commerce/watchlist/{watchlistid}
|
|
- A watchlist is a viewer's saved list of movies — a user id, an email, and the movies themselves. It stores WHOLE MOVIE SNAPSHOTS rather than movie ids, so a list goes stale the moment a film record changes and grows without bound as it fills. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. Any valid access token reaches it. The per-kind permission table has no entry for watchlist, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter watchlistid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceWatchlistByWatchlistidWithRequestBuilder(watchlistid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/watchlist/{watchlistid}"
|
|
let watchlistidPreEscape = "\(APIHelper.mapValueToPathItem(watchlistid))"
|
|
let watchlistidPostEscape = watchlistidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{watchlistid}", with: watchlistidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Change part of a webhook
|
|
|
|
- parameter webhookid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchCommerceWebhookByWebhookid(webhookid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await patchCommerceWebhookByWebhookidWithRequestBuilder(webhookid: webhookid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Change part of a webhook
|
|
- PATCH /v1/commerce/webhook/{webhookid}
|
|
- A webhook is a merchant-registered endpoint that receives commerce event callbacks — a name, a URL, live and all flags, a per-event map, an enabled flag, and the shared access token each delivery posts IN THE BODY. Two things to know before registering one: that token is a plainly readable field, so anyone who may read webhooks reads every endpoint's secret, and delivery consults only the all flag and the event map — it does NOT consult enabled or live, so setting enabled false does not stop delivery and deleting the row is the only thing that does. Delivery is a single POST with a twenty-second timeout and no retry. Loads the stored row and decodes the body OVER it, so only the fields the body names change and everything else keeps its stored value — the difference from the full replace, which clears what it is not told. Answers the merged row. An id absent from the caller org's namespace is 404 and a body that fails to decode is 400. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for webhook, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter webhookid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func patchCommerceWebhookByWebhookidWithRequestBuilder(webhookid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/webhook/{webhookid}"
|
|
let webhookidPreEscape = "\(APIHelper.mapValueToPathItem(webhookid))"
|
|
let webhookidPostEscape = webhookidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{webhookid}", with: webhookidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Add a catalog entry
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceCatalogEntries(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceCatalogEntriesWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Add a catalog entry
|
|
- POST /v1/commerce/catalog/entries
|
|
- Creates a catalog row from the body and answers it at 201. The slug is required and is the globally-unique catalog key, so a second entry claiming a slug already in use is refused 409 rather than shadowing the first. PLATFORM admin only — this is cross-tenant pricing and packaging data, and an org-level admin is refused 403.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceCatalogEntriesWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/catalog/entries"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Land a syncer's view of the model catalog: upstream costs and machine facts
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceCatalogModels(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceCatalogModelsWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Land a syncer's view of the model catalog: upstream costs and machine facts
|
|
- POST /v1/commerce/catalog/models
|
|
- Takes a batch of model rows and upserts each one's upstream COST and machine-observable facts, answering what was created and changed. It deliberately touches nothing a human owns — not the retail price, not the markup, not the entitlement tier — so a sync can never overwrite an administrator's pricing decision. The gate is a PLATFORM principal rather than a platform ADMIN, because the caller is normally a scheduled job holding the internal service token, which carries platform scope but no admin claim.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceCatalogModelsWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/catalog/models"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Refresh the model catalog by reading the upstream provider
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceCatalogModelsRefresh(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceCatalogModelsRefreshWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Refresh the model catalog by reading the upstream provider
|
|
- POST /v1/commerce/catalog/models/refresh
|
|
- Pulls the upstream model list and lands it through the same upsert the push endpoint uses, so the rule that a sync owns cost and an administrator owns price holds no matter which endpoint a row came through. It takes no body — the upstream is READ rather than told. If that upstream cannot be read the call answers 502 and writes NOTHING: a sync that cannot see its source must never conclude the source is empty, because that conclusion would withdraw every model on sale. The gate is a PLATFORM principal so the scheduled job's service token qualifies.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceCatalogModelsRefreshWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/catalog/models/refresh"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Seed the embedded catalog, without disturbing edits already made
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceCatalogSeed(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceCatalogSeedWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Seed the embedded catalog, without disturbing edits already made
|
|
- POST /v1/commerce/catalog/seed
|
|
- Upserts the shipped catalog seed and answers how many entries it created. It is idempotent and non-destructive — an entry an administrator has since edited is left alone — so it is safe to run against a live catalog to fill in what is missing. PLATFORM admin only; an org-level admin is refused 403.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceCatalogSeedWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/catalog/seed"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a collection
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceCollection(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceCollectionWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a collection
|
|
- POST /v1/commerce/collection/
|
|
- A collection is a merchandising group a storefront renders — a slug and name, copy and media, flat lists of the product and variant ids it holds, published, preorder and out-of-stock flags, and an availability window. Membership lives on the collection as those id lists rather than as a join, so putting a product into a collection is a write here and not on the product. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or WriteCollection.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceCollectionWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/collection/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a collection — for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter collectionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceCollectionByCollectionid(collectionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceCollectionByCollectionidWithRequestBuilder(collectionid: collectionid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a collection — for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/collection/{collectionid}
|
|
- A collection is a merchandising group a storefront renders — a slug and name, copy and media, flat lists of the product and variant ids it holds, published, preorder and out-of-stock flags, and an availability window. Membership lives on the collection as those id lists rather than as a join, so putting a product into a collection is a write here and not on the product. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter collectionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceCollectionByCollectionidWithRequestBuilder(collectionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/collection/{collectionid}"
|
|
let collectionidPreEscape = "\(APIHelper.mapValueToPathItem(collectionid))"
|
|
let collectionidPostEscape = collectionidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{collectionid}", with: collectionidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a disclosure
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceDisclosure(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceDisclosureWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a disclosure
|
|
- POST /v1/commerce/disclosure/
|
|
- A disclosure is a published-document record — a publication body, a content hash, a type and a named receiver. The hash LOOKS like a field you set and is in fact derived, but only on update: a freshly created disclosure keeps whatever hash the caller sent until the first replace or patch recomputes it, so a new row's hash attests to nothing. This kind lives in commerce's demo tree — a live writable resource in your tenant's real store that nothing else in commerce reads. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The per-kind permission table has no entry for disclosure, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceDisclosureWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/disclosure/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a disclosure — for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter disclosureid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceDisclosureByDisclosureid(disclosureid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceDisclosureByDisclosureidWithRequestBuilder(disclosureid: disclosureid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a disclosure — for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/disclosure/{disclosureid}
|
|
- A disclosure is a published-document record — a publication body, a content hash, a type and a named receiver. The hash LOOKS like a field you set and is in fact derived, but only on update: a freshly created disclosure keeps whatever hash the caller sent until the first replace or patch recomputes it, so a new row's hash attests to nothing. This kind lives in commerce's demo tree — a live writable resource in your tenant's real store that nothing else in commerce reads. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter disclosureid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceDisclosureByDisclosureidWithRequestBuilder(disclosureid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/disclosure/{disclosureid}"
|
|
let disclosureidPreEscape = "\(APIHelper.mapValueToPathItem(disclosureid))"
|
|
let disclosureidPostEscape = disclosureidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{disclosureid}", with: disclosureidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a discount
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceDiscount(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceDiscountWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a discount
|
|
- POST /v1/commerce/discount/
|
|
- A discount is a price rule: a type (flat, percent, free-shipping, free-item or bulk), a window, a scope naming the store, collection, product or variant it applies to, a target, and rules pairing a trigger — a price or quantity threshold — with an action, an amount off or a percentage. It is ENABLED BY DEFAULT, so a bare create makes a live discount rather than a draft. The rule engine caches per replica for about thirty seconds, so a discount switched off here can keep applying briefly on other replicas. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for discount, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceDiscountWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/discount/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a discount — for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter discountid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceDiscountByDiscountid(discountid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceDiscountByDiscountidWithRequestBuilder(discountid: discountid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a discount — for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/discount/{discountid}
|
|
- A discount is a price rule: a type (flat, percent, free-shipping, free-item or bulk), a window, a scope naming the store, collection, product or variant it applies to, a target, and rules pairing a trigger — a price or quantity threshold — with an action, an amount off or a percentage. It is ENABLED BY DEFAULT, so a bare create makes a live discount rather than a draft. The rule engine caches per replica for about thirty seconds, so a discount switched off here can keep applying briefly on other replicas. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter discountid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceDiscountByDiscountidWithRequestBuilder(discountid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/discount/{discountid}"
|
|
let discountidPreEscape = "\(APIHelper.mapValueToPathItem(discountid))"
|
|
let discountidPostEscape = discountidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{discountid}", with: discountidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a movie
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceMovie(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceMovieWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a movie
|
|
- POST /v1/commerce/movie/
|
|
- A movie is a film catalog record — a slug plus EIDR and IMDB ids, all three required, with title and synopsis copy, artwork, screenshots, trailers, cast and crew, and available and hidden flags. It carries NO price: the money for a film lives on the product that sells it. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The per-kind permission table has no entry for movie, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceMovieWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/movie/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a movie — for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter movieid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceMovieByMovieid(movieid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceMovieByMovieidWithRequestBuilder(movieid: movieid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a movie — for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/movie/{movieid}
|
|
- A movie is a film catalog record — a slug plus EIDR and IMDB ids, all three required, with title and synopsis copy, artwork, screenshots, trailers, cast and crew, and available and hidden flags. It carries NO price: the money for a film lives on the product that sells it. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter movieid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceMovieByMovieidWithRequestBuilder(movieid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/movie/{movieid}"
|
|
let movieidPreEscape = "\(APIHelper.mapValueToPathItem(movieid))"
|
|
let movieidPostEscape = movieidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{movieid}", with: movieidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a note
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceNote(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceNoteWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a note
|
|
- POST /v1/commerce/note/
|
|
- A note is a timestamped free-text log line — a caller-supplied time, a source, a message and an enabled flag. That time is the caller's own field and is distinct from the row's creation stamp; the note search filters on it, so a note written without one is a zero-time note the ops log will never surface. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The per-kind permission table has no entry for note, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceNoteWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/note/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a note — for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter noteid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceNoteByNoteid(noteid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceNoteByNoteidWithRequestBuilder(noteid: noteid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a note — for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/note/{noteid}
|
|
- A note is a timestamped free-text log line — a caller-supplied time, a source, a message and an enabled flag. That time is the caller's own field and is distinct from the row's creation stamp; the note search filters on it, so a note written without one is a zero-time note the ops log will never surface. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter noteid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceNoteByNoteidWithRequestBuilder(noteid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/note/{noteid}"
|
|
let noteidPreEscape = "\(APIHelper.mapValueToPathItem(noteid))"
|
|
let noteidPostEscape = noteidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{noteid}", with: noteidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Add a subscription plan
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommercePlansEntries(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommercePlansEntriesWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Add a subscription plan
|
|
- POST /v1/commerce/plans/entries
|
|
- Creates a plan from the body and answers it at 201. The slug is required and globally unique — a duplicate is 409 — and the row is marked authoritative on creation, so the corrective seed will leave it alone. Price, annual price and the contact-sales flag are stored exactly as sent, never coerced, so the difference between a free plan and a quote-only plan survives. PLATFORM admin only.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommercePlansEntriesWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/plans/entries"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Seed the embedded plan catalog, without overwriting administrative edits
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommercePlansSeed(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommercePlansSeedWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Seed the embedded plan catalog, without overwriting administrative edits
|
|
- POST /v1/commerce/plans/seed
|
|
- Upserts the shipped plan rows and answers how many were created and how many corrected. It is idempotent and non-destructive — a row an administrator authored or edited is left as it stands — so it is safe against a live authority and fills only what is missing or has drifted. PLATFORM admin only, and a deployment with no seed source wired answers 500 rather than quietly seeding nothing.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommercePlansSeedWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/plans/seed"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a product
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceProduct(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceProductWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a product
|
|
- POST /v1/commerce/product/
|
|
- A product is a sellable catalog item: slug, SKU and UPC, name and copy, media, availability and preorder flags, a reservation block, and its money — currency, price, MSRP, list price and inventory cost in minor units, inventory count, taxability, and the subscription interval when it is subscribeable. Its variants and options are carried as a denormalized JSON snapshot inside the product, separate from the standalone variant rows, and nothing keeps the two in step for you. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or WriteProduct.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceProductWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/product/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a product — for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter productid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceProductByProductid(productid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceProductByProductidWithRequestBuilder(productid: productid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a product — for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/product/{productid}
|
|
- A product is a sellable catalog item: slug, SKU and UPC, name and copy, media, availability and preorder flags, a reservation block, and its money — currency, price, MSRP, list price and inventory cost in minor units, inventory count, taxability, and the subscription interval when it is subscribeable. Its variants and options are carried as a denormalized JSON snapshot inside the product, separate from the standalone variant rows, and nothing keeps the two in step for you. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter productid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceProductByProductidWithRequestBuilder(productid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/product/{productid}"
|
|
let productidPreEscape = "\(APIHelper.mapValueToPathItem(productid))"
|
|
let productidPostEscape = productidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{productid}", with: productidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Add a rate
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceRatesEntries(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceRatesEntriesWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Add a rate
|
|
- POST /v1/commerce/rates/entries
|
|
- Creates one rate. Product AND meter are both required, because together they are the identity: a rate keyed on the metered thing alone would let one product's price overwrite another's under the same name. A slug that already exists is refused rather than silently replaced. SuperAdmin only.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceRatesEntriesWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/rates/entries"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Load the published price document, reconciling rather than replacing
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceRatesImport(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceRatesImportWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Load the published price document, reconciling rather than replacing
|
|
- POST /v1/commerce/rates/import
|
|
- Takes an array of rates and seeds the authority from it — the same reconcile the boot catalog runs, driven from admin instead. It RECONCILES: a row that matches is left alone, a row that has drifted is corrected, and a row an operator edited is skipped — so importing the same document twice is a no-op and importing a corrected one moves exactly the rows that changed. Answers what it received, created, corrected and left unchanged, so an import that changes nothing reads as nothing to do rather than as a failure. An empty array is refused 400. SuperAdmin only.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceRatesImportWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/rates/import"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a return
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceReturn(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceReturnWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a return
|
|
- POST /v1/commerce/return/
|
|
- A return is an RMA — the store, user and order it belongs to, the line items coming back, a fulfillment block carrying its own type, status and pricing, a summary, and eight lifecycle timestamps from submitted through delivered and processed. Its status is a FREE STRING with no enumeration behind it, and there is no refund amount on the return itself: the money sits inside the line items and the fulfillment pricing. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The token must also carry Admin or WriteReturn.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceReturnWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/return/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a return — for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter returnid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceReturnByReturnid(returnid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceReturnByReturnidWithRequestBuilder(returnid: returnid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a return — for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/return/{returnid}
|
|
- A return is an RMA — the store, user and order it belongs to, the line items coming back, a fulfillment block carrying its own type, status and pricing, a summary, and eight lifecycle timestamps from submitted through delivered and processed. Its status is a FREE STRING with no enumeration behind it, and there is no refund amount on the return itself: the money sits inside the line items and the fulfillment pricing. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter returnid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceReturnByReturnidWithRequestBuilder(returnid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/return/{returnid}"
|
|
let returnidPreEscape = "\(APIHelper.mapValueToPathItem(returnid))"
|
|
let returnidPostEscape = returnidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{returnid}", with: returnidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a sales channel
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceSaleschannel(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceSaleschannelWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a sales channel
|
|
- POST /v1/commerce/saleschannel/
|
|
- A sales channel is a named selling surface — a name, a description, a disabled flag and metadata. The flag is NEGATIVE, so a channel created from an empty body is enabled. Nothing on this row links products, prices or stock to the channel; here it is a label other surfaces scope themselves by. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for saleschannel, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceSaleschannelWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/saleschannel/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a sales channel — for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter saleschannelid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceSaleschannelBySaleschannelid(saleschannelid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceSaleschannelBySaleschannelidWithRequestBuilder(saleschannelid: saleschannelid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a sales channel — for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/saleschannel/{saleschannelid}
|
|
- A sales channel is a named selling surface — a name, a description, a disabled flag and metadata. The flag is NEGATIVE, so a channel created from an empty body is enabled. Nothing on this row links products, prices or stock to the channel; here it is a label other surfaces scope themselves by. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter saleschannelid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceSaleschannelBySaleschannelidWithRequestBuilder(saleschannelid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/saleschannel/{saleschannelid}"
|
|
let saleschannelidPreEscape = "\(APIHelper.mapValueToPathItem(saleschannelid))"
|
|
let saleschannelidPostEscape = saleschannelidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{saleschannelid}", with: saleschannelidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a stock location
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStocklocation(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStocklocationWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a stock location
|
|
- POST /v1/commerce/stocklocation/
|
|
- A stock location is a physical address inventory can be held at — a name, street lines, city, province, country, postal code and a phone. None of it is validated, there are no coordinates, and the row carries no enabled flag and no inventory link, so deleting it is the only way to retire one. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for stocklocation, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStocklocationWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/stocklocation/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a stock location — for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter stocklocationid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStocklocationByStocklocationid(stocklocationid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStocklocationByStocklocationidWithRequestBuilder(stocklocationid: stocklocationid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a stock location — for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/stocklocation/{stocklocationid}
|
|
- A stock location is a physical address inventory can be held at — a name, street lines, city, province, country, postal code and a phone. None of it is validated, there are no coordinates, and the row carries no enabled flag and no inventory link, so deleting it is the only way to retire one. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter stocklocationid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStocklocationByStocklocationidWithRequestBuilder(stocklocationid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/stocklocation/{stocklocationid}"
|
|
let stocklocationidPreEscape = "\(APIHelper.mapValueToPathItem(stocklocationid))"
|
|
let stocklocationidPostEscape = stocklocationidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{stocklocationid}", with: stocklocationidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a storefront
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStore(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a storefront
|
|
- POST /v1/commerce/store/
|
|
- Creates a store from the body inside the caller org's own namespaced database, so the row is physically isolated to that tenant from its first write, and answers it at 201 with a Location header naming its id. Requires an admin or store-write token: the anonymous published storefront key may READ stores but never create one. A body that fails to decode is 400.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/store/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreByStoreid(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreByStoreidWithRequestBuilder(storeid: storeid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/store/{storeid}
|
|
- Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header, the header winning when both are present. Only PUT, PATCH and DELETE are accepted; anything else resolves to 405. The trap is the default: naming NO override at all is treated as a partial update, never as a create. Authorization is whatever the underlying operation requires, since the real handler runs.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreByStoreidWithRequestBuilder(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Authorize a new order against a storefront, holding the funds without settling them
|
|
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreByStoreidAuthorize(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreByStoreidAuthorizeWithRequestBuilder(storeid: storeid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Authorize a new order against a storefront, holding the funds without settling them
|
|
- POST /v1/commerce/store/{storeid}/authorize
|
|
- Tallies a new order for the addressed store from the user, payment and order body, reserves its items, runs the processor authorization and answers the saved order with a Location header pointing at it. The gate is a token carrying admin or published scope, so a published storefront key is enough; no token is 401 and a token with neither bit is 403. The store is loaded BEFORE any payment work and its currency OVERRIDES whatever the body asked for, so a store that will not load ends the call with 500 and nothing is charged. On any authorization failure the reservations are released and the order and payment are persisted as cancelled, so a failed attempt still leaves a durable record. Capture is a separate call.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreByStoreidAuthorizeWithRequestBuilder(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/authorize"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Authorize an order that already exists, holding the funds without settling them
|
|
|
|
- parameter storeid: (path)
|
|
- parameter orderid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreByStoreidAuthorizeByOrderid(storeid: String, orderid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreByStoreidAuthorizeByOrderidWithRequestBuilder(storeid: storeid, orderid: orderid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Authorize an order that already exists, holding the funds without settling them
|
|
- POST /v1/commerce/store/{storeid}/authorize/{orderid}
|
|
- Continues the order named in the path rather than minting a new one, holding funds for it. The order is loaded from the caller org's own store, so an id belonging to another tenant is a 404. The rule most callers get wrong is that the body's order object is MERGED onto the loaded order before the tally — this is not a read-only reference, and a field sent here overwrites what is stored. The gate, the store resolution and the currency override behave exactly as on the bodiless-id sibling, and settling is still the capture call's job.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter orderid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreByStoreidAuthorizeByOrderidWithRequestBuilder(storeid: String, orderid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/authorize/{orderid}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let orderidPreEscape = "\(APIHelper.mapValueToPathItem(orderid))"
|
|
let orderidPostEscape = orderidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{orderid}", with: orderidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Capture a previously authorized order and settle the payment
|
|
|
|
- parameter storeid: (path)
|
|
- parameter orderid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreByStoreidCaptureByOrderid(storeid: String, orderid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreByStoreidCaptureByOrderidWithRequestBuilder(storeid: storeid, orderid: orderid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Capture a previously authorized order and settle the payment
|
|
- POST /v1/commerce/store/{storeid}/capture/{orderid}
|
|
- Settles the order named in the path — the second half of the two-step flow — and answers the updated order with a Location header. Dispatch follows the order's STORED payment type, and a successful capture is the moment the rest of the system learns about the sale: order and payment rows are updated, coupon redemptions, referral, cart and stats are written, the confirmation email goes out, and the paid and completed events are emitted. A capture failure releases the order's inventory reservations and answers 400, so a failed settlement never leaves items held.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter orderid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreByStoreidCaptureByOrderidWithRequestBuilder(storeid: String, orderid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/capture/{orderid}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let orderidPreEscape = "\(APIHelper.mapValueToPathItem(orderid))"
|
|
let orderidPostEscape = orderidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{orderid}", with: orderidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Authorize and capture a new order in one call
|
|
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreByStoreidCharge(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreByStoreidChargeWithRequestBuilder(storeid: storeid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Authorize and capture a new order in one call
|
|
- POST /v1/commerce/store/{storeid}/charge
|
|
- Runs authorization and capture back to back against a freshly created order — the one-step flow for callers with no reason to hold funds. It takes the authorize body and inherits every authorize rule: the store's currency wins over the body, the items are reserved before the processor is called, and the amount bounds the processor enforces still apply. There is no order id on this address, so it can never continue an existing order. Either half failing answers 400, and the capture side effects — confirmation email, redemptions, stats, the paid and completed events — run only when both halves succeed.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreByStoreidChargeWithRequestBuilder(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/charge"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Authorize a new order against a storefront, holding the funds — the checkout spelling
|
|
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreByStoreidCheckoutAuthorize(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreByStoreidCheckoutAuthorizeWithRequestBuilder(storeid: storeid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Authorize a new order against a storefront, holding the funds — the checkout spelling
|
|
- POST /v1/commerce/store/{storeid}/checkout/authorize
|
|
- Authorizes a new order for the addressed store and holds the funds, answering the saved order with a Location header. It binds the identical handler as the shorter authorize address, so the two are ONE operation at two spellings and not two behaviours; the checkout prefix is the newer one. Every rule carries over: admin or published scope on the token, the store loaded first with its currency overriding the body, items reserved before the processor call, and reservations released with the order persisted cancelled on failure. Nothing is settled here.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreByStoreidCheckoutAuthorizeWithRequestBuilder(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/checkout/authorize"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Authorize an existing order, holding the funds — the checkout spelling
|
|
|
|
- parameter storeid: (path)
|
|
- parameter orderid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreByStoreidCheckoutAuthorizeByOrderid(storeid: String, orderid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreByStoreidCheckoutAuthorizeByOrderidWithRequestBuilder(storeid: storeid, orderid: orderid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Authorize an existing order, holding the funds — the checkout spelling
|
|
- POST /v1/commerce/store/{storeid}/checkout/authorize/{orderid}
|
|
- Continues the order named in the path rather than minting one, and shares its handler byte for byte with the unprefixed authorize-by-id address. The order is loaded from the caller org's own store, so another tenant's id is a 404, and the body's order object is merged onto the loaded row before the tally — a field sent here overwrites what is stored. Store resolution, the token gate and the currency override behave as on every other authorize address; settle with the capture address and the same order id.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter orderid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreByStoreidCheckoutAuthorizeByOrderidWithRequestBuilder(storeid: String, orderid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/checkout/authorize/{orderid}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let orderidPreEscape = "\(APIHelper.mapValueToPathItem(orderid))"
|
|
let orderidPostEscape = orderidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{orderid}", with: orderidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Capture a previously authorized order and settle it — the checkout spelling
|
|
|
|
- parameter storeid: (path)
|
|
- parameter orderid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreByStoreidCheckoutCaptureByOrderid(storeid: String, orderid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreByStoreidCheckoutCaptureByOrderidWithRequestBuilder(storeid: storeid, orderid: orderid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Capture a previously authorized order and settle it — the checkout spelling
|
|
- POST /v1/commerce/store/{storeid}/checkout/capture/{orderid}
|
|
- Settles the authorized order named in the path and answers the updated order with a Location header, running the same handler as the unprefixed capture address. Dispatch follows the order's stored payment type. Success is what triggers the downstream work — order and payment updates, redemptions, referral, cart and stats, the confirmation email, and the paid and completed events — while a failure releases the order's inventory reservations and answers 400.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter orderid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreByStoreidCheckoutCaptureByOrderidWithRequestBuilder(storeid: String, orderid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/checkout/capture/{orderid}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let orderidPreEscape = "\(APIHelper.mapValueToPathItem(orderid))"
|
|
let orderidPostEscape = orderidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{orderid}", with: orderidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Authorize and capture a new order in one call — the checkout spelling
|
|
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreByStoreidCheckoutCharge(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreByStoreidCheckoutChargeWithRequestBuilder(storeid: storeid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Authorize and capture a new order in one call — the checkout spelling
|
|
- POST /v1/commerce/store/{storeid}/checkout/charge
|
|
- Performs authorization and capture back to back against a newly created order for the addressed store, on the same handler as the unprefixed charge address. It takes the authorize body and inherits every authorize rule, including the store's currency winning over the body and the items being reserved before the processor is called. There is no order id on this address, so it can never continue an existing order. Either half failing answers 400, and the capture side effects run only when both succeed.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreByStoreidCheckoutChargeWithRequestBuilder(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/checkout/charge"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
PayPal cancel by pay key — refuses, exactly as the unprefixed address does
|
|
|
|
- parameter storeid: (path)
|
|
- parameter payKey: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreByStoreidCheckoutPaypalCancelByPaykey(storeid: String, payKey: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreByStoreidCheckoutPaypalCancelByPaykeyWithRequestBuilder(storeid: storeid, payKey: payKey, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
PayPal cancel by pay key — refuses, exactly as the unprefixed address does
|
|
- POST /v1/commerce/store/{storeid}/checkout/paypal/cancel/{payKey}
|
|
- Meant to void the payments carrying the given pay key, stamp them cancelled and cancel the order, but the shared checkout handler resolves its order from an ORDER ID path parameter this route does not carry. The result is an untyped order and a cancel dispatch that refuses with 400 before the pay key lookup ever runs. Token gate, namespacing and store resolution happen first, so a missing token is still 401 and an unloadable store still 500. It is the same handler as the unprefixed cancel address, with the same outcome.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter payKey: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreByStoreidCheckoutPaypalCancelByPaykeyWithRequestBuilder(storeid: String, payKey: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/checkout/paypal/cancel/{payKey}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let payKeyPreEscape = "\(APIHelper.mapValueToPathItem(payKey))"
|
|
let payKeyPostEscape = payKeyPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{payKey}", with: payKeyPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
PayPal confirm by pay key — refuses, exactly as the unprefixed address does
|
|
|
|
- parameter storeid: (path)
|
|
- parameter payKey: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreByStoreidCheckoutPaypalConfirmByPaykey(storeid: String, payKey: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreByStoreidCheckoutPaypalConfirmByPaykeyWithRequestBuilder(storeid: storeid, payKey: payKey, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
PayPal confirm by pay key — refuses, exactly as the unprefixed address does
|
|
- POST /v1/commerce/store/{storeid}/checkout/paypal/confirm/{payKey}
|
|
- Meant to mark the payments carrying the given pay key as paid and set the order to paid, it cannot reach that work from this address: the shared checkout handler takes its order from an ORDER ID path parameter this route does not carry, so the order is always fresh and untyped and the confirm dispatch refuses with 400 before the pay key is queried. The token gate, the namespace middleware and the store lookup all run ahead of that, so authentication and store failures surface first. Behaviour is identical to the unprefixed confirm address; the checkout prefix changes nothing here.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter payKey: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreByStoreidCheckoutPaypalConfirmByPaykeyWithRequestBuilder(storeid: String, payKey: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/checkout/paypal/confirm/{payKey}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let payKeyPreEscape = "\(APIHelper.mapValueToPathItem(payKey))"
|
|
let payKeyPostEscape = payKeyPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{payKey}", with: payKeyPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Start a PayPal authorization for a new order — the checkout spelling
|
|
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreByStoreidCheckoutPaypalPay(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreByStoreidCheckoutPaypalPayWithRequestBuilder(storeid: storeid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Start a PayPal authorization for a new order — the checkout spelling
|
|
- POST /v1/commerce/store/{storeid}/checkout/paypal/pay
|
|
- Begins a PayPal authorization by running the ordinary store authorize flow, since the route binds that exact handler — body, store resolution, tally, reservations and failure behaviour are the authorize address's, unchanged. The processor is chosen from the body's payment type, so this path reaches PayPal only when that type says so. A successful PayPal authorization stamps a pay key onto the payment, which is the key the confirm and cancel addresses filter on. Build against the plain authorize address instead.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreByStoreidCheckoutPaypalPayWithRequestBuilder(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/checkout/paypal/pay"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Add a listing override under a new key
|
|
|
|
- parameter storeid: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreByStoreidListingByKey(storeid: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreByStoreidListingByKeyWithRequestBuilder(storeid: storeid, key: key, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Add a listing override under a new key
|
|
- POST /v1/commerce/store/{storeid}/listing/{key}
|
|
- Creates the override and answers the store's ENTIRE listing map at 201 with a Location header — not just the entry that was added. A key already present is refused 400: creation never silently overwrites, so changing an existing listing has to be an explicit replace. The stored listing has its currency stamped from the store's own, which the replace path does not do. The key is matched exactly here, with none of the slug or SKU fallback the read allows. Admin-gated and resolved inside the caller org's namespace.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreByStoreidListingByKeyWithRequestBuilder(storeid: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/listing/{key}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let keyPreEscape = "\(APIHelper.mapValueToPathItem(key))"
|
|
let keyPostEscape = keyPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{key}", with: keyPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
PayPal cancel by pay key — refuses, because a pay key alone does not identify the order
|
|
|
|
- parameter storeid: (path)
|
|
- parameter payKey: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreByStoreidPaypalCancelByPaykey(storeid: String, payKey: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreByStoreidPaypalCancelByPaykeyWithRequestBuilder(storeid: storeid, payKey: payKey, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
PayPal cancel by pay key — refuses, because a pay key alone does not identify the order
|
|
- POST /v1/commerce/store/{storeid}/paypal/cancel/{payKey}
|
|
- Intended to void the payments carrying the given pay key, stamp them cancelled and cancel the order, it never reaches that work: the shared checkout handler reads its order from an ORDER ID path parameter this route does not carry, leaving an untyped order that the cancel dispatch refuses with 400 before the pay key lookup runs. Authentication, namespacing and store resolution happen ahead of the refusal, so a missing token is 401 and an unloadable store 500. Cancelling a real PayPal authorization needs an address that carries the order id.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter payKey: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreByStoreidPaypalCancelByPaykeyWithRequestBuilder(storeid: String, payKey: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/paypal/cancel/{payKey}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let payKeyPreEscape = "\(APIHelper.mapValueToPathItem(payKey))"
|
|
let payKeyPostEscape = payKeyPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{payKey}", with: payKeyPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
PayPal confirm by pay key — refuses, because a pay key alone does not identify the order
|
|
|
|
- parameter storeid: (path)
|
|
- parameter payKey: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreByStoreidPaypalConfirmByPaykey(storeid: String, payKey: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreByStoreidPaypalConfirmByPaykeyWithRequestBuilder(storeid: storeid, payKey: payKey, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
PayPal confirm by pay key — refuses, because a pay key alone does not identify the order
|
|
- POST /v1/commerce/store/{storeid}/paypal/confirm/{payKey}
|
|
- Intended to mark every payment carrying the given pay key as paid and flip the order to paid, it cannot do that from this address and does not pretend to: the shared checkout handler resolves its order from an ORDER ID path parameter that this route does not carry, so it always works against a fresh untyped order and the confirm dispatch refuses it with 400 before the pay key is ever queried. The token gate, the namespace and the store lookup all run ahead of that, so a missing token is still 401 and an unloadable store still 500. Drive a PayPal return through an address that carries the order id.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter payKey: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreByStoreidPaypalConfirmByPaykeyWithRequestBuilder(storeid: String, payKey: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/paypal/confirm/{payKey}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let payKeyPreEscape = "\(APIHelper.mapValueToPathItem(payKey))"
|
|
let payKeyPostEscape = payKeyPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{payKey}", with: payKeyPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Start a PayPal authorization for a new order
|
|
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreByStoreidPaypalPay(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreByStoreidPaypalPayWithRequestBuilder(storeid: storeid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Start a PayPal authorization for a new order
|
|
- POST /v1/commerce/store/{storeid}/paypal/pay
|
|
- Runs the ordinary store authorize flow — the route binds that very handler, so the body, the store resolution, the tally, the reservations and the failure behaviour are the authorize address's, unchanged. It reaches PayPal only when the body's payment type says so; nothing about this path forces the processor, so a card-typed payment posted here authorizes on the card processor instead. A successful PayPal authorization stamps a pay key onto the payment, which is the key the confirm and cancel addresses filter on. It is the older entry point; the plain authorize address is the one to build against.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreByStoreidPaypalPayWithRequestBuilder(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/paypal/pay"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Start this store's no-card trial on the entry plan
|
|
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreByStoreidTrial(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreByStoreidTrialWithRequestBuilder(storeid: storeid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Start this store's no-card trial on the entry plan
|
|
- POST /v1/commerce/store/{storeid}/trial
|
|
- Creates a trialing subscription for the addressed store on the entry plan and grants that plan's trial credit, answering 201 when this call actually started one and 200 with a reason otherwise — not_new when the store already has billing history, trial_not_configured when no entry plan is wired. The window is always the SEVEN-DAY no-card trial, because this address never presents a card; the longer card-present window is reached only by adding a card afterwards. Entitlement is per store while the billing subject is the org, so every store an org owns takes its own trial. Admin-gated and namespaced to the caller's org: no resolvable store is 404 with store_required, and a backing-store failure is 503.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreByStoreidTrialWithRequestBuilder(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/trial"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Mint your org's least-privilege storefront read key
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceStoreToken(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceStoreTokenWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Mint your org's least-privilege storefront read key
|
|
- POST /v1/commerce/store/token
|
|
- Answers a freshly minted token carrying ONLY the published-read permission — enough for a logged-out shopper's storefront to read your published catalog and nothing more, with no write and no admin scope. It is org-bound, signed with the org's own secret and subject to the org id, so unlike a shared service token it can never act on another tenant. Minting ROTATES rather than accumulates: the previous storefront token is dropped first and is invalid immediately, so re-minting is how you revoke. Admin is enforced by the handler as well as the route, because the route's token gate does not apply on the identity path and a plain member must not be able to mint their org's key.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceStoreTokenWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/store/token"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a submission
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceSubmission(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceSubmissionWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a submission
|
|
- POST /v1/commerce/submission/
|
|
- A submission is one filled-in form from a site visitor — an email, an optional user id, the client details the server observed (user agent, referer, geography) and the form's own fields as free metadata. It carries no form id, so the link back to the form that produced it is not stored on the row. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The per-kind permission table has no entry for submission, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceSubmissionWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/submission/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a submission — for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter submissionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceSubmissionBySubmissionid(submissionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceSubmissionBySubmissionidWithRequestBuilder(submissionid: submissionid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a submission — for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/submission/{submissionid}
|
|
- A submission is one filled-in form from a site visitor — an email, an optional user id, the client details the server observed (user agent, referer, geography) and the form's own fields as free metadata. It carries no form id, so the link back to the form that produced it is not stored on the row. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter submissionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceSubmissionBySubmissionidWithRequestBuilder(submissionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/submission/{submissionid}"
|
|
let submissionidPreEscape = "\(APIHelper.mapValueToPathItem(submissionid))"
|
|
let submissionidPostEscape = submissionidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{submissionid}", with: submissionidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a subscriber
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceSubscriber(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceSubscriberWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a subscriber
|
|
- POST /v1/commerce/subscriber/
|
|
- A subscriber is a mailing-list member — name, email, the form id that captured them, unsubscribed state and date, client details, tags and metadata. Writing one FIRES A WEBHOOK: subscriber.created on create and subscriber.updated on replace or patch, emitted BEFORE the write is known to have succeeded and carrying the row as sent, so the payload holds the raw email rather than the normalized one that gets stored. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The token must also carry Admin or WriteSubscriber.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceSubscriberWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/subscriber/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a subscriber — for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter subscriberid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceSubscriberBySubscriberid(subscriberid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceSubscriberBySubscriberidWithRequestBuilder(subscriberid: subscriberid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a subscriber — for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/subscriber/{subscriberid}
|
|
- A subscriber is a mailing-list member — name, email, the form id that captured them, unsubscribed state and date, client details, tags and metadata. Writing one FIRES A WEBHOOK: subscriber.created on create and subscriber.updated on replace or patch, emitted BEFORE the write is known to have succeeded and carrying the row as sent, so the payload holds the raw email rather than the normalized one that gets stored. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter subscriberid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceSubscriberBySubscriberidWithRequestBuilder(subscriberid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/subscriber/{subscriberid}"
|
|
let subscriberidPreEscape = "\(APIHelper.mapValueToPathItem(subscriberid))"
|
|
let subscriberidPostEscape = subscriberidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{subscriberid}", with: subscriberidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a token transaction
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceTokentransaction(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceTokentransactionWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a token transaction
|
|
- POST /v1/commerce/tokentransaction/
|
|
- A token transaction records a transfer between two identified parties — amount and fees, a timestamp, sending and receiving addresses, names, user ids, states and countries, a flag per side, a protocol name and a transaction hash. Nothing here touches a chain: the hash is an unvalidated string and the flags are plain writable booleans with no screening behind them. Amounts are floating-point rather than the exact minor units every real money field in commerce uses, and there is no currency field at all — this kind lives in commerce's demo tree, so it is a live writable resource in your tenant's store that nothing else in commerce reads, and it must never carry real money. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The per-kind permission table has no entry for tokentransaction, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceTokentransactionWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/tokentransaction/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a token transaction — for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter tokentransactionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceTokentransactionByTokentransactionid(tokentransactionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceTokentransactionByTokentransactionidWithRequestBuilder(tokentransactionid: tokentransactionid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a token transaction — for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/tokentransaction/{tokentransactionid}
|
|
- A token transaction records a transfer between two identified parties — amount and fees, a timestamp, sending and receiving addresses, names, user ids, states and countries, a flag per side, a protocol name and a transaction hash. Nothing here touches a chain: the hash is an unvalidated string and the flags are plain writable booleans with no screening behind them. Amounts are floating-point rather than the exact minor units every real money field in commerce uses, and there is no currency field at all — this kind lives in commerce's demo tree, so it is a live writable resource in your tenant's store that nothing else in commerce reads, and it must never carry real money. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter tokentransactionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceTokentransactionByTokentransactionidWithRequestBuilder(tokentransactionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/tokentransaction/{tokentransactionid}"
|
|
let tokentransactionidPreEscape = "\(APIHelper.mapValueToPathItem(tokentransactionid))"
|
|
let tokentransactionidPostEscape = tokentransactionidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{tokentransactionid}", with: tokentransactionidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a transfer
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceTransfer(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceTransferWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a transfer
|
|
- POST /v1/commerce/transfer/
|
|
- A transfer records that a payable WAS PAID — the annotation a human writes after paying out of band. Commerce executes no payout: creating one moves no money, and it marks the referenced payable settled. It carries the payable and payee ids, the amount it settles and the amount actually sent (which may be a different asset), a type of eth, wire or other, the transaction hash or wire reference, when it was paid and who recorded it; amounts are exact decimal strings with an asset, not cents. It is admin-gated because writing one settles money we owe, and nothing enforces uniqueness on the reference — so posting the same transfer twice settles the payable twice. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for transfer, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceTransferWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/transfer/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a transfer — for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter transferid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceTransferByTransferid(transferid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceTransferByTransferidWithRequestBuilder(transferid: transferid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a transfer — for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/transfer/{transferid}
|
|
- A transfer records that a payable WAS PAID — the annotation a human writes after paying out of band. Commerce executes no payout: creating one moves no money, and it marks the referenced payable settled. It carries the payable and payee ids, the amount it settles and the amount actually sent (which may be a different asset), a type of eth, wire or other, the transaction hash or wire reference, when it was paid and who recorded it; amounts are exact decimal strings with an asset, not cents. It is admin-gated because writing one settles money we owe, and nothing enforces uniqueness on the reference — so posting the same transfer twice settles the payable twice. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. The token must carry the ADMIN permission; an ordinary access token is refused.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter transferid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceTransferByTransferidWithRequestBuilder(transferid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/transfer/{transferid}"
|
|
let transferidPreEscape = "\(APIHelper.mapValueToPathItem(transferid))"
|
|
let transferidPostEscape = transferidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{transferid}", with: transferidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a variant
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceVariant(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceVariantWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a variant
|
|
- POST /v1/commerce/variant/
|
|
- A variant is one purchasable SKU of a product — its product id, SKU and UPC, name, media, availability, the option name and value pairs that distinguish it, a sold counter, and its own money and stock: currency, price, MSRP, inventory cost, inventory count and taxability. Inventory and sold are plain writable numbers with no decrement logic behind them here. The same variant also exists as a JSON copy inside its product, and writing one does not update the other. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin or WriteVariant.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceVariantWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/variant/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a variant — for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter variantid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceVariantByVariantid(variantid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceVariantByVariantidWithRequestBuilder(variantid: variantid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a variant — for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/variant/{variantid}
|
|
- A variant is one purchasable SKU of a product — its product id, SKU and UPC, name, media, availability, the option name and value pairs that distinguish it, a sold counter, and its own money and stock: currency, price, MSRP, inventory cost, inventory count and taxability. Inventory and sold are plain writable numbers with no decrement logic behind them here. The same variant also exists as a JSON copy inside its product, and writing one does not update the other. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter variantid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceVariantByVariantidWithRequestBuilder(variantid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/variant/{variantid}"
|
|
let variantidPreEscape = "\(APIHelper.mapValueToPathItem(variantid))"
|
|
let variantidPostEscape = variantidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{variantid}", with: variantidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a wallet
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceWallet(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceWalletWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a wallet
|
|
- POST /v1/commerce/wallet/
|
|
- A wallet is a container of custodial blockchain accounts, and its only field is that account list — each account carrying a name, an address, a chain type, and the ENCRYPTED private key with its salt. Creating a wallet through this table generates NO KEYS: key generation lives on the account routes, so a wallet made here is an empty shell and an account posted into one is stored exactly as sent, with no key generation and no validation behind it. Know what a read renders: the plaintext private key is never marshalled and never stored, but the encrypted blob and its salt ARE returned, so whoever can read a wallet can attack it offline down to the strength of the owner's passphrase. That is why this kind is admin-gated. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for wallet, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceWalletWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/wallet/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a wallet — for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter walletid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceWalletByWalletid(walletid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceWalletByWalletidWithRequestBuilder(walletid: walletid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a wallet — for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/wallet/{walletid}
|
|
- A wallet is a container of custodial blockchain accounts, and its only field is that account list — each account carrying a name, an address, a chain type, and the ENCRYPTED private key with its salt. Creating a wallet through this table generates NO KEYS: key generation lives on the account routes, so a wallet made here is an empty shell and an account posted into one is stored exactly as sent, with no key generation and no validation behind it. Know what a read renders: the plaintext private key is never marshalled and never stored, but the encrypted blob and its salt ARE returned, so whoever can read a wallet can attack it offline down to the strength of the owner's passphrase. That is why this kind is admin-gated. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. The token must carry the ADMIN permission; an ordinary access token is refused.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter walletid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceWalletByWalletidWithRequestBuilder(walletid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/wallet/{walletid}"
|
|
let walletidPreEscape = "\(APIHelper.mapValueToPathItem(walletid))"
|
|
let walletidPostEscape = walletidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{walletid}", with: walletidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a watchlist
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceWatchlist(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceWatchlistWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a watchlist
|
|
- POST /v1/commerce/watchlist/
|
|
- A watchlist is a viewer's saved list of movies — a user id, an email, and the movies themselves. It stores WHOLE MOVIE SNAPSHOTS rather than movie ids, so a list goes stale the moment a film record changes and grows without bound as it fills. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. Any valid access token reaches it. The per-kind permission table has no entry for watchlist, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceWatchlistWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/watchlist/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a watchlist — for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter watchlistid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceWatchlistByWatchlistid(watchlistid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceWatchlistByWatchlistidWithRequestBuilder(watchlistid: watchlistid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a watchlist — for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/watchlist/{watchlistid}
|
|
- A watchlist is a viewer's saved list of movies — a user id, an email, and the movies themselves. It stores WHOLE MOVIE SNAPSHOTS rather than movie ids, so a list goes stale the moment a film record changes and grows without bound as it fills. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. Any valid access token reaches it.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter watchlistid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceWatchlistByWatchlistidWithRequestBuilder(watchlistid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/watchlist/{watchlistid}"
|
|
let watchlistidPreEscape = "\(APIHelper.mapValueToPathItem(watchlistid))"
|
|
let watchlistidPostEscape = watchlistidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{watchlistid}", with: watchlistidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create a webhook
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceWebhook(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceWebhookWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create a webhook
|
|
- POST /v1/commerce/webhook/
|
|
- A webhook is a merchant-registered endpoint that receives commerce event callbacks — a name, a URL, live and all flags, a per-event map, an enabled flag, and the shared access token each delivery posts IN THE BODY. Two things to know before registering one: that token is a plainly readable field, so anyone who may read webhooks reads every endpoint's secret, and delivery consults only the all flag and the event map — it does NOT consult enabled or live, so setting enabled false does not stop delivery and deleting the row is the only thing that does. Delivery is a single POST with a twenty-second timeout and no retry. Decodes the body into a new row in the caller org's own namespaced store — isolated to that tenant from its first write — and answers the stored row at 201 with a Location header naming its id. The id is assigned by the store, not taken from the body. A body that fails to decode is 400 and a store that refuses the write is 500. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for webhook, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceWebhookWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
let localVariablePath = "/v1/commerce/webhook/"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a webhook — for clients that cannot send PUT, PATCH or DELETE
|
|
|
|
- parameter webhookid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceWebhookByWebhookid(webhookid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceWebhookByWebhookidWithRequestBuilder(webhookid: webhookid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Method-override tunnel for a webhook — for clients that cannot send PUT, PATCH or DELETE
|
|
- POST /v1/commerce/webhook/{webhookid}
|
|
- A webhook is a merchant-registered endpoint that receives commerce event callbacks — a name, a URL, live and all flags, a per-event map, an enabled flag, and the shared access token each delivery posts IN THE BODY. Two things to know before registering one: that token is a plainly readable field, so anyone who may read webhooks reads every endpoint's secret, and delivery consults only the all flag and the event map — it does NOT consult enabled or live, so setting enabled false does not stop delivery and deleting the row is the only thing that does. Delivery is a single POST with a twenty-second timeout and no retry. Re-dispatches the request into the handler the intended verb would have reached, taking that verb from a _method form value or query parameter and then from the X-HTTP-Method-Override header. PUT replaces the row, PATCH changes part of it, DELETE removes it, and anything else is 405. The trap is the DEFAULT: naming no override at all leaves the method POST, which this tunnel maps to the PARTIAL UPDATE — it is never a create, and creating is the collection root's job. Behaviour and authorization are the underlying operation's, since the real handler runs. The token must carry the ADMIN permission; an ordinary access token is refused.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter webhookid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceWebhookByWebhookidWithRequestBuilder(webhookid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/webhook/{webhookid}"
|
|
let webhookidPreEscape = "\(APIHelper.mapValueToPathItem(webhookid))"
|
|
let webhookidPostEscape = webhookidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{webhookid}", with: webhookidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Payment-provider webhook intake for settlement and subscription lifecycle events
|
|
|
|
- parameter provider: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCommerceWebhooksByProvider(provider: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postCommerceWebhooksByProviderWithRequestBuilder(provider: provider, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Payment-provider webhook intake for settlement and subscription lifecycle events
|
|
- POST /v1/commerce/webhooks/{provider}
|
|
- Accepts a payment provider's event, verifies it, records it for audit, and applies subscription lifecycle changes to the matching local row. There is no bearer here and there cannot be: the provider's SIGNATURE over the body IS the authentication, so a request with no recognized signature header is 400 and one whose signature does not verify is 401. The provider path segment is only a hint for dashboard configuration — verification picks the processor regardless of what the URL says. Redelivery is safe: an event id already recorded is acknowledged as a duplicate without re-applying any side effect, which matters because providers retry for days until they see a 2xx.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter provider: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postCommerceWebhooksByProviderWithRequestBuilder(provider: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/webhooks/{provider}"
|
|
let providerPreEscape = "\(APIHelper.mapValueToPathItem(provider))"
|
|
let providerPostEscape = providerPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{provider}", with: providerPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a collection outright
|
|
|
|
- parameter collectionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceCollectionByCollectionid(collectionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceCollectionByCollectionidWithRequestBuilder(collectionid: collectionid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a collection outright
|
|
- PUT /v1/commerce/collection/{collectionid}
|
|
- A collection is a merchandising group a storefront renders — a slug and name, copy and media, flat lists of the product and variant ids it holds, published, preorder and out-of-stock flags, and an availability window. Membership lives on the collection as those id lists rather than as a join, so putting a product into a collection is a write here and not on the product. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin, or ReadCollection and WriteCollection together.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter collectionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceCollectionByCollectionidWithRequestBuilder(collectionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/collection/{collectionid}"
|
|
let collectionidPreEscape = "\(APIHelper.mapValueToPathItem(collectionid))"
|
|
let collectionidPostEscape = collectionidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{collectionid}", with: collectionidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a disclosure outright
|
|
|
|
- parameter disclosureid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceDisclosureByDisclosureid(disclosureid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceDisclosureByDisclosureidWithRequestBuilder(disclosureid: disclosureid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a disclosure outright
|
|
- PUT /v1/commerce/disclosure/{disclosureid}
|
|
- A disclosure is a published-document record — a publication body, a content hash, a type and a named receiver. The hash LOOKS like a field you set and is in fact derived, but only on update: a freshly created disclosure keeps whatever hash the caller sent until the first replace or patch recomputes it, so a new row's hash attests to nothing. This kind lives in commerce's demo tree — a live writable resource in your tenant's real store that nothing else in commerce reads. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The per-kind permission table has no entry for disclosure, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter disclosureid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceDisclosureByDisclosureidWithRequestBuilder(disclosureid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/disclosure/{disclosureid}"
|
|
let disclosureidPreEscape = "\(APIHelper.mapValueToPathItem(disclosureid))"
|
|
let disclosureidPostEscape = disclosureidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{disclosureid}", with: disclosureidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a discount outright
|
|
|
|
- parameter discountid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceDiscountByDiscountid(discountid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceDiscountByDiscountidWithRequestBuilder(discountid: discountid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a discount outright
|
|
- PUT /v1/commerce/discount/{discountid}
|
|
- A discount is a price rule: a type (flat, percent, free-shipping, free-item or bulk), a window, a scope naming the store, collection, product or variant it applies to, a target, and rules pairing a trigger — a price or quantity threshold — with an action, an amount off or a percentage. It is ENABLED BY DEFAULT, so a bare create makes a live discount rather than a draft. The rule engine caches per replica for about thirty seconds, so a discount switched off here can keep applying briefly on other replicas. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for discount, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter discountid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceDiscountByDiscountidWithRequestBuilder(discountid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/discount/{discountid}"
|
|
let discountidPreEscape = "\(APIHelper.mapValueToPathItem(discountid))"
|
|
let discountidPostEscape = discountidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{discountid}", with: discountidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a movie outright
|
|
|
|
- parameter movieid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceMovieByMovieid(movieid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceMovieByMovieidWithRequestBuilder(movieid: movieid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a movie outright
|
|
- PUT /v1/commerce/movie/{movieid}
|
|
- A movie is a film catalog record — a slug plus EIDR and IMDB ids, all three required, with title and synopsis copy, artwork, screenshots, trailers, cast and crew, and available and hidden flags. It carries NO price: the money for a film lives on the product that sells it. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The per-kind permission table has no entry for movie, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter movieid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceMovieByMovieidWithRequestBuilder(movieid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/movie/{movieid}"
|
|
let movieidPreEscape = "\(APIHelper.mapValueToPathItem(movieid))"
|
|
let movieidPostEscape = movieidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{movieid}", with: movieidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a note outright
|
|
|
|
- parameter noteid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceNoteByNoteid(noteid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceNoteByNoteidWithRequestBuilder(noteid: noteid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a note outright
|
|
- PUT /v1/commerce/note/{noteid}
|
|
- A note is a timestamped free-text log line — a caller-supplied time, a source, a message and an enabled flag. That time is the caller's own field and is distinct from the row's creation stamp; the note search filters on it, so a note written without one is a zero-time note the ops log will never surface. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The per-kind permission table has no entry for note, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter noteid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceNoteByNoteidWithRequestBuilder(noteid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/note/{noteid}"
|
|
let noteidPreEscape = "\(APIHelper.mapValueToPathItem(noteid))"
|
|
let noteidPostEscape = noteidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{noteid}", with: noteidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Edit a plan, leaving the fields you omit alone
|
|
|
|
- parameter slug: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommercePlansEntriesBySlug(slug: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommercePlansEntriesBySlugWithRequestBuilder(slug: slug, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Edit a plan, leaving the fields you omit alone
|
|
- PUT /v1/commerce/plans/entries/{slug}
|
|
- Loads the addressed plan, applies the body over it and answers the stored result, so a partial edit never silently zeroes a price or the contact-sales flag. The slug is IMMUTABLE: a body naming a different slug is rejected outright before anything is written, because a rename would orphan every subscription that stored the old id — deprecate and create instead. An admin edit marks the row authoritative so the seed stops correcting it. PLATFORM admin only; an unknown slug is 404.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter slug: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommercePlansEntriesBySlugWithRequestBuilder(slug: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/plans/entries/{slug}"
|
|
let slugPreEscape = "\(APIHelper.mapValueToPathItem(slug))"
|
|
let slugPostEscape = slugPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{slug}", with: slugPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a product outright
|
|
|
|
- parameter productid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceProductByProductid(productid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceProductByProductidWithRequestBuilder(productid: productid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a product outright
|
|
- PUT /v1/commerce/product/{productid}
|
|
- A product is a sellable catalog item: slug, SKU and UPC, name and copy, media, availability and preorder flags, a reservation block, and its money — currency, price, MSRP, list price and inventory cost in minor units, inventory count, taxability, and the subscription interval when it is subscribeable. Its variants and options are carried as a denormalized JSON snapshot inside the product, separate from the standalone variant rows, and nothing keeps the two in step for you. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin, or ReadProduct and WriteProduct together.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter productid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceProductByProductidWithRequestBuilder(productid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/product/{productid}"
|
|
let productidPreEscape = "\(APIHelper.mapValueToPathItem(productid))"
|
|
let productidPostEscape = productidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{productid}", with: productidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Edit a rate, and mark it as operator-set
|
|
|
|
- parameter product: (path)
|
|
- parameter meter: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceRatesEntriesByProductByMeter(product: String, meter: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceRatesEntriesByProductByMeterWithRequestBuilder(product: product, meter: meter, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Edit a rate, and mark it as operator-set
|
|
- PUT /v1/commerce/rates/entries/{product}/{meter}
|
|
- Edits one rate and MARKS it edited, which is the whole contract with the importer: an operator's price outranks the document it came from, so a later import leaves this row alone. Without that mark a price set here would apply, work, and silently revert on the next import. Only the editable fields move; identity and bookkeeping are not writable from the body. SuperAdmin only.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter product: (path)
|
|
- parameter meter: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceRatesEntriesByProductByMeterWithRequestBuilder(product: String, meter: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/rates/entries/{product}/{meter}"
|
|
let productPreEscape = "\(APIHelper.mapValueToPathItem(product))"
|
|
let productPostEscape = productPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{product}", with: productPostEscape, options: .literal, range: nil)
|
|
let meterPreEscape = "\(APIHelper.mapValueToPathItem(meter))"
|
|
let meterPostEscape = meterPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{meter}", with: meterPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a return outright
|
|
|
|
- parameter returnid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceReturnByReturnid(returnid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceReturnByReturnidWithRequestBuilder(returnid: returnid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a return outright
|
|
- PUT /v1/commerce/return/{returnid}
|
|
- A return is an RMA — the store, user and order it belongs to, the line items coming back, a fulfillment block carrying its own type, status and pricing, a summary, and eight lifecycle timestamps from submitted through delivered and processed. Its status is a FREE STRING with no enumeration behind it, and there is no refund amount on the return itself: the money sits inside the line items and the fulfillment pricing. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The token must also carry Admin, or ReadReturn and WriteReturn together.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter returnid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceReturnByReturnidWithRequestBuilder(returnid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/return/{returnid}"
|
|
let returnidPreEscape = "\(APIHelper.mapValueToPathItem(returnid))"
|
|
let returnidPostEscape = returnidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{returnid}", with: returnidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a sales channel outright
|
|
|
|
- parameter saleschannelid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceSaleschannelBySaleschannelid(saleschannelid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceSaleschannelBySaleschannelidWithRequestBuilder(saleschannelid: saleschannelid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a sales channel outright
|
|
- PUT /v1/commerce/saleschannel/{saleschannelid}
|
|
- A sales channel is a named selling surface — a name, a description, a disabled flag and metadata. The flag is NEGATIVE, so a channel created from an empty body is enabled. Nothing on this row links products, prices or stock to the channel; here it is a label other surfaces scope themselves by. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for saleschannel, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter saleschannelid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceSaleschannelBySaleschannelidWithRequestBuilder(saleschannelid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/saleschannel/{saleschannelid}"
|
|
let saleschannelidPreEscape = "\(APIHelper.mapValueToPathItem(saleschannelid))"
|
|
let saleschannelidPostEscape = saleschannelidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{saleschannelid}", with: saleschannelidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a stock location outright
|
|
|
|
- parameter stocklocationid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceStocklocationByStocklocationid(stocklocationid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceStocklocationByStocklocationidWithRequestBuilder(stocklocationid: stocklocationid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a stock location outright
|
|
- PUT /v1/commerce/stocklocation/{stocklocationid}
|
|
- A stock location is a physical address inventory can be held at — a name, street lines, city, province, country, postal code and a phone. None of it is validated, there are no coordinates, and the row carries no enabled flag and no inventory link, so deleting it is the only way to retire one. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The per-kind permission table has no entry for stocklocation, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter stocklocationid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceStocklocationByStocklocationidWithRequestBuilder(stocklocationid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/stocklocation/{stocklocationid}"
|
|
let stocklocationidPreEscape = "\(APIHelper.mapValueToPathItem(stocklocationid))"
|
|
let stocklocationidPostEscape = stocklocationidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{stocklocationid}", with: stocklocationidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a storefront outright
|
|
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceStoreByStoreid(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceStoreByStoreidWithRequestBuilder(storeid: storeid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a storefront outright
|
|
- PUT /v1/commerce/store/{storeid}
|
|
- This is a true REPLACEMENT, not a merge: the stored key is preserved but the body is decoded onto a fresh entity, so every field the body omits is written back as its zero value. Use the partial update when you mean to change part of a store. The id is resolved inside the caller org's own namespace, so an unknown or foreign id is a 404 before anything is written. Requires an admin token, or one holding both store read and store write.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceStoreByStoreidWithRequestBuilder(storeid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Upsert a listing override
|
|
|
|
- parameter storeid: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceStoreByStoreidListingByKey(storeid: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceStoreByStoreidListingByKeyWithRequestBuilder(storeid: storeid, key: key, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Upsert a listing override
|
|
- PUT /v1/commerce/store/{storeid}/listing/{key}
|
|
- Decodes the body over the existing listing when the key is present, so fields it omits keep their stored values, and builds the listing from the body alone when the key is new. Answers 200 when it replaced something and 201 with a Location header when it created it; either way the body is the store's entire listing map, not the single entry. Unlike creation, this path does NOT restamp the listing's currency from the store. Admin-gated, with the store resolved inside the caller org's namespace.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter storeid: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceStoreByStoreidListingByKeyWithRequestBuilder(storeid: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/store/{storeid}/listing/{key}"
|
|
let storeidPreEscape = "\(APIHelper.mapValueToPathItem(storeid))"
|
|
let storeidPostEscape = storeidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{storeid}", with: storeidPostEscape, options: .literal, range: nil)
|
|
let keyPreEscape = "\(APIHelper.mapValueToPathItem(key))"
|
|
let keyPostEscape = keyPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{key}", with: keyPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a submission outright
|
|
|
|
- parameter submissionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceSubmissionBySubmissionid(submissionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceSubmissionBySubmissionidWithRequestBuilder(submissionid: submissionid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a submission outright
|
|
- PUT /v1/commerce/submission/{submissionid}
|
|
- A submission is one filled-in form from a site visitor — an email, an optional user id, the client details the server observed (user agent, referer, geography) and the form's own fields as free metadata. It carries no form id, so the link back to the form that produced it is not stored on the row. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The per-kind permission table has no entry for submission, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter submissionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceSubmissionBySubmissionidWithRequestBuilder(submissionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/submission/{submissionid}"
|
|
let submissionidPreEscape = "\(APIHelper.mapValueToPathItem(submissionid))"
|
|
let submissionidPostEscape = submissionidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{submissionid}", with: submissionidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a subscriber outright
|
|
|
|
- parameter subscriberid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceSubscriberBySubscriberid(subscriberid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceSubscriberBySubscriberidWithRequestBuilder(subscriberid: subscriberid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a subscriber outright
|
|
- PUT /v1/commerce/subscriber/{subscriberid}
|
|
- A subscriber is a mailing-list member — name, email, the form id that captured them, unsubscribed state and date, client details, tags and metadata. Writing one FIRES A WEBHOOK: subscriber.created on create and subscriber.updated on replace or patch, emitted BEFORE the write is known to have succeeded and carrying the row as sent, so the payload holds the raw email rather than the normalized one that gets stored. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The token must also carry Admin, or ReadSubscriber and WriteSubscriber together.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter subscriberid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceSubscriberBySubscriberidWithRequestBuilder(subscriberid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/subscriber/{subscriberid}"
|
|
let subscriberidPreEscape = "\(APIHelper.mapValueToPathItem(subscriberid))"
|
|
let subscriberidPostEscape = subscriberidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{subscriberid}", with: subscriberidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a token transaction outright
|
|
|
|
- parameter tokentransactionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceTokentransactionByTokentransactionid(tokentransactionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceTokentransactionByTokentransactionidWithRequestBuilder(tokentransactionid: tokentransactionid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a token transaction outright
|
|
- PUT /v1/commerce/tokentransaction/{tokentransactionid}
|
|
- A token transaction records a transfer between two identified parties — amount and fees, a timestamp, sending and receiving addresses, names, user ids, states and countries, a flag per side, a protocol name and a transaction hash. Nothing here touches a chain: the hash is an unvalidated string and the flags are plain writable booleans with no screening behind them. Amounts are floating-point rather than the exact minor units every real money field in commerce uses, and there is no currency field at all — this kind lives in commerce's demo tree, so it is a live writable resource in your tenant's store that nothing else in commerce reads, and it must never carry real money. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The per-kind permission table has no entry for tokentransaction, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter tokentransactionid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceTokentransactionByTokentransactionidWithRequestBuilder(tokentransactionid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/tokentransaction/{tokentransactionid}"
|
|
let tokentransactionidPreEscape = "\(APIHelper.mapValueToPathItem(tokentransactionid))"
|
|
let tokentransactionidPostEscape = tokentransactionidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{tokentransactionid}", with: tokentransactionidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a transfer outright
|
|
|
|
- parameter transferid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceTransferByTransferid(transferid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceTransferByTransferidWithRequestBuilder(transferid: transferid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a transfer outright
|
|
- PUT /v1/commerce/transfer/{transferid}
|
|
- A transfer records that a payable WAS PAID — the annotation a human writes after paying out of band. Commerce executes no payout: creating one moves no money, and it marks the referenced payable settled. It carries the payable and payee ids, the amount it settles and the amount actually sent (which may be a different asset), a type of eth, wire or other, the transaction hash or wire reference, when it was paid and who recorded it; amounts are exact decimal strings with an asset, not cents. It is admin-gated because writing one settles money we owe, and nothing enforces uniqueness on the reference — so posting the same transfer twice settles the payable twice. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for transfer, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter transferid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceTransferByTransferidWithRequestBuilder(transferid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/transfer/{transferid}"
|
|
let transferidPreEscape = "\(APIHelper.mapValueToPathItem(transferid))"
|
|
let transferidPostEscape = transferidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{transferid}", with: transferidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a variant outright
|
|
|
|
- parameter variantid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceVariantByVariantid(variantid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceVariantByVariantidWithRequestBuilder(variantid: variantid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a variant outright
|
|
- PUT /v1/commerce/variant/{variantid}
|
|
- A variant is one purchasable SKU of a product — its product id, SKU and UPC, name, media, availability, the option name and value pairs that distinguish it, a sold counter, and its own money and stock: currency, price, MSRP, inventory cost, inventory count and taxability. Inventory and sold are plain writable numbers with no decrement logic behind them here. The same variant also exists as a JSON copy inside its product, and writing one does not update the other. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The org must also be entitled to the commerce admin: the paywall answers 402 subscription_required unless the org holds an active or trialing pro subscription, a live trial credit or a redeemed invite, and 503 when that entitlement cannot be read rather than admitting on an unknown. The internal service token and a platform superadmin pass straight through. The token must also carry Admin, or ReadVariant and WriteVariant together.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter variantid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceVariantByVariantidWithRequestBuilder(variantid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/variant/{variantid}"
|
|
let variantidPreEscape = "\(APIHelper.mapValueToPathItem(variantid))"
|
|
let variantidPostEscape = variantidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{variantid}", with: variantidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a wallet outright
|
|
|
|
- parameter walletid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceWalletByWalletid(walletid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceWalletByWalletidWithRequestBuilder(walletid: walletid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a wallet outright
|
|
- PUT /v1/commerce/wallet/{walletid}
|
|
- A wallet is a container of custodial blockchain accounts, and its only field is that account list — each account carrying a name, an address, a chain type, and the ENCRYPTED private key with its salt. Creating a wallet through this table generates NO KEYS: key generation lives on the account routes, so a wallet made here is an empty shell and an account posted into one is stored exactly as sent, with no key generation and no validation behind it. Know what a read renders: the plaintext private key is never marshalled and never stored, but the encrypted blob and its salt ARE returned, so whoever can read a wallet can attack it offline down to the strength of the owner's passphrase. That is why this kind is admin-gated. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for wallet, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter walletid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceWalletByWalletidWithRequestBuilder(walletid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/wallet/{walletid}"
|
|
let walletidPreEscape = "\(APIHelper.mapValueToPathItem(walletid))"
|
|
let walletidPostEscape = walletidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{walletid}", with: walletidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a watchlist outright
|
|
|
|
- parameter watchlistid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceWatchlistByWatchlistid(watchlistid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceWatchlistByWatchlistidWithRequestBuilder(watchlistid: watchlistid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a watchlist outright
|
|
- PUT /v1/commerce/watchlist/{watchlistid}
|
|
- A watchlist is a viewer's saved list of movies — a user id, an email, and the movies themselves. It stores WHOLE MOVIE SNAPSHOTS rather than movie ids, so a list goes stale the moment a film record changes and grows without bound as it fills. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. Any valid access token reaches it. The per-kind permission table has no entry for watchlist, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter watchlistid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceWatchlistByWatchlistidWithRequestBuilder(watchlistid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/watchlist/{watchlistid}"
|
|
let watchlistidPreEscape = "\(APIHelper.mapValueToPathItem(watchlistid))"
|
|
let watchlistidPostEscape = watchlistidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{watchlistid}", with: watchlistidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a webhook outright
|
|
|
|
- parameter webhookid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCommerceWebhookByWebhookid(webhookid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCommerceWebhookByWebhookidWithRequestBuilder(webhookid: webhookid, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a webhook outright
|
|
- PUT /v1/commerce/webhook/{webhookid}
|
|
- A webhook is a merchant-registered endpoint that receives commerce event callbacks — a name, a URL, live and all flags, a per-event map, an enabled flag, and the shared access token each delivery posts IN THE BODY. Two things to know before registering one: that token is a plainly readable field, so anyone who may read webhooks reads every endpoint's secret, and delivery consults only the all flag and the event map — it does NOT consult enabled or live, so setting enabled false does not stop delivery and deleting the row is the only thing that does. Delivery is a single POST with a twenty-second timeout and no retry. This is a true REPLACEMENT, not a merge: the stored row's key is preserved, but the body is decoded onto a FRESH entity, so every field the body omits is written back as its ZERO value. Patch is the verb for changing part of a row. The id is resolved inside the caller org's own namespace and an absent one is 404 before anything is written; a body that fails to decode is 400. Answers the stored result. The token must carry the ADMIN permission; an ordinary access token is refused. The per-kind permission table has no entry for webhook, so the scaffold skips that second check with a warning and the gate above is the whole authorization story.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter webhookid: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCommerceWebhookByWebhookidWithRequestBuilder(webhookid: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/commerce/webhook/{webhookid}"
|
|
let webhookidPreEscape = "\(APIHelper.mapValueToPathItem(webhookid))"
|
|
let webhookidPostEscape = webhookidPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{webhookid}", with: webhookidPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Set one item's quantity in a cart; zero removes it
|
|
|
|
- parameter id: (path) ID is the cart to amend, from the path.
|
|
- parameter cartItemSet: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Cart
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func setCartItem(id: String, cartItemSet: CartItemSet, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Cart {
|
|
return try await setCartItemWithRequestBuilder(id: id, cartItemSet: cartItemSet, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Set one item's quantity in a cart; zero removes it
|
|
- POST /v1/commerce/cart/{id}/item
|
|
- Sets how many of one item a cart holds, and answers the whole updated cart. This is the ONE way a cart's contents change. The quantity is the RESULT, not a delta: sending 3 leaves 3 however many were there before, so a retry is safe and a double-submit cannot double an order. ZERO REMOVES the line — there is deliberately no separate delete, because removal is the same act at the boundary value and a second spelling would be a second set of edge cases. Name the item with EITHER product OR variant, never both. Prefer variant for anything sold in sizes, colours or tiers: the price and the stock belong to the variant, so a product-level line on a varianted product prices the wrong thing. Either may be given as an id or as the human key — a product's URL slug, a variant's SKU — which is what lets a storefront add to cart straight from a product page URL without a lookup first. The item's price and name are CACHED onto the line as it is added, so the cart keeps the price the shopper was shown even if the catalog moves underneath it. An item that resolves to nothing in the catalog is refused 400 and the cart is left exactly as it was; nothing is partially applied. A named handler, not a closure, so zipdoc can lift this prose into the registry.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter id: (path) ID is the cart to amend, from the path.
|
|
- parameter cartItemSet: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Cart>
|
|
*/
|
|
open class func setCartItemWithRequestBuilder(id: String, cartItemSet: CartItemSet, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Cart> {
|
|
var localVariablePath = "/v1/commerce/cart/{id}/item"
|
|
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
|
|
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: cartItemSet, codableHelper: apiConfiguration.codableHelper)
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
"Content-Type": "application/json",
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Cart>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
}
|