Moltin
public class Moltin
Allows access to Moltin API. Create this class with a Moltin client ID and an optional configuration to access the Moltin API, and get information such as products, categories, or interact with carts.
-
The config used for connecting to the Moltin API.
Declaration
Swift
public var config: MoltinConfig
-
Entry point to requesting information about brands
This object allows the developer to interact with brands.
Declaration
Swift
public var brand: BrandRequest { get }
Return Value
A
BrandRequest
object, inheriting fromMoltinRequest
, with the config from theMoltin
class. -
Entry point to requesting information about your cart
This object allows the developer to interact with their cart, such as adding items to the cart, or checking out the cart.
Declaration
Swift
public var cart: CartRequest { get }
Return Value
A
CartRequest
object, inheriting fromMoltinRequest
, with the config from theMoltin
class. -
Entry point to requesting information about categories
This object allows the developer to interact with categories.
Declaration
Swift
public var category: CategoryRequest { get }
Return Value
A
CategoryRequest
object, inheriting fromMoltinRequest
, with the config from theMoltin
class. -
Entry point to requesting information about collections
This object allows the developer to interact with collections.
Declaration
Swift
public var collection: CollectionRequest { get }
Return Value
A
CollectionRequest
object, inheriting fromMoltinRequest
, with the config from theMoltin
class. -
Entry point to requesting information about currencies
This object allows the developer to interact with currencies.
Declaration
Swift
public var currency: CurrencyRequest { get }
Return Value
A
CurrencyRequest
object, inheriting fromMoltinRequest
, with the config from theMoltin
class. -
Entry point to requesting information about customers and related entries
This object allows the developer to interact with customers and related entires such as addresses. Customers and Addresses can only be accessed with valid customer tokens.
Declaration
Swift
public func customer(withCustomerToken customerToken: String) -> CustomerRequest
Return Value
A
CustomerRequest
object, inheriting fromMoltinRequest
, with the config from theMoltin
class. -
Entry point to requesting information about files
This object allows the developer to interact with files.
Declaration
Swift
public var file: FileRequest { get }
Return Value
A
FileRequest
object, inheriting fromMoltinRequest
, with the config from theMoltin
class. -
Entry point to requesting information about fields
This object allows the developer to interact with fields.
Declaration
Swift
public var field: FieldRequest { get }
Return Value
A
FieldRequest
object, inheriting fromMoltinRequest
, with the config from theMoltin
class. -
Entry point to requesting information about flows
This object allows the developer to interact with flows.
Declaration
Swift
public var flow: FlowRequest { get }
Return Value
A
FlowRequest
object, inheriting fromMoltinRequest
, with the config from theMoltin
class. -
Entry point to requesting information about orders
This object allows the developer to interact with orders. Orders can only be accessed with customer tokens.
Declaration
Swift
public func order(withCustomerToken customerToken: String) -> OrderRequest
Return Value
A
OrderRequest
object, inheriting fromMoltinRequest
, with the config from theMoltin
class. -
Entry point to requesting information about products
This object allows the developer to interact with products.
Declaration
Swift
public var product: ProductRequest { get }
Return Value
A
ProductRequest
object, inheriting fromMoltinRequest
, with the config from theMoltin
class. -
Allows the user to set up a instance of the
Moltin
object with a client ID and an optional configuration objectDeclaration
Swift
public init(withClientID clientID: String, withConfiguration configuration: MoltinConfig? = nil, withLocale locale: Locale? = Locale.current)
Parameters
withClientID
Your Moltin Client ID
withConfiguration
An optional configuration object
withLocale
An optional
Locale
objectReturn Value
A instance of the Moltin object for users to interact with in order to call the API
-
Allows the user to set up a instance of the
Moltin
object with a configuration objectDeclaration
Swift
public init(withConfiguration configuration: MoltinConfig)
Parameters
withConfiguration
A configuration object. Must contain a client ID.
Return Value
A instance of the Moltin object for users to interact with in order to call the API