shopify

package module
v0.0.0-...-ed2caf5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2019 License: MIT Imports: 15 Imported by: 0

README

shopify-go-api

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Scopes = map[string]string{
	"read_content":             "Access to Article, Blog, Comment, Page, and Redirect.",
	"write_content":            "Write to Article, Blog, Comment, Page, and Redirect.",
	"read_themes":              "Access to Asset and Theme.",
	"write_themes":             "Write to Asset and Theme.",
	"read_products":            "Access to Product, Product Variant, Product Image, Collect, Custom Collection, and Smart Collection.",
	"write_products":           "Write to Product, Product Variant, Product Image, Collect, Custom Collection, and Smart Collection.",
	"read_product_listings":    "Access to Product Listing, and Collection Listing.",
	"read_collection_listings": "Write to Product Listing, and Collection Listing.",
	"read_customers":           "Access to Customer and Saved Search.",
	"write_customers":          "Write to Customer and Saved Search.",
	"read_orders":              "Access to Order, Transaction and Fulfillment.",
	"write_orders":             "Write to Order, Transaction and Fulfillment.",
	"read_draft_orders":        "Access to Draft Order.",
	"write_draft_orders":       "Write to Draft Order.",
	"read_script_tags":         "Access to Script Tag.",
	"write_script_tags":        "Write to Script Tag.",
	"read_fulfillments":        "Access to Fulfillment Service.",
	"write_fulfillments":       "Write to Fulfillment Service.",
	"read_shipping":            "Access to Carrier Service, Country and Province.",
	"write_shipping":           "Write to Carrier Service, Country and Province.",
	"read_analytics":           "Access to Analytics API.",
	"read_checkouts":           "Access to Checkouts.",
	"write_checkouts":          "Write to Checkouts.",
	"read_reports":             "Access to Reports.",
	"write_reports":            "Write to Reports.",
	"read_price_rules":         "Access to Price Rules.",
	"write_price_rules":        "Write to Price Rules.",
}

Functions

func CheckResponseError

func CheckResponseError(resp *http.Response) error

Types

type Address

type Address struct {
	Address1     string           `json:"address1,omitempty"`
	Address2     string           `json:"address2,omitempty"`
	City         string           `json:"city,omitempty"`
	Company      string           `json:"company,omitempty"`
	Country      string           `json:"country,omitempty"`
	FirstName    string           `json:"first_name,omitempty"`
	LastName     string           `json:"last_name,omitempty"`
	Latitude     *decimal.Decimal `json:"latitude,omitempty"`
	Longitude    *decimal.Decimal `json:"longitude,omitempty"`
	Phone        string           `json:"phone,omitempty"`
	Province     string           `json:"province,omitempty"`
	Zip          string           `json:"zip,omitempty"`
	Name         string           `json:"name,omitempty"`
	CountryCode  string           `json:"country_code,omitempty"`
	ProvinceCode string           `json:"province_code,omitempty"`
}

type App

type App struct {
	APIKey       string
	APISecretKey string
	RedirectURL  string
	Scope        string
	ShopName     string
	State        string
	Private      bool
}

func (App) AuthorizeURL

func (app App) AuthorizeURL(state string) string

func (App) GetAccessToken

func (app App) GetAccessToken(code string) (interface{}, error)

func (App) VerifyHMAC

func (app App) VerifyHMAC(message, messageMAC string) bool

func (App) VerifyURL

func (app App) VerifyURL(u *url.URL) bool

type AppliedDiscount

type AppliedDiscount struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Value       string `json:"value"`
	ValueType   string `json:"value_type"`
	Amount      string `json:"amount"`
}

type Article

type Article struct {
	ID             int64       `json:"id,omitempty"`
	Title          string      `json:"title,omitempty"`
	CreatedAt      *time.Time  `json:"created_at,omitempty"`
	BodyHTML       string      `json:"body_html,omitempty"`
	BlogID         int64       `json:"blog_id,omitempty"`
	Author         string      `json:"author,omitempty"`
	UserID         int64       `json:"user_id,omitempty"`
	PublishedAt    *time.Time  `json:"published_at,omitempty"`
	UpdatedAt      *time.Time  `json:"updated_at,omitempty"`
	SummaryHTML    string      `json:"summary_html,omitempty"`
	TemplateSuffix string      `json:"template_suffix,omitempty"`
	Handle         string      `json:"handle,omitempty"`
	Tags           string      `json:"tags,omitempty"`
	Image          Image       `json:"image,omitempty"`
	Metafields     []Metafield `json:"metafields,omitempty"`
	Published      bool        `json:"published,omitempty"`
}

type ArticleResource

type ArticleResource struct {
	Article Article `json:"article"`
}

type ArticleService

type ArticleService interface {
	Get(int64, interface{}) ([]Article, error)
	Count(int64, interface{}) (int64, error)
	Paginate(int64, interface{}) (int64, []Article, error)
	Find(int64, int64, interface{}) (Article, error)
	Create(int64, interface{}) (Article, error)
	Update(int64, int64, interface{}) (Article, error)
	Delete(int64, int64) error
	Authors() ([]string, error)
	Tags(interface{}) ([]string, error)
	BlogTags(int64, interface{}) ([]string, error)
}

type ArticleServiceRequest

type ArticleServiceRequest struct {
	// contains filtered or unexported fields
}

func (*ArticleServiceRequest) Authors

func (r *ArticleServiceRequest) Authors() ([]string, error)

func (*ArticleServiceRequest) BlogTags

func (r *ArticleServiceRequest) BlogTags(blogID int64, params interface{}) ([]string, error)

func (*ArticleServiceRequest) Count

func (r *ArticleServiceRequest) Count(blogID int64, params interface{}) (int64, error)

func (*ArticleServiceRequest) Create

func (r *ArticleServiceRequest) Create(blogID int64, params interface{}) (Article, error)

func (*ArticleServiceRequest) Delete

func (r *ArticleServiceRequest) Delete(blogID int64, articleID int64) error

func (*ArticleServiceRequest) Find

func (r *ArticleServiceRequest) Find(blogID int64, articleID int64, params interface{}) (Article, error)

func (*ArticleServiceRequest) Get

func (r *ArticleServiceRequest) Get(blogID int64, params interface{}) ([]Article, error)

func (*ArticleServiceRequest) Paginate

func (r *ArticleServiceRequest) Paginate(blogID int64, params interface{}) (int64, []Article, error)

func (*ArticleServiceRequest) Tags

func (r *ArticleServiceRequest) Tags(params interface{}) ([]string, error)

func (*ArticleServiceRequest) Update

func (r *ArticleServiceRequest) Update(blogID int64, articleID int64, params interface{}) (Article, error)

type ArticlesResource

type ArticlesResource struct {
	Articles []Article `json:"articles"`
}

type AuthorsResource

type AuthorsResource struct {
	Authors []string `json:"authors,omitempty"`
}

type Checkout

type Checkout struct {
	ID                    int64           `json:"id,omitempty"`
	Token                 string          `json:"token,omitempty"`
	CartToken             string          `json:"cart_token,omitempty"`
	Email                 string          `json:"email,omitempty"`
	Gateway               string          `json:"gateway,omitempty"`
	BuyerAcceptsMarketing bool            `json:"buyer_accepts_marketing,omitempty"`
	CreatedAt             *time.Time      `json:"created_at,omitempty"`
	UpdatedAt             *time.Time      `json:"updated_at,omitempty"`
	LandingSite           string          `json:"landing_site,omitempty"`
	Note                  string          `json:"note,omitempty"`
	NoteAttributes        []NoteAttribute `json:"note_attributes,omitempty"`
	ReferringSite         string          `json:"referring_site,omitempty"`
	ShippingLines         []ShippingLine  `json:"shipping_lines,omitempty"`
	SubtotalPrice         string          `json:"subtotal_price,omitempty"`
	TaxesIncluded         bool            `json:"taxes_included,omitempty"`
	TotalDiscounts        string          `json:"total_discounts,omitempty"`
	TotalLineItemsPrice   string          `json:"total_line_items_price,omitempty"`
	TotalPrice            string          `json:"total_price,omitempty"`
	TotalTax              string          `json:"total_tax,omitempty"`
	TotalWeight           int64           `json:"total_weight,omitempty"`
	Currency              string          `json:"currency,omitempty"`
	CompletedAt           *time.Time      `json:"completed_at,omitempty"`
	ClosedAt              *time.Time      `json:"closed_at,omitempty"`
	UserID                int64           `json:"user_id,omitempty"`
	LocationID            int64           `json:"location_id,omitempty"`
	SourceIdentifier      string          `json:"source_identifier,omitempty"`
	SourceURL             string          `json:"source_url,omitempty"`
	DeviceID              string          `json:"device_id,omitempty"`
	Phone                 string          `json:"phone,omitempty"`
	CustomerLocale        string          `json:"customer_locale,omitempty"`
	LineItems             []LineItem      `json:"line_items,omitempty"`
	Name                  string          `json:"name,omitempty"`
	Source                string          `json:"source,omitempty"`
	DiscountCodes         []DiscountCode  `json:"discount_codes,omitempty"`
	AbandonedCheckoutURL  string          `json:"abandoned_checkout_url,omitempty"`
	TaxLines              []TaxLine       `json:"tax_lines,omitempty"`
	SourceName            string          `json:"source_name,omitempty"`
	ShippingAddress       *Address        `json:"shipping_address,omitempty"`
	Customer              *Customer       `json:"customer,omitempty"`
}

type CheckoutService

type CheckoutService interface {
	Get(interface{}) ([]Checkout, error)
	Count(interface{}) (int64, error)
	Paginate(interface{}) (int64, []Checkout, error)
}

type CheckoutServiceRequest

type CheckoutServiceRequest struct {
	// contains filtered or unexported fields
}

func (*CheckoutServiceRequest) Count

func (r *CheckoutServiceRequest) Count(params interface{}) (int64, error)

func (*CheckoutServiceRequest) Get

func (r *CheckoutServiceRequest) Get(params interface{}) ([]Checkout, error)

func (*CheckoutServiceRequest) Paginate

func (r *CheckoutServiceRequest) Paginate(params interface{}) (int64, []Checkout, error)

type CheckoutsResource

type CheckoutsResource struct {
	Checkouts []Checkout `json:"checkouts"`
}

type Client

type Client struct {
	DraftOrder *DraftOrderService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(app App, httpClient *http.Client, accessToken string) *Client

func (*Client) CreateAndDo

func (c *Client) CreateAndDo(method, urlStr string, body, options, resource interface{}) error

func (*Client) Delete

func (c *Client) Delete(urlStr string, body, resource interface{}) error

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) error

func (*Client) Get

func (c *Client) Get(urlStr string, options, resource interface{}) error

func (*Client) NewRequest

func (c *Client) NewRequest(method, path string, body, params interface{}) (*http.Request, error)

func (*Client) Post

func (c *Client) Post(urlStr string, body, resource interface{}) error

func (*Client) Put

func (c *Client) Put(urlStr string, body, resource interface{}) error

type ClientDetail

type ClientDetail struct {
	BrowserIP      string `json:"browser_ip"`
	AcceptLanguage string `json:"accept_language"`
	UserAgent      string `json:"user_agent"`
	SessionHash    string `json:"session_hash"`
	BrowserWidth   string `json:"browser_width"`
	BrowserHeight  string `json:"browser_height"`
}

type Count

type Count struct {
	Count int64 `json:"count"`
}

type CountriesResource

type CountriesResource struct {
	Countries []Country `json:"countries"`
}

type Country

type Country struct {
	ID        int64      `json:"id"`
	Name      string     `json:"name"`
	Code      string     `json:"code"`
	Tax       float64    `json:"tax"`
	TaxName   string     `json:"tax_name"`
	Provinces []Province `json:"provinces"`
}

type CountryResource

type CountryResource struct {
	Country Country `json:"country"`
}

type CountryService

type CountryService interface {
	Get(interface{}) ([]Country, error)
	Count() (int64, error)
	Find(int64, interface{}) (Country, error)
}

type CountryServiceRequest

type CountryServiceRequest struct {
	// contains filtered or unexported fields
}

func (*CountryServiceRequest) Count

func (r *CountryServiceRequest) Count() (int64, error)

func (*CountryServiceRequest) Find

func (r *CountryServiceRequest) Find(countryID int64, params interface{}) (Country, error)

func (*CountryServiceRequest) Get

func (r *CountryServiceRequest) Get(params interface{}) ([]Country, error)

type Customer

type Customer struct {
	AcceptsMarketing    bool              `json:"accepts_marketing"`
	Addresses           []CustomerAddress `json:"addresses,omitempty"`
	CreatedAt           *time.Time        `json:"created_at,omitempty"`
	DefaultAddress      *CustomerAddress  `json:"default_address,omitempty"`
	Email               string            `json:"email,omitempty"`
	FirstName           string            `json:"first_name,omitempty"`
	ID                  int64             `json:"id,omitempty"`
	LastName            string            `json:"last_name,omitempty"`
	LastOrderID         int64             `json:"last_order_id,omitempty"`
	LastOrderName       string            `json:"last_order_name,omitempty"`
	Metafields          []Metafield       `json:"metafields,omitempty"`
	MultipassIdentifier string            `json:"multipass_identifier,omitempty"`
	Note                string            `json:"note,omitempty"`
	OrderCount          int64             `json:"order_count,omitempty"`
	Phone               string            `json:"phone,omitempty"`
	State               string            `json:"state,omitempty"`
	Tags                string            `json:"tags,omitempty"`
	TaxExempt           bool              `json:"tax_exempt,omitempty"`
	TotalSpent          *decimal.Decimal  `json:"total_spent,omitempty"`
	UpdatedAt           *time.Time        `json:"updated_at,omitempty"`
	VerifiedEmail       bool              `json:"verified_email,omitempty"`
}

type CustomerAddress

type CustomerAddress struct {
	Address
	ID         int64 `json:"id,omitempty"`
	CustomerID int64 `json:"customer_id,omitempty"`
	Default    bool  `json:"default,omitempty"`
}

type DiscountCode

type DiscountCode struct {
	Amount string `json:"amount"`
	Code   string `json:"code"`
	Type   string `json:"type"`
}

type DraftOrder

type DraftOrder struct {
	ID                        int64            `json:"id,omitempty"`
	OrderID                   int64            `json:"order_id,omitempty"`
	Name                      string           `json:"name,omitempty"`
	Customer                  *Customer        `json:"customer"`
	ShippingAddress           *Address         `json:"shipping_address"`
	BillingAddress            *Address         `json:"billing_address"`
	Note                      string           `json:"note,omitempty"`
	NoteAttributes            []NoteAttribute  `json:"note_attributes,omitempty"`
	Email                     string           `json:"email,omitempty"`
	Currency                  string           `json:"currency,omitempty"`
	InvoiceSentAt             *time.Time       `json:"invoice_sent_at,omitempty"`
	InvoiceURL                string           `json:"invoice_url"`
	LineItems                 []LineItem       `json:"line_items,omitempty"`
	ShippingLine              *ShippingLine    `json:"shipping_line,omitempty"`
	Tags                      string           `json:"tags,omitempty"`
	TaxExempt                 bool             `json:"tax_exempt,omitempty"`
	TaxLines                  []TaxLine        `json:"tax_lines,omitempty"`
	AppliedDiscount           *AppliedDiscount `json:"applied_discount,omitempty"`
	TaxesIncluded             bool             `json:"taxes_included,omitempty"`
	TotalTax                  *decimal.Decimal `json:"total_tax,omitempty"`
	SubtotalPrice             *decimal.Decimal `json:"subtotal_price,omitempty"`
	TotalPrice                *decimal.Decimal `json:"total_price,omitempty"`
	CompletedAt               *time.Time       `json:"completed_at,omitempty"`
	CreatedAt                 *time.Time       `json:"created_at,omitempty"`
	UpdatedAt                 *time.Time       `json:"updated_at,omitempty"`
	Status                    string           `json:"status,omitempty"`
	UseCustomerDefaultAddress bool             `json:"use_customer_default_address,omitempty"`
}

type DraftOrderInvoice

type DraftOrderInvoice struct {
	To            string   `json:"to,omitempty"`
	From          string   `json:"from,omitempty"`
	Subject       string   `json:"subject,omitempty"`
	CustomMessage string   `json:"custom_message,omitempty"`
	Bcc           []string `json:"bcc,omitempty"`
}

type DraftOrderInvoiceResource

type DraftOrderInvoiceResource struct {
	DraftOrderInvoice DraftOrderInvoice `json:"draft_order_invoice"`
}

type DraftOrderResource

type DraftOrderResource struct {
	DraftOrder DraftOrder `json:"draft_order"`
}

type DraftOrderService

type DraftOrderService service

type DraftOrderServiceRequest

type DraftOrderServiceRequest struct {
	// contains filtered or unexported fields
}

func (*DraftOrderServiceRequest) Complete

func (r *DraftOrderServiceRequest) Complete(draftOrderID int64, params interface{}) (DraftOrder, error)

func (*DraftOrderServiceRequest) Count

func (r *DraftOrderServiceRequest) Count(params interface{}) (int64, error)

func (*DraftOrderServiceRequest) Create

func (r *DraftOrderServiceRequest) Create(params interface{}) (DraftOrder, error)

func (*DraftOrderServiceRequest) Delete

func (r *DraftOrderServiceRequest) Delete(draftOrderID int64) error

func (*DraftOrderServiceRequest) Find

func (r *DraftOrderServiceRequest) Find(draftOrderID int64, params interface{}) (DraftOrder, error)

func (*DraftOrderServiceRequest) Get

func (r *DraftOrderServiceRequest) Get(params interface{}) ([]DraftOrder, error)

func (*DraftOrderServiceRequest) Invoice

func (r *DraftOrderServiceRequest) Invoice(draftOrderID int64) (DraftOrderInvoice, error)

func (*DraftOrderServiceRequest) Paginate

func (r *DraftOrderServiceRequest) Paginate(params interface{}) (int64, []DraftOrder, error)

func (*DraftOrderServiceRequest) Update

func (r *DraftOrderServiceRequest) Update(draftOrderID int64, params interface{}) (DraftOrder, error)

type DraftOrdersResource

type DraftOrdersResource struct {
	DraftOrders []DraftOrder `json:"draft_orders"`
}

type Fulfillment

type Fulfillment struct {
	ID              int64      `json:"id"`
	OrderID         int64      `json:"order_id"`
	Status          string     `json:"status"`
	CreatedAt       *time.Time `json:"created_at"`
	Service         string     `json:"service"`
	UpdatedAt       *time.Time `json:"updated_at"`
	TrackingCompany string     `json:"tracking_company"`
	ShipmentStatus  string     `json:"shipment_status"`
	TrackingNumber  string     `json:"tracking_number"`
	TrackingNumbers []string   `json:"tracking_numbers"`
	TrackingURL     string     `json:"tracking_url"`
	TrackingURLs    []string   `json:"tracking_urls"`
	Receipt         Receipt    `json:"receipt"`
	LineItems       []LineItem `json:"line_items"`
}

type Image

type Image struct {
	Src       string     `json:"src"`
	CreatedAt *time.Time `json:"created_at"`
}

type LineItem

type LineItem struct {
	Custom                     bool             `json:"custom,omitempty"`
	FulfillableQuantity        int64            `json:"fulfillable_quantity,omitempty"`
	FulfillmentService         string           `json:"fulfillment_service,omitempty"`
	Grams                      *decimal.Decimal `json:"grams,omitempty"`
	ID                         int64            `json:"id,omitempty"`
	Price                      *decimal.Decimal `json:"price,omitempty"`
	ProductID                  int64            `json:"product_id,omitempty"`
	Quantity                   int64            `json:"quantity,omitempty"`
	RequiresShipping           bool             `json:"requires_shipping,omitempty"`
	SKU                        string           `json:"sku,omitempty"`
	Title                      string           `json:"title,omitempty"`
	VariantID                  int64            `json:"variant_id,omitempty"`
	VariantTitle               string           `json:"variant_title,omitempty"`
	Vendor                     string           `json:"vendor,omitempty"`
	Name                       string           `json:"name,omitempty"`
	GiftCard                   bool             `json:"gift_card,omitempty"`
	Properties                 []Property       `json:"properties,omitempty"`
	Taxable                    bool             `json:"taxable,omitempty"`
	VariantInventoryManagement string           `json:"variant_inventory_management,omitempty"`
	ProductExists              bool             `json:"product_exists,omitempty"`
	TotalDiscount              *decimal.Decimal `json:"total_discount,omitempty"`
	FulfillmentStatus          string           `json:"fulfillment_status,omitempty"`
	TaxLines                   []TaxLine        `json:"tax_lines,omitempty"`
	AppliedDiscount            *AppliedDiscount `json:"applied_discount,omitempty"`
}

type Metafield

type Metafield struct {
	CreatedAt     *time.Time `json:"created_at,omitempty"`
	Description   string     `json:"description,omitempty"`
	ID            int64      `json:"id,omitempty"`
	Key           string     `json:"key,omitempty"`
	Namespace     string     `json:"namespace,omitempty"`
	OwnerID       int64      `json:"owner_id,omitempty"`
	OwnerResource string     `json:"owner_resource,omitempty"`
	Value         string     `json:"value,omitempty"`
	ValueType     string     `json:"value_type,omitempty"`
	UpdatedAt     *time.Time `json:"updated_at,omitempty"`
}

type NoteAttribute

type NoteAttribute struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Order

type Order struct {
	ID                    int64            `json:"id,omitempty"`
	Email                 string           `json:"email,omitempty"`
	ClosedAt              *time.Time       `json:"closed_at,omitempty"`
	CreatedAt             *time.Time       `json:"created_at,omitempty"`
	UpdatedAt             *time.Time       `json:"updated_at,omitempty"`
	Number                int64            `json:"number,omitempty"`
	Note                  string           `json:"note,omitempty"`
	Token                 string           `json:"token,omitempty"`
	Gateway               string           `json:"gateway,omitempty"`
	Test                  bool             `json:"test,omitempty"`
	TotalPrice            *decimal.Decimal `json:"total_price,omitempty"`
	SubtotalPrice         *decimal.Decimal `json:"subtotal_price,omitempty"`
	TotalWeight           *decimal.Decimal `json:"total_weight,omitempty"`
	TotalTax              *decimal.Decimal `json:"total_tax,omitempty"`
	TaxesIncluded         bool             `json:"taxes_included,omitempty"`
	Currency              string           `json:"currency,omitempty"`
	FinancialStatus       string           `json:"financial_status,omitempty"`
	Confirmed             bool             `json:"confirmed,omitempty"`
	TotalDiscounts        *decimal.Decimal `json:"total_discounts,omitempty"`
	TotalLineItemsPrice   *decimal.Decimal `json:"total_line_items_price,omitempty"`
	CartToken             string           `json:"cart_token,omitempty"`
	BuyerAcceptsMarketing bool             `json:"buyer_accepts_marketing,omitempty"`
	Name                  string           `json:"name,omitempty"`
	ReferringSite         string           `json:"referring_site,omitempty"`
	LandingSite           string           `json:"landing_site,omitempty"`
	CancelledAt           *time.Time       `json:"cancelled_at,omitempty"`
	CancelReason          string           `json:"cancel_reason,omitempty"`
	TotalPriceUSD         *decimal.Decimal `json:"total_price_usd,omitempty"`
	CheckoutToken         string           `json:"checkout_token,omitempty"`
	Reference             string           `json:"reference,omitempty"`
	UserID                int64            `json:"user_id,omitempty"`
	LocationID            int64            `json:"location_id,omitempty"`
	SourceIdentifier      string           `json:"source_identifier,omitempty"`
	SourceURL             string           `json:"source_url,omitempty"`
	ProcessedAt           *time.Time       `json:"processed_at,omitempty"`
	DeviceID              int64            `json:"device_id,omitempty"`
	Phone                 string           `json:"phone,omitempty"`
	CustomerLocale        string           `json:"customer_locale,omitempty"`
	AppID                 int64            `json:"app_id,omitempty"`
	BrowserIP             string           `json:"browser_ip,omitempty"`
	LandingSiteRef        string           `json:"landing_site_ref,omitempty"`
	OrderNumber           int64            `json:"order_number,omitempty"`
	DiscountCodes         []DiscountCode   `json:"discount_codes,omitempty"`
	NoteAttributes        []NoteAttribute  `json:"note_attributes,omitempty"`
	PaymentGatewayNames   []string         `json:"payment_gateway_names,omitempty"`
	ProcessingMethod      string           `json:"processing_method,omitempty"`
	CheckoutID            int64            `json:"checkout_id,omitempty"`
	SourceName            string           `json:"source_name,omitempty"`
	FulfillmentStatus     string           `json:"fulfillment_status,omitempty"`
	TaxLines              []TaxLine        `json:"tax_lines,omitempty"`
	Tags                  string           `json:"tags,omitempty"`
	ContactEmail          string           `json:"contact_email,omitempty"`
	OrderStatusURL        string           `json:"order_status_url,omitempty"`
	LineItems             []LineItem       `json:"line_items,omitempty"`
	ShippingLines         []ShippingLine   `json:"shipping_lines,omitempty"`
	BillingAddress        *Address         `json:"billing_address,omitempty"`
	ShippingAddress       *Address         `json:"shipping_address,omitempty"`
	Fulfillments          []Fulfillment    `json:"fulfillments,omitempty"`
	ClientDetails         *ClientDetail    `json:"client_details,omitempty"`
	Refunds               []Refund         `json:"refunds,omitempty"`
	Customer              *Customer        `json:"customer,omitempty"`
}

type OrderAdjustment

type OrderAdjustment struct {
}

type OrderCountOptions

type OrderCountOptions struct {
	CreatedAtMin      *time.Time `url:"created_at_min,omitempty"`
	CreatedAtMax      *time.Time `url:"created_at_max,omitempty"`
	UpdatedAtMin      *time.Time `url:"updated_at_min,omitempty"`
	UpdatedAtMax      *time.Time `url:"updated_at_max,omitempty"`
	Status            string     `url:"status,omitempty"`
	FinancialStatus   string     `url:"financial_status,omitempty"`
	FulfillmentStatus string     `url:"fulfillment_status,omitempty"`
}

type OrderOptions

type OrderOptions struct {
	OrderCountOptions
	IDs              string     `url:"ids,omitempty"`
	Limit            int64      `url:"limit,omitempty"`
	Page             int64      `url:"page"`
	SinceID          int64      `url:"since_id,omitempty"`
	ProcessedAtMin   *time.Time `url:"processed_at_min,omitempty"`
	ProcessedAtMax   *time.Time `url:"processed_at_max,omitempty"`
	AttributionAppID string     `url:"attribution_app_id"`
	Fields           string     `url:"fields"`
}

type OrderResource

type OrderResource struct {
	Order Order `json:"order"`
}

type OrderService

type OrderService interface {
	Get(interface{}) ([]Order, error)
	Count(interface{}) (int64, error)
	Paginate(interface{}) (int64, []Order, error)
	Find(int64, interface{}) (Order, error)
	Close(int64) (Order, error)
	Open(int64) (Order, error)
	Cancel(int64, interface{}) (Order, error)
	Create(interface{}) (Order, error)
	Update(int64, interface{}) (Order, error)
	Delete(int64) error
}

type OrderServiceRequest

type OrderServiceRequest struct {
	// contains filtered or unexported fields
}

func (*OrderServiceRequest) Cancel

func (r *OrderServiceRequest) Cancel(orderID int64, params interface{}) (Order, error)

func (*OrderServiceRequest) Close

func (r *OrderServiceRequest) Close(orderID int64) (Order, error)

func (*OrderServiceRequest) Count

func (r *OrderServiceRequest) Count(params interface{}) (int64, error)

func (*OrderServiceRequest) Create

func (r *OrderServiceRequest) Create(params interface{}) (Order, error)

func (*OrderServiceRequest) Delete

func (r *OrderServiceRequest) Delete(orderID int64) error

func (*OrderServiceRequest) Find

func (r *OrderServiceRequest) Find(orderID int64, params interface{}) (Order, error)

func (*OrderServiceRequest) Get

func (r *OrderServiceRequest) Get(params interface{}) ([]Order, error)

func (*OrderServiceRequest) Open

func (r *OrderServiceRequest) Open(orderID int64) (Order, error)

func (*OrderServiceRequest) Paginate

func (r *OrderServiceRequest) Paginate(params interface{}) (int64, []Order, error)

func (*OrderServiceRequest) Update

func (r *OrderServiceRequest) Update(orderID int64, params interface{}) (Order, error)

type OrdersResource

type OrdersResource struct {
	Orders []Order `json:"orders"`
}

type Product

type Product struct {
	ID             int64            `json:"id"`
	Title          string           `json:"title"`
	BodyHTML       string           `json:"body_html"`
	Vendor         string           `json:"vendor"`
	ProductType    string           `json:"product_type"`
	CreatedAt      *time.Time       `json:"created_at"`
	Handle         string           `json:"handle"`
	UpdatedAt      *time.Time       `json:"updated_at"`
	PublishedAt    *time.Time       `json:"published_at"`
	TemplateSuffix string           `json:"template_suffix"`
	PublishedScope string           `json:"published_scope"`
	Tags           string           `json:"tags"`
	Variants       []ProductVariant `json:"variants"`
	Options        []ProductOption  `json:"options"`
	Images         []ProductImage   `json:"images"`
	Image          ProductImage     `json:"image"`
}

type ProductImage

type ProductImage struct {
	ID         int64      `json:"id"`
	ProductID  int64      `json:"product_id"`
	Position   int64      `json:"position"`
	CreatedAt  *time.Time `json:"created_at"`
	UpdatedAt  *time.Time `json:"updated_at"`
	Width      int64      `json:"width"`
	Height     int64      `json:"height"`
	Src        string     `json:"src"`
	VariantIDs []int64    `json:"variant_ids"`
}

type ProductOption

type ProductOption struct {
	ID        int64    `json:"id"`
	ProductID int64    `json:"product_id"`
	Name      string   `json:"name"`
	Position  int64    `json:"position"`
	Values    []string `json:"values"`
}

type ProductResource

type ProductResource struct {
	Product Product `json:"product"`
}

type ProductService

type ProductService interface {
	Get(interface{}) ([]Product, error)
	Count(interface{}) (int64, error)
	Find(int64, interface{}) (Product, error)
	Create(interface{}) (Product, error)
	Update(int64, interface{}) (Product, error)
	Delete(int64) error
}

type ProductServiceRequest

type ProductServiceRequest struct {
	// contains filtered or unexported fields
}

func (*ProductServiceRequest) Count

func (r *ProductServiceRequest) Count(params interface{}) (int64, error)

func (*ProductServiceRequest) Create

func (r *ProductServiceRequest) Create(params interface{}) (Product, error)

func (*ProductServiceRequest) Delete

func (r *ProductServiceRequest) Delete(productID int64) error

func (*ProductServiceRequest) Find

func (r *ProductServiceRequest) Find(productID int64, params interface{}) (Product, error)

func (*ProductServiceRequest) Get

func (r *ProductServiceRequest) Get(params interface{}) ([]Product, error)

func (*ProductServiceRequest) Update

func (r *ProductServiceRequest) Update(productID int64, params interface{}) (Product, error)

type ProductVariant

type ProductVariant struct {
	ID                   int64            `json:"id"`
	ProductID            int64            `json:"product_id"`
	Title                string           `json:"title"`
	Price                string           `json:"price"`
	SKU                  string           `json:"sku"`
	Position             int64            `json:"position"`
	InventoryPolicy      string           `json:"inventory_policy"`
	CompareAtPrice       string           `json:"compare_at_price"`
	FulfillmentService   string           `json:"fulfillment_service"`
	InventoryManagement  string           `json:"inventory_management"`
	Option1              string           `json:"option_1"`
	Option2              string           `json:"option_2"`
	Option3              string           `json:"option_3"`
	CreatedAt            *time.Time       `json:"created_at"`
	UpdatedAt            *time.Time       `json:"updated_at"`
	Taxable              bool             `json:"taxable"`
	Barcode              string           `json:"barcode"`
	Grams                int64            `json:"grams"`
	ImageID              int64            `json:"image_id"`
	InventoryQuantity    int64            `json:"inventory_quantity"`
	Weight               *decimal.Decimal `json:"weight"`
	WeightUnit           string           `json:"weight_unit"`
	OldInventoryQuantity int64            `json:"old_inventory_quantity"`
	RequiresShipping     bool             `json:"requires_shipping"`
}

type ProductsResource

type ProductsResource struct {
	Products []Product `json:"products"`
}

type Property

type Property struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Province

type Province struct {
	ID             int64   `json:"id"`
	Name           string  `json:"name"`
	Code           string  `json:"code"`
	CountryID      int64   `json:"country_id"`
	Tax            float64 `json:"tax"`
	TaxName        string  `json:"tax_name"`
	TaxType        string  `json:"tax_type"`
	TaxPercentage  float64 `json:"tax_percentage"`
	ShippingZoneID int64   `json:"shipping_zone_id"`
}

type RateLimitError

type RateLimitError struct {
	ResponseError
	RetryAfter int
}

type Receipt

type Receipt struct {
	Testcase      bool   `json:"testcase"`
	Authorization string `json:"authorization"`
}

type Redirect

type Redirect struct {
	ID     int64  `json:"id"`
	Path   string `json:"path"`
	Target string `json:"target"`
}

type RedirectResource

type RedirectResource struct {
	Redirect Redirect `json:"redirect"`
}

type RedirectService

type RedirectService interface {
	Get(interface{}) ([]Redirect, error)
	Count(interface{}) (int64, error)
	Paginate(interface{}) (int64, []Redirect, error)
	Find(int64, interface{}) (Redirect, error)
	Create(interface{}) (Redirect, error)
	Update(int64, interface{}) (Redirect, error)
	Delete(int64) error
}

type RedirectServiceRequest

type RedirectServiceRequest struct {
	// contains filtered or unexported fields
}

func (*RedirectServiceRequest) Count

func (r *RedirectServiceRequest) Count(params interface{}) (int64, error)

func (*RedirectServiceRequest) Create

func (r *RedirectServiceRequest) Create(params interface{}) (Redirect, error)

func (*RedirectServiceRequest) Delete

func (r *RedirectServiceRequest) Delete(redirectID int64) error

func (*RedirectServiceRequest) Find

func (r *RedirectServiceRequest) Find(redirectID int64, params interface{}) (Redirect, error)

func (*RedirectServiceRequest) Get

func (r *RedirectServiceRequest) Get(params interface{}) ([]Redirect, error)

func (*RedirectServiceRequest) Paginate

func (r *RedirectServiceRequest) Paginate(params interface{}) (int64, []Redirect, error)

func (*RedirectServiceRequest) Update

func (r *RedirectServiceRequest) Update(redirectID int64, params interface{}) (Redirect, error)

type RedirectsResource

type RedirectsResource struct {
	Redirects []Redirect `json:"redirects"`
}

type Refund

type Refund struct {
	ID               int64             `json:"id"`
	OrderID          int64             `json:"order_id"`
	CreatedAt        *time.Time        `json:"created_at"`
	Note             string            `json:"note"`
	Restock          bool              `json:"restock"`
	UserID           int64             `json:"user_id"`
	ProcessedAt      *time.Time        `json:"processed_at"`
	RefundLineItems  []RefundLineItem  `json:"refund_line_items"`
	Transactions     []Transaction     `json:"transactions"`
	OrderAdjustments []OrderAdjustment `json:"order_adjustments"`
}

type RefundLineItem

type RefundLineItem struct {
	ID         int64            `json:"id"`
	Quantity   int64            `json:"quantity"`
	LineItemID int64            `json:"line_item_id"`
	Subtotal   *decimal.Decimal `json:"subtotal"`
	TotalTax   *decimal.Decimal `json:"total_tax"`
	LineItem   LineItem         `json:"line_item"`
}

type ResponseError

type ResponseError struct {
	StatusCode int
	Message    string
	Errors     []string
}

func (ResponseError) Error

func (e ResponseError) Error() string

type ShippingLine

type ShippingLine struct {
	ID                            int64           `json:"id"`
	Title                         string          `json:"title"`
	Price                         decimal.Decimal `json:"price"`
	Code                          string          `json:"code"`
	Source                        string          `json:"source"`
	Phone                         string          `json:"phone"`
	RequestedFulfillmentServiceID string          `json:"requested_fulfillment_service_id"`
	DeliveryCategory              string          `json:"delivery_category"`
	CarrierIdentifier             string          `json:"carrier_identifier"`
	TaxLines                      []TaxLine       `json:"tax_lines"`
	Custom                        bool            `json:"custom"`
}

type TagsResource

type TagsResource struct {
	Tags []string `json:"tags,omitempty"`
}

type TaxLine

type TaxLine struct {
	Title string          `json:"title"`
	Price decimal.Decimal `json:"price"`
	Rate  decimal.Decimal `json:"rate"`
}

type Transaction

type Transaction struct {
	ID            int64      `json:"id"`
	OrderID       int64      `json:"order_id"`
	Amount        string     `json:"amount"`
	Kind          string     `json:"kind"`
	Gateway       string     `json:"gateway"`
	Status        string     `json:"status"`
	Message       string     `json:"message"`
	CreatedAt     *time.Time `json:"created_at"`
	Test          bool       `json:"test"`
	Authorization string     `json:"authorization"`
	Currency      string     `json:"currency"`
	LocationID    int64      `json:"location_id"`
	UserID        int64      `json:"user_id"`
	ParentID      int64      `json:"parent_id"`
	DeviceID      int64      `json:"device_id"`
	Receipt       Receipt    `json:"receipt"`
	ErrorCode     string     `json:"error_code"`
	SourceName    string     `json:"source_name"`
}

type Webhook

type Webhook struct {
	ID                  int64      `json:"id,omitempty"`
	Address             string     `json:"address,omitempty"`
	Topic               string     `json:"topic,omitempty"`
	CreatedAt           *time.Time `json:"created_at,omitempty"`
	UpdatedAt           *time.Time `json:"updated_at,omitempty"`
	Format              string     `json:"format,omitempty"`
	Fields              []string   `json:"fields,omitempty"`
	MetafieldNamespaces []string   `json:"metafield_namespaces"`
}

type WebhookResource

type WebhookResource struct {
	Webhook Webhook `json:"webhook"`
}

type WebhookService

type WebhookService interface {
	Get(interface{}) ([]Webhook, error)
	Count(interface{}) (int64, error)
	Paginate(interface{}) (int64, []Webhook, error)
	Find(int64, interface{}) (Webhook, error)
	Create(interface{}) (Webhook, error)
	Update(int64, interface{}) (Webhook, error)
	Delete(int64) error
}

type WebhookServiceRequest

type WebhookServiceRequest struct {
	// contains filtered or unexported fields
}

func (*WebhookServiceRequest) Count

func (r *WebhookServiceRequest) Count(params interface{}) (int64, error)

func (*WebhookServiceRequest) Create

func (r *WebhookServiceRequest) Create(params interface{}) (Webhook, error)

func (*WebhookServiceRequest) Delete

func (r *WebhookServiceRequest) Delete(webhookID int64) error

func (*WebhookServiceRequest) Find

func (r *WebhookServiceRequest) Find(webhookID int64, params interface{}) (Webhook, error)

func (*WebhookServiceRequest) Get

func (r *WebhookServiceRequest) Get(params interface{}) ([]Webhook, error)

func (*WebhookServiceRequest) Paginate

func (r *WebhookServiceRequest) Paginate(params interface{}) (int64, []Webhook, error)

func (*WebhookServiceRequest) Update

func (r *WebhookServiceRequest) Update(webhookID int64, params interface{}) (Webhook, error)

type WebhooksResource

type WebhooksResource struct {
	Webhooks []Webhook `json:"webhooks"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL