Documentation
¶
Index ¶
- type Address
- type AdyenGateway
- type BraintreeGateway
- type Brand
- type BrandIncludes
- type CardConnectGateway
- type Cart
- type CartItem
- type CartItemImage
- type CartItemMeta
- type CartItemUnitPrice
- type CartItemValue
- type CartMeta
- type Category
- type CategoryIncludes
- type Collection
- type CollectionIncludes
- type Currency
- type Customer
- type CustomerPassword
- type DisplayPrice
- type DisplayPriceWrapper
- type Event
- type EventPayload
- type EventPayloadAddress
- type EventPayloadBrand
- type EventPayloadCart
- type EventPayloadCategory
- type EventPayloadCollection
- type EventPayloadCurrency
- type EventPayloadDeleted
- type EventPayloadFile
- type EventPayloadIntegration
- type EventPayloadOrder
- type EventPayloadProduct
- type EventPayloadResource
- type EventPayloadSettings
- type EventPayloadStockTransaction
- type EventPayloadTransaction
- type Field
- type File
- type FileMeta
- type FileUploadRequest
- type Flow
- type Integration
- type IntegrationConfiguration
- type IntegrationLog
- type IntegrationLogJobs
- type IntegrationLogMeta
- type Inventory
- type Job
- type Links
- type Meta
- type MetaPage
- type MetaResults
- type Modifier
- type ModifierValue
- type ModifierValueBuilder
- type ModifierValuePlain
- type ModifierValuePrice
- type Option
- type Order
- type OrderBillingAddress
- type OrderCustomer
- type OrderMeta
- type OrderShippingAddress
- type Product
- type ProductIncludes
- type ProductMeta
- type ProductPrice
- type ProductStock
- type ProductVariation
- type ProductVariationOptions
- type Promotion
- type PromotionCurrency
- type PromotionSchema
- type Relationship
- type RelationshipContainer
- type Relationships
- type Settings
- type StockTransaction
- type StripeGateway
- type Timestamps
- type Transaction
- type Variation
- type VariationIncluded
- type VariationIncludedOption
- type VariationMatrix
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Name string `json:"name"`
PhoneNumber int32 `json:"phone_number,omitempty"`
Instructions string `json:"instructions,omitempty"`
CompanyName string `json:"company_name"`
Line1 string `json:"line_1"`
Line2 string `json:"line_2"`
City string `json:"city"`
County string `json:"county"`
Postcode string `json:"postcode"`
Country string `json:"country"`
}
Address represents a Moltin customer address: https://docs.moltin.com/api/orders-and-customers/addresses
type AdyenGateway ¶
type AdyenGateway struct {
Type string `json:"type"`
Name string `json:"name"`
Slug string `json:"slug"`
Enabled bool `json:"enabled"`
Test bool `json:"test"`
Username string `json:"username"`
Password string `json:"password"`
MerchantAccount string `json:"merchant_account"`
}
AdyenGateway is a Moltin AdyenGateway - https://docs.moltin.com/payments/gateways/configure-adyen
func (*AdyenGateway) SetType ¶
func (a *AdyenGateway) SetType()
type BraintreeGateway ¶
type BraintreeGateway struct {
Type string `json:"type"`
Name string `json:"name"`
Slug string `json:"slug"`
Enabled bool `json:"enabled"`
Environment string `json:"environment"`
PublicKey string `json:"public_key"`
PrivateKey string `json:"private_key"`
MerchantID string `json:"merchant_id"`
}
BraintreeGateway is a Moltin BraintreeGateway - https://docs.moltin.com/payments/gateways/configure-braintree
func (*BraintreeGateway) SetType ¶
func (b *BraintreeGateway) SetType()
type Brand ¶
type Brand struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
Status string `json:"status"`
Meta *struct {
Timestamps Timestamps `json:"timestamps,omitempty"`
} `json:"meta,omitempty"`
Relationships *Relationships `json:"relationships,omitempty"`
}
Brand is a Moltin Brand - https://docs.moltin.com/catalog/brands
type BrandIncludes ¶
type BrandIncludes struct {
Products []Product `json:"products"`
}
BrandIncludes is possible includes for a Brand
type CardConnectGateway ¶
type CardConnectGateway struct {
Type string `json:"type"`
Name string `json:"name"`
Slug string `json:"slug"`
Enabled bool `json:"enabled"`
Test bool `json:"test"`
Username string `json:"username"`
Password string `json:"password"`
MerchantID string `json:"merchant_id"`
}
CardConnectGateway is a Moltin CardConnectGateway - https://docs.moltin.com/payments/gateways/configure-cardconnect
func (*CardConnectGateway) SetType ¶
func (c *CardConnectGateway) SetType()
type Cart ¶
type Cart struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Links *Links `json:"links,omitempty"`
Meta *CartMeta `json:"meta,omitempty"`
}
Cart represents a Moltin cart: https://docs.moltin.com/api/carts-and-checkout/carts
type CartItem ¶
type CartItem struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Name string `json:"name"`
Description string `json:"description"`
Sku string `json:"sku"`
Image *CartItemImage `json:"image,omitempty"`
Quantity int32 `json:"quantity"`
UnitPrice CartItemUnitPrice `json:"unit_price"`
Value CartItemValue `json:"value"`
Links *Links `json:"links,omitempty"`
Meta *CartItemMeta `json:"meta,omitempty"`
}
CartItem represents a Moltin cart item: https://docs.moltin.com/api/carts-and-checkout/carts/cart-items
type CartItemImage ¶
type CartItemImage struct {
FileName string `json:"file_name"`
MimeType string `json:"mime_type"`
Href string `json:"href"`
}
CartItemImage represents the image object for a Moltin cart item
type CartItemMeta ¶
type CartItemMeta struct {
DisplayPrice DisplayPriceWrapper `json:"display_price,omitempty"`
Timestamps Timestamps `json:"timestamps,omitempty"`
}
CartItemMeta represents the Meta object for a Moltin cart item
type CartItemUnitPrice ¶
type CartItemUnitPrice struct {
Amount int32 `json:"amount"`
Currency string `json:"currenct"`
IncludesTax bool `json:"includes_tax"`
}
CartItemUnitPrice represents the unit price object for a Moltin cart item
type CartItemValue ¶
type CartItemValue struct {
Amount int32 `json:"amount"`
Currency string `json:"currenct"`
IncludesTax bool `json:"includes_tax"`
}
CartItemValue represents the value object for a Moltin cart item
type CartMeta ¶
type CartMeta struct {
DisplayPrice DisplayPriceWrapper `json:"display_price,omitempty"`
Timestamps Timestamps `json:"timestamps,omitempty"`
}
CartMeta represents the Meta object for a Moltin cart
type Category ¶
type Category struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
Status string `json:"status"`
Meta *struct {
Timestamps Timestamps `json:"timestamps,omitempty"`
} `json:"meta,omitempty"`
Relationships *Relationships `json:"relationships,omitempty"`
}
Category is a Moltin Category - https://docs.moltin.com/catalog/categories
type CategoryIncludes ¶
type CategoryIncludes struct {
Products []Product `json:"products"`
}
CategoryIncludes is possible includes for a Category
type Collection ¶
type Collection struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
Status string `json:"status"`
Meta *struct {
Timestamps Timestamps `json:"timestamps,omitempty"`
} `json:"meta,omitempty"`
Relationships *Relationships `json:"relationships,omitempty"`
}
Collection is a Moltin Collection - https://docs.moltin.com/catalog/collections
func (*Collection) SetType ¶
func (c *Collection) SetType()
type CollectionIncludes ¶
type CollectionIncludes struct {
Products []Product `json:"products"`
}
CollectionIncludes is possible includes for a Collection
type Currency ¶
type Currency struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Code string `json:"code"`
ExchangeRate float64 `json:"exchange_rate"`
Format string `json:"format"`
ThousandSeparator string `json:"thousand_separator"`
DecimalPoint string `json:"decimal_point"`
DecimalPlaces int64 `json:"decimal_places"`
Default bool `json:"default"`
Enabled bool `json:"enabled"`
Links *Links `json:"links"`
Meta *struct {
Timestamps Timestamps `json:"timestamps,omitempty"`
} `json:"meta,omitempty"`
}
Currency is a Moltin Currency - https://docs.moltin.com/advanced/currencies
type Customer ¶
type Customer struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Name string `json:"name"`
Email string `json:"email"`
Password *CustomerPassword `json:"password,omitempty"`
}
Customer represents a Moltin Customer Entity: https://docs.moltin.com/api/orders-and-customers/customers
type CustomerPassword ¶
CustomerPassword is a customer's password when making an API request, in which case the Password field should be set, or an indicator that the password was set when reading an API response, in which case Password will be empty and IsSet is indicative.
func (CustomerPassword) MarshalJSON ¶
func (p CustomerPassword) MarshalJSON() ([]byte, error)
MarshalJSON marshals a CustomerPassword into JSON
func (*CustomerPassword) UnmarshalJSON ¶
func (p *CustomerPassword) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals a CustomerPassword from JSON
type DisplayPrice ¶
type DisplayPrice struct {
Amount int `json:"amount"`
Currency string `json:"currency"`
Formatted string `json:"formatted"`
}
DisplayPrice is the content of a price for display purposes
type DisplayPriceWrapper ¶
type DisplayPriceWrapper struct {
WithTax DisplayPrice `json:"with_tax"`
WithoutTax DisplayPrice `json:"without_tax"`
}
DisplayPriceWrapper is the format that price display responses are returned by Moltin
type Event ¶
type Event struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Observes []string `json:"observes"`
Enabled bool `json:"enabled,omitempty"`
IntegrationType string `json:"integration_type"`
Description string `json:"description"`
Name string `json:"name"`
Configuration struct {
URL string `json:"url"`
SecretKey string `json:"secret_key,omitempty"`
} `json:"configuration"`
}
Event represents a Moltin event (not an event payload): https://docs.moltin.com/api/advanced/events
type EventPayload ¶
type EventPayload struct {
ID string `json:"id"`
TriggeredBy string `json:"triggered_by"`
Integration Integration `json:"integration"`
Attempt int `json:"attempt"`
Resources EventPayloadResource `json:"resources"`
}
EventPayload represents the payload delivered to a webhook URL. See https://docs.moltin.com/api/advanced/events/event-payload
Example ¶
package main
import (
"encoding/json"
"io/ioutil"
"log"
"net/http"
"github.com/moltin/gomo/core"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
b, err := ioutil.ReadAll(r.Body)
defer r.Body.Close()
if err != nil {
log.Print(err)
return
}
var payload core.EventPayload
err = json.Unmarshal(b, &payload)
if err != nil {
log.Print(err)
return
}
if payload.TriggeredBy != "order.created" {
log.Printf("unexpected event: %s\n", payload.TriggeredBy)
return
}
order := payload.Resources.(*core.EventPayloadOrder).Data
log.Printf("processing new order: %s\n", order.ID)
// process order...
})
log.Fatal(http.ListenAndServe(":8080", nil))
}
func (*EventPayload) UnmarshalJSON ¶
func (ep *EventPayload) UnmarshalJSON(b []byte) error
type EventPayloadAddress ¶
type EventPayloadAddress struct {
Data Address `json:"address"`
}
type EventPayloadBrand ¶
type EventPayloadBrand struct {
Data Brand `json:"brand"`
}
type EventPayloadCart ¶
type EventPayloadCart struct {
Data Cart `json:"cart"`
}
type EventPayloadCategory ¶
type EventPayloadCategory struct {
Data Category `json:"category"`
}
type EventPayloadCollection ¶
type EventPayloadCollection struct {
Data Collection `json:"collection"`
}
type EventPayloadCurrency ¶
type EventPayloadCurrency struct {
Data Currency `json:"currency"`
}
type EventPayloadDeleted ¶
type EventPayloadDeleted Relationship
type EventPayloadFile ¶
type EventPayloadFile struct {
Data File `json:"file"`
}
type EventPayloadIntegration ¶
type EventPayloadIntegration struct {
Data Integration `json:"integrations"`
}
type EventPayloadOrder ¶
type EventPayloadOrder struct {
Data Order `json:"order"`
}
type EventPayloadProduct ¶
type EventPayloadProduct struct {
Data Product `json:"product"`
}
type EventPayloadResource ¶
type EventPayloadResource interface {
// contains filtered or unexported methods
}
type EventPayloadSettings ¶
type EventPayloadSettings struct {
Data Settings `json:"settings"`
}
type EventPayloadStockTransaction ¶
type EventPayloadStockTransaction struct {
Data StockTransaction `json:"stock-transaction"`
}
type EventPayloadTransaction ¶
type EventPayloadTransaction struct {
Data Transaction `json:"transaction"`
}
type Field ¶
type Field struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
FieldType string `json:"field_type"`
ValidationRules []fv.Rule `json:"validation_rules,omitempty"`
Enabled bool `json:"enabled"`
Required bool `json:"required"`
Order int32 `json:"order"`
Unique bool `json:"unique"`
Default interface{} `json:"default,omitempty"`
OmitNull bool `json:"omit_null,omitempty"`
Meta *struct {
Timestamps Timestamps `json:"timestamps,omitempty"`
} `json:"meta,omitempty"`
Relationships *Relationships `json:"relationships,omitempty"`
}
Field is a Moltin Field - https://docs.moltin.com/advanced/custom-data/fields
func (Field) MarshalJSON ¶
func (*Field) UnmarshalJSON ¶
type File ¶
type File struct {
ID string `json:"id,omitempty" form:"-"`
Type string `json:"type" form:"-"`
FileName string `json:"file_name" form:"file_name,omitempty"`
Public bool `json:"public" form:"public"`
MimeType string `json:"mime_type" form:"mime_type,omitempty"`
FileSize int `json:"file_size" form:"file_size,omitempty"`
Meta *FileMeta `json:"meta,omitempty" form:"-"`
Link *struct {
Href string `json:"href"`
} `json:"link" form:"-"`
Links *Links `json:"links,omitempty" form:"-"`
File *form.File `json:"-" form:"file"`
}
File is a Moltin File - https://docs.moltin.com/advanced/files
type FileMeta ¶
type FileMeta struct {
Dimensions struct {
Width int32 `json:"width"`
Height int32 `json:"height"`
} `json:"dimensions"`
Timestamps Timestamps `json:"timestamps"`
}
FileMeta represents the meta object for a moltin file entity
type FileUploadRequest ¶
type FileUploadRequest struct {
File bytes.Buffer `json:"file"`
Public bool `json:"public,omitempty"`
}
FileUploadRequest represents a request to upload a file to Moltin
type Flow ¶
type Flow struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
Enabled bool `json:"enabled"`
Meta *struct {
Timestamps Timestamps `json:"timestamps,omitempty"`
} `json:"meta,omitempty"`
Relationships *Relationships `json:"relationships,omitempty"`
}
Flow is a Moltin Flow - https://docs.moltin.com/advanced/custom-data/flows
type Integration ¶
type Integration struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Name string `json:"name"`
Description string `json:"description"`
Enabled bool `json:"enabled"`
IntegrationType string `json:"integration_type"`
Observes []string `json:"observes"`
Configuration IntegrationConfiguration `json:"configuration"`
Meta *struct {
Timestamps Timestamps `json:"timestamps,omitempty"`
} `json:"meta,omitempty"`
}
Integration is a Moltin Integration - https://docs.moltin.com/advanced/events
func (*Integration) SetType ¶
func (i *Integration) SetType()
type IntegrationConfiguration ¶
type IntegrationConfiguration struct {
URL string `json:"url"`
SecretKey string `json:"secret_key,omitempty"`
}
IntegrationConfiguration specifies a webhook configuration object
type IntegrationLog ¶
type IntegrationLog struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Succeeded bool `json:"succeeded"`
ProcessingTime float64 `json:"processing_time"`
Body string `json:"body"`
StatusCode int `json:"status_code"`
ErrorDetail string `json:"error_detail"`
Relationships *Relationships `json:"relationships,omitempty"`
Meta *IntegrationLogMeta `json:"meta,omitempty"`
}
IntegrationLog represents a single event log. See https://docs.moltin.com/api/advanced/events/logs
func (*IntegrationLog) SetType ¶
func (i *IntegrationLog) SetType()
type IntegrationLogJobs ¶
type IntegrationLogJobs []Relationship
IntegrationLogJobs is a list of jobs relating to an event. See https://docs.moltin.com/api/advanced/events/logs
type IntegrationLogMeta ¶
type IntegrationLogMeta struct {
Timestamps Timestamps `json:"timestamps,omitempty"`
}
type Inventory ¶
type Inventory struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Total int64 `json:"total"`
Available int64 `json:"available"`
Allocated int64 `json:"allocated"`
}
Inventory represents a product stock object in the Moltin API: https://docs.moltin.com/api/catalog/inventory
type Job ¶
type Links ¶
type Links struct {
Self string `json:"self"`
}
Links represents the links available for a Moltin entity
type Meta ¶
type Meta struct {
Results MetaResults `json:"results"`
Page MetaPage `json:"page"`
}
Meta is returned from many queries that support pagination
type MetaPage ¶
type MetaPage struct {
Limit int `json:"limit"`
Offset int `json:"offset"`
Current int `json:"current"`
Total int `json:"total"`
}
MetaPage contains pagination information
type MetaResults ¶
MetaResults contains the total number of results
type Modifier ¶
type Modifier struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
ModifierType string `json:"modifier_type"`
Value ModifierValue `json:"value"`
}
Modifier represents a modifier for a variation option:
func (*Modifier) UnmarshalJSON ¶
UnmarshalJSON unmarshals a Modifier from JSON
type ModifierValue ¶
type ModifierValue interface {
// contains filtered or unexported methods
}
ModifierValue repesents a number of possible structures depending on the modifier type
type ModifierValueBuilder ¶
ModifierValueBuilder is used for modifier types: sku_builder, slug_builder
type ModifierValuePlain ¶
type ModifierValuePlain struct {
Value string
}
ModifierValuePlain is used for modifier types: description_equals, description_prepend, description_append, commoditytype, name_equals, name_prepend, name_append, slug_equals, slug_prepend, slug_append, sku_equals, sku_prepend, sku_append, status
func (*ModifierValuePlain) MarshalJSON ¶
func (v *ModifierValuePlain) MarshalJSON() ([]byte, error)
func (*ModifierValuePlain) UnmarshalJSON ¶
func (v *ModifierValuePlain) UnmarshalJSON(b []byte) error
type ModifierValuePrice ¶
type ModifierValuePrice struct {
Amount int `json:"amount"`
Currency string `json:"currency"`
IncludesTax bool `json:"includes_tax"`
}
ModifierValuePrice is used for modifier types: price_increment, price_decrement, price_equals
type Option ¶
type Option struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Name string `json:"name"`
Description string `json:"description"`
Modifiers []Modifier `json:"modifiers"`
}
Option represents an option for selection for a single Moltin product-variation: https://docs.moltin.com/api/catalog/product-variations/options
type Order ¶
type Order struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Status string `json:"status"`
Payment string `json:"payment"`
Shipping string `json:"shipping"`
Customer OrderCustomer `json:"customer"`
ShippingAddress OrderShippingAddress `json:"shipping_address"`
BillingAddress OrderBillingAddress `json:"billing_address"`
Links *Links `json:"links"`
Meta *OrderMeta `json:"meta,omitempty"`
Relationships *Relationships `json:"relationships,omitempty"`
}
Order represents a Moltin order: https://docs.moltin.com/api/orders-and-customers/orders
type OrderBillingAddress ¶
type OrderBillingAddress struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
CompanyName string `json:"company_name"`
Line1 string `json:"line_1"`
Line2 string `json:"line_2"`
City string `json:"city"`
PostCode string `json:"postcode"`
County string `json:"county"`
Country string `json:"country"`
}
OrderBillingAddress represents a Moltin billing address for a Moltin order
type OrderCustomer ¶
OrderCustomer represents a Moltin customer object for a Moltin order (can be ID or Name and Email)
type OrderMeta ¶
type OrderMeta struct {
DisplayPrice DisplayPriceWrapper `json:"display_price"`
Timestamps Timestamps `json:"timestamps,omitempty"`
}
OrderMeta represents the meta object for a Moltin order
type OrderShippingAddress ¶
type OrderShippingAddress struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
PhoneNumber string `json:"phone_number"`
CompanyName string `json:"company_name"`
Line1 string `json:"line_1"`
Line2 string `json:"line_2"`
City string `json:"city"`
PostCode string `json:"postcode"`
County string `json:"county"`
Country string `json:"country"`
Instructions string `json:"instructions"`
}
OrderShippingAddress represents a Moltin shipping address for a Moltin order
type Product ¶
type Product struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Name string `json:"name"`
Slug string `json:"slug"`
SKU string `json:"sku"`
Description string `json:"description"`
ManageStock bool `json:"manage_stock"`
Status string `json:"status"`
CommodityType string `json:"commodity_type"`
Price []ProductPrice `json:"price"`
Meta *ProductMeta `json:"meta,omitempty"`
Relationships *Relationships `json:"relationships,omitempty"`
Included *ProductIncludes `json:"included,omitempty"`
}
Product is a Moltin Product https://docs.moltin.com/catalog/products
type ProductIncludes ¶
type ProductIncludes struct {
Brands []Brand `json:"brands"`
Categories []Category `json:"categories"`
Collections []Collection `json:"collections"`
Files []File `json:"files"`
MainImage File `json:"main_image"`
MainImages []File `json:"main_images"`
}
ProductIncludes is possible includes for a Product
type ProductMeta ¶
type ProductMeta struct {
DisplayPrice DisplayPriceWrapper `json:"display_price"`
Timestamps Timestamps `json:"timestamps,omitempty"`
Stock ProductStock `json:"stock"`
Variations []ProductVariation `json:"variations,omitempty"`
VariationMatrix *VariationMatrix `json:"variation_matrix"`
}
ProductMeta represents the meta object of a Moltin product
type ProductPrice ¶
type ProductPrice struct {
Amount int `json:"amount"`
Currency string `json:"currency"`
IncludesTax bool `json:"includes_tax"`
}
ProductPrice is a price for a Products meta
type ProductStock ¶
ProductStock is a stock object for a Products meta
type ProductVariation ¶
type ProductVariation struct {
ID string `json:"id"`
Name string `json:"name"`
Options []ProductVariationOptions `json:"options"`
}
ProductVariation is a variation object for a Products Variations meta
type ProductVariationOptions ¶
type ProductVariationOptions struct {
Name string `json:"name"`
Description string `json:"description"`
}
ProductVariationOptions is a options object for a Products ProductVariation meta
type Promotion ¶
type Promotion struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Name string `json:"name"`
Description string `json:"description"`
Enabled bool `json:"enabled"`
PromotionType string `json:"promotion_type"`
Schema PromotionSchema `json:"schema"`
Start string `json:"start"`
End string `json:"end"`
Meta *struct {
Timestamps Timestamps `json:"timestamps,omitempty"`
} `json:"meta,omitempty"`
}
Promotion represents a Moltin promotion: https://docs.moltin.com/api/carts-and-checkout/promotions
type PromotionCurrency ¶
type PromotionSchema ¶
type PromotionSchema struct {
Currencies []PromotionCurrency `json:"currencies"`
}
type Relationship ¶
Relationship is the shorthand relationship object
type RelationshipContainer ¶
type RelationshipContainer struct {
Relationships []Relationship
OneToOne bool
}
RelationshipContainer contains one-to-one or on-to-many relationships. One-to-one relationships should have exactly one Relationship and OneToOne set to true.
type Relationships ¶
type Relationships map[string]RelationshipContainer
Relationships represents a relaionships object
func (Relationships) MarshalJSON ¶
func (r Relationships) MarshalJSON() ([]byte, error)
MarshalJSON marshals Relationships into JSON
func (*Relationships) UnmarshalJSON ¶
func (r *Relationships) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals Relationships from JSON
type Settings ¶
type Settings struct {
Type string `json:"type"`
PageLength int `json:"page_length"`
ListChildProducts bool `json:"list_child_products"`
AdditionalLanguages []string `json:"additional_languages"`
CalculationMethod string `json:"calculation_method,omitempty"`
}
Settings is a Moltin Setting Configuration - https://docs.moltin.com/advanced/settings
func (*Settings) SupportedLanguages ¶
SupportedLanguages returns the languages that are supported on the additional_languages field
type StockTransaction ¶
type StockTransaction struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Action string `json:"action"`
ProductID string `json:"product_id"`
Quantity int32 `json:"quantity"`
}
StockTransaction represents a Moltin inventory transaction: https://docs.moltin.com/api/catalog/inventory/stock-transactions
func (*StockTransaction) SetType ¶
func (s *StockTransaction) SetType()
type StripeGateway ¶
type StripeGateway struct {
Type string `json:"type"`
Name string `json:"name"`
Slug string `json:"slug"`
Enabled bool `json:"enabled"`
Login string `json:"login"`
}
StripeGateway is a Moltin StripeGateway - https://docs.moltin.com/payments/gateways/configure-stripe
func (*StripeGateway) SetType ¶
func (s *StripeGateway) SetType()
type Timestamps ¶
type Timestamps struct {
CreatedAt string `json:"created_at,omitempty"`
}
Timestamps represents the timestamps from the Moltin API
type Transaction ¶
type Transaction struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Reference string `json:"reference"`
Gateway string `json:"gateway"`
Amount int32 `json:"amount"`
Currency string `json:"currency"`
TransactionType string `json:"transaction_type"`
Status string `json:"status"`
Relationships *Relationships `json:"relationships,omitempty"`
}
func (*Transaction) SetType ¶
func (t *Transaction) SetType()
type Variation ¶
type Variation struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
Type string `json:"type"`
Relationships *Relationships `json:"relationships,omitempty"`
Included *VariationIncluded `json:"included,omitempty"`
}
Variation is a Moltin variation: https://docs.moltin.com/api/catalog/product-variations
type VariationIncluded ¶
type VariationIncluded struct {
Options []VariationIncludedOption `json:"options"`
Modifiers []Modifier `json:"modifiers"`
}
type VariationIncludedOption ¶
type VariationIncludedOption struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Relationships *Relationships `json:"relationships,omitempty"`
}
type VariationMatrix ¶
type VariationMatrix struct {
Children map[string]*VariationMatrix
Products map[string]string
}
func (VariationMatrix) MarshalJSON ¶
func (m VariationMatrix) MarshalJSON() ([]byte, error)
func (*VariationMatrix) UnmarshalJSON ¶
func (m *VariationMatrix) UnmarshalJSON(b []byte) error
Source Files
¶
- address.go
- brand.go
- cart.go
- cart_item.go
- category.go
- collection.go
- currency.go
- customer.go
- display_price.go
- event.go
- event_payload.go
- event_payload_resources.go
- field.go
- file.go
- flow.go
- gateway_adyen.go
- gateway_braintree.go
- gateway_cardconnect.go
- gateway_stripe.go
- integration.go
- integration_log.go
- inventory.go
- job.go
- links.go
- meta.go
- modifier.go
- option.go
- order.go
- product.go
- promotion.go
- relationship.go
- set_types.go
- settings.go
- stock_transaction.go
- timestamps.go
- transaction.go
- types.go
- variation.go