Documentation ¶
Overview ¶
Package goshopify provides methods for making requests to Shopify's admin API.
Index ¶
- Constants
- func CheckResponseError(r *http.Response) error
- func FulfillmentOrderPathPrefix(resource string, resourceID int64) string
- func FulfillmentPathPrefix(resource string, resourceID int64) string
- func MetafieldPathPrefix(resource string, resourceID int64) string
- func ShopBaseUrl(name string) string
- func ShopFullName(name string) string
- func ShopShortName(name string) string
- type AbandonedCheckout
- type AbandonedCheckoutService
- type AbandonedCheckoutServiceOp
- type AbandonedCheckoutsResource
- type AccessScope
- type AccessScopesResource
- type AccessScopesService
- type AccessScopesServiceOp
- type Address
- type AmountSet
- type AmountSetEntry
- type App
- func (app App) AuthorizeUrl(shopName string, state string) string
- func (app App) GetAccessToken(ctx context.Context, shopName string, code string) (string, error)
- func (app App) NewClient(shopName, token string, opts ...Option) *Client
- func (app App) VerifyAuthorizationURL(u *url.URL) (bool, error)
- func (app App) VerifyMessage(message, messageMAC string) bool
- func (app App) VerifySignature(u *url.URL) bool
- func (app App) VerifyWebhookRequest(httpRequest *http.Request) bool
- func (app App) VerifyWebhookRequestVerbose(httpRequest *http.Request) (bool, error)
- type ApplicationCharge
- type ApplicationChargeResource
- type ApplicationChargeService
- type ApplicationChargeServiceOp
- func (a ApplicationChargeServiceOp) Activate(ctx context.Context, charge ApplicationCharge) (*ApplicationCharge, error)
- func (a ApplicationChargeServiceOp) Create(ctx context.Context, charge ApplicationCharge) (*ApplicationCharge, error)
- func (a ApplicationChargeServiceOp) Get(ctx context.Context, chargeID int64, options interface{}) (*ApplicationCharge, error)
- func (a ApplicationChargeServiceOp) List(ctx context.Context, options interface{}) ([]ApplicationCharge, error)
- type ApplicationChargesResource
- type AppliedDiscount
- type Asset
- type AssetResource
- type AssetService
- type AssetServiceOp
- func (s *AssetServiceOp) Delete(ctx context.Context, themeID int64, key string) error
- func (s *AssetServiceOp) Get(ctx context.Context, themeID int64, key string) (*Asset, error)
- func (s *AssetServiceOp) List(ctx context.Context, themeID int64, options interface{}) ([]Asset, error)
- func (s *AssetServiceOp) Update(ctx context.Context, themeID int64, asset Asset) (*Asset, error)
- type AssetsResource
- type AssignedFulfillmentOrder
- type AssignedFulfillmentOrderDestination
- type AssignedFulfillmentOrderLineItem
- type AssignedFulfillmentOrderOptions
- type AssignedFulfillmentOrderService
- type AssignedFulfillmentOrderServiceOp
- type AssignedFulfillmentOrdersResource
- type Blog
- type BlogResource
- type BlogService
- type BlogServiceOp
- func (s *BlogServiceOp) Count(ctx context.Context, options interface{}) (int, error)
- func (s *BlogServiceOp) Create(ctx context.Context, blog Blog) (*Blog, error)
- func (s *BlogServiceOp) Delete(ctx context.Context, blogId int64) error
- func (s *BlogServiceOp) Get(ctx context.Context, blogId int64, options interface{}) (*Blog, error)
- func (s *BlogServiceOp) List(ctx context.Context, options interface{}) ([]Blog, error)
- func (s *BlogServiceOp) Update(ctx context.Context, blog Blog) (*Blog, error)
- type BlogsResource
- type CarrierService
- type CarrierServiceOp
- func (s *CarrierServiceOp) Create(ctx context.Context, carrier CarrierService) (*CarrierService, error)
- func (s *CarrierServiceOp) Delete(ctx context.Context, id int64) error
- func (s *CarrierServiceOp) Get(ctx context.Context, id int64) (*CarrierService, error)
- func (s *CarrierServiceOp) List(ctx context.Context) ([]CarrierService, error)
- func (s *CarrierServiceOp) Update(ctx context.Context, carrier CarrierService) (*CarrierService, error)
- type CarrierServiceService
- type CarrierShippingRateProvider
- type Client
- func (c *Client) Count(ctx context.Context, path string, options interface{}) (int, error)
- func (c *Client) CreateAndDo(ctx context.Context, method, relPath string, ...) error
- func (c *Client) Delete(ctx context.Context, path string) error
- func (c *Client) DeleteWithOptions(ctx context.Context, path string, options interface{}) error
- func (c *Client) Do(req *http.Request, v interface{}) error
- func (c *Client) Get(ctx context.Context, path string, resource, options interface{}) error
- func (c *Client) ListWithPagination(ctx context.Context, path string, resource, options interface{}) (*Pagination, error)
- func (c *Client) NewRequest(ctx context.Context, method, relPath string, body, options interface{}) (*http.Request, error)
- func (c *Client) Post(ctx context.Context, path string, data, resource interface{}) error
- func (c *Client) Put(ctx context.Context, path string, data, resource interface{}) error
- type ClientDetails
- type Collect
- type CollectResource
- type CollectService
- type CollectServiceOp
- func (s *CollectServiceOp) Count(ctx context.Context, options interface{}) (int, error)
- func (s *CollectServiceOp) Create(ctx context.Context, collect Collect) (*Collect, error)
- func (s *CollectServiceOp) Delete(ctx context.Context, collectID int64) error
- func (s *CollectServiceOp) Get(ctx context.Context, collectID int64, options interface{}) (*Collect, error)
- func (s *CollectServiceOp) List(ctx context.Context, options interface{}) ([]Collect, error)
- type Collection
- type CollectionResource
- type CollectionService
- type CollectionServiceOp
- func (s *CollectionServiceOp) Get(ctx context.Context, collectionID int64, options interface{}) (*Collection, error)
- func (s *CollectionServiceOp) ListProducts(ctx context.Context, collectionID int64, options interface{}) ([]Product, error)
- func (s *CollectionServiceOp) ListProductsWithPagination(ctx context.Context, collectionID int64, options interface{}) ([]Product, *Pagination, error)
- type CollectsResource
- type CountOptions
- type CustomCollection
- type CustomCollectionResource
- type CustomCollectionService
- type CustomCollectionServiceOp
- func (s *CustomCollectionServiceOp) Count(ctx context.Context, options interface{}) (int, error)
- func (s *CustomCollectionServiceOp) CountMetafields(ctx context.Context, customCollectionID int64, options interface{}) (int, error)
- func (s *CustomCollectionServiceOp) Create(ctx context.Context, collection CustomCollection) (*CustomCollection, error)
- func (s *CustomCollectionServiceOp) CreateMetafield(ctx context.Context, customCollectionID int64, metafield Metafield) (*Metafield, error)
- func (s *CustomCollectionServiceOp) Delete(ctx context.Context, collectionID int64) error
- func (s *CustomCollectionServiceOp) DeleteMetafield(ctx context.Context, customCollectionID int64, metafieldID int64) error
- func (s *CustomCollectionServiceOp) Get(ctx context.Context, collectionID int64, options interface{}) (*CustomCollection, error)
- func (s *CustomCollectionServiceOp) GetMetafield(ctx context.Context, customCollectionID int64, metafieldID int64, ...) (*Metafield, error)
- func (s *CustomCollectionServiceOp) List(ctx context.Context, options interface{}) ([]CustomCollection, error)
- func (s *CustomCollectionServiceOp) ListMetafields(ctx context.Context, customCollectionID int64, options interface{}) ([]Metafield, error)
- func (s *CustomCollectionServiceOp) Update(ctx context.Context, collection CustomCollection) (*CustomCollection, error)
- func (s *CustomCollectionServiceOp) UpdateMetafield(ctx context.Context, customCollectionID int64, metafield Metafield) (*Metafield, error)
- type CustomCollectionsResource
- type Customer
- type CustomerAddress
- type CustomerAddressResource
- type CustomerAddressService
- type CustomerAddressServiceOp
- func (s *CustomerAddressServiceOp) Create(ctx context.Context, customerID int64, address CustomerAddress) (*CustomerAddress, error)
- func (s *CustomerAddressServiceOp) Delete(ctx context.Context, customerID, addressID int64) error
- func (s *CustomerAddressServiceOp) Get(ctx context.Context, customerID, addressID int64, options interface{}) (*CustomerAddress, error)
- func (s *CustomerAddressServiceOp) List(ctx context.Context, customerID int64, options interface{}) ([]CustomerAddress, error)
- func (s *CustomerAddressServiceOp) Update(ctx context.Context, customerID int64, address CustomerAddress) (*CustomerAddress, error)
- type CustomerAddressesResource
- type CustomerID
- type CustomerResource
- type CustomerSearchOptions
- type CustomerService
- type CustomerServiceOp
- func (s *CustomerServiceOp) Count(ctx context.Context, options interface{}) (int, error)
- func (s *CustomerServiceOp) CountMetafields(ctx context.Context, customerID int64, options interface{}) (int, error)
- func (s *CustomerServiceOp) Create(ctx context.Context, customer Customer) (*Customer, error)
- func (s *CustomerServiceOp) CreateMetafield(ctx context.Context, customerID int64, metafield Metafield) (*Metafield, error)
- func (s *CustomerServiceOp) Delete(ctx context.Context, customerID int64) error
- func (s *CustomerServiceOp) DeleteMetafield(ctx context.Context, customerID int64, metafieldID int64) error
- func (s *CustomerServiceOp) Get(ctx context.Context, customerID int64, options interface{}) (*Customer, error)
- func (s *CustomerServiceOp) GetMetafield(ctx context.Context, customerID int64, metafieldID int64, options interface{}) (*Metafield, error)
- func (s *CustomerServiceOp) List(ctx context.Context, options interface{}) ([]Customer, error)
- func (s *CustomerServiceOp) ListMetafields(ctx context.Context, customerID int64, options interface{}) ([]Metafield, error)
- func (s *CustomerServiceOp) ListOrders(ctx context.Context, customerID int64, options interface{}) ([]Order, error)
- func (s *CustomerServiceOp) ListTags(ctx context.Context, options interface{}) ([]string, error)
- func (s *CustomerServiceOp) ListWithPagination(ctx context.Context, options interface{}) ([]Customer, *Pagination, error)
- func (s *CustomerServiceOp) Search(ctx context.Context, options interface{}) ([]Customer, error)
- func (s *CustomerServiceOp) Update(ctx context.Context, customer Customer) (*Customer, error)
- func (s *CustomerServiceOp) UpdateMetafield(ctx context.Context, customerID int64, metafield Metafield) (*Metafield, error)
- type CustomerTagsResource
- type CustomersResource
- type DiscountAllocations
- type DiscountCode
- type DiscountCodeResource
- type DiscountCodeService
- type DiscountCodeServiceOp
- func (s *DiscountCodeServiceOp) Create(ctx context.Context, priceRuleID int64, dc PriceRuleDiscountCode) (*PriceRuleDiscountCode, error)
- func (s *DiscountCodeServiceOp) Delete(ctx context.Context, priceRuleID int64, discountCodeID int64) error
- func (s *DiscountCodeServiceOp) Get(ctx context.Context, priceRuleID int64, discountCodeID int64) (*PriceRuleDiscountCode, error)
- func (s *DiscountCodeServiceOp) List(ctx context.Context, priceRuleID int64) ([]PriceRuleDiscountCode, error)
- func (s *DiscountCodeServiceOp) Update(ctx context.Context, priceRuleID int64, dc PriceRuleDiscountCode) (*PriceRuleDiscountCode, error)
- type DiscountCodesResource
- type DraftOrder
- type DraftOrderCountOptions
- type DraftOrderInvoice
- type DraftOrderInvoiceResource
- type DraftOrderListOptions
- type DraftOrderResource
- type DraftOrderService
- type DraftOrderServiceOp
- func (s *DraftOrderServiceOp) Complete(ctx context.Context, draftOrderID int64, paymentPending bool) (*DraftOrder, error)
- func (s *DraftOrderServiceOp) Count(ctx context.Context, options interface{}) (int, error)
- func (s *DraftOrderServiceOp) CountMetafields(ctx context.Context, draftOrderID int64, options interface{}) (int, error)
- func (s *DraftOrderServiceOp) Create(ctx context.Context, draftOrder DraftOrder) (*DraftOrder, error)
- func (s *DraftOrderServiceOp) CreateMetafield(ctx context.Context, draftOrderID int64, metafield Metafield) (*Metafield, error)
- func (s *DraftOrderServiceOp) Delete(ctx context.Context, draftOrderID int64) error
- func (s *DraftOrderServiceOp) DeleteMetafield(ctx context.Context, draftOrderID int64, metafieldID int64) error
- func (s *DraftOrderServiceOp) Get(ctx context.Context, draftOrderID int64, options interface{}) (*DraftOrder, error)
- func (s *DraftOrderServiceOp) GetMetafield(ctx context.Context, draftOrderID int64, metafieldID int64, ...) (*Metafield, error)
- func (s *DraftOrderServiceOp) Invoice(ctx context.Context, draftOrderID int64, draftOrderInvoice DraftOrderInvoice) (*DraftOrderInvoice, error)
- func (s *DraftOrderServiceOp) List(ctx context.Context, options interface{}) ([]DraftOrder, error)
- func (s *DraftOrderServiceOp) ListMetafields(ctx context.Context, draftOrderID int64, options interface{}) ([]Metafield, error)
- func (s *DraftOrderServiceOp) Update(ctx context.Context, draftOrder DraftOrder) (*DraftOrder, error)
- func (s *DraftOrderServiceOp) UpdateMetafield(ctx context.Context, draftOrderID int64, metafield Metafield) (*Metafield, error)
- type DraftOrdersResource
- type Fulfillment
- type FulfillmentEvent
- type FulfillmentEventCreateRequest
- type FulfillmentEventResource
- type FulfillmentEventService
- type FulfillmentEventServiceOp
- func (s *FulfillmentEventServiceOp) Create(ctx context.Context, orderID int64, fulfillmentID int64, ...) (*FulfillmentEvent, error)
- func (s *FulfillmentEventServiceOp) Delete(ctx context.Context, orderID int64, fulfillmentID int64, eventID int64) error
- func (s *FulfillmentEventServiceOp) Get(ctx context.Context, orderID int64, fulfillmentID int64, eventID int64) (*FulfillmentEvent, error)
- func (s *FulfillmentEventServiceOp) List(ctx context.Context, orderID int64, fulfillmentID int64) ([]FulfillmentEvent, error)
- type FulfillmentEventsResource
- type FulfillmentOrder
- type FulfillmentOrderAssignedLocation
- type FulfillmentOrderDeliveryMethod
- type FulfillmentOrderDestination
- type FulfillmentOrderHold
- type FulfillmentOrderHoldReason
- type FulfillmentOrderInternationalDuties
- type FulfillmentOrderLineItem
- type FulfillmentOrderLineItemQuantity
- type FulfillmentOrderMerchantRequest
- type FulfillmentOrderMoveRequest
- type FulfillmentOrderMoveResource
- type FulfillmentOrderResource
- type FulfillmentOrderService
- type FulfillmentOrderServiceOp
- func (s *FulfillmentOrderServiceOp) Cancel(ctx context.Context, fulfillmentID int64) (*FulfillmentOrder, error)
- func (s *FulfillmentOrderServiceOp) Close(ctx context.Context, fulfillmentID int64, message string) (*FulfillmentOrder, error)
- func (s *FulfillmentOrderServiceOp) Get(ctx context.Context, fulfillmentID int64, options interface{}) (*FulfillmentOrder, error)
- func (s *FulfillmentOrderServiceOp) Hold(ctx context.Context, fulfillmentID int64, notify bool, ...) (*FulfillmentOrder, error)
- func (s *FulfillmentOrderServiceOp) List(ctx context.Context, orderId int64, options interface{}) ([]FulfillmentOrder, error)
- func (s *FulfillmentOrderServiceOp) Move(ctx context.Context, fulfillmentID int64, ...) (*FulfillmentOrderMoveResource, error)
- func (s *FulfillmentOrderServiceOp) Open(ctx context.Context, fulfillmentID int64) (*FulfillmentOrder, error)
- func (s *FulfillmentOrderServiceOp) ReleaseHold(ctx context.Context, fulfillmentID int64) (*FulfillmentOrder, error)
- func (s *FulfillmentOrderServiceOp) Reschedule(ctx context.Context, fulfillmentID int64) (*FulfillmentOrder, error)
- func (s *FulfillmentOrderServiceOp) SetDeadline(ctx context.Context, fulfillmentIDs []int64, deadline time.Time) error
- type FulfillmentOrdersResource
- type FulfillmentRequest
- type FulfillmentRequestLineItem
- type FulfillmentRequestOrderLineItem
- type FulfillmentRequestResource
- type FulfillmentRequestService
- type FulfillmentRequestServiceOp
- func (s *FulfillmentRequestServiceOp) Accept(ctx context.Context, fulfillmentOrderID int64, request FulfillmentRequest) (*FulfillmentOrder, error)
- func (s *FulfillmentRequestServiceOp) Reject(ctx context.Context, fulfillmentOrderID int64, request FulfillmentRequest) (*FulfillmentOrder, error)
- func (s *FulfillmentRequestServiceOp) Send(ctx context.Context, fulfillmentOrderID int64, request FulfillmentRequest) (*FulfillmentOrder, error)
- type FulfillmentResource
- type FulfillmentService
- type FulfillmentServiceData
- type FulfillmentServiceOp
- func (s *FulfillmentServiceOp) Cancel(ctx context.Context, fulfillmentID int64) (*Fulfillment, error)
- func (s *FulfillmentServiceOp) Complete(ctx context.Context, fulfillmentID int64) (*Fulfillment, error)
- func (s *FulfillmentServiceOp) Count(ctx context.Context, options interface{}) (int, error)
- func (s *FulfillmentServiceOp) Create(ctx context.Context, fulfillment Fulfillment) (*Fulfillment, error)
- func (s *FulfillmentServiceOp) Get(ctx context.Context, fulfillmentID int64, options interface{}) (*Fulfillment, error)
- func (s *FulfillmentServiceOp) List(ctx context.Context, options interface{}) ([]Fulfillment, error)
- func (s *FulfillmentServiceOp) Transition(ctx context.Context, fulfillmentID int64) (*Fulfillment, error)
- func (s *FulfillmentServiceOp) Update(ctx context.Context, fulfillment Fulfillment) (*Fulfillment, error)
- type FulfillmentServiceOptions
- type FulfillmentServiceResource
- type FulfillmentServiceService
- type FulfillmentServiceServiceOp
- func (s *FulfillmentServiceServiceOp) Create(ctx context.Context, fulfillmentService FulfillmentServiceData) (*FulfillmentServiceData, error)
- func (s *FulfillmentServiceServiceOp) Delete(ctx context.Context, fulfillmentServiceId int64) error
- func (s *FulfillmentServiceServiceOp) Get(ctx context.Context, fulfillmentServiceId int64, options interface{}) (*FulfillmentServiceData, error)
- func (s *FulfillmentServiceServiceOp) List(ctx context.Context, options interface{}) ([]FulfillmentServiceData, error)
- func (s *FulfillmentServiceServiceOp) Update(ctx context.Context, fulfillmentService FulfillmentServiceData) (*FulfillmentServiceData, error)
- type FulfillmentServicesResource
- type FulfillmentTrackingInfo
- type FulfillmentsResource
- type FulfillmentsService
- type GiftCard
- type GiftCardResource
- type GiftCardService
- type GiftCardServiceOp
- func (s *GiftCardServiceOp) Count(ctx context.Context, options interface{}) (int, error)
- func (s *GiftCardServiceOp) Create(ctx context.Context, pr GiftCard) (*GiftCard, error)
- func (s *GiftCardServiceOp) Disable(ctx context.Context, giftCardID int64) (*GiftCard, error)
- func (s *GiftCardServiceOp) Get(ctx context.Context, giftCardID int64) (*GiftCard, error)
- func (s *GiftCardServiceOp) List(ctx context.Context) ([]GiftCard, error)
- func (s *GiftCardServiceOp) Update(ctx context.Context, pr GiftCard) (*GiftCard, error)
- type GiftCardsResource
- type GraphQLCost
- type GraphQLService
- type GraphQLServiceOp
- type GraphQLThrottleStatus
- type Image
- type ImageResource
- type ImageService
- type ImageServiceOp
- func (s *ImageServiceOp) Count(ctx context.Context, productID int64, options interface{}) (int, error)
- func (s *ImageServiceOp) Create(ctx context.Context, productID int64, image Image) (*Image, error)
- func (s *ImageServiceOp) Delete(ctx context.Context, productID int64, imageID int64) error
- func (s *ImageServiceOp) Get(ctx context.Context, productID int64, imageID int64, options interface{}) (*Image, error)
- func (s *ImageServiceOp) List(ctx context.Context, productID int64, options interface{}) ([]Image, error)
- func (s *ImageServiceOp) Update(ctx context.Context, productID int64, image Image) (*Image, error)
- type ImagesResource
- type InventoryItem
- type InventoryItemResource
- type InventoryItemService
- type InventoryItemServiceOp
- func (s *InventoryItemServiceOp) Get(ctx context.Context, id int64, options interface{}) (*InventoryItem, error)
- func (s *InventoryItemServiceOp) List(ctx context.Context, options interface{}) ([]InventoryItem, error)
- func (s *InventoryItemServiceOp) Update(ctx context.Context, item InventoryItem) (*InventoryItem, error)
- type InventoryItemsResource
- type InventoryLevel
- type InventoryLevelAdjustOptions
- type InventoryLevelListOptions
- type InventoryLevelResource
- type InventoryLevelService
- type InventoryLevelServiceOp
- func (s *InventoryLevelServiceOp) Adjust(ctx context.Context, options interface{}) (*InventoryLevel, error)
- func (s *InventoryLevelServiceOp) Connect(ctx context.Context, level InventoryLevel) (*InventoryLevel, error)
- func (s *InventoryLevelServiceOp) Delete(ctx context.Context, itemId, locationId int64) error
- func (s *InventoryLevelServiceOp) List(ctx context.Context, options interface{}) ([]InventoryLevel, error)
- func (s *InventoryLevelServiceOp) Set(ctx context.Context, level InventoryLevel) (*InventoryLevel, error)
- type InventoryLevelsResource
- type LeveledLogger
- type LeveledLoggerInterface
- type LineItem
- type LineItemByFulfillmentOrder
- type LineItemByFulfillmentOrderItemQuantity
- type LineItemProperty
- type ListCarrierResource
- type ListOptions
- type Location
- type LocationResource
- type LocationService
- type LocationServiceOp
- type LocationsResource
- type Metafield
- type MetafieldResource
- type MetafieldService
- type MetafieldServiceOp
- func (s *MetafieldServiceOp) Count(ctx context.Context, options interface{}) (int, error)
- func (s *MetafieldServiceOp) Create(ctx context.Context, metafield Metafield) (*Metafield, error)
- func (s *MetafieldServiceOp) Delete(ctx context.Context, metafieldID int64) error
- func (s *MetafieldServiceOp) Get(ctx context.Context, metafieldID int64, options interface{}) (*Metafield, error)
- func (s *MetafieldServiceOp) List(ctx context.Context, options interface{}) ([]Metafield, error)
- func (s *MetafieldServiceOp) Update(ctx context.Context, metafield Metafield) (*Metafield, error)
- type MetafieldsResource
- type MetafieldsService
- type NoteAttribute
- type OnlyDate
- type Option
- type Order
- type OrderAdjustment
- type OrderAdjustmentType
- type OrderCancelOptions
- type OrderCountOptions
- type OrderListOptions
- type OrderResource
- type OrderRisk
- type OrderRiskListOptions
- type OrderRiskResource
- type OrderRiskService
- type OrderRiskServiceOp
- func (s *OrderRiskServiceOp) Create(ctx context.Context, orderID int64, orderRisk OrderRisk) (*OrderRisk, error)
- func (s *OrderRiskServiceOp) Delete(ctx context.Context, orderID int64, riskID int64) error
- func (s *OrderRiskServiceOp) Get(ctx context.Context, orderID int64, riskID int64, options interface{}) (*OrderRisk, error)
- func (s *OrderRiskServiceOp) List(ctx context.Context, orderId int64, options interface{}) ([]OrderRisk, error)
- func (s *OrderRiskServiceOp) ListWithPagination(ctx context.Context, orderId int64, options interface{}) ([]OrderRisk, *Pagination, error)
- func (s *OrderRiskServiceOp) Update(ctx context.Context, orderID int64, riskID int64, orderRisk OrderRisk) (*OrderRisk, error)
- type OrderService
- type OrderServiceOp
- func (s *OrderServiceOp) Cancel(ctx context.Context, orderID int64, options interface{}) (*Order, error)
- func (s *OrderServiceOp) CancelFulfillment(ctx context.Context, orderID int64, fulfillmentID int64) (*Fulfillment, error)
- func (s *OrderServiceOp) Close(ctx context.Context, orderID int64) (*Order, error)
- func (s *OrderServiceOp) CompleteFulfillment(ctx context.Context, orderID int64, fulfillmentID int64) (*Fulfillment, error)
- func (s *OrderServiceOp) Count(ctx context.Context, options interface{}) (int, error)
- func (s *OrderServiceOp) CountFulfillments(ctx context.Context, orderID int64, options interface{}) (int, error)
- func (s *OrderServiceOp) CountMetafields(ctx context.Context, orderID int64, options interface{}) (int, error)
- func (s *OrderServiceOp) Create(ctx context.Context, order Order) (*Order, error)
- func (s *OrderServiceOp) CreateFulfillment(ctx context.Context, orderID int64, fulfillment Fulfillment) (*Fulfillment, error)
- func (s *OrderServiceOp) CreateMetafield(ctx context.Context, orderID int64, metafield Metafield) (*Metafield, error)
- func (s *OrderServiceOp) Delete(ctx context.Context, orderID int64) error
- func (s *OrderServiceOp) DeleteMetafield(ctx context.Context, orderID int64, metafieldID int64) error
- func (s *OrderServiceOp) Get(ctx context.Context, orderID int64, options interface{}) (*Order, error)
- func (s *OrderServiceOp) GetFulfillment(ctx context.Context, orderID int64, fulfillmentID int64, options interface{}) (*Fulfillment, error)
- func (s *OrderServiceOp) GetMetafield(ctx context.Context, orderID int64, metafieldID int64, options interface{}) (*Metafield, error)
- func (s *OrderServiceOp) List(ctx context.Context, options interface{}) ([]Order, error)
- func (s *OrderServiceOp) ListFulfillments(ctx context.Context, orderID int64, options interface{}) ([]Fulfillment, error)
- func (s *OrderServiceOp) ListMetafields(ctx context.Context, orderID int64, options interface{}) ([]Metafield, error)
- func (s *OrderServiceOp) ListWithPagination(ctx context.Context, options interface{}) ([]Order, *Pagination, error)
- func (s *OrderServiceOp) Open(ctx context.Context, orderID int64) (*Order, error)
- func (s *OrderServiceOp) TransitionFulfillment(ctx context.Context, orderID int64, fulfillmentID int64) (*Fulfillment, error)
- func (s *OrderServiceOp) Update(ctx context.Context, order Order) (*Order, error)
- func (s *OrderServiceOp) UpdateFulfillment(ctx context.Context, orderID int64, fulfillment Fulfillment) (*Fulfillment, error)
- func (s *OrderServiceOp) UpdateMetafield(ctx context.Context, orderID int64, metafield Metafield) (*Metafield, error)
- type OrdersResource
- type OrdersRisksResource
- type Page
- type PageResource
- type PageService
- type PageServiceOp
- func (s *PageServiceOp) Count(ctx context.Context, options interface{}) (int, error)
- func (s *PageServiceOp) CountMetafields(ctx context.Context, pageID int64, options interface{}) (int, error)
- func (s *PageServiceOp) Create(ctx context.Context, page Page) (*Page, error)
- func (s *PageServiceOp) CreateMetafield(ctx context.Context, pageID int64, metafield Metafield) (*Metafield, error)
- func (s *PageServiceOp) Delete(ctx context.Context, pageID int64) error
- func (s *PageServiceOp) DeleteMetafield(ctx context.Context, pageID int64, metafieldID int64) error
- func (s *PageServiceOp) Get(ctx context.Context, pageID int64, options interface{}) (*Page, error)
- func (s *PageServiceOp) GetMetafield(ctx context.Context, pageID int64, metafieldID int64, options interface{}) (*Metafield, error)
- func (s *PageServiceOp) List(ctx context.Context, options interface{}) ([]Page, error)
- func (s *PageServiceOp) ListMetafields(ctx context.Context, pageID int64, options interface{}) ([]Metafield, error)
- func (s *PageServiceOp) Update(ctx context.Context, page Page) (*Page, error)
- func (s *PageServiceOp) UpdateMetafield(ctx context.Context, pageID int64, metafield Metafield) (*Metafield, error)
- type PagesResource
- type Pagination
- type PaymentDetails
- type PaymentsTransactionResource
- type PaymentsTransactions
- type PaymentsTransactionsListOptions
- type PaymentsTransactionsResource
- type PaymentsTransactionsService
- type PaymentsTransactionsServiceOp
- func (s *PaymentsTransactionsServiceOp) Get(ctx context.Context, payoutID int64, options interface{}) (*PaymentsTransactions, error)
- func (s *PaymentsTransactionsServiceOp) List(ctx context.Context, options interface{}) ([]PaymentsTransactions, error)
- func (s *PaymentsTransactionsServiceOp) ListWithPagination(ctx context.Context, options interface{}) ([]PaymentsTransactions, *Pagination, error)
- type PaymentsTransactionsTypes
- type Payout
- type PayoutResource
- type PayoutStatus
- type PayoutsListOptions
- type PayoutsResource
- type PayoutsService
- type PayoutsServiceOp
- func (s *PayoutsServiceOp) Get(ctx context.Context, id int64, options interface{}) (*Payout, error)
- func (s *PayoutsServiceOp) List(ctx context.Context, options interface{}) ([]Payout, error)
- func (s *PayoutsServiceOp) ListWithPagination(ctx context.Context, options interface{}) ([]Payout, *Pagination, error)
- type PriceBasedShippingRate
- type PriceRule
- func (pr *PriceRule) SetPrerequisiteQuantityRange(greaterThanOrEqualTo *int)
- func (pr *PriceRule) SetPrerequisiteShippingPriceRange(lessThanOrEqualTo *string) error
- func (pr *PriceRule) SetPrerequisiteSubtotalRange(greaterThanOrEqualTo *string) error
- func (pr *PriceRule) SetPrerequisiteToEntitlementQuantityRatio(prerequisiteQuantity *int, entitledQuantity *int)
- type PriceRuleDiscountCode
- type PriceRuleResource
- type PriceRuleService
- type PriceRuleServiceOp
- func (s *PriceRuleServiceOp) Create(ctx context.Context, pr PriceRule) (*PriceRule, error)
- func (s *PriceRuleServiceOp) Delete(ctx context.Context, priceRuleID int64) error
- func (s *PriceRuleServiceOp) Get(ctx context.Context, priceRuleID int64) (*PriceRule, error)
- func (s *PriceRuleServiceOp) List(ctx context.Context) ([]PriceRule, error)
- func (s *PriceRuleServiceOp) Update(ctx context.Context, pr PriceRule) (*PriceRule, error)
- type PriceRulesResource
- type Product
- type ProductListOptions
- type ProductListing
- type ProductListingIDsResource
- type ProductListingPublishResource
- type ProductListingResource
- type ProductListingService
- type ProductListingServiceOp
- func (s *ProductListingServiceOp) Count(ctx context.Context, options interface{}) (int, error)
- func (s *ProductListingServiceOp) Delete(ctx context.Context, productID int64) error
- func (s *ProductListingServiceOp) Get(ctx context.Context, productID int64, options interface{}) (*ProductListing, error)
- func (s *ProductListingServiceOp) GetProductIDs(ctx context.Context, options interface{}) ([]int64, error)
- func (s *ProductListingServiceOp) List(ctx context.Context, options interface{}) ([]ProductListing, error)
- func (s *ProductListingServiceOp) ListWithPagination(ctx context.Context, options interface{}) ([]ProductListing, *Pagination, error)
- func (s *ProductListingServiceOp) Publish(ctx context.Context, productID int64) (*ProductListing, error)
- type ProductOption
- type ProductResource
- type ProductService
- type ProductServiceOp
- func (s *ProductServiceOp) Count(ctx context.Context, options interface{}) (int, error)
- func (s *ProductServiceOp) CountMetafields(ctx context.Context, productID int64, options interface{}) (int, error)
- func (s *ProductServiceOp) Create(ctx context.Context, product Product) (*Product, error)
- func (s *ProductServiceOp) CreateMetafield(ctx context.Context, productID int64, metafield Metafield) (*Metafield, error)
- func (s *ProductServiceOp) Delete(ctx context.Context, productID int64) error
- func (s *ProductServiceOp) DeleteMetafield(ctx context.Context, productID int64, metafieldID int64) error
- func (s *ProductServiceOp) Get(ctx context.Context, productID int64, options interface{}) (*Product, error)
- func (s *ProductServiceOp) GetMetafield(ctx context.Context, productID int64, metafieldID int64, options interface{}) (*Metafield, error)
- func (s *ProductServiceOp) List(ctx context.Context, options interface{}) ([]Product, error)
- func (s *ProductServiceOp) ListMetafields(ctx context.Context, productID int64, options interface{}) ([]Metafield, error)
- func (s *ProductServiceOp) ListWithPagination(ctx context.Context, options interface{}) ([]Product, *Pagination, error)
- func (s *ProductServiceOp) Update(ctx context.Context, product Product) (*Product, error)
- func (s *ProductServiceOp) UpdateMetafield(ctx context.Context, productID int64, metafield Metafield) (*Metafield, error)
- type ProductStatus
- type ProductsListingsResource
- type ProductsResource
- type RateLimitError
- type RateLimitInfo
- type Receipt
- type RecurringApplicationCharge
- type RecurringApplicationChargeResource
- type RecurringApplicationChargeService
- type RecurringApplicationChargeServiceOp
- func (r *RecurringApplicationChargeServiceOp) Activate(ctx context.Context, charge RecurringApplicationCharge) (*RecurringApplicationCharge, error)
- func (r *RecurringApplicationChargeServiceOp) Create(ctx context.Context, charge RecurringApplicationCharge) (*RecurringApplicationCharge, error)
- func (r *RecurringApplicationChargeServiceOp) Delete(ctx context.Context, chargeID int64) error
- func (r *RecurringApplicationChargeServiceOp) Get(ctx context.Context, chargeID int64, options interface{}) (*RecurringApplicationCharge, error)
- func (r *RecurringApplicationChargeServiceOp) List(ctx context.Context, options interface{}) ([]RecurringApplicationCharge, error)
- func (r *RecurringApplicationChargeServiceOp) Update(ctx context.Context, chargeID, newCappedAmount int64) (*RecurringApplicationCharge, error)
- type RecurringApplicationChargesResource
- type Redirect
- type RedirectResource
- type RedirectService
- type RedirectServiceOp
- func (s *RedirectServiceOp) Count(ctx context.Context, options interface{}) (int, error)
- func (s *RedirectServiceOp) Create(ctx context.Context, redirect Redirect) (*Redirect, error)
- func (s *RedirectServiceOp) Delete(ctx context.Context, redirectID int64) error
- func (s *RedirectServiceOp) Get(ctx context.Context, redirectID int64, options interface{}) (*Redirect, error)
- func (s *RedirectServiceOp) List(ctx context.Context, options interface{}) ([]Redirect, error)
- func (s *RedirectServiceOp) Update(ctx context.Context, redirect Redirect) (*Redirect, error)
- type RedirectsResource
- type Refund
- type RefundLineItem
- type ResponseDecodingError
- type ResponseError
- type Rule
- type ScriptTag
- type ScriptTagOption
- type ScriptTagResource
- type ScriptTagService
- type ScriptTagServiceOp
- func (s *ScriptTagServiceOp) Count(ctx context.Context, options interface{}) (int, error)
- func (s *ScriptTagServiceOp) Create(ctx context.Context, tag ScriptTag) (*ScriptTag, error)
- func (s *ScriptTagServiceOp) Delete(ctx context.Context, tagID int64) error
- func (s *ScriptTagServiceOp) Get(ctx context.Context, tagID int64, options interface{}) (*ScriptTag, error)
- func (s *ScriptTagServiceOp) List(ctx context.Context, options interface{}) ([]ScriptTag, error)
- func (s *ScriptTagServiceOp) Update(ctx context.Context, tag ScriptTag) (*ScriptTag, error)
- type ScriptTagsResource
- type ShippingCountry
- type ShippingLines
- type ShippingProvince
- type ShippingRate
- type ShippingRateAddress
- type ShippingRateQuery
- type ShippingRateRequest
- type ShippingRateResponse
- type ShippingZone
- type ShippingZoneService
- type ShippingZoneServiceOp
- type ShippingZonesResource
- type Shop
- type ShopResource
- type ShopService
- type ShopServiceOp
- func (s *ShopServiceOp) CountMetafields(ctx context.Context, _ int64, options interface{}) (int, error)
- func (s *ShopServiceOp) CreateMetafield(ctx context.Context, _ int64, metafield Metafield) (*Metafield, error)
- func (s *ShopServiceOp) DeleteMetafield(ctx context.Context, _ int64, metafieldID int64) error
- func (s *ShopServiceOp) Get(ctx context.Context, options interface{}) (*Shop, error)
- func (s *ShopServiceOp) GetMetafield(ctx context.Context, _ int64, metafieldID int64, options interface{}) (*Metafield, error)
- func (s *ShopServiceOp) ListMetafields(ctx context.Context, _ int64, options interface{}) ([]Metafield, error)
- func (s *ShopServiceOp) UpdateMetafield(ctx context.Context, _ int64, metafield Metafield) (*Metafield, error)
- type SingleCarrierResource
- type SmartCollection
- type SmartCollectionResource
- type SmartCollectionService
- type SmartCollectionServiceOp
- func (s *SmartCollectionServiceOp) Count(ctx context.Context, options interface{}) (int, error)
- func (s *SmartCollectionServiceOp) CountMetafields(ctx context.Context, smartCollectionID int64, options interface{}) (int, error)
- func (s *SmartCollectionServiceOp) Create(ctx context.Context, collection SmartCollection) (*SmartCollection, error)
- func (s *SmartCollectionServiceOp) CreateMetafield(ctx context.Context, smartCollectionID int64, metafield Metafield) (*Metafield, error)
- func (s *SmartCollectionServiceOp) Delete(ctx context.Context, collectionID int64) error
- func (s *SmartCollectionServiceOp) DeleteMetafield(ctx context.Context, smartCollectionID int64, metafieldID int64) error
- func (s *SmartCollectionServiceOp) Get(ctx context.Context, collectionID int64, options interface{}) (*SmartCollection, error)
- func (s *SmartCollectionServiceOp) GetMetafield(ctx context.Context, smartCollectionID int64, metafieldID int64, ...) (*Metafield, error)
- func (s *SmartCollectionServiceOp) List(ctx context.Context, options interface{}) ([]SmartCollection, error)
- func (s *SmartCollectionServiceOp) ListMetafields(ctx context.Context, smartCollectionID int64, options interface{}) ([]Metafield, error)
- func (s *SmartCollectionServiceOp) Update(ctx context.Context, collection SmartCollection) (*SmartCollection, error)
- func (s *SmartCollectionServiceOp) UpdateMetafield(ctx context.Context, smartCollectionID int64, metafield Metafield) (*Metafield, error)
- type SmartCollectionsResource
- type SmsMarketingConsent
- type StorefrontAccessToken
- type StorefrontAccessTokenResource
- type StorefrontAccessTokenService
- type StorefrontAccessTokenServiceOp
- func (s *StorefrontAccessTokenServiceOp) Create(ctx context.Context, storefrontAccessToken StorefrontAccessToken) (*StorefrontAccessToken, error)
- func (s *StorefrontAccessTokenServiceOp) Delete(ctx context.Context, ID int64) error
- func (s *StorefrontAccessTokenServiceOp) List(ctx context.Context, options interface{}) ([]StorefrontAccessToken, error)
- type StorefrontAccessTokensResource
- type TaxLine
- type Theme
- type ThemeListOptions
- type ThemeResource
- type ThemeService
- type ThemeServiceOp
- func (s *ThemeServiceOp) Create(ctx context.Context, theme Theme) (*Theme, error)
- func (s *ThemeServiceOp) Delete(ctx context.Context, themeID int64) error
- func (s *ThemeServiceOp) Get(ctx context.Context, themeID int64, options interface{}) (*Theme, error)
- func (s *ThemeServiceOp) List(ctx context.Context, options interface{}) ([]Theme, error)
- func (s *ThemeServiceOp) Update(ctx context.Context, theme Theme) (*Theme, error)
- type ThemesResource
- type Transaction
- type TransactionResource
- type TransactionService
- type TransactionServiceOp
- func (s *TransactionServiceOp) Count(ctx context.Context, orderID int64, options interface{}) (int, error)
- func (s *TransactionServiceOp) Create(ctx context.Context, orderID int64, transaction Transaction) (*Transaction, error)
- func (s *TransactionServiceOp) Get(ctx context.Context, orderID int64, transactionID int64, options interface{}) (*Transaction, error)
- func (s *TransactionServiceOp) List(ctx context.Context, orderID int64, options interface{}) ([]Transaction, error)
- type TransactionsResource
- type UsageCharge
- type UsageChargeResource
- type UsageChargeService
- type UsageChargeServiceOp
- func (r *UsageChargeServiceOp) Create(ctx context.Context, chargeID int64, usageCharge UsageCharge) (*UsageCharge, error)
- func (r *UsageChargeServiceOp) Get(ctx context.Context, chargeID int64, usageChargeID int64, options interface{}) (*UsageCharge, error)
- func (r *UsageChargeServiceOp) List(ctx context.Context, chargeID int64, options interface{}) ([]UsageCharge, error)
- type UsageChargesResource
- type Variant
- type VariantResource
- type VariantService
- type VariantServiceOp
- func (s *VariantServiceOp) Count(ctx context.Context, productID int64, options interface{}) (int, error)
- func (s *VariantServiceOp) CountMetafields(ctx context.Context, variantID int64, options interface{}) (int, error)
- func (s *VariantServiceOp) Create(ctx context.Context, productID int64, variant Variant) (*Variant, error)
- func (s *VariantServiceOp) CreateMetafield(ctx context.Context, variantID int64, metafield Metafield) (*Metafield, error)
- func (s *VariantServiceOp) Delete(ctx context.Context, productID int64, variantID int64) error
- func (s *VariantServiceOp) DeleteMetafield(ctx context.Context, variantID int64, metafieldID int64) error
- func (s *VariantServiceOp) Get(ctx context.Context, variantID int64, options interface{}) (*Variant, error)
- func (s *VariantServiceOp) GetMetafield(ctx context.Context, variantID int64, metafieldID int64, options interface{}) (*Metafield, error)
- func (s *VariantServiceOp) List(ctx context.Context, productID int64, options interface{}) ([]Variant, error)
- func (s *VariantServiceOp) ListMetafields(ctx context.Context, variantID int64, options interface{}) ([]Metafield, error)
- func (s *VariantServiceOp) Update(ctx context.Context, variant Variant) (*Variant, error)
- func (s *VariantServiceOp) UpdateMetafield(ctx context.Context, variantID int64, metafield Metafield) (*Metafield, error)
- type VariantsResource
- type Webhook
- type WebhookOptions
- type WebhookResource
- type WebhookService
- type WebhookServiceOp
- func (s *WebhookServiceOp) Count(ctx context.Context, options interface{}) (int, error)
- func (s *WebhookServiceOp) Create(ctx context.Context, webhook Webhook) (*Webhook, error)
- func (s *WebhookServiceOp) Delete(ctx context.Context, ID int64) error
- func (s *WebhookServiceOp) Get(ctx context.Context, webhookdID int64, options interface{}) (*Webhook, error)
- func (s *WebhookServiceOp) List(ctx context.Context, options interface{}) ([]Webhook, error)
- func (s *WebhookServiceOp) Update(ctx context.Context, webhook Webhook) (*Webhook, error)
- type WebhooksResource
- type WeightBasedShippingRate
Constants ¶
const ( UserAgent = "goshopify/1.0.0" // UnstableApiVersion Shopify API version for accessing unstable API features UnstableApiVersion = "unstable" )
const ( LevelError = iota + 1 LevelWarn LevelInfo LevelDebug )
const ( // True or false. MetafieldTypeBoolean metafieldType = "boolean" // A hexidecimal color code, #fff123. MetafieldTypeColor metafieldType = "color" //#fff123 // ISO601, YYYY-MM-DD. MetafieldTypeDate metafieldType = "date" // ISO8601, YYYY-MM-DDTHH:MM:SS. MetafieldTypeDatetime metafieldType = "date_time" // JSON, {"value:" 25.0, "unit": "cm"}. MetafieldTypeDimension metafieldType = "dimension" //{"ingredient": "flour", "amount": 0.3}. MetafieldTypeJSON metafieldType = "json" // JSON, {"amount": 5.99, "currency_code": "CAD"}. MetafieldTypeMoney metafieldType = "money" // lines of text separated with newline characters. MetafieldTypeMultiLineTextField metafieldType = "multi_line_text_field" // 10.4. MetafieldTypeNumberDecimal metafieldType = "number_decimal" // 10. MetafieldTypeNumberInteger metafieldType = "number_integer" // JSON, {"value": "3.5", "scale_min": "1.0", "scale_max": "5.0"}. MetafieldTypeRating metafieldType = "rating" // JSON, {"type": "root","children": [{"type": "paragraph","children": [{"type": "text","value": "Bold text.","bold": true}]}]}. MetafieldTypeRichTextField metafieldType = "rich_text_field" // A single line of text. Do not use for numbers or dates, use correct type instead! MetafieldTypeSingleLineTextField metafieldType = "single_line_text_field" // https, http, mailto, sms, or tel. MetafieldTypeURL metafieldType = "url" // JSON, {"value:" 20.0, "unit": "ml"}. MetafieldTypeVolume metafieldType = "volume" // JSON, {"value:" 2.5, "unit": "kg"}. MetafieldTypeWeight metafieldType = "weight" )
https://shopify.dev/docs/api/admin-rest/2023-07/resources/metafield#resource-object
const ( // Show only open orders. OrderStatusOpen orderStatus = "open" // Show only closed orders. OrderStatusClosed orderStatus = "closed" // Show only cancelled orders. OrderStatusCancelled orderStatus = "cancelled" // Show orders of any status, open, closed, cancellerd, or archived. OrderStatusAny orderStatus = "any" )
https://shopify.dev/docs/api/admin-rest/2023-07/resources/order#get-orders?status=any
const ( // Show orders that have been shipped. OrderFulfillmentStatusShipped orderFulfillmentStatus = "shipped" // Show partially shipped orders. OrderFulfillmentStatusPartial orderFulfillmentStatus = "partial" // Show orders that have not yet been shipped. OrderFulfillmentStatusUnshipped orderFulfillmentStatus = "unshipped" // Show orders of any fulfillment status. OrderFulfillmentStatusAny orderFulfillmentStatus = "any" // Returns orders with fulfillment_status of null or partial. OrderFulfillmentStatusUnfulfilled orderFulfillmentStatus = "unfulfilled" //"fulfilled" used to be an acceptable value? Was it deprecated? It isn't noted //in the Shopify docs at the provided URL, but it was used in tests and still //seems to function. OrderFulfillmentStatusFulfilled orderFulfillmentStatus = "fulfilled" )
https://shopify.dev/docs/api/admin-rest/2023-07/resources/order#get-orders?status=any
const ( // Show only authorized orders. OrderFinancialStatusAuthorized orderFinancialStatus = "authorized" // Show only pending orders. OrderFinancialStatusPending orderFinancialStatus = "pending" // Show only paid orders. OrderFinancialStatusPaid orderFinancialStatus = "paid" // Show only partially paid orders. OrderFinancialStatusPartiallyPaid orderFinancialStatus = "partially_paid" // Show only refunded orders. OrderFinancialStatusRefunded orderFinancialStatus = "refunded" // Show only voided orders. OrderFinancialStatusVoided orderFinancialStatus = "voided" // Show only partially refunded orders. OrderFinancialStatusPartiallyRefunded orderFinancialStatus = "partially_refunded" // Show orders of any financial status. OrderFinancialStatusAny orderFinancialStatus = "any" // Show authorized and partially paid orders. OrderFinancialStatusUnpaid orderFinancialStatus = "unpaid" )
https://shopify.dev/docs/api/admin-rest/2023-07/resources/order#get-orders?status=any
const ( // The customer canceled the order. OrderCancelReasonCustomer orderCancelReason = "customer" // The order was fraudulent. OrderCancelReasonFraud orderCancelReason = "fraud" // Items in the order were not in inventory. OrderCancelReasonInventory orderCancelReason = "inventory" // The payment was declined. OrderCancelReasonDeclined orderCancelReason = "declined" // Cancelled for some other reason. OrderCancelReasonOther orderCancelReason = "other" )
const ( // order is fraudulent. OrderRecommendationCancel orderRiskRecommendation = "cancel" // medium level of risk that this order is fraudulent. OrderRecommendationInvestigate orderRiskRecommendation = "investigate" // level of risk that this order is fraudulent. OrderRecommendationAccept orderRiskRecommendation = "accept" )
const ( // Customers are not allowed to place orders for the product variant if it's out // of stock. This is the default value. VariantInventoryPolicyDeny variantInventoryPolicy = "deny" // Customers are allowed to place orders for the product variant if it's out of // stock. VariantInventoryPolicyContinue variantInventoryPolicy = "continue" )
https://shopify.dev/docs/api/admin-rest/2023-07/resources/product-variant#resource-object
Variables ¶
This section is empty.
Functions ¶
func CheckResponseError ¶
func FulfillmentOrderPathPrefix ¶
FulfillmentOrderPathPrefix returns the prefix for a fulfillmentOrder path
func FulfillmentPathPrefix ¶
Return the prefix for a fulfillment path
func MetafieldPathPrefix ¶
Return the prefix for a metafield path
func ShopFullName ¶
Return the full shop name, including .myshopify.com
func ShopShortName ¶
Return the short shop name, excluding .myshopify.com
Types ¶
type AbandonedCheckout ¶
type AbandonedCheckout 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 []ShippingLines `json:"shipping_lines,omitempty"` TaxesIncluded bool `json:"taxes_included,omitempty"` TotalWeight int `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"` SourceIdentifier string `json:"source_identifier,omitempty"` SourceUrl string `json:"source_url,omitempty"` DeviceID int64 `json:"device_id,omitempty"` Phone string `json:"phone,omitempty"` CustomerLocale string `json:"customer_locale,omitempty"` Name string `json:"name,omitempty"` Source string `json:"source,omitempty"` AbandonedCheckoutUrl string `json:"abandoned_checkout_url,omitempty"` DiscountCodes []DiscountCode `json:"discount_codes,omitempty"` TaxLines []TaxLine `json:"tax_lines,omitempty"` SourceName string `json:"source_name,omitempty"` PresentmentCurrency string `json:"presentment_currency,omitempty"` BuyerAcceptsSmsMarketing bool `json:"buyer_accepts_sms_marketing,omitempty"` SmsMarketingPhone string `json:"sms_marketing_phone,omitempty"` TotalDiscounts *decimal.Decimal `json:"total_discounts,omitempty"` TotalLineItemsPrice *decimal.Decimal `json:"total_line_items_price,omitempty"` TotalPrice *decimal.Decimal `json:"total_price,omitempty"` SubtotalPrice *decimal.Decimal `json:"subtotal_price,omitempty"` TotalDuties string `json:"total_duties,omitempty"` BillingAddress *Address `json:"billing_address,omitempty"` ShippingAddress *Address `json:"shipping_address,omitempty"` Customer *Customer `json:"customer,omitempty"` SmsMarketingConsent *SmsMarketingConsent `json:"sms_marketing_consent,omitempty"` AdminGraphqlApiID string `json:"admin_graphql_api_id,omitempty"` DefaultAddress *CustomerAddress `json:"default_address,omitempty"` }
AbandonedCheckout represents a Shopify abandoned checkout
type AbandonedCheckoutService ¶
type AbandonedCheckoutService interface {
List(context.Context, interface{}) ([]AbandonedCheckout, error)
}
AbandonedCheckoutService is an interface for interfacing with the abandonedCheckouts endpoints of the Shopify API. See: https://shopify.dev/docs/api/admin-rest/latest/resources/abandoned-checkouts
type AbandonedCheckoutServiceOp ¶
type AbandonedCheckoutServiceOp struct {
// contains filtered or unexported fields
}
AbandonedCheckoutServiceOp handles communication with the checkout related methods of the Shopify API.
func (*AbandonedCheckoutServiceOp) List ¶
func (s *AbandonedCheckoutServiceOp) List(ctx context.Context, options interface{}) ([]AbandonedCheckout, error)
Get abandoned checkout list
type AbandonedCheckoutsResource ¶
type AbandonedCheckoutsResource struct {
AbandonedCheckouts []AbandonedCheckout `json:"checkouts,omitempty"`
}
Represents the result from the checkouts.json endpoint
type AccessScope ¶
type AccessScope struct {
Handle string `json:"handle,omitempty"`
}
type AccessScopesResource ¶
type AccessScopesResource struct {
AccessScopes []AccessScope `json:"access_scopes,omitempty"`
}
AccessScopesResource represents the result from the oauth/access_scopes.json endpoint
type AccessScopesService ¶
type AccessScopesService interface {
List(context.Context, interface{}) ([]AccessScope, error)
}
type AccessScopesServiceOp ¶
type AccessScopesServiceOp struct {
// contains filtered or unexported fields
}
AccessScopesServiceOp handles communication with the Access Scopes related methods of the Shopify API
func (*AccessScopesServiceOp) List ¶
func (s *AccessScopesServiceOp) List(ctx context.Context, options interface{}) ([]AccessScope, error)
List gets access scopes based on used oauth token
type Address ¶
type Address struct { ID int64 `json:"id,omitempty"` 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"` CountryCode string `json:"country_code,omitempty"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` Latitude float64 `json:"latitude,omitempty"` Longitude float64 `json:"longitude,omitempty"` Name string `json:"name,omitempty"` Phone string `json:"phone,omitempty"` Province string `json:"province,omitempty"` ProvinceCode string `json:"province_code,omitempty"` Zip string `json:"zip,omitempty"` }
type AmountSet ¶
type AmountSet struct { ShopMoney AmountSetEntry `json:"shop_money,omitempty"` PresentmentMoney AmountSetEntry `json:"presentment_money,omitempty"` }
type AmountSetEntry ¶
type App ¶
type App struct { ApiKey string ApiSecret string RedirectUrl string Scope string Password string Client *Client // see GetAccessToken }
App represents basic app settings such as Api key, secret, scope, and redirect url. See oauth.go for OAuth related helper functions.
func (App) AuthorizeUrl ¶
Returns a Shopify oauth authorization url for the given shopname and state.
State is a unique value that can be used to check the authenticity during a callback from Shopify.
func (App) GetAccessToken ¶
func (App) NewClient ¶
NewClient returns a new Shopify API client with an already authenticated shopname and token. The shopName parameter is the shop's myshopify domain, e.g. "theshop.myshopify.com", or simply "theshop" a.NewClient(shopName, token, opts) is equivalent to NewClient(a, shopName, token, opts)
func (App) VerifyAuthorizationURL ¶
Verifying URL callback parameters.
func (App) VerifyMessage ¶
Verify a message against a message HMAC
func (App) VerifySignature ¶
Verifies an app proxy request, sent by Shopify. When Shopify proxies HTTP requests to the proxy URL, Shopify adds a signature paramter that is used to verify that the request was sent by Shopify. https://shopify.dev/tutorials/display-dynamic-store-data-with-app-proxies
func (App) VerifyWebhookRequest ¶
Verifies a webhook http request, sent by Shopify. The body of the request is still readable after invoking the method.
func (App) VerifyWebhookRequestVerbose ¶
Verifies a webhook http request, sent by Shopify. The body of the request is still readable after invoking the method. This method has more verbose error output which is useful for debugging.
type ApplicationCharge ¶
type ApplicationCharge struct { ID int64 `json:"id"` Name string `json:"name"` APIClientID int64 `json:"api_client_id"` Price *decimal.Decimal `json:"price"` Status string `json:"status"` ReturnURL string `json:"return_url"` Test *bool `json:"test"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` ChargeType *string `json:"charge_type"` DecoratedReturnURL string `json:"decorated_return_url"` ConfirmationURL string `json:"confirmation_url"` }
type ApplicationChargeResource ¶
type ApplicationChargeResource struct {
Charge *ApplicationCharge `json:"application_charge"`
}
ApplicationChargeResource represents the result from the admin/application_charges{/X{/activate.json}.json}.json endpoints.
type ApplicationChargeService ¶
type ApplicationChargeService interface { Create(context.Context, ApplicationCharge) (*ApplicationCharge, error) Get(context.Context, int64, interface{}) (*ApplicationCharge, error) List(context.Context, interface{}) ([]ApplicationCharge, error) Activate(context.Context, ApplicationCharge) (*ApplicationCharge, error) }
ApplicationChargeService is an interface for interacting with the ApplicationCharge endpoints of the Shopify API. See https://help.shopify.com/api/reference/billing/applicationcharge
type ApplicationChargeServiceOp ¶
type ApplicationChargeServiceOp struct {
// contains filtered or unexported fields
}
func (ApplicationChargeServiceOp) Activate ¶
func (a ApplicationChargeServiceOp) Activate(ctx context.Context, charge ApplicationCharge) (*ApplicationCharge, error)
Activate activates application charge.
func (ApplicationChargeServiceOp) Create ¶
func (a ApplicationChargeServiceOp) Create(ctx context.Context, charge ApplicationCharge) (*ApplicationCharge, error)
Create creates new application charge.
func (ApplicationChargeServiceOp) Get ¶
func (a ApplicationChargeServiceOp) Get(ctx context.Context, chargeID int64, options interface{}) (*ApplicationCharge, error)
Get gets individual application charge.
func (ApplicationChargeServiceOp) List ¶
func (a ApplicationChargeServiceOp) List(ctx context.Context, options interface{}) ([]ApplicationCharge, error)
List gets all application charges.
type ApplicationChargesResource ¶
type ApplicationChargesResource struct {
Charges []ApplicationCharge `json:"application_charges"`
}
ApplicationChargesResource represents the result from the admin/application_charges.json endpoint.
type AppliedDiscount ¶
type AppliedDiscount struct { Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Value string `json:"value,omitempty"` ValueType string `json:"value_type,omitempty"` Amount string `json:"amount,omitempty"` }
AppliedDiscount is the discount applied to the line item or the draft order object.
type Asset ¶
type Asset struct { Attachment string `json:"attachment,omitempty"` ContentType string `json:"content_type,omitempty"` Key string `json:"key,omitempty"` PublicURL string `json:"public_url,omitempty"` Size int `json:"size,omitempty"` SourceKey string `json:"source_key,omitempty"` Src string `json:"src,omitempty"` ThemeID int64 `json:"theme_id,omitempty"` Value string `json:"value,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
Asset represents a Shopify asset
type AssetResource ¶
type AssetResource struct {
Asset *Asset `json:"asset"`
}
AssetResource is the result from the themes/x/assets.json?asset[key]= endpoint
type AssetService ¶
type AssetService interface { List(context.Context, int64, interface{}) ([]Asset, error) Get(context.Context, int64, string) (*Asset, error) Update(context.Context, int64, Asset) (*Asset, error) Delete(context.Context, int64, string) error }
AssetService is an interface for interfacing with the asset endpoints of the Shopify API. See: https://help.shopify.com/api/reference/asset
type AssetServiceOp ¶
type AssetServiceOp struct {
// contains filtered or unexported fields
}
AssetServiceOp handles communication with the asset related methods of the Shopify API.
type AssetsResource ¶
type AssetsResource struct {
Assets []Asset `json:"assets"`
}
AssetsResource is the result from the themes/x/assets.json endpoint
type AssignedFulfillmentOrder ¶
type AssignedFulfillmentOrder struct { Id int64 `json:"id,omitempty"` AssignedLocationId int64 `json:"assigned_location_id,omitempty"` Destination AssignedFulfillmentOrderDestination `json:"destination,omitempty"` LineItems []AssignedFulfillmentOrderLineItem `json:"line_items,omitempty"` OrderId int64 `json:"order_id,omitempty"` RequestStatus string `json:"request_status,omitempty"` ShopId int64 `json:"shop_id,omitempty"` Status string `json:"status,omitempty"` }
type AssignedFulfillmentOrderDestination ¶
type AssignedFulfillmentOrderDestination struct { Id int64 `json:"id,omitempty"` 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"` Email string `json:"email,omitempty"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` Phone string `json:"phone,omitempty"` Province string `json:"province,omitempty"` Zip string `json:"zip,omitempty"` }
AssignedFulfillmentOrderDestination represents a destination for a AssignedFulfillmentOrder
type AssignedFulfillmentOrderLineItem ¶
type AssignedFulfillmentOrderLineItem struct { Id int64 `json:"id,omitempty"` ShopId int64 `json:"shop_id,omitempty"` FulfillmentOrderId int64 `json:"fulfillment_order_id,omitempty"` LineItemId int64 `json:"line_item_id,omitempty"` InventoryItemId int64 `json:"inventory_item_id,omitempty"` Quantity int64 `json:"quantity,omitempty"` FulfillableQuantity int64 `json:"fulfillable_quantity,omitempty"` }
AssignedFulfillmentOrderLineItem represents a line item for a AssignedFulfillmentOrder
type AssignedFulfillmentOrderService ¶
type AssignedFulfillmentOrderService interface {
Get(context.Context, interface{}) ([]AssignedFulfillmentOrder, error)
}
AssignedFulfillmentService is an interface for interfacing with the assigned fulfillment orders of the Shopify API. https://shopify.dev/docs/api/admin-rest/2023-07/resources/assignedfulfillmentorder
type AssignedFulfillmentOrderServiceOp ¶
type AssignedFulfillmentOrderServiceOp struct {
// contains filtered or unexported fields
}
AssignedFulfillmentOrderServiceOp handles communication with the AssignedFulfillmentOrderService related methods of the Shopify API
func (*AssignedFulfillmentOrderServiceOp) Get ¶
func (s *AssignedFulfillmentOrderServiceOp) Get(ctx context.Context, options interface{}) ([]AssignedFulfillmentOrder, error)
Gets a list of all the fulfillment orders that are assigned to an app at the shop level
type AssignedFulfillmentOrdersResource ¶
type AssignedFulfillmentOrdersResource struct {
AssignedFulfillmentOrders []AssignedFulfillmentOrder `json:"fulfillment_orders,omitempty"`
}
AssignedFulfillmentOrderResource represents the result from the assigned_fulfillment_order.json endpoint
type Blog ¶
type Blog struct { ID int64 `json:"id"` Title string `json:"title"` Commentable string `json:"commentable"` Feedburner string `json:"feedburner"` FeedburnerLocation string `json:"feedburner_location"` Handle string `json:"handle"` Metafield Metafield `json:"metafield"` Tags string `json:"tags"` TemplateSuffix string `json:"template_suffix"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` AdminGraphqlAPIID string `json:"admin_graphql_api_id,omitempty"` }
Blog represents a Shopify blog
type BlogResource ¶
type BlogResource struct {
Blog *Blog `json:"blog"`
}
Represents the result from the blogs/X.json endpoint
type BlogService ¶
type BlogService interface { List(context.Context, interface{}) ([]Blog, error) Count(context.Context, interface{}) (int, error) Get(context.Context, int64, interface{}) (*Blog, error) Create(context.Context, Blog) (*Blog, error) Update(context.Context, Blog) (*Blog, error) Delete(context.Context, int64) error }
BlogService is an interface for interfacing with the blogs endpoints of the Shopify API. See: https://help.shopify.com/api/reference/online_store/blog
type BlogServiceOp ¶
type BlogServiceOp struct {
// contains filtered or unexported fields
}
BlogServiceOp handles communication with the blog related methods of the Shopify API.
func (*BlogServiceOp) Count ¶
func (s *BlogServiceOp) Count(ctx context.Context, options interface{}) (int, error)
Count blogs
func (*BlogServiceOp) Delete ¶
func (s *BlogServiceOp) Delete(ctx context.Context, blogId int64) error
Delete an blog
type BlogsResource ¶
type BlogsResource struct {
Blogs []Blog `json:"blogs"`
}
BlogsResource is the result from the blogs.json endpoint
type CarrierService ¶
type CarrierService struct { // Whether this carrier service is active. Active bool `json:"active,omitempty"` // The URL endpoint that Shopify needs to retrieve shipping rates. This must be a public URL. CallbackUrl string `json:"callback_url,omitempty"` // Distinguishes between API or legacy carrier services. CarrierServiceType string `json:"carrier_service_type,omitempty"` // The Id of the carrier service. Id int64 `json:"id,omitempty"` // The format of the data returned by the URL endpoint. Valid values: json and xml. Default value: json. Format string `json:"format,omitempty"` // The name of the shipping service as seen by merchants and their customers. Name string `json:"name,omitempty"` // Whether merchants are able to send dummy data to your service through the Shopify admin to see shipping rate examples. ServiceDiscovery bool `json:"service_discovery,omitempty"` AdminGraphqlAPIID string `json:"admin_graphql_api_id,omitempty"` }
CarrierService represents a Shopify carrier service
type CarrierServiceOp ¶
type CarrierServiceOp struct {
// contains filtered or unexported fields
}
CarrierServiceOp handles communication with the product related methods of the Shopify API.
func (*CarrierServiceOp) Create ¶
func (s *CarrierServiceOp) Create(ctx context.Context, carrier CarrierService) (*CarrierService, error)
Create a carrier service
func (*CarrierServiceOp) Delete ¶
func (s *CarrierServiceOp) Delete(ctx context.Context, id int64) error
Delete a carrier service
func (*CarrierServiceOp) Get ¶
func (s *CarrierServiceOp) Get(ctx context.Context, id int64) (*CarrierService, error)
Get individual carrier resource by carrier resource ID
func (*CarrierServiceOp) List ¶
func (s *CarrierServiceOp) List(ctx context.Context) ([]CarrierService, error)
List carrier services
func (*CarrierServiceOp) Update ¶
func (s *CarrierServiceOp) Update(ctx context.Context, carrier CarrierService) (*CarrierService, error)
Update a carrier service
type CarrierServiceService ¶
type CarrierServiceService interface { List(context.Context) ([]CarrierService, error) Get(context.Context, int64) (*CarrierService, error) Create(context.Context, CarrierService) (*CarrierService, error) Update(context.Context, CarrierService) (*CarrierService, error) Delete(context.Context, int64) error }
CarrierServiceService is an interface for interfacing with the carrier service endpoints of the Shopify API. See: https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/carrierservice
type CarrierShippingRateProvider ¶
type CarrierShippingRateProvider struct { ID int64 `json:"id,omitempty"` CarrierServiceID int64 `json:"carrier_service_id,omitempty"` ShippingZoneID int64 `json:"shipping_zone_id,omitempty"` FlatModifier *decimal.Decimal `json:"flat_modifier,omitempty"` PercentModifier *decimal.Decimal `json:"percent_modifier,omitempty"` ServiceFilter map[string]string `json:"service_filter,omitempty"` }
CarrierShippingRateProvider represents a Shopify carrier-constrained shipping rate
type Client ¶
type Client struct { // HTTP client used to communicate with the Shopify API. Client *http.Client RateLimits RateLimitInfo // Services used for communicating with the API Product ProductService CustomCollection CustomCollectionService SmartCollection SmartCollectionService Customer CustomerService CustomerAddress CustomerAddressService Order OrderService Fulfillment FulfillmentService DraftOrder DraftOrderService AbandonedCheckout AbandonedCheckoutService Shop ShopService Webhook WebhookService Variant VariantService Image ImageService Transaction TransactionService Theme ThemeService Asset AssetService ScriptTag ScriptTagService RecurringApplicationCharge RecurringApplicationChargeService UsageCharge UsageChargeService Metafield MetafieldService Blog BlogService ApplicationCharge ApplicationChargeService Redirect RedirectService Page PageService StorefrontAccessToken StorefrontAccessTokenService Collect CollectService Collection CollectionService Location LocationService DiscountCode DiscountCodeService PriceRule PriceRuleService InventoryItem InventoryItemService ShippingZone ShippingZoneService ProductListing ProductListingService InventoryLevel InventoryLevelService AccessScopes AccessScopesService FulfillmentService FulfillmentServiceService CarrierService CarrierServiceService Payouts PayoutsService GiftCard GiftCardService FulfillmentOrder FulfillmentOrderService GraphQL GraphQLService AssignedFulfillmentOrder AssignedFulfillmentOrderService FulfillmentEvent FulfillmentEventService FulfillmentRequest FulfillmentRequestService PaymentsTransactions PaymentsTransactionsService OrderRisk OrderRiskService // contains filtered or unexported fields }
Client manages communication with the Shopify API.
func NewClient ¶
Returns a new Shopify API client with an already authenticated shopname and token. The shopName parameter is the shop's myshopify domain, e.g. "theshop.myshopify.com", or simply "theshop"
func (*Client) CreateAndDo ¶
func (c *Client) CreateAndDo(ctx context.Context, method, relPath string, data, options, resource interface{}) error
CreateAndDo performs a web request to Shopify with the given method (GET, POST, PUT, DELETE) and relative path (e.g. "/admin/orders.json"). The data, options and resource arguments are optional and only relevant in certain situations. If the data argument is non-nil, it will be used as the body of the request for POST and PUT requests. The options argument is used for specifying request options such as search parameters like created_at_min Any data returned from Shopify will be marshalled into resource argument.
func (*Client) DeleteWithOptions ¶
DeleteWithOptions performs a DELETE request for the given path WithOptions
func (*Client) Do ¶
Do sends an API request and populates the given interface with the parsed response. It does not make much sense to call Do without a prepared interface instance.
func (*Client) Get ¶
Get performs a GET request for the given path and saves the result in the given resource.
func (*Client) ListWithPagination ¶
func (c *Client) ListWithPagination(ctx context.Context, path string, resource, options interface{}) (*Pagination, error)
ListWithPagination performs a GET request for the given path and saves the result in the given resource and returns the pagination.
func (*Client) NewRequest ¶
func (c *Client) NewRequest(ctx context.Context, method, relPath string, body, options interface{}) (*http.Request, error)
Creates an API request. A relative URL can be provided in urlStr, which will be resolved to the BaseURL of the Client. Relative URLS should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.
type ClientDetails ¶
type ClientDetails struct { AcceptLanguage string `json:"accept_language,omitempty"` BrowserHeight int `json:"browser_height,omitempty"` BrowserIp string `json:"browser_ip,omitempty"` BrowserWidth int `json:"browser_width,omitempty"` SessionHash string `json:"session_hash,omitempty"` UserAgent string `json:"user_agent,omitempty"` }
type Collect ¶
type Collect struct { ID int64 `json:"id,omitempty"` CollectionID int64 `json:"collection_id,omitempty"` ProductID int64 `json:"product_id,omitempty"` Featured bool `json:"featured,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` Position int `json:"position,omitempty"` SortValue string `json:"sort_value,omitempty"` }
Collect represents a Shopify collect
type CollectResource ¶
type CollectResource struct {
Collect *Collect `json:"collect"`
}
Represents the result from the collects/X.json endpoint
type CollectService ¶
type CollectService interface { List(context.Context, interface{}) ([]Collect, error) Count(context.Context, interface{}) (int, error) Get(context.Context, int64, interface{}) (*Collect, error) Create(context.Context, Collect) (*Collect, error) Delete(context.Context, int64) error }
CollectService is an interface for interfacing with the collect endpoints of the Shopify API. See: https://help.shopify.com/api/reference/products/collect
type CollectServiceOp ¶
type CollectServiceOp struct {
// contains filtered or unexported fields
}
CollectServiceOp handles communication with the collect related methods of the Shopify API.
func (*CollectServiceOp) Count ¶
func (s *CollectServiceOp) Count(ctx context.Context, options interface{}) (int, error)
Count collects
func (*CollectServiceOp) Delete ¶
func (s *CollectServiceOp) Delete(ctx context.Context, collectID int64) error
Delete an existing collect
type Collection ¶
type Collection struct { ID int64 `json:"id"` Handle string `json:"handle"` Title string `json:"title"` UpdatedAt *time.Time `json:"updated_at"` BodyHTML string `json:"body_html"` SortOrder string `json:"sort_order"` TemplateSuffix string `json:"template_suffix"` Image Image `json:"image"` PublishedAt *time.Time `json:"published_at"` PublishedScope string `json:"published_scope"` }
Collection represents a Shopify collection
type CollectionResource ¶
type CollectionResource struct {
Collection *Collection `json:"collection"`
}
Represents the result from the collections/X.json endpoint
type CollectionService ¶
type CollectionService interface { Get(ctx context.Context, collectionID int64, options interface{}) (*Collection, error) ListProducts(ctx context.Context, collectionID int64, options interface{}) ([]Product, error) ListProductsWithPagination(ctx context.Context, collectionID int64, options interface{}) ([]Product, *Pagination, error) }
CollectionService is an interface for interfacing with the collection endpoints of the Shopify API. See: https://help.shopify.com/api/reference/products/collection
type CollectionServiceOp ¶
type CollectionServiceOp struct {
// contains filtered or unexported fields
}
CollectionServiceOp handles communication with the collection related methods of the Shopify API.
func (*CollectionServiceOp) Get ¶
func (s *CollectionServiceOp) Get(ctx context.Context, collectionID int64, options interface{}) (*Collection, error)
Get individual collection
func (*CollectionServiceOp) ListProducts ¶
func (s *CollectionServiceOp) ListProducts(ctx context.Context, collectionID int64, options interface{}) ([]Product, error)
List products for a collection
func (*CollectionServiceOp) ListProductsWithPagination ¶
func (s *CollectionServiceOp) ListProductsWithPagination(ctx context.Context, collectionID int64, options interface{}) ([]Product, *Pagination, error)
List products for a collection and return pagination to retrieve next/previous results.
type CollectsResource ¶
type CollectsResource struct {
Collects []Collect `json:"collects"`
}
Represents the result from the collects.json endpoint
type CountOptions ¶
type CountOptions 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"` }
General count options that can be used for most collection counts.
type CustomCollection ¶
type CustomCollection struct { ID int64 `json:"id"` Handle string `json:"handle"` Title string `json:"title"` UpdatedAt *time.Time `json:"updated_at"` BodyHTML string `json:"body_html"` SortOrder string `json:"sort_order"` TemplateSuffix string `json:"template_suffix"` Image Image `json:"image"` Published bool `json:"published"` PublishedAt *time.Time `json:"published_at"` PublishedScope string `json:"published_scope"` Metafields []Metafield `json:"metafields,omitempty"` }
CustomCollection represents a Shopify custom collection.
type CustomCollectionResource ¶
type CustomCollectionResource struct {
Collection *CustomCollection `json:"custom_collection"`
}
CustomCollectionResource represents the result form the custom_collections/X.json endpoint
type CustomCollectionService ¶
type CustomCollectionService interface { List(context.Context, interface{}) ([]CustomCollection, error) Count(context.Context, interface{}) (int, error) Get(context.Context, int64, interface{}) (*CustomCollection, error) Create(context.Context, CustomCollection) (*CustomCollection, error) Update(context.Context, CustomCollection) (*CustomCollection, error) Delete(context.Context, int64) error // MetafieldsService used for CustomCollection resource to communicate with Metafields resource MetafieldsService }
CustomCollectionService is an interface for interacting with the custom collection endpoints of the Shopify API. See https://help.shopify.com/api/reference/customcollection
type CustomCollectionServiceOp ¶
type CustomCollectionServiceOp struct {
// contains filtered or unexported fields
}
CustomCollectionServiceOp handles communication with the custom collection related methods of the Shopify API.
func (*CustomCollectionServiceOp) Count ¶
func (s *CustomCollectionServiceOp) Count(ctx context.Context, options interface{}) (int, error)
Count custom collections
func (*CustomCollectionServiceOp) CountMetafields ¶
func (s *CustomCollectionServiceOp) CountMetafields(ctx context.Context, customCollectionID int64, options interface{}) (int, error)
Count metafields for a custom collection
func (*CustomCollectionServiceOp) Create ¶
func (s *CustomCollectionServiceOp) Create(ctx context.Context, collection CustomCollection) (*CustomCollection, error)
Create a new custom collection See Image for the details of the Image creation for a collection.
func (*CustomCollectionServiceOp) CreateMetafield ¶
func (s *CustomCollectionServiceOp) CreateMetafield(ctx context.Context, customCollectionID int64, metafield Metafield) (*Metafield, error)
Create a new metafield for a custom collection
func (*CustomCollectionServiceOp) Delete ¶
func (s *CustomCollectionServiceOp) Delete(ctx context.Context, collectionID int64) error
Delete an existing custom collection.
func (*CustomCollectionServiceOp) DeleteMetafield ¶
func (s *CustomCollectionServiceOp) DeleteMetafield(ctx context.Context, customCollectionID int64, metafieldID int64) error
// Delete an existing metafield for a custom collection
func (*CustomCollectionServiceOp) Get ¶
func (s *CustomCollectionServiceOp) Get(ctx context.Context, collectionID int64, options interface{}) (*CustomCollection, error)
Get individual custom collection
func (*CustomCollectionServiceOp) GetMetafield ¶
func (s *CustomCollectionServiceOp) GetMetafield(ctx context.Context, customCollectionID int64, metafieldID int64, options interface{}) (*Metafield, error)
Get individual metafield for a custom collection
func (*CustomCollectionServiceOp) List ¶
func (s *CustomCollectionServiceOp) List(ctx context.Context, options interface{}) ([]CustomCollection, error)
List custom collections
func (*CustomCollectionServiceOp) ListMetafields ¶
func (s *CustomCollectionServiceOp) ListMetafields(ctx context.Context, customCollectionID int64, options interface{}) ([]Metafield, error)
List metafields for a custom collection
func (*CustomCollectionServiceOp) Update ¶
func (s *CustomCollectionServiceOp) Update(ctx context.Context, collection CustomCollection) (*CustomCollection, error)
Update an existing custom collection
func (*CustomCollectionServiceOp) UpdateMetafield ¶
func (s *CustomCollectionServiceOp) UpdateMetafield(ctx context.Context, customCollectionID int64, metafield Metafield) (*Metafield, error)
Update an existing metafield for a custom collection
type CustomCollectionsResource ¶
type CustomCollectionsResource struct {
Collections []CustomCollection `json:"custom_collections"`
}
CustomCollectionsResource represents the result from the custom_collections.json endpoint
type Customer ¶
type Customer struct { ID int64 `json:"id,omitempty"` Email string `json:"email,omitempty"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` State string `json:"state,omitempty"` Note string `json:"note,omitempty"` VerifiedEmail bool `json:"verified_email,omitempty"` MultipassIdentifier string `json:"multipass_identifier,omitempty"` OrdersCount int `json:"orders_count,omitempty"` TaxExempt bool `json:"tax_exempt,omitempty"` TotalSpent *decimal.Decimal `json:"total_spent,omitempty"` Phone string `json:"phone,omitempty"` Tags string `json:"tags,omitempty"` LastOrderId int64 `json:"last_order_id,omitempty"` LastOrderName string `json:"last_order_name,omitempty"` AcceptsMarketing bool `json:"accepts_marketing,omitempty"` DefaultAddress *CustomerAddress `json:"default_address,omitempty"` Addresses []*CustomerAddress `json:"addresses,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` Metafields []Metafield `json:"metafields,omitempty"` }
Customer represents a Shopify customer
type CustomerAddress ¶
type CustomerAddress struct { ID int64 `json:"id,omitempty"` CustomerID int64 `json:"customer_id,omitempty"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` Company string `json:"company,omitempty"` Address1 string `json:"address1,omitempty"` Address2 string `json:"address2,omitempty"` City string `json:"city,omitempty"` Province string `json:"province,omitempty"` Country string `json:"country,omitempty"` Zip string `json:"zip,omitempty"` Phone string `json:"phone,omitempty"` Name string `json:"name,omitempty"` ProvinceCode string `json:"province_code,omitempty"` CountryCode string `json:"country_code,omitempty"` CountryName string `json:"country_name,omitempty"` Default bool `json:"default,omitempty"` }
CustomerAddress represents a Shopify customer address
type CustomerAddressResource ¶
type CustomerAddressResource struct {
Address *CustomerAddress `json:"customer_address"`
}
CustomerAddressResoruce represents the result from the addresses/X.json endpoint
type CustomerAddressService ¶
type CustomerAddressService interface { List(context.Context, int64, interface{}) ([]CustomerAddress, error) Get(context.Context, int64, int64, interface{}) (*CustomerAddress, error) Create(context.Context, int64, CustomerAddress) (*CustomerAddress, error) Update(context.Context, int64, CustomerAddress) (*CustomerAddress, error) Delete(context.Context, int64, int64) error }
CustomerAddressService is an interface for interfacing with the customer address endpoints of the Shopify API. See: https://help.shopify.com/en/api/reference/customers/customer_address
type CustomerAddressServiceOp ¶
type CustomerAddressServiceOp struct {
// contains filtered or unexported fields
}
CustomerAddressServiceOp handles communication with the customer address related methods of the Shopify API.
func (*CustomerAddressServiceOp) Create ¶
func (s *CustomerAddressServiceOp) Create(ctx context.Context, customerID int64, address CustomerAddress) (*CustomerAddress, error)
Create a new address for given customer
func (*CustomerAddressServiceOp) Delete ¶
func (s *CustomerAddressServiceOp) Delete(ctx context.Context, customerID, addressID int64) error
Delete an existing address
func (*CustomerAddressServiceOp) Get ¶
func (s *CustomerAddressServiceOp) Get(ctx context.Context, customerID, addressID int64, options interface{}) (*CustomerAddress, error)
Get address
func (*CustomerAddressServiceOp) List ¶
func (s *CustomerAddressServiceOp) List(ctx context.Context, customerID int64, options interface{}) ([]CustomerAddress, error)
List addresses
func (*CustomerAddressServiceOp) Update ¶
func (s *CustomerAddressServiceOp) Update(ctx context.Context, customerID int64, address CustomerAddress) (*CustomerAddress, error)
Create a new address for given customer
type CustomerAddressesResource ¶
type CustomerAddressesResource struct {
Addresses []CustomerAddress `json:"addresses"`
}
CustomerAddressResoruce represents the result from the customers/X/addresses.json endpoint
type CustomerID ¶
type CustomerID struct {
CustomerID int64 `json:"customer_id,omitempty"`
}
type CustomerResource ¶
type CustomerResource struct {
Customer *Customer `json:"customer"`
}
Represents the result from the customers/X.json endpoint
type CustomerSearchOptions ¶
type CustomerSearchOptions struct { Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` Fields string `url:"fields,omitempty"` Order string `url:"order,omitempty"` Query string `url:"query,omitempty"` }
Represents the options available when searching for a customer
type CustomerService ¶
type CustomerService interface { List(context.Context, interface{}) ([]Customer, error) ListWithPagination(ctx context.Context, options interface{}) ([]Customer, *Pagination, error) Count(context.Context, interface{}) (int, error) Get(context.Context, int64, interface{}) (*Customer, error) Search(context.Context, interface{}) ([]Customer, error) Create(context.Context, Customer) (*Customer, error) Update(context.Context, Customer) (*Customer, error) Delete(context.Context, int64) error ListOrders(context.Context, int64, interface{}) ([]Order, error) ListTags(context.Context, interface{}) ([]string, error) // MetafieldsService used for Customer resource to communicate with Metafields resource MetafieldsService }
CustomerService is an interface for interfacing with the customers endpoints of the Shopify API. See: https://help.shopify.com/api/reference/customer
type CustomerServiceOp ¶
type CustomerServiceOp struct {
// contains filtered or unexported fields
}
CustomerServiceOp handles communication with the product related methods of the Shopify API.
func (*CustomerServiceOp) Count ¶
func (s *CustomerServiceOp) Count(ctx context.Context, options interface{}) (int, error)
Count customers
func (*CustomerServiceOp) CountMetafields ¶
func (s *CustomerServiceOp) CountMetafields(ctx context.Context, customerID int64, options interface{}) (int, error)
Count metafields for a customer
func (*CustomerServiceOp) CreateMetafield ¶
func (s *CustomerServiceOp) CreateMetafield(ctx context.Context, customerID int64, metafield Metafield) (*Metafield, error)
Create a new metafield for a customer
func (*CustomerServiceOp) Delete ¶
func (s *CustomerServiceOp) Delete(ctx context.Context, customerID int64) error
Delete an existing customer
func (*CustomerServiceOp) DeleteMetafield ¶
func (s *CustomerServiceOp) DeleteMetafield(ctx context.Context, customerID int64, metafieldID int64) error
// Delete an existing metafield for a customer
func (*CustomerServiceOp) Get ¶
func (s *CustomerServiceOp) Get(ctx context.Context, customerID int64, options interface{}) (*Customer, error)
Get customer
func (*CustomerServiceOp) GetMetafield ¶
func (s *CustomerServiceOp) GetMetafield(ctx context.Context, customerID int64, metafieldID int64, options interface{}) (*Metafield, error)
Get individual metafield for a customer
func (*CustomerServiceOp) List ¶
func (s *CustomerServiceOp) List(ctx context.Context, options interface{}) ([]Customer, error)
List customers
func (*CustomerServiceOp) ListMetafields ¶
func (s *CustomerServiceOp) ListMetafields(ctx context.Context, customerID int64, options interface{}) ([]Metafield, error)
List metafields for a customer
func (*CustomerServiceOp) ListOrders ¶
func (s *CustomerServiceOp) ListOrders(ctx context.Context, customerID int64, options interface{}) ([]Order, error)
ListOrders retrieves all orders from a customer
func (*CustomerServiceOp) ListTags ¶
func (s *CustomerServiceOp) ListTags(ctx context.Context, options interface{}) ([]string, error)
ListTags retrieves all unique tags across all customers
func (*CustomerServiceOp) ListWithPagination ¶
func (s *CustomerServiceOp) ListWithPagination(ctx context.Context, options interface{}) ([]Customer, *Pagination, error)
ListWithPagination lists customers and return pagination to retrieve next/previous results.
func (*CustomerServiceOp) Search ¶
func (s *CustomerServiceOp) Search(ctx context.Context, options interface{}) ([]Customer, error)
Search customers
func (*CustomerServiceOp) UpdateMetafield ¶
func (s *CustomerServiceOp) UpdateMetafield(ctx context.Context, customerID int64, metafield Metafield) (*Metafield, error)
Update an existing metafield for a customer
type CustomerTagsResource ¶
type CustomerTagsResource struct {
Tags []string `json:"tags"`
}
Represents the result from the customers/tags.json endpoint
type CustomersResource ¶
type CustomersResource struct {
Customers []Customer `json:"customers"`
}
Represents the result from the customers.json endpoint
type DiscountAllocations ¶
type DiscountCode ¶
type DiscountCodeResource ¶
type DiscountCodeResource struct {
PriceRuleDiscountCode *PriceRuleDiscountCode `json:"discount_code"`
}
DiscountCodeResource represents the result from the discount_codes/X.json endpoint
type DiscountCodeService ¶
type DiscountCodeService interface { Create(context.Context, int64, PriceRuleDiscountCode) (*PriceRuleDiscountCode, error) Update(context.Context, int64, PriceRuleDiscountCode) (*PriceRuleDiscountCode, error) List(context.Context, int64) ([]PriceRuleDiscountCode, error) Get(context.Context, int64, int64) (*PriceRuleDiscountCode, error) Delete(context.Context, int64, int64) error }
DiscountCodeService is an interface for interfacing with the discount endpoints of the Shopify API. See: https://help.shopify.com/en/api/reference/discounts/PriceRuleDiscountCode
type DiscountCodeServiceOp ¶
type DiscountCodeServiceOp struct {
// contains filtered or unexported fields
}
DiscountCodeServiceOp handles communication with the discount code related methods of the Shopify API.
func (*DiscountCodeServiceOp) Create ¶
func (s *DiscountCodeServiceOp) Create(ctx context.Context, priceRuleID int64, dc PriceRuleDiscountCode) (*PriceRuleDiscountCode, error)
Create a discount code
func (*DiscountCodeServiceOp) Delete ¶
func (s *DiscountCodeServiceOp) Delete(ctx context.Context, priceRuleID int64, discountCodeID int64) error
Delete a discount code
func (*DiscountCodeServiceOp) Get ¶
func (s *DiscountCodeServiceOp) Get(ctx context.Context, priceRuleID int64, discountCodeID int64) (*PriceRuleDiscountCode, error)
Get a single discount code
func (*DiscountCodeServiceOp) List ¶
func (s *DiscountCodeServiceOp) List(ctx context.Context, priceRuleID int64) ([]PriceRuleDiscountCode, error)
List of discount codes
func (*DiscountCodeServiceOp) Update ¶
func (s *DiscountCodeServiceOp) Update(ctx context.Context, priceRuleID int64, dc PriceRuleDiscountCode) (*PriceRuleDiscountCode, error)
Update an existing discount code
type DiscountCodesResource ¶
type DiscountCodesResource struct {
DiscountCodes []PriceRuleDiscountCode `json:"discount_codes"`
}
DiscountCodesResource is the result from the discount_codes.json endpoint
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,omitempty"` ShippingAddress *Address `json:"shipping_address,omitempty"` BillingAddress *Address `json:"billing_address,omitempty"` 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,omitempty"` LineItems []LineItem `json:"line_items,omitempty"` ShippingLine *ShippingLines `json:"shipping_line,omitempty"` Tags string `json:"tags,omitempty"` TaxLines []TaxLine `json:"tax_lines,omitempty"` AppliedDiscount *AppliedDiscount `json:"applied_discount,omitempty"` TaxesIncluded bool `json:"taxes_included,omitempty"` TotalTax string `json:"total_tax,omitempty"` TaxExempt *bool `json:"tax_exempt,omitempty"` TotalPrice string `json:"total_price,omitempty"` SubtotalPrice *decimal.Decimal `json:"subtotal_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"` // only in request to flag using the customer's default address UseCustomerDefaultAddress bool `json:"use_customer_default_address,omitempty"` }
DraftOrder represents a shopify draft order
type DraftOrderCountOptions ¶
type DraftOrderCountOptions struct { Fields string `url:"fields,omitempty"` Limit int `url:"limit,omitempty"` SinceID int64 `url:"since_id,omitempty"` IDs string `url:"ids,omitempty"` Status orderStatus `url:"status,omitempty"` }
DraftOrderCountOptions represents the possible options to the count draft orders endpoint
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"` }
DraftOrderInvoice is the struct used to create an invoice for a draft order
type DraftOrderInvoiceResource ¶
type DraftOrderInvoiceResource struct {
DraftOrderInvoice *DraftOrderInvoice `json:"draft_order_invoice,omitempty"`
}
type DraftOrderListOptions ¶
type DraftOrderListOptions struct { Fields string `url:"fields,omitempty"` Limit int `url:"limit,omitempty"` SinceID int64 `url:"since_id,omitempty"` UpdatedAtMin *time.Time `url:"updated_at_min,omitempty"` UpdatedAtMax *time.Time `url:"updated_at_max,omitempty"` IDs string `url:"ids,omitempty"` Status orderStatus `url:"status,omitempty"` }
DraftOrderListOptions represents the possible options that can be used to further query the list draft orders endpoint
type DraftOrderResource ¶
type DraftOrderResource struct {
DraftOrder *DraftOrder `json:"draft_order"`
}
type DraftOrderService ¶
type DraftOrderService interface { List(context.Context, interface{}) ([]DraftOrder, error) Count(context.Context, interface{}) (int, error) Get(context.Context, int64, interface{}) (*DraftOrder, error) Create(context.Context, DraftOrder) (*DraftOrder, error) Update(context.Context, DraftOrder) (*DraftOrder, error) Delete(context.Context, int64) error Invoice(context.Context, int64, DraftOrderInvoice) (*DraftOrderInvoice, error) Complete(context.Context, int64, bool) (*DraftOrder, error) // MetafieldsService used for DrafT Order resource to communicate with Metafields resource MetafieldsService }
DraftOrderService is an interface for interfacing with the draft orders endpoints of the Shopify API. See: https://help.shopify.com/api/reference/orders/draftorder
type DraftOrderServiceOp ¶
type DraftOrderServiceOp struct {
// contains filtered or unexported fields
}
DraftOrderServiceOp handles communication with the draft order related methods of the Shopify API.
func (*DraftOrderServiceOp) Complete ¶
func (s *DraftOrderServiceOp) Complete(ctx context.Context, draftOrderID int64, paymentPending bool) (*DraftOrder, error)
Complete draft order
func (*DraftOrderServiceOp) Count ¶
func (s *DraftOrderServiceOp) Count(ctx context.Context, options interface{}) (int, error)
Count draft orders
func (*DraftOrderServiceOp) CountMetafields ¶
func (s *DraftOrderServiceOp) CountMetafields(ctx context.Context, draftOrderID int64, options interface{}) (int, error)
Count metafields for an order
func (*DraftOrderServiceOp) Create ¶
func (s *DraftOrderServiceOp) Create(ctx context.Context, draftOrder DraftOrder) (*DraftOrder, error)
Create draft order
func (*DraftOrderServiceOp) CreateMetafield ¶
func (s *DraftOrderServiceOp) CreateMetafield(ctx context.Context, draftOrderID int64, metafield Metafield) (*Metafield, error)
Create a new metafield for an order
func (*DraftOrderServiceOp) Delete ¶
func (s *DraftOrderServiceOp) Delete(ctx context.Context, draftOrderID int64) error
Delete draft orders
func (*DraftOrderServiceOp) DeleteMetafield ¶
func (s *DraftOrderServiceOp) DeleteMetafield(ctx context.Context, draftOrderID int64, metafieldID int64) error
Delete an existing metafield for an order
func (*DraftOrderServiceOp) Get ¶
func (s *DraftOrderServiceOp) Get(ctx context.Context, draftOrderID int64, options interface{}) (*DraftOrder, error)
Get individual draft order
func (*DraftOrderServiceOp) GetMetafield ¶
func (s *DraftOrderServiceOp) GetMetafield(ctx context.Context, draftOrderID int64, metafieldID int64, options interface{}) (*Metafield, error)
Get individual metafield for an order
func (*DraftOrderServiceOp) Invoice ¶
func (s *DraftOrderServiceOp) Invoice(ctx context.Context, draftOrderID int64, draftOrderInvoice DraftOrderInvoice) (*DraftOrderInvoice, error)
Invoice a draft order
func (*DraftOrderServiceOp) List ¶
func (s *DraftOrderServiceOp) List(ctx context.Context, options interface{}) ([]DraftOrder, error)
List draft orders
func (*DraftOrderServiceOp) ListMetafields ¶
func (s *DraftOrderServiceOp) ListMetafields(ctx context.Context, draftOrderID int64, options interface{}) ([]Metafield, error)
List metafields for an order
func (*DraftOrderServiceOp) Update ¶
func (s *DraftOrderServiceOp) Update(ctx context.Context, draftOrder DraftOrder) (*DraftOrder, error)
Update draft order
func (*DraftOrderServiceOp) UpdateMetafield ¶
func (s *DraftOrderServiceOp) UpdateMetafield(ctx context.Context, draftOrderID int64, metafield Metafield) (*Metafield, error)
Update an existing metafield for an order
type DraftOrdersResource ¶
type DraftOrdersResource struct {
DraftOrders []DraftOrder `json:"draft_orders"`
}
type Fulfillment ¶
type Fulfillment struct { ID int64 `json:"id,omitempty"` OrderID int64 `json:"order_id,omitempty"` LocationID int64 `json:"location_id,omitempty"` Status string `json:"status,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` Service string `json:"service,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` TrackingCompany string `json:"tracking_company,omitempty"` ShipmentStatus string `json:"shipment_status,omitempty"` TrackingInfo FulfillmentTrackingInfo `json:"tracking_info,omitempty"` TrackingNumber string `json:"tracking_number,omitempty"` TrackingNumbers []string `json:"tracking_numbers,omitempty"` TrackingUrl string `json:"tracking_url,omitempty"` TrackingUrls []string `json:"tracking_urls,omitempty"` Receipt Receipt `json:"receipt,omitempty"` LineItems []LineItem `json:"line_items,omitempty"` LineItemsByFulfillmentOrder []LineItemByFulfillmentOrder `json:"line_items_by_fulfillment_order,omitempty"` NotifyCustomer bool `json:"notify_customer"` }
Fulfillment represents a Shopify fulfillment.
type FulfillmentEvent ¶
type FulfillmentEvent struct { ID int64 `json:"id"` Address1 string `json:"address1"` City string `json:"city"` Country string `json:"country"` CreatedAt string `json:"created_at"` EstimatedDeliveryAt string `json:"estimated_delivery_at"` FulfillmentID int64 `json:"fulfillment_id"` HappenedAt string `json:"happened_at"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Message string `json:"message"` OrderID int64 `json:"order_id"` Province string `json:"province"` ShopID int64 `json:"shop_id"` Status string `json:"status"` UpdatedAt string `json:"updated_at"` Zip string `json:"zip"` }
FulfillmentEvent represents a Shopify fulfillment event.
type FulfillmentEventCreateRequest ¶
type FulfillmentEventCreateRequest struct {
Event *FulfillmentEvent `json:"event"`
}
type FulfillmentEventResource ¶
type FulfillmentEventResource struct { FulfillmentEvent *FulfillmentEvent `json:"fulfillment_event,omitempty"` Event *FulfillmentEvent `json:"event,omitempty"` }
type FulfillmentEventService ¶
type FulfillmentEventService interface { List(ctx context.Context, orderID int64, fulfillmentID int64) ([]FulfillmentEvent, error) Get(ctx context.Context, orderID int64, fulfillmentID int64, eventID int64) (*FulfillmentEvent, error) Create(ctx context.Context, orderID int64, fulfillmentID int64, event FulfillmentEvent) (*FulfillmentEvent, error) Delete(ctx context.Context, orderID int64, fulfillmentID int64, eventID int64) error }
FulfillmentEventService is an interface for interfacing with the fulfillment event service of the Shopify API. https://help.shopify.com/api/reference/fulfillmentevent
type FulfillmentEventServiceOp ¶
type FulfillmentEventServiceOp struct {
// contains filtered or unexported fields
}
FulfillmentEventServiceOp handles communication with the fulfillment event related methods of the Shopify API.
func (*FulfillmentEventServiceOp) Create ¶
func (s *FulfillmentEventServiceOp) Create(ctx context.Context, orderID int64, fulfillmentID int64, event FulfillmentEvent) (*FulfillmentEvent, error)
Create a new FulfillmentEvent
func (*FulfillmentEventServiceOp) Delete ¶
func (s *FulfillmentEventServiceOp) Delete(ctx context.Context, orderID int64, fulfillmentID int64, eventID int64) error
Delete an existing FulfillmentEvent
func (*FulfillmentEventServiceOp) Get ¶
func (s *FulfillmentEventServiceOp) Get(ctx context.Context, orderID int64, fulfillmentID int64, eventID int64) (*FulfillmentEvent, error)
Get a single FulfillmentEvent. The API returns the event under the 'fulfillment_event' key.
func (*FulfillmentEventServiceOp) List ¶
func (s *FulfillmentEventServiceOp) List(ctx context.Context, orderID int64, fulfillmentID int64) ([]FulfillmentEvent, error)
List of all FulfillmentEvents for an order's fulfillment. The API returns the list under the 'fulfillment_events' key.
type FulfillmentEventsResource ¶
type FulfillmentEventsResource struct {
FulfillmentEvents []FulfillmentEvent `json:"fulfillment_events"`
}
type FulfillmentOrder ¶
type FulfillmentOrder struct { Id int64 `json:"id,omitempty"` AssignedLocation FulfillmentOrderAssignedLocation `json:"assigned_location,omitempty"` AssignedLocationId int64 `json:"assigned_location_id,omitempty"` DeliveryMethod FulfillmentOrderDeliveryMethod `json:"delivery_method,omitempty"` Destination FulfillmentOrderDestination `json:"destination,omitempty"` FulfillAt *time.Time `json:"fulfill_at,omitempty"` FulfillBy *time.Time `json:"fulfill_by,omitempty"` FulfillmentHolds []FulfillmentOrderHold `json:"fulfillment_holds,omitempty"` InternationalDuties FulfillmentOrderInternationalDuties `json:"international_duties,omitempty"` LineItems []FulfillmentOrderLineItem `json:"line_items,omitempty"` MerchantRequests []FulfillmentOrderMerchantRequest `json:"merchant_requests,omitempty"` OrderId int64 `json:"order_id,omitempty"` RequestStatus string `json:"request_status,omitempty"` ShopId int64 `json:"shop_id,omitempty"` Status string `json:"status,omitempty"` SupportedActions []string `json:"supported_actions,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
FulfillmentOrder represents a Shopify Fulfillment Order
type FulfillmentOrderAssignedLocation ¶
type FulfillmentOrderAssignedLocation struct { Address1 string `json:"address1,omitempty"` Address2 string `json:"address2,omitempty"` City string `json:"city,omitempty"` CountryCode string `json:"country_code,omitempty"` LocationId int64 `json:"location_id,omitempty"` Name string `json:"name,omitempty"` Phone string `json:"phone,omitempty"` Province string `json:"province,omitempty"` Zip string `json:"zip,omitempty"` }
FulfillmentOrderAssignedLocation represents an AssignedLocation for a FulfillmentOrder
type FulfillmentOrderDeliveryMethod ¶
type FulfillmentOrderDeliveryMethod struct { Id int64 `json:"id,omitempty"` MethodType string `json:"method_type,omitempty"` MinDeliveryDateTime time.Time `json:"min_delivery_date_time,omitempty"` MaxDeliveryDateTime time.Time `json:"max_delivery_date_time,omitempty"` }
FulfillmentOrderDeliveryMethod represents a delivery method for a FulfillmentOrder
type FulfillmentOrderDestination ¶
type FulfillmentOrderDestination struct { Id int64 `json:"id,omitempty"` 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"` Email string `json:"email,omitempty"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` Phone string `json:"phone,omitempty"` Province string `json:"province,omitempty"` Zip string `json:"zip,omitempty"` }
FulfillmentOrderDestination represents a destination for a FulfillmentOrder
type FulfillmentOrderHold ¶
type FulfillmentOrderHold struct { Reason FulfillmentOrderHoldReason `json:"reason,omitempty"` ReasonNotes string `json:"reason_notes,omitempty"` }
FulfillmentOrderHold represents a fulfillment hold for a FulfillmentOrder
type FulfillmentOrderHoldReason ¶
type FulfillmentOrderHoldReason string
FulfillmentOrderHoldReason represents the reason for a fulfillment hold
const ( HoldReasonAwaitingPayment FulfillmentOrderHoldReason = "awaiting_payment" HoldReasonHighRiskOfFraud FulfillmentOrderHoldReason = "high_risk_of_fraud" HoldReasonIncorrectAddress FulfillmentOrderHoldReason = "incorrect_address" HoldReasonOutOfStock FulfillmentOrderHoldReason = "inventory_out_of_stock" HoldReasonOther FulfillmentOrderHoldReason = "other" )
type FulfillmentOrderInternationalDuties ¶
type FulfillmentOrderInternationalDuties struct {
IncoTerm string `json:"incoterm,omitempty"`
}
FulfillmentOrderInternationalDuties represents an InternationalDuty for a FulfillmentOrder
type FulfillmentOrderLineItem ¶
type FulfillmentOrderLineItem struct { Id int64 `json:"id,omitempty"` ShopId int64 `json:"shop_id,omitempty"` FulfillmentOrderId int64 `json:"fulfillment_order_id,omitempty"` LineItemId int64 `json:"line_item_id,omitempty"` InventoryItemId int64 `json:"inventory_item_id,omitempty"` Quantity int64 `json:"quantity,omitempty"` FulfillableQuantity int64 `json:"fulfillable_quantity,omitempty"` VariantId int64 `json:"variant_id,omitempty"` }
FulfillmentOrderLineItem represents a line item for a FulfillmentOrder
type FulfillmentOrderMerchantRequest ¶
type FulfillmentOrderMerchantRequest struct { Message string `json:"message,omitempty"` RequestOptions struct { ShippingMethod string `json:"shipping_method,omitempty"` Note string `json:"note,omitempty"` Date time.Time `json:"date,omitempty"` } `json:"request_options"` Kind string `json:"kind,omitempty"` }
FulfillmentOrderMerchantRequest represents a MerchantRequest for a FulfillmentOrder
type FulfillmentOrderMoveRequest ¶
type FulfillmentOrderMoveRequest struct { NewLocationId int64 `json:"new_location_id"` LineItems []FulfillmentOrderLineItemQuantity `json:"fulfillment_order_line_items,omitempty"` }
type FulfillmentOrderMoveResource ¶
type FulfillmentOrderMoveResource struct { OriginalFulfillmentOrder FulfillmentOrder `json:"original_fulfillment_order"` MovedFulfillmentOrder FulfillmentOrder `json:"moved_fulfillment_order"` }
FulfillmentOrderMoveResource represents the result from the move.json endpoint
type FulfillmentOrderResource ¶
type FulfillmentOrderResource struct {
FulfillmentOrder *FulfillmentOrder `json:"fulfillment_order"`
}
FulfillmentOrderResource represents the result from the fulfillment_orders/<id>.json endpoint
type FulfillmentOrderService ¶
type FulfillmentOrderService interface { List(context.Context, int64, interface{}) ([]FulfillmentOrder, error) Get(context.Context, int64, interface{}) (*FulfillmentOrder, error) Cancel(context.Context, int64) (*FulfillmentOrder, error) Close(context.Context, int64, string) (*FulfillmentOrder, error) Hold(context.Context, int64, bool, FulfillmentOrderHoldReason, string) (*FulfillmentOrder, error) Open(context.Context, int64) (*FulfillmentOrder, error) ReleaseHold(context.Context, int64) (*FulfillmentOrder, error) Reschedule(context.Context, int64) (*FulfillmentOrder, error) SetDeadline(context.Context, []int64, time.Time) error Move(context.Context, int64, FulfillmentOrderMoveRequest) (*FulfillmentOrderMoveResource, error) }
FulfillmentOrderService is an interface for interfacing with the fulfillment order endpoints of the Shopify API. https://shopify.dev/docs/api/admin-rest/2023-01/resources/fulfillmentorder#resource-object
type FulfillmentOrderServiceOp ¶
type FulfillmentOrderServiceOp struct {
// contains filtered or unexported fields
}
FulfillmentOrderServiceOp handles communication with the fulfillment order related methods of the Shopify API.
func (*FulfillmentOrderServiceOp) Cancel ¶
func (s *FulfillmentOrderServiceOp) Cancel(ctx context.Context, fulfillmentID int64) (*FulfillmentOrder, error)
Cancel cancels a fulfillment order
func (*FulfillmentOrderServiceOp) Close ¶
func (s *FulfillmentOrderServiceOp) Close(ctx context.Context, fulfillmentID int64, message string) (*FulfillmentOrder, error)
Close marks a fulfillment order as incomplete with an optional message
func (*FulfillmentOrderServiceOp) Get ¶
func (s *FulfillmentOrderServiceOp) Get(ctx context.Context, fulfillmentID int64, options interface{}) (*FulfillmentOrder, error)
Get gets an individual fulfillment order
func (*FulfillmentOrderServiceOp) Hold ¶
func (s *FulfillmentOrderServiceOp) Hold(ctx context.Context, fulfillmentID int64, notify bool, reason FulfillmentOrderHoldReason, notes string) (*FulfillmentOrder, error)
Hold applies a fulfillment hold on an open fulfillment order
func (*FulfillmentOrderServiceOp) List ¶
func (s *FulfillmentOrderServiceOp) List(ctx context.Context, orderId int64, options interface{}) ([]FulfillmentOrder, error)
List gets FulfillmentOrder items for an order
func (*FulfillmentOrderServiceOp) Move ¶
func (s *FulfillmentOrderServiceOp) Move(ctx context.Context, fulfillmentID int64, moveRequest FulfillmentOrderMoveRequest) (*FulfillmentOrderMoveResource, error)
Move moves a fulfillment order to a new location
func (*FulfillmentOrderServiceOp) Open ¶
func (s *FulfillmentOrderServiceOp) Open(ctx context.Context, fulfillmentID int64) (*FulfillmentOrder, error)
Open marks the fulfillment order as open
func (*FulfillmentOrderServiceOp) ReleaseHold ¶
func (s *FulfillmentOrderServiceOp) ReleaseHold(ctx context.Context, fulfillmentID int64) (*FulfillmentOrder, error)
ReleaseHold releases the fulfillment hold on a fulfillment order
func (*FulfillmentOrderServiceOp) Reschedule ¶
func (s *FulfillmentOrderServiceOp) Reschedule(ctx context.Context, fulfillmentID int64) (*FulfillmentOrder, error)
Reschedule reschedules the fulfill_at time of a scheduled fulfillment order
func (*FulfillmentOrderServiceOp) SetDeadline ¶
func (s *FulfillmentOrderServiceOp) SetDeadline(ctx context.Context, fulfillmentIDs []int64, deadline time.Time) error
SetDeadline sets deadline for fulfillment orders
type FulfillmentOrdersResource ¶
type FulfillmentOrdersResource struct {
FulfillmentOrders []FulfillmentOrder `json:"fulfillment_orders"`
}
FulfillmentOrdersResource represents the result from the fulfillment_orders.json endpoint
type FulfillmentRequest ¶
type FulfillmentRequest struct { Message string `json:"message,omitempty"` FulfillmentOrderLineItems []FulfillmentOrderLineItem `json:"fulfillment_order_line_items,omitempty"` Reason string `json:"reason,omitempty"` LineItems []FulfillmentRequestLineItem `json:"line_items,omitempty"` }
type FulfillmentRequestResource ¶
type FulfillmentRequestResource struct { FulfillmentOrder *FulfillmentOrder `json:"fulfillment_order,omitempty"` FulfillmentRequest FulfillmentRequest `json:"fulfillment_request,omitempty"` OriginalFulfillmentOrder *FulfillmentOrder `json:"original_fulfillment_order,omitempty"` }
type FulfillmentRequestService ¶
type FulfillmentRequestService interface { Send(context.Context, int64, FulfillmentRequest) (*FulfillmentOrder, error) Accept(context.Context, int64, FulfillmentRequest) (*FulfillmentOrder, error) Reject(context.Context, int64, FulfillmentRequest) (*FulfillmentOrder, error) }
FulfillmentRequestService is an interface for interfacing with the fulfillment request endpoints of the Shopify API. https://shopify.dev/docs/api/admin-rest/2023-10/resources/fulfillmentrequest
type FulfillmentRequestServiceOp ¶
type FulfillmentRequestServiceOp struct {
// contains filtered or unexported fields
}
FulfillmentRequestServiceOp handles communication with the fulfillment request related methods of the Shopify API.
func (*FulfillmentRequestServiceOp) Accept ¶
func (s *FulfillmentRequestServiceOp) Accept(ctx context.Context, fulfillmentOrderID int64, request FulfillmentRequest) (*FulfillmentOrder, error)
Accept accepts a fulfillment request sent to a fulfillment service for a fulfillment order.
func (*FulfillmentRequestServiceOp) Reject ¶
func (s *FulfillmentRequestServiceOp) Reject(ctx context.Context, fulfillmentOrderID int64, request FulfillmentRequest) (*FulfillmentOrder, error)
Reject rejects a fulfillment request sent to a fulfillment service for a fulfillment order.
func (*FulfillmentRequestServiceOp) Send ¶
func (s *FulfillmentRequestServiceOp) Send(ctx context.Context, fulfillmentOrderID int64, request FulfillmentRequest) (*FulfillmentOrder, error)
Send sends a fulfillment request to the fulfillment service of a fulfillment order.
type FulfillmentResource ¶
type FulfillmentResource struct {
Fulfillment *Fulfillment `json:"fulfillment"`
}
FulfillmentResource represents the result from the fulfillments/X.json endpoint
type FulfillmentService ¶
type FulfillmentService interface { List(context.Context, interface{}) ([]Fulfillment, error) Count(context.Context, interface{}) (int, error) Get(context.Context, int64, interface{}) (*Fulfillment, error) Create(context.Context, Fulfillment) (*Fulfillment, error) Update(context.Context, Fulfillment) (*Fulfillment, error) Complete(context.Context, int64) (*Fulfillment, error) Transition(context.Context, int64) (*Fulfillment, error) Cancel(context.Context, int64) (*Fulfillment, error) }
FulfillmentService is an interface for interfacing with the fulfillment endpoints of the Shopify API. https://help.shopify.com/api/reference/fulfillment
type FulfillmentServiceData ¶
type FulfillmentServiceData struct { Id int64 `json:"id,omitempty"` Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` ServiceName string `json:"service_name,omitempty"` Handle string `json:"handle,omitempty"` FulfillmentOrdersOptIn bool `json:"fulfillment_orders_opt_in,omitempty"` IncludePendingStock bool `json:"include_pending_stock,omitempty"` ProviderId int64 `json:"provider_id,omitempty"` LocationId int64 `json:"location_id,omitempty"` CallbackURL string `json:"callback_url,omitempty"` TrackingSupport bool `json:"tracking_support,omitempty"` InventoryManagement bool `json:"inventory_management,omitempty"` AdminGraphqlApiId string `json:"admin_graphql_api_id,omitempty"` PermitsSkuSharing bool `json:"permits_sku_sharing,omitempty"` RequiresShippingMethod bool `json:"requires_shipping_method,omitempty"` Format string `json:"format,omitempty"` }
type FulfillmentServiceOp ¶
type FulfillmentServiceOp struct {
// contains filtered or unexported fields
}
FulfillmentServiceOp handles communication with the fulfillment related methods of the Shopify API.
func (*FulfillmentServiceOp) Cancel ¶
func (s *FulfillmentServiceOp) Cancel(ctx context.Context, fulfillmentID int64) (*Fulfillment, error)
Cancel an existing fulfillment
func (*FulfillmentServiceOp) Complete ¶
func (s *FulfillmentServiceOp) Complete(ctx context.Context, fulfillmentID int64) (*Fulfillment, error)
Complete an existing fulfillment
func (*FulfillmentServiceOp) Count ¶
func (s *FulfillmentServiceOp) Count(ctx context.Context, options interface{}) (int, error)
Count fulfillments
func (*FulfillmentServiceOp) Create ¶
func (s *FulfillmentServiceOp) Create(ctx context.Context, fulfillment Fulfillment) (*Fulfillment, error)
Create a new fulfillment
func (*FulfillmentServiceOp) Get ¶
func (s *FulfillmentServiceOp) Get(ctx context.Context, fulfillmentID int64, options interface{}) (*Fulfillment, error)
Get individual fulfillment
func (*FulfillmentServiceOp) List ¶
func (s *FulfillmentServiceOp) List(ctx context.Context, options interface{}) ([]Fulfillment, error)
List fulfillments
func (*FulfillmentServiceOp) Transition ¶
func (s *FulfillmentServiceOp) Transition(ctx context.Context, fulfillmentID int64) (*Fulfillment, error)
Transition an existing fulfillment
func (*FulfillmentServiceOp) Update ¶
func (s *FulfillmentServiceOp) Update(ctx context.Context, fulfillment Fulfillment) (*Fulfillment, error)
Update an existing fulfillment
type FulfillmentServiceOptions ¶
type FulfillmentServiceOptions struct {
Scope string `url:"scope,omitempty"`
}
type FulfillmentServiceResource ¶
type FulfillmentServiceResource struct {
FulfillmentService *FulfillmentServiceData `json:"fulfillment_service,omitempty"`
}
type FulfillmentServiceService ¶
type FulfillmentServiceService interface { List(context.Context, interface{}) ([]FulfillmentServiceData, error) Get(context.Context, int64, interface{}) (*FulfillmentServiceData, error) Create(context.Context, FulfillmentServiceData) (*FulfillmentServiceData, error) Update(context.Context, FulfillmentServiceData) (*FulfillmentServiceData, error) Delete(context.Context, int64) error }
FulfillmentServiceService is an interface for interfacing with the fulfillment service of the Shopify API. https://help.shopify.com/api/reference/fulfillmentservice
type FulfillmentServiceServiceOp ¶
type FulfillmentServiceServiceOp struct {
// contains filtered or unexported fields
}
FulfillmentServiceServiceOp handles communication with the FulfillmentServices related methods of the Shopify API
func (*FulfillmentServiceServiceOp) Create ¶
func (s *FulfillmentServiceServiceOp) Create(ctx context.Context, fulfillmentService FulfillmentServiceData) (*FulfillmentServiceData, error)
Create Create a new FulfillmentServiceData
func (*FulfillmentServiceServiceOp) Delete ¶
func (s *FulfillmentServiceServiceOp) Delete(ctx context.Context, fulfillmentServiceId int64) error
Delete Remove an existing FulfillmentServiceData
func (*FulfillmentServiceServiceOp) Get ¶
func (s *FulfillmentServiceServiceOp) Get(ctx context.Context, fulfillmentServiceId int64, options interface{}) (*FulfillmentServiceData, error)
Get Receive a single FulfillmentServiceData
func (*FulfillmentServiceServiceOp) List ¶
func (s *FulfillmentServiceServiceOp) List(ctx context.Context, options interface{}) ([]FulfillmentServiceData, error)
List Receive a list of all FulfillmentServiceData
func (*FulfillmentServiceServiceOp) Update ¶
func (s *FulfillmentServiceServiceOp) Update(ctx context.Context, fulfillmentService FulfillmentServiceData) (*FulfillmentServiceData, error)
Update Modify an existing FulfillmentServiceData
type FulfillmentServicesResource ¶
type FulfillmentServicesResource struct {
FulfillmentServices []FulfillmentServiceData `json:"fulfillment_services,omitempty"`
}
type FulfillmentTrackingInfo ¶
type FulfillmentTrackingInfo struct { Company string `json:"company,omitempty"` Number string `json:"number,omitempty"` Url string `json:"url,omitempty"` }
FulfillmentTrackingInfo represents the tracking information used to create a Fulfillment. https://shopify.dev/docs/api/admin-rest/2023-01/resources/fulfillment#post-fulfillments
type FulfillmentsResource ¶
type FulfillmentsResource struct {
Fulfillments []Fulfillment `json:"fulfillments"`
}
FulfillmentsResource represents the result from the fullfilments.json endpoint
type FulfillmentsService ¶
type FulfillmentsService interface { ListFulfillments(context.Context, int64, interface{}) ([]Fulfillment, error) CountFulfillments(context.Context, int64, interface{}) (int, error) GetFulfillment(context.Context, int64, int64, interface{}) (*Fulfillment, error) CreateFulfillment(context.Context, int64, Fulfillment) (*Fulfillment, error) UpdateFulfillment(context.Context, int64, Fulfillment) (*Fulfillment, error) CompleteFulfillment(context.Context, int64, int64) (*Fulfillment, error) TransitionFulfillment(context.Context, int64, int64) (*Fulfillment, error) CancelFulfillment(context.Context, int64, int64) (*Fulfillment, error) }
FulfillmentsService is an interface for other Shopify resources to interface with the fulfillment endpoints of the Shopify API. https://help.shopify.com/api/reference/fulfillment
type GiftCard ¶
type GiftCard struct { ID int64 `json:"id,omitempty"` ApiClientId int64 `json:"api_client_id,omitempty"` Balance *decimal.Decimal `json:"balance,omitempty"` InitalValue *decimal.Decimal `json:"initial_value,omitempty"` Code string `json:"code,omitempty"` Currency string `json:"currency,omitempty"` CustomerID *CustomerID `json:"customer_id,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` DisabledAt *time.Time `json:"disabled_at,omitempty"` ExpiresOn string `json:"expires_on,omitempty"` LastCharacters string `json:"last_characters,omitempty"` LineItemID int64 `json:"line_item_id,omitempty"` Note string `json:"note,omitempty"` OrderID int64 `json:"order_id,omitempty"` TemplateSuffix string `json:"template_suffix,omitempty"` UserID int64 `json:"user_id,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
giftCard represents a Shopify discount rule
type GiftCardResource ¶
type GiftCardResource struct {
GiftCard *GiftCard `json:"gift_card"`
}
giftCardResource represents the result from the gift_cards/X.json endpoint
type GiftCardService ¶
type GiftCardService interface { Get(context.Context, int64) (*GiftCard, error) Create(context.Context, GiftCard) (*GiftCard, error) Update(context.Context, GiftCard) (*GiftCard, error) List(context.Context) ([]GiftCard, error) Disable(context.Context, int64) (*GiftCard, error) Count(context.Context, interface{}) (int, error) }
giftCardService is an interface for interfacing with the gift card endpoints of the Shopify API. See: https://shopify.dev/docs/api/admin-rest/2023-04/resources/gift-card
type GiftCardServiceOp ¶
type GiftCardServiceOp struct {
// contains filtered or unexported fields
}
giftCardServiceOp handles communication with the gift card related methods of the Shopify API.
func (*GiftCardServiceOp) Count ¶
func (s *GiftCardServiceOp) Count(ctx context.Context, options interface{}) (int, error)
Count retrieves the number of gift cards
type GiftCardsResource ¶
type GiftCardsResource struct {
GiftCards []GiftCard `json:"gift_cards"`
}
giftCardsResource represents the result from the gift_cards.json endpoint
type GraphQLCost ¶
type GraphQLCost struct { RequestedQueryCost int `json:"requestedQueryCost"` ActualQueryCost *int `json:"actualQueryCost"` ThrottleStatus GraphQLThrottleStatus `json:"throttleStatus"` }
GraphQLCost represents the cost of the graphql query
func (GraphQLCost) RetryAfterSeconds ¶
func (c GraphQLCost) RetryAfterSeconds() float64
RetryAfterSeconds returns the estimated retry after seconds based on the requested query cost and throttle status
type GraphQLService ¶
GraphQLService is an interface to interact with the graphql endpoint of the Shopify API See https://shopify.dev/docs/admin-api/graphql/reference
type GraphQLServiceOp ¶
type GraphQLServiceOp struct {
// contains filtered or unexported fields
}
GraphQLServiceOp handles communication with the graphql endpoint of the Shopify API.
type GraphQLThrottleStatus ¶
type GraphQLThrottleStatus struct { MaximumAvailable float64 `json:"maximumAvailable"` CurrentlyAvailable float64 `json:"currentlyAvailable"` RestoreRate float64 `json:"restoreRate"` }
GraphQLThrottleStatus represents the status of the shop's rate limit points
type Image ¶
type Image struct { ID int64 `json:"id,omitempty"` ProductID int64 `json:"product_id,omitempty"` Position int `json:"position,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` Width int `json:"width,omitempty"` Height int `json:"height,omitempty"` Src string `json:"src,omitempty"` Attachment string `json:"attachment,omitempty"` Filename string `json:"filename,omitempty"` VariantIds []int64 `json:"variant_ids,omitempty"` AdminGraphqlApiId string `json:"admin_graphql_api_id,omitempty"` }
Image represents a Shopify product's image.
type ImageResource ¶
type ImageResource struct {
Image *Image `json:"image"`
}
ImageResource represents the result form the products/X/images/Y.json endpoint
type ImageService ¶
type ImageService interface { List(context.Context, int64, interface{}) ([]Image, error) Count(context.Context, int64, interface{}) (int, error) Get(context.Context, int64, int64, interface{}) (*Image, error) Create(context.Context, int64, Image) (*Image, error) Update(context.Context, int64, Image) (*Image, error) Delete(context.Context, int64, int64) error }
ImageService is an interface for interacting with the image endpoints of the Shopify API. See https://help.shopify.com/api/reference/product_image
type ImageServiceOp ¶
type ImageServiceOp struct {
// contains filtered or unexported fields
}
ImageServiceOp handles communication with the image related methods of the Shopify API.
func (*ImageServiceOp) Count ¶
func (s *ImageServiceOp) Count(ctx context.Context, productID int64, options interface{}) (int, error)
Count images
func (*ImageServiceOp) Create ¶
Create a new image
There are 2 methods of creating an image in Shopify: 1. Src 2. Filename and Attachment
If both Image.Filename and Image.Attachment are supplied, then Image.Src is not needed. And vice versa.
If both Image.Attachment and Image.Src are provided, Shopify will take the attachment.
Shopify will accept Image.Attachment without Image.Filename.
func (*ImageServiceOp) Get ¶
func (s *ImageServiceOp) Get(ctx context.Context, productID int64, imageID int64, options interface{}) (*Image, error)
Get individual image
type ImagesResource ¶
type ImagesResource struct {
Images []Image `json:"images"`
}
ImagesResource represents the result from the products/X/images.json endpoint
type InventoryItem ¶
type InventoryItem struct { ID int64 `json:"id,omitempty"` SKU string `json:"sku,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` Cost *decimal.Decimal `json:"cost,omitempty"` Tracked *bool `json:"tracked,omitempty"` AdminGraphqlAPIID string `json:"admin_graphql_api_id,omitempty"` CountryCodeOfOrigin *string `json:"country_code_of_origin"` CountryHarmonizedSystemCodes []string `json:"country_harmonized_system_codes"` HarmonizedSystemCode *string `json:"harmonized_system_code"` ProvinceCodeOfOrigin *string `json:"province_code_of_origin"` }
InventoryItem represents a Shopify inventory item
type InventoryItemResource ¶
type InventoryItemResource struct {
InventoryItem *InventoryItem `json:"inventory_item"`
}
InventoryItemResource is used for handling single item requests and responses
type InventoryItemService ¶
type InventoryItemService interface { List(context.Context, interface{}) ([]InventoryItem, error) Get(context.Context, int64, interface{}) (*InventoryItem, error) Update(context.Context, InventoryItem) (*InventoryItem, error) }
InventoryItemService is an interface for interacting with the inventory items endpoints of the Shopify API See https://help.shopify.com/en/api/reference/inventory/inventoryitem
type InventoryItemServiceOp ¶
type InventoryItemServiceOp struct {
// contains filtered or unexported fields
}
InventoryItemServiceOp is the default implementation of the InventoryItemService interface
func (*InventoryItemServiceOp) Get ¶
func (s *InventoryItemServiceOp) Get(ctx context.Context, id int64, options interface{}) (*InventoryItem, error)
Get a inventory item
func (*InventoryItemServiceOp) List ¶
func (s *InventoryItemServiceOp) List(ctx context.Context, options interface{}) ([]InventoryItem, error)
List inventory items
func (*InventoryItemServiceOp) Update ¶
func (s *InventoryItemServiceOp) Update(ctx context.Context, item InventoryItem) (*InventoryItem, error)
Update a inventory item
type InventoryItemsResource ¶
type InventoryItemsResource struct {
InventoryItems []InventoryItem `json:"inventory_items"`
}
InventoryItemsResource is used for handling multiple item responsees
type InventoryLevel ¶
type InventoryLevel struct { InventoryItemId int64 `json:"inventory_item_id,omitempty"` LocationId int64 `json:"location_id,omitempty"` Available int `json:"available"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` AdminGraphqlApiId string `json:"admin_graphql_api_id,omitempty"` }
InventoryLevel represents a Shopify inventory level
type InventoryLevelAdjustOptions ¶
type InventoryLevelAdjustOptions struct { InventoryItemId int64 `json:"inventory_item_id"` LocationId int64 `json:"location_id"` Adjust int `json:"available_adjustment"` }
InventoryLevelAdjustOptions is used for Adjust inventory levels
type InventoryLevelListOptions ¶
type InventoryLevelListOptions struct { InventoryItemIds []int64 `url:"inventory_item_ids,omitempty,comma"` LocationIds []int64 `url:"location_ids,omitempty,comma"` Limit int `url:"limit,omitempty"` UpdatedAtMin time.Time `url:"updated_at_min,omitempty"` }
InventoryLevelListOptions is used for get list
type InventoryLevelResource ¶
type InventoryLevelResource struct {
InventoryLevel *InventoryLevel `json:"inventory_level"`
}
InventoryLevelResource is used for handling single level requests and responses
type InventoryLevelService ¶
type InventoryLevelService interface { List(context.Context, interface{}) ([]InventoryLevel, error) Adjust(context.Context, interface{}) (*InventoryLevel, error) Delete(context.Context, int64, int64) error Connect(context.Context, InventoryLevel) (*InventoryLevel, error) Set(context.Context, InventoryLevel) (*InventoryLevel, error) }
InventoryLevelService is an interface for interacting with the inventory items endpoints of the Shopify API See https://help.shopify.com/en/api/reference/inventory/inventorylevel
type InventoryLevelServiceOp ¶
type InventoryLevelServiceOp struct {
// contains filtered or unexported fields
}
InventoryLevelServiceOp is the default implementation of the InventoryLevelService interface
func (*InventoryLevelServiceOp) Adjust ¶
func (s *InventoryLevelServiceOp) Adjust(ctx context.Context, options interface{}) (*InventoryLevel, error)
Adjust the inventory level of an inventory item at a single location
func (*InventoryLevelServiceOp) Connect ¶
func (s *InventoryLevelServiceOp) Connect(ctx context.Context, level InventoryLevel) (*InventoryLevel, error)
Connect an inventory level
func (*InventoryLevelServiceOp) Delete ¶
func (s *InventoryLevelServiceOp) Delete(ctx context.Context, itemId, locationId int64) error
Delete an inventory level
func (*InventoryLevelServiceOp) List ¶
func (s *InventoryLevelServiceOp) List(ctx context.Context, options interface{}) ([]InventoryLevel, error)
List inventory levels
func (*InventoryLevelServiceOp) Set ¶
func (s *InventoryLevelServiceOp) Set(ctx context.Context, level InventoryLevel) (*InventoryLevel, error)
Set an inventory level
type InventoryLevelsResource ¶
type InventoryLevelsResource struct {
InventoryLevels []InventoryLevel `json:"inventory_levels"`
}
InventoryLevelsResource is used for handling multiple item responsees
type LeveledLogger ¶
type LeveledLogger struct { // Level is the minimum logging level that will be emitted by this logger. // // For example, a Level set to LevelWarn will emit warnings and errors, but // not informational or debug messages. // // Always set this with a constant like LevelWarn because the individual // values are not guaranteed to be stable. Level int // contains filtered or unexported fields }
It prints warnings and errors to `os.Stderr` and other messages to `os.Stdout`.
func (*LeveledLogger) Debugf ¶
func (l *LeveledLogger) Debugf(format string, v ...interface{})
Debugf logs a debug message using Printf conventions.
func (*LeveledLogger) Errorf ¶
func (l *LeveledLogger) Errorf(format string, v ...interface{})
Errorf logs a warning message using Printf conventions.
func (*LeveledLogger) Infof ¶
func (l *LeveledLogger) Infof(format string, v ...interface{})
Infof logs an informational message using Printf conventions.
func (*LeveledLogger) Warnf ¶
func (l *LeveledLogger) Warnf(format string, v ...interface{})
Warnf logs a warning message using Printf conventions.
type LeveledLoggerInterface ¶
type LineItem ¶
type LineItem struct { ID int64 `json:"id,omitempty"` ProductID int64 `json:"product_id,omitempty"` VariantID int64 `json:"variant_id,omitempty"` Quantity int `json:"quantity,omitempty"` Price *decimal.Decimal `json:"price,omitempty"` TotalDiscount *decimal.Decimal `json:"total_discount,omitempty"` Title string `json:"title,omitempty"` VariantTitle string `json:"variant_title,omitempty"` Name string `json:"name,omitempty"` SKU string `json:"sku,omitempty"` Vendor string `json:"vendor,omitempty"` GiftCard bool `json:"gift_card,omitempty"` Taxable bool `json:"taxable,omitempty"` FulfillmentService string `json:"fulfillment_service,omitempty"` RequiresShipping bool `json:"requires_shipping,omitempty"` VariantInventoryManagement string `json:"variant_inventory_management,omitempty"` PreTaxPrice *decimal.Decimal `json:"pre_tax_price,omitempty"` Properties []NoteAttribute `json:"properties,omitempty"` ProductExists bool `json:"product_exists,omitempty"` FulfillableQuantity int `json:"fulfillable_quantity,omitempty"` Grams int `json:"grams,omitempty"` FulfillmentStatus orderFulfillmentStatus `json:"fulfillment_status,omitempty"` TaxLines []TaxLine `json:"tax_lines,omitempty"` // Deprecated: See 2022-10 release notes: https://shopify.dev/docs/api/release-notes/2022-10 OriginLocation *Address `json:"origin_location,omitempty"` // Deprecated: See 2022-10 release notes: https://shopify.dev/docs/api/release-notes/2022-10 DestinationLocation *Address `json:"destination_location,omitempty"` AppliedDiscount *AppliedDiscount `json:"applied_discount,omitempty"` DiscountAllocations []DiscountAllocations `json:"discount_allocations,omitempty"` }
func (*LineItem) UnmarshalJSON ¶
UnmarshalJSON custom unmarsaller for LineItem required to mitigate some older orders having LineItem.Properies which are empty JSON objects rather than the expected array.
type LineItemByFulfillmentOrder ¶
type LineItemByFulfillmentOrder struct { FulfillmentOrderID int64 `json:"fulfillment_order_id,omitempty"` FulfillmentOrderLineItems []LineItemByFulfillmentOrderItemQuantity `json:"fulfillment_order_line_items,omitempty"` }
LineItemByFulfillmentOrder represents the FulfillmentOrders (and optionally the items) used to create a Fulfillment. https://shopify.dev/docs/api/admin-rest/2023-01/resources/fulfillment#post-fulfillments
type LineItemByFulfillmentOrderItemQuantity ¶
type LineItemByFulfillmentOrderItemQuantity struct { Id int64 `json:"id"` Quantity int64 `json:"quantity"` }
LineItemByFulfillmentOrderItemQuantity represents the quantity to fulfill for one item.
type LineItemProperty ¶
type LineItemProperty struct {
Message string `json:"message"`
}
type ListCarrierResource ¶
type ListCarrierResource struct {
CarrierServices []CarrierService `json:"carrier_services"`
}
type ListOptions ¶
type ListOptions struct { // PageInfo is used with new pagination search. PageInfo string `url:"page_info,omitempty"` // Page is used to specify a specific page to load. // It is the deprecated way to do pagination. Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` SinceID int64 `url:"since_id,omitempty"` 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"` Order string `url:"order,omitempty"` Fields string `url:"fields,omitempty"` Vendor string `url:"vendor,omitempty"` IDs []int64 `url:"ids,omitempty,comma"` }
General list options that can be used for most collections of entities.
type Location ¶
type Location struct { // Whether the location is active.If true, then the location can be used to sell products, // stock inventory, and fulfill orders.Merchants can deactivate locations from the Shopify admin. // Deactivated locations don't contribute to the shop's location limit. Active bool `json:"active"` // The first line of the address. Address1 string `json:"address1"` // The second line of the address. Address2 string `json:"address2"` // The city the location is in. City string `json:"city"` // The country the location is in. Country string `json:"country"` // The two-letter code (ISO 3166-1 alpha-2 format) corresponding to country the location is in. CountryCode string `json:"country_code"` CountryName string `json:"country_name"` // The date and time (ISO 8601 format) when the location was created. CreatedAt time.Time `json:"created_at"` // The ID for the location. ID int64 `json:"id"` // Whether this is a fulfillment service location. // If true, then the location is a fulfillment service location. // If false, then the location was created by the merchant and isn't tied to a fulfillment service. Legacy bool `json:"legacy"` // The name of the location. Name string `json:"name"` // The phone number of the location.This value can contain special characters like - and +. Phone string `json:"phone"` // The province the location is in. Province string `json:"province"` // The two-letter code corresponding to province or state the location is in. ProvinceCode string `json:"province_code"` // The date and time (ISO 8601 format) when the location was last updated. UpdatedAt time.Time `json:"updated_at"` // The zip or postal code. Zip string `json:"zip"` AdminGraphqlAPIID string `json:"admin_graphql_api_id"` }
type LocationResource ¶
type LocationResource struct {
Location *Location `json:"location"`
}
Represents the result from the locations/X.json endpoint
type LocationService ¶
type LocationService interface { // Retrieves a list of locations List(ctx context.Context, options interface{}) ([]Location, error) // Retrieves a single location by its ID Get(ctx context.Context, id int64, options interface{}) (*Location, error) // Retrieves a count of locations Count(ctx context.Context, options interface{}) (int, error) }
LocationService is an interface for interfacing with the location endpoints of the Shopify API. See: https://help.shopify.com/en/api/reference/inventory/location
type LocationServiceOp ¶
type LocationServiceOp struct {
// contains filtered or unexported fields
}
LocationServiceOp handles communication with the location related methods of the Shopify API.
func (*LocationServiceOp) Count ¶
func (s *LocationServiceOp) Count(ctx context.Context, options interface{}) (int, error)
type LocationsResource ¶
type LocationsResource struct {
Locations []Location `json:"locations"`
}
Represents the result from the locations.json endpoint
type Metafield ¶
type Metafield struct { CreatedAt *time.Time `json:"created_at,omitempty"` Description string `json:"description,omitempty"` // Description of the metafield. ID int64 `json:"id,omitempty"` // Assigned by Shopify, used for updating a metafield. Key string `json:"key,omitempty"` // The unique identifier for a metafield within its namespace, 3-64 characters long. Namespace string `json:"namespace,omitempty"` // The container for a group of metafields, 3-255 characters long. OwnerId int64 `json:"owner_id,omitempty"` // The unique ID of the resource the metafield is for, i.e.: an Order ID. OwnerResource string `json:"owner_resource,omitempty"` // The type of reserouce the metafield is for, i.e.: and Order. UpdatedAt *time.Time `json:"updated_at,omitempty"` // Value interface{} `json:"value,omitempty"` // The data stored in the metafield. Always stored as a string, use Type field for actual data type. Type metafieldType `json:"type,omitempty"` // One of Shopify's defined types, see metafieldType. AdminGraphqlAPIID string `json:"admin_graphql_api_id,omitempty"` }
Metafield represents a Shopify metafield.
type MetafieldResource ¶
type MetafieldResource struct {
Metafield *Metafield `json:"metafield"`
}
MetafieldResource represents the result from the metafields/X.json endpoint
type MetafieldService ¶
type MetafieldService interface { List(context.Context, interface{}) ([]Metafield, error) Count(context.Context, interface{}) (int, error) Get(context.Context, int64, interface{}) (*Metafield, error) Create(context.Context, Metafield) (*Metafield, error) Update(context.Context, Metafield) (*Metafield, error) Delete(context.Context, int64) error }
MetafieldService is an interface for interfacing with the metafield endpoints of the Shopify API. https://help.shopify.com/api/reference/metafield
type MetafieldServiceOp ¶
type MetafieldServiceOp struct {
// contains filtered or unexported fields
}
MetafieldServiceOp handles communication with the metafield related methods of the Shopify API.
func (*MetafieldServiceOp) Count ¶
func (s *MetafieldServiceOp) Count(ctx context.Context, options interface{}) (int, error)
Count metafields
func (*MetafieldServiceOp) Delete ¶
func (s *MetafieldServiceOp) Delete(ctx context.Context, metafieldID int64) error
Delete an existing metafield
func (*MetafieldServiceOp) Get ¶
func (s *MetafieldServiceOp) Get(ctx context.Context, metafieldID int64, options interface{}) (*Metafield, error)
Get individual metafield
type MetafieldsResource ¶
type MetafieldsResource struct {
Metafields []Metafield `json:"metafields"`
}
MetafieldsResource represents the result from the metafields.json endpoint
type MetafieldsService ¶
type MetafieldsService interface { ListMetafields(context.Context, int64, interface{}) ([]Metafield, error) CountMetafields(context.Context, int64, interface{}) (int, error) GetMetafield(context.Context, int64, int64, interface{}) (*Metafield, error) CreateMetafield(context.Context, int64, Metafield) (*Metafield, error) UpdateMetafield(context.Context, int64, Metafield) (*Metafield, error) DeleteMetafield(context.Context, int64, int64) error }
MetafieldsService is an interface for other Shopify resources to interface with the metafield endpoints of the Shopify API. https://help.shopify.com/api/reference/metafield
type NoteAttribute ¶
type NoteAttribute struct { Name string `json:"name,omitempty"` Value interface{} `json:"value,omitempty"` }
type OnlyDate ¶
func (*OnlyDate) EncodeValues ¶
It seems shopify accepts both the date with double-quotes and without them, so we just stick to the double-quotes for now.
func (*OnlyDate) MarshalJSON ¶
func (*OnlyDate) UnmarshalJSON ¶
type Option ¶
type Option func(c *Client)
Option is used to configure client with options
func WithHTTPClient ¶
WithHTTPClient is used to set a custom http client
func WithLogger ¶
func WithLogger(logger LeveledLoggerInterface) Option
func WithRetry ¶
WithRetry sets the number of times a request will be retried if a rate limit or service unavailable error is returned. Rate limiting can be either REST API limits or GraphQL Cost limits
func WithVersion ¶
WithVersion optionally sets the api-version if the passed string is valid
type Order ¶
type Order struct { ID int64 `json:"id,omitempty"` Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` CancelledAt *time.Time `json:"cancelled_at,omitempty"` ClosedAt *time.Time `json:"closed_at,omitempty"` ProcessedAt *time.Time `json:"processed_at,omitempty"` Customer *Customer `json:"customer,omitempty"` BillingAddress *Address `json:"billing_address,omitempty"` ShippingAddress *Address `json:"shipping_address,omitempty"` Currency string `json:"currency,omitempty"` TotalPrice *decimal.Decimal `json:"total_price,omitempty"` TotalPriceSet *AmountSet `json:"total_price_set,omitempty"` TotalShippingPriceSet *AmountSet `json:"total_shipping_price_set,omitempty"` CurrentTotalPrice *decimal.Decimal `json:"current_total_price,omitempty"` SubtotalPrice *decimal.Decimal `json:"subtotal_price,omitempty"` CurrentSubtotalPrice *decimal.Decimal `json:"current_subtotal_price,omitempty"` TotalDiscounts *decimal.Decimal `json:"total_discounts,omitempty"` CurrentTotalDiscounts *decimal.Decimal `json:"current_total_discounts,omitempty"` TotalLineItemsPrice *decimal.Decimal `json:"total_line_items_price,omitempty"` TaxesIncluded bool `json:"taxes_included,omitempty"` TotalTax *decimal.Decimal `json:"total_tax,omitempty"` TotalTaxSet *AmountSet `json:"total_tax_set,omitempty"` CurrentTotalTax *decimal.Decimal `json:"current_total_tax,omitempty"` TaxLines []TaxLine `json:"tax_lines,omitempty"` TotalWeight int `json:"total_weight,omitempty"` FinancialStatus orderFinancialStatus `json:"financial_status,omitempty"` Fulfillments []Fulfillment `json:"fulfillments,omitempty"` FulfillmentStatus orderFulfillmentStatus `json:"fulfillment_status,omitempty"` Token string `json:"token,omitempty"` CartToken string `json:"cart_token,omitempty"` Number int `json:"number,omitempty"` OrderNumber int `json:"order_number,omitempty"` Note string `json:"note,omitempty"` Test bool `json:"test,omitempty"` BrowserIp string `json:"browser_ip,omitempty"` BuyerAcceptsMarketing bool `json:"buyer_accepts_marketing,omitempty"` CancelReason orderCancelReason `json:"cancel_reason,omitempty"` NoteAttributes []NoteAttribute `json:"note_attributes,omitempty"` DiscountCodes []DiscountCode `json:"discount_codes,omitempty"` LineItems []LineItem `json:"line_items,omitempty"` ShippingLines []ShippingLines `json:"shipping_lines,omitempty"` Transactions []Transaction `json:"transactions,omitempty"` AppID int `json:"app_id,omitempty"` CustomerLocale string `json:"customer_locale,omitempty"` LandingSite string `json:"landing_site,omitempty"` ReferringSite string `json:"referring_site,omitempty"` SourceName string `json:"source_name,omitempty"` ClientDetails *ClientDetails `json:"client_details,omitempty"` Tags string `json:"tags,omitempty"` LocationId int64 `json:"location_id,omitempty"` PaymentGatewayNames []string `json:"payment_gateway_names,omitempty"` ProcessingMethod string `json:"processing_method,omitempty"` Refunds []Refund `json:"refunds,omitempty"` UserId int64 `json:"user_id,omitempty"` OrderStatusUrl string `json:"order_status_url,omitempty"` Gateway string `json:"gateway,omitempty"` Confirmed bool `json:"confirmed,omitempty"` CheckoutToken string `json:"checkout_token,omitempty"` Reference string `json:"reference,omitempty"` SourceIdentifier string `json:"source_identifier,omitempty"` SourceURL string `json:"source_url,omitempty"` DeviceID int64 `json:"device_id,omitempty"` Phone string `json:"phone,omitempty"` LandingSiteRef string `json:"landing_site_ref,omitempty"` CheckoutID int64 `json:"checkout_id,omitempty"` ContactEmail string `json:"contact_email,omitempty"` Metafields []Metafield `json:"metafields,omitempty"` SendReceipt bool `json:"send_receipt,omitempty"` SendFulfillmentReceipt bool `json:"send_fulfillment_receipt,omitempty"` }
Order represents a Shopify order
type OrderAdjustment ¶
type OrderAdjustment struct { Id int64 `json:"id,omitempty"` OrderId int64 `json:"order_id,omitempty"` RefundId int64 `json:"refund_id,omitempty"` Amount *decimal.Decimal `json:"amount,omitempty"` TaxAmount *decimal.Decimal `json:"tax_amount,omitempty"` Kind OrderAdjustmentType `json:"kind,omitempty"` Reason string `json:"reason,omitempty"` AmountSet *AmountSet `json:"amount_set,omitempty"` TaxAmountSet *AmountSet `json:"tax_amount_set,omitempty"` }
type OrderAdjustmentType ¶
type OrderAdjustmentType string
const ( OrderAdjustmentTypeShippingRefund OrderAdjustmentType = "shipping_refund" OrderAdjustmentTypeRefundDiscrepancy OrderAdjustmentType = "refund_discrepancy" )
type OrderCancelOptions ¶
type OrderCancelOptions struct { Amount *decimal.Decimal `json:"amount,omitempty"` Currency string `json:"currency,omitempty"` Restock bool `json:"restock,omitempty"` Reason string `json:"reason,omitempty"` Email bool `json:"email,omitempty"` Refund *Refund `json:"refund,omitempty"` }
A struct of all available order cancel options. See: https://help.shopify.com/api/reference/order#index
type OrderCountOptions ¶
type OrderCountOptions struct { Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` SinceID int64 `url:"since_id,omitempty"` 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"` Order string `url:"order,omitempty"` Fields string `url:"fields,omitempty"` Status orderStatus `url:"status,omitempty"` FinancialStatus orderFinancialStatus `url:"financial_status,omitempty"` FulfillmentStatus orderFulfillmentStatus `url:"fulfillment_status,omitempty"` }
A struct for all available order count options
type OrderListOptions ¶
type OrderListOptions struct { ListOptions Status orderStatus `url:"status,omitempty"` FinancialStatus orderFinancialStatus `url:"financial_status,omitempty"` FulfillmentStatus orderFulfillmentStatus `url:"fulfillment_status,omitempty"` ProcessedAtMin time.Time `url:"processed_at_min,omitempty"` ProcessedAtMax time.Time `url:"processed_at_max,omitempty"` Order string `url:"order,omitempty"` }
A struct for all available order list options. See: https://help.shopify.com/api/reference/order#index
type OrderResource ¶
type OrderResource struct {
Order *Order `json:"order"`
}
Represents the result from the orders/X.json endpoint
type OrderRisk ¶
type OrderRisk struct { Id int64 `json:"id,omitempty"` CheckoutId int64 `json:"checkout_id,omitempty"` OrderId int64 `json:"order_id,omitempty"` CauseCancel bool `json:"cause_cancel,omitempty"` Display bool `json:"display,omitempty"` MerchantMessage string `json:"merchant_message,omitempty"` Message string `json:"message,omitempty"` Score string `json:"score,omitempty"` Source string `json:"source,omitempty"` Recommendation orderRiskRecommendation `json:"recommendation,omitempty"` }
OrderRisk represents a Shopify order risk
type OrderRiskListOptions ¶
type OrderRiskListOptions struct {
ListOptions
}
A struct for all available order Risk list options. See: https://shopify.dev/docs/api/admin-rest/2023-10/resources/order-risk#index
type OrderRiskResource ¶
type OrderRiskResource struct {
OrderRisk *OrderRisk `json:"risk"`
}
Represents the result from the orders-risk/X.json endpoint
type OrderRiskService ¶
type OrderRiskService interface { List(context.Context, int64, interface{}) ([]OrderRisk, error) ListWithPagination(context.Context, int64, interface{}) ([]OrderRisk, *Pagination, error) Get(context.Context, int64, int64, interface{}) (*OrderRisk, error) Create(context.Context, int64, OrderRisk) (*OrderRisk, error) Update(context.Context, int64, int64, OrderRisk) (*OrderRisk, error) Delete(context.Context, int64, int64) error }
OrderRiskService is an interface for interfacing with the orders Risk endpoints of the Shopify API. See: https://shopify.dev/docs/api/admin-rest/2023-10/resources/order-risk
type OrderRiskServiceOp ¶
type OrderRiskServiceOp struct {
// contains filtered or unexported fields
}
OrderRiskServiceOp handles communication with the order related methods of the Shopify API.
func (*OrderRiskServiceOp) Create ¶
func (s *OrderRiskServiceOp) Create(ctx context.Context, orderID int64, orderRisk OrderRisk) (*OrderRisk, error)
Create order
func (*OrderRiskServiceOp) Get ¶
func (s *OrderRiskServiceOp) Get(ctx context.Context, orderID int64, riskID int64, options interface{}) (*OrderRisk, error)
Get individual order
func (*OrderRiskServiceOp) List ¶
func (s *OrderRiskServiceOp) List(ctx context.Context, orderId int64, options interface{}) ([]OrderRisk, error)
List OrderRisk
func (*OrderRiskServiceOp) ListWithPagination ¶
func (s *OrderRiskServiceOp) ListWithPagination(ctx context.Context, orderId int64, options interface{}) ([]OrderRisk, *Pagination, error)
type OrderService ¶
type OrderService interface { List(context.Context, interface{}) ([]Order, error) ListWithPagination(context.Context, interface{}) ([]Order, *Pagination, error) Count(context.Context, interface{}) (int, error) Get(context.Context, int64, interface{}) (*Order, error) Create(context.Context, Order) (*Order, error) Update(context.Context, Order) (*Order, error) Cancel(context.Context, int64, interface{}) (*Order, error) Close(context.Context, int64) (*Order, error) Open(context.Context, int64) (*Order, error) Delete(context.Context, int64) error // MetafieldsService used for Order resource to communicate with Metafields resource MetafieldsService // FulfillmentsService used for Order resource to communicate with Fulfillments resource FulfillmentsService }
OrderService is an interface for interfacing with the orders endpoints of the Shopify API. See: https://help.shopify.com/api/reference/order
type OrderServiceOp ¶
type OrderServiceOp struct {
// contains filtered or unexported fields
}
OrderServiceOp handles communication with the order related methods of the Shopify API.
func (*OrderServiceOp) Cancel ¶
func (s *OrderServiceOp) Cancel(ctx context.Context, orderID int64, options interface{}) (*Order, error)
Cancel order
func (*OrderServiceOp) CancelFulfillment ¶
func (s *OrderServiceOp) CancelFulfillment(ctx context.Context, orderID int64, fulfillmentID int64) (*Fulfillment, error)
Cancel an existing fulfillment for an order
func (*OrderServiceOp) CompleteFulfillment ¶
func (s *OrderServiceOp) CompleteFulfillment(ctx context.Context, orderID int64, fulfillmentID int64) (*Fulfillment, error)
Complete an existing fulfillment for an order
func (*OrderServiceOp) Count ¶
func (s *OrderServiceOp) Count(ctx context.Context, options interface{}) (int, error)
Count orders
func (*OrderServiceOp) CountFulfillments ¶
func (s *OrderServiceOp) CountFulfillments(ctx context.Context, orderID int64, options interface{}) (int, error)
Count fulfillments for an order
func (*OrderServiceOp) CountMetafields ¶
func (s *OrderServiceOp) CountMetafields(ctx context.Context, orderID int64, options interface{}) (int, error)
Count metafields for an order
func (*OrderServiceOp) CreateFulfillment ¶
func (s *OrderServiceOp) CreateFulfillment(ctx context.Context, orderID int64, fulfillment Fulfillment) (*Fulfillment, error)
Create a new fulfillment for an order
func (*OrderServiceOp) CreateMetafield ¶
func (s *OrderServiceOp) CreateMetafield(ctx context.Context, orderID int64, metafield Metafield) (*Metafield, error)
Create a new metafield for an order
func (*OrderServiceOp) Delete ¶
func (s *OrderServiceOp) Delete(ctx context.Context, orderID int64) error
Delete order
func (*OrderServiceOp) DeleteMetafield ¶
func (s *OrderServiceOp) DeleteMetafield(ctx context.Context, orderID int64, metafieldID int64) error
Delete an existing metafield for an order
func (*OrderServiceOp) Get ¶
func (s *OrderServiceOp) Get(ctx context.Context, orderID int64, options interface{}) (*Order, error)
Get individual order
func (*OrderServiceOp) GetFulfillment ¶
func (s *OrderServiceOp) GetFulfillment(ctx context.Context, orderID int64, fulfillmentID int64, options interface{}) (*Fulfillment, error)
Get individual fulfillment for an order
func (*OrderServiceOp) GetMetafield ¶
func (s *OrderServiceOp) GetMetafield(ctx context.Context, orderID int64, metafieldID int64, options interface{}) (*Metafield, error)
Get individual metafield for an order
func (*OrderServiceOp) List ¶
func (s *OrderServiceOp) List(ctx context.Context, options interface{}) ([]Order, error)
List orders
func (*OrderServiceOp) ListFulfillments ¶
func (s *OrderServiceOp) ListFulfillments(ctx context.Context, orderID int64, options interface{}) ([]Fulfillment, error)
List fulfillments for an order
func (*OrderServiceOp) ListMetafields ¶
func (s *OrderServiceOp) ListMetafields(ctx context.Context, orderID int64, options interface{}) ([]Metafield, error)
List metafields for an order
func (*OrderServiceOp) ListWithPagination ¶
func (s *OrderServiceOp) ListWithPagination(ctx context.Context, options interface{}) ([]Order, *Pagination, error)
func (*OrderServiceOp) TransitionFulfillment ¶
func (s *OrderServiceOp) TransitionFulfillment(ctx context.Context, orderID int64, fulfillmentID int64) (*Fulfillment, error)
Transition an existing fulfillment for an order
func (*OrderServiceOp) UpdateFulfillment ¶
func (s *OrderServiceOp) UpdateFulfillment(ctx context.Context, orderID int64, fulfillment Fulfillment) (*Fulfillment, error)
Update an existing fulfillment for an order
func (*OrderServiceOp) UpdateMetafield ¶
func (s *OrderServiceOp) UpdateMetafield(ctx context.Context, orderID int64, metafield Metafield) (*Metafield, error)
Update an existing metafield for an order
type OrdersResource ¶
type OrdersResource struct {
Orders []Order `json:"orders"`
}
Represents the result from the orders.json endpoint
type OrdersRisksResource ¶
type OrdersRisksResource struct {
OrderRisk []OrderRisk `json:"risks"`
}
Represents the result from the orders-risk.json endpoint
type Page ¶
type Page struct { ID int64 `json:"id,omitempty"` Author string `json:"author,omitempty"` Handle string `json:"handle,omitempty"` Title string `json:"title,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` BodyHTML string `json:"body_html,omitempty"` TemplateSuffix string `json:"template_suffix,omitempty"` PublishedAt *time.Time `json:"published_at,omitempty"` ShopID int64 `json:"shop_id,omitempty"` Metafields []Metafield `json:"metafields,omitempty"` }
Page represents a Shopify page.
type PageResource ¶
type PageResource struct {
Page *Page `json:"page"`
}
PageResource represents the result from the pages/X.json endpoint
type PageService ¶
type PageService interface { List(context.Context, interface{}) ([]Page, error) Count(context.Context, interface{}) (int, error) Get(context.Context, int64, interface{}) (*Page, error) Create(context.Context, Page) (*Page, error) Update(context.Context, Page) (*Page, error) Delete(context.Context, int64) error // MetafieldsService used for Pages resource to communicate with Metafields // resource MetafieldsService }
PagesPageService is an interface for interacting with the pages endpoints of the Shopify API. See https://help.shopify.com/api/reference/online_store/page
type PageServiceOp ¶
type PageServiceOp struct {
// contains filtered or unexported fields
}
PageServiceOp handles communication with the page related methods of the Shopify API.
func (*PageServiceOp) Count ¶
func (s *PageServiceOp) Count(ctx context.Context, options interface{}) (int, error)
Count pages
func (*PageServiceOp) CountMetafields ¶
func (s *PageServiceOp) CountMetafields(ctx context.Context, pageID int64, options interface{}) (int, error)
Count metafields for a page
func (*PageServiceOp) CreateMetafield ¶
func (s *PageServiceOp) CreateMetafield(ctx context.Context, pageID int64, metafield Metafield) (*Metafield, error)
Create a new metafield for a page
func (*PageServiceOp) Delete ¶
func (s *PageServiceOp) Delete(ctx context.Context, pageID int64) error
Delete an existing page.
func (*PageServiceOp) DeleteMetafield ¶
Delete an existing metafield for a page
func (*PageServiceOp) GetMetafield ¶
func (s *PageServiceOp) GetMetafield(ctx context.Context, pageID int64, metafieldID int64, options interface{}) (*Metafield, error)
Get individual metafield for a page
func (*PageServiceOp) List ¶
func (s *PageServiceOp) List(ctx context.Context, options interface{}) ([]Page, error)
List pages
func (*PageServiceOp) ListMetafields ¶
func (s *PageServiceOp) ListMetafields(ctx context.Context, pageID int64, options interface{}) ([]Metafield, error)
List metafields for a page
func (*PageServiceOp) UpdateMetafield ¶
func (s *PageServiceOp) UpdateMetafield(ctx context.Context, pageID int64, metafield Metafield) (*Metafield, error)
Update an existing metafield for a page
type PagesResource ¶
type PagesResource struct {
Pages []Page `json:"pages"`
}
PagesResource represents the result from the pages.json endpoint
type Pagination ¶
type Pagination struct { NextPageOptions *ListOptions PreviousPageOptions *ListOptions }
Pagination of results
type PaymentDetails ¶
type PaymentDetails struct { AVSResultCode string `json:"avs_result_code,omitempty"` CreditCardBin string `json:"credit_card_bin,omitempty"` CVVResultCode string `json:"cvv_result_code,omitempty"` CreditCardNumber string `json:"credit_card_number,omitempty"` CreditCardCompany string `json:"credit_card_company,omitempty"` }
type PaymentsTransactionResource ¶
type PaymentsTransactionResource struct {
PaymentsTransaction *PaymentsTransactions `json:"transaction"`
}
Represents the result from the PaymentsTransactions/X.json endpoint
type PaymentsTransactions ¶
type PaymentsTransactions struct { Id int64 `json:"id,omitempty"` Type PaymentsTransactionsTypes `json:"type,omitempty"` Test bool `json:"test,omitempty"` PayoutId int `json:"payout_id,omitempty"` PayoutStatus PayoutStatus `json:"payout_status,omitempty"` Currency string `json:"currency,omitempty"` Amount string `json:"amount,omitempty"` Fee string `json:"fee,omitempty"` Net string `json:"net,omitempty"` SourceId int `json:"source_id,omitempty"` SourceType string `json:"source_type,omitempty"` SourceOrderTransactionId int `json:"source_order_transaction_id,omitempty"` SourceOrderId int `json:"source_order_id,omitempty"` ProcessedAt OnlyDate `json:"processed_at,omitempty"` }
PaymentsTransactions represents a Shopify Transactions
type PaymentsTransactionsListOptions ¶
type PaymentsTransactionsListOptions struct { PageInfo string `url:"page_info,omitempty"` Limit int `url:"limit,omitempty"` Fields string `url:"fields,omitempty"` LastId int64 `url:"last_id,omitempty"` SinceId int64 `url:"since_id,omitempty"` PayoutId int64 `url:"payout_id,omitempty"` PayoutStatus PayoutStatus `url:"payout_status,omitempty"` DateMin *OnlyDate `url:"date_min,omitempty"` DateMax *OnlyDate `url:"date_max,omitempty"` ProcessedAt *OnlyDate `json:"processed_at,omitempty"` }
A struct for all available PaymentsTransactions list options
type PaymentsTransactionsResource ¶
type PaymentsTransactionsResource struct {
PaymentsTransactions []PaymentsTransactions `json:"transactions"`
}
Represents the result from the PaymentsTransactions.json endpoint
type PaymentsTransactionsService ¶
type PaymentsTransactionsService interface { List(context.Context, interface{}) ([]PaymentsTransactions, error) ListWithPagination(context.Context, interface{}) ([]PaymentsTransactions, *Pagination, error) Get(context.Context, int64, interface{}) (*PaymentsTransactions, error) }
PaymentsTransactionsService is an interface for interfacing with the Transactions endpoints of the Shopify API. See: https://shopify.dev/docs/api/admin-rest/2023-01/resources/transactions
type PaymentsTransactionsServiceOp ¶
type PaymentsTransactionsServiceOp struct {
// contains filtered or unexported fields
}
PaymentsTransactionsServiceOp handles communication with the transactions related methods of the Payment methods of Shopify API.
func (*PaymentsTransactionsServiceOp) Get ¶
func (s *PaymentsTransactionsServiceOp) Get(ctx context.Context, payoutID int64, options interface{}) (*PaymentsTransactions, error)
Get individual PaymentsTransactions
func (*PaymentsTransactionsServiceOp) List ¶
func (s *PaymentsTransactionsServiceOp) List(ctx context.Context, options interface{}) ([]PaymentsTransactions, error)
List PaymentsTransactions
func (*PaymentsTransactionsServiceOp) ListWithPagination ¶
func (s *PaymentsTransactionsServiceOp) ListWithPagination(ctx context.Context, options interface{}) ([]PaymentsTransactions, *Pagination, error)
type PaymentsTransactionsTypes ¶
type PaymentsTransactionsTypes string
const ( PaymentsTransactionsCharge PaymentsTransactionsTypes = "charge" PaymentsTransactionsRefund PaymentsTransactionsTypes = "refund" PaymentsTransactionsDispute PaymentsTransactionsTypes = "dispute" PaymentsTransactionsReserve PaymentsTransactionsTypes = "reserve" PaymentsTransactionsAdjustment PaymentsTransactionsTypes = "adjustment" PaymentsTransactionsCredit PaymentsTransactionsTypes = "credit" PaymentsTransactionsDebit PaymentsTransactionsTypes = "debit" PaymentsTransactionsPayout PaymentsTransactionsTypes = "payout" PaymentsTransactionsPayoutFailure PaymentsTransactionsTypes = "payout_failure" PaymentsTransactionsPayoutCancellation PaymentsTransactionsTypes = "payout_cancellation" )
type Payout ¶
type Payout struct { Id int64 `json:"id,omitempty"` Date OnlyDate `json:"date,omitempty"` Currency string `json:"currency,omitempty"` Amount decimal.Decimal `json:"amount,omitempty"` Status PayoutStatus `json:"status,omitempty"` }
Payout represents a Shopify payout
type PayoutResource ¶
type PayoutResource struct {
Payout *Payout `json:"payout"`
}
Represents the result from the payouts/X.json endpoint
type PayoutStatus ¶
type PayoutStatus string
const ( PayoutStatusScheduled PayoutStatus = "scheduled" PayoutStatusInTransit PayoutStatus = "in_transit" PayoutStatusPaid PayoutStatus = "paid" PayoutStatusFailed PayoutStatus = "failed" PayoutStatusCancelled PayoutStatus = "canceled" )
type PayoutsListOptions ¶
type PayoutsListOptions struct { PageInfo string `url:"page_info,omitempty"` Limit int `url:"limit,omitempty"` Fields string `url:"fields,omitempty"` LastId int64 `url:"last_id,omitempty"` SinceId int64 `url:"since_id,omitempty"` Status PayoutStatus `url:"status,omitempty"` DateMin *OnlyDate `url:"date_min,omitempty"` DateMax *OnlyDate `url:"date_max,omitempty"` Date *OnlyDate `url:"date,omitempty"` }
A struct for all available payout list options
type PayoutsResource ¶
type PayoutsResource struct {
Payouts []Payout `json:"payouts"`
}
Represents the result from the payouts.json endpoint
type PayoutsService ¶
type PayoutsService interface { List(context.Context, interface{}) ([]Payout, error) ListWithPagination(context.Context, interface{}) ([]Payout, *Pagination, error) Get(context.Context, int64, interface{}) (*Payout, error) }
PayoutsService is an interface for interfacing with the payouts endpoints of the Shopify API. See: https://shopify.dev/docs/api/admin-rest/2023-01/resources/payouts
type PayoutsServiceOp ¶
type PayoutsServiceOp struct {
// contains filtered or unexported fields
}
PayoutsServiceOp handles communication with the payout related methods of the Shopify API.
func (*PayoutsServiceOp) List ¶
func (s *PayoutsServiceOp) List(ctx context.Context, options interface{}) ([]Payout, error)
List payouts
func (*PayoutsServiceOp) ListWithPagination ¶
func (s *PayoutsServiceOp) ListWithPagination(ctx context.Context, options interface{}) ([]Payout, *Pagination, error)
type PriceBasedShippingRate ¶
type PriceBasedShippingRate struct { ID int64 `json:"id,omitempty"` ShippingZoneID int64 `json:"shipping_zone_id,omitempty"` Name string `json:"name,omitempty"` Price *decimal.Decimal `json:"price,omitempty"` MinOrderSubtotal *decimal.Decimal `json:"min_order_subtotal,omitempty"` MaxOrderSubtotal *decimal.Decimal `json:"max_order_subtotal,omitempty"` }
PriceBasedShippingRate represents a Shopify subtotal-constrained shipping rate
type PriceRule ¶
type PriceRule struct { ID int64 `json:"id,omitempty"` Title string `json:"title,omitempty"` ValueType string `json:"value_type,omitempty"` Value *decimal.Decimal `json:"value,omitempty"` CustomerSelection string `json:"customer_selection,omitempty"` TargetType string `json:"target_type,omitempty"` TargetSelection string `json:"target_selection,omitempty"` AllocationMethod string `json:"allocation_method,omitempty"` AllocationLimit int `json:"allocation_limit,omitempty"` OncePerCustomer bool `json:"once_per_customer,omitempty"` UsageLimit int `json:"usage_limit,omitempty"` StartsAt *time.Time `json:"starts_at,omitempty"` EndsAt *time.Time `json:"ends_at,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` EntitledProductIds []int64 `json:"entitled_product_ids,omitempty"` EntitledVariantIds []int64 `json:"entitled_variant_ids,omitempty"` EntitledCollectionIds []int64 `json:"entitled_collection_ids,omitempty"` EntitledCountryIds []int64 `json:"entitled_country_ids,omitempty"` PrerequisiteProductIds []int64 `json:"prerequisite_product_ids,omitempty"` PrerequisiteVariantIds []int64 `json:"prerequisite_variant_ids,omitempty"` PrerequisiteCollectionIds []int64 `json:"prerequisite_collection_ids,omitempty"` PrerequisiteSavedSearchIds []int64 `json:"prerequisite_saved_search_ids,omitempty"` PrerequisiteCustomerIds []int64 `json:"prerequisite_customer_ids,omitempty"` PrerequisiteSubtotalRange *prerequisiteSubtotalRange `json:"prerequisite_subtotal_range,omitempty"` PrerequisiteQuantityRange *prerequisiteQuantityRange `json:"prerequisite_quantity_range,omitempty"` PrerequisiteShippingPriceRange *prerequisiteShippingPriceRange `json:"prerequisite_shipping_price_range,omitempty"` PrerequisiteToEntitlementQuantityRatio *prerequisiteToEntitlementQuantityRatio `json:"prerequisite_to_entitlement_quantity_ratio,omitempty"` }
PriceRule represents a Shopify discount rule
func (*PriceRule) SetPrerequisiteQuantityRange ¶
SetPrerequisiteQuantityRange sets or clears the quantity range for which a cart must lie within to qualify for the price-rule
func (*PriceRule) SetPrerequisiteShippingPriceRange ¶
SetPrerequisiteShippingPriceRange sets or clears the shipping price range for which a cart must lie within to qualify for the price-rule
func (*PriceRule) SetPrerequisiteSubtotalRange ¶
SetPrerequisiteSubtotalRange sets or clears the subtotal range for which a cart must lie within to qualify for the price-rule
func (*PriceRule) SetPrerequisiteToEntitlementQuantityRatio ¶
func (pr *PriceRule) SetPrerequisiteToEntitlementQuantityRatio(prerequisiteQuantity *int, entitledQuantity *int)
SetPrerequisiteToEntitlementQuantityRatio sets or clears the ratio between ordered items and entitled items (eg. buy X, get y free) for which a cart is eligible in the price-rule
type PriceRuleDiscountCode ¶
type PriceRuleDiscountCode struct { ID int64 `json:"id,omitempty"` PriceRuleID int64 `json:"price_rule_id,omitempty"` Code string `json:"code,omitempty"` UsageCount int `json:"usage_count,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
PriceRuleDiscountCode represents a Shopify Discount Code
type PriceRuleResource ¶
type PriceRuleResource struct {
PriceRule *PriceRule `json:"price_rule"`
}
PriceRuleResource represents the result from the price_rules/X.json endpoint
type PriceRuleService ¶
type PriceRuleService interface { Get(context.Context, int64) (*PriceRule, error) Create(context.Context, PriceRule) (*PriceRule, error) Update(context.Context, PriceRule) (*PriceRule, error) List(context.Context) ([]PriceRule, error) Delete(context.Context, int64) error }
PriceRuleService is an interface for interfacing with the price rule endpoints of the Shopify API. See: https://shopify.dev/docs/admin-api/rest/reference/discounts/pricerule
type PriceRuleServiceOp ¶
type PriceRuleServiceOp struct {
// contains filtered or unexported fields
}
PriceRuleServiceOp handles communication with the price rule related methods of the Shopify API.
func (*PriceRuleServiceOp) Delete ¶
func (s *PriceRuleServiceOp) Delete(ctx context.Context, priceRuleID int64) error
Delete deletes a price rule
type PriceRulesResource ¶
type PriceRulesResource struct {
PriceRules []PriceRule `json:"price_rules"`
}
PriceRulesResource represents the result from the price_rules.json endpoint
type Product ¶
type Product struct { ID int64 `json:"id,omitempty"` Title string `json:"title,omitempty"` BodyHTML string `json:"body_html,omitempty"` Vendor string `json:"vendor,omitempty"` ProductType string `json:"product_type,omitempty"` Handle string `json:"handle,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` PublishedAt *time.Time `json:"published_at,omitempty"` PublishedScope string `json:"published_scope,omitempty"` Tags string `json:"tags,omitempty"` Status ProductStatus `json:"status,omitempty"` Options []ProductOption `json:"options,omitempty"` Variants []Variant `json:"variants,omitempty"` Image Image `json:"image,omitempty"` Images []Image `json:"images,omitempty"` TemplateSuffix string `json:"template_suffix,omitempty"` MetafieldsGlobalTitleTag string `json:"metafields_global_title_tag,omitempty"` MetafieldsGlobalDescriptionTag string `json:"metafields_global_description_tag,omitempty"` Metafields []Metafield `json:"metafields,omitempty"` AdminGraphqlAPIID string `json:"admin_graphql_api_id,omitempty"` }
Product represents a Shopify product
type ProductListOptions ¶
type ProductListOptions struct { ListOptions CollectionID int64 `url:"collection_id,omitempty"` ProductType string `url:"product_type,omitempty"` Vendor string `url:"vendor,omitempty"` Handle string `url:"handle,omitempty"` PublishedAtMin time.Time `url:"published_at_min,omitempty"` PublishedAtMax time.Time `url:"published_at_max,omitempty"` PublishedStatus string `url:"published_status,omitempty"` PresentmentCurrencies string `url:"presentment_currencies,omitempty"` Status []ProductStatus `url:"status,omitempty,comma"` }
type ProductListing ¶
type ProductListing struct { ID int64 `json:"product_id,omitempty"` Title string `json:"title,omitempty"` BodyHTML string `json:"body_html,omitempty"` Vendor string `json:"vendor,omitempty"` ProductType string `json:"product_type,omitempty"` Handle string `json:"handle,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` PublishedAt *time.Time `json:"published_at,omitempty"` Tags string `json:"tags,omitempty"` Options []ProductOption `json:"options,omitempty"` Variants []Variant `json:"variants,omitempty"` Images []Image `json:"images,omitempty"` }
ProductListing represents a Shopify product published to your sales channel app
type ProductListingIDsResource ¶
type ProductListingIDsResource struct {
ProductIDs []int64 `json:"product_ids"`
}
Represents the result from the product_listings/product_ids.json endpoint
type ProductListingPublishResource ¶
type ProductListingPublishResource struct { ProductListing struct { ProductID int64 `json:"product_id"` } `json:"product_listing"` }
Resource which create product_listing endpoint expects in request body e.g. PUT /admin/api/2020-07/product_listings/921728736.json
{ "product_listing": { "product_id": 921728736 } }
type ProductListingResource ¶
type ProductListingResource struct {
ProductListing *ProductListing `json:"product_listing"`
}
Represents the result from the product_listings/X.json endpoint
type ProductListingService ¶
type ProductListingService interface { List(context.Context, interface{}) ([]ProductListing, error) ListWithPagination(context.Context, interface{}) ([]ProductListing, *Pagination, error) Count(context.Context, interface{}) (int, error) Get(context.Context, int64, interface{}) (*ProductListing, error) GetProductIDs(context.Context, interface{}) ([]int64, error) Publish(context.Context, int64) (*ProductListing, error) Delete(context.Context, int64) error }
ProductListingService is an interface for interfacing with the product listing endpoints of the Shopify API. See: https://shopify.dev/docs/admin-api/rest/reference/sales-channels/productlisting
type ProductListingServiceOp ¶
type ProductListingServiceOp struct {
// contains filtered or unexported fields
}
ProductListingServiceOp handles communication with the product related methods of the Shopify API.
func (*ProductListingServiceOp) Count ¶
func (s *ProductListingServiceOp) Count(ctx context.Context, options interface{}) (int, error)
Count products listings published to your sales channel app
func (*ProductListingServiceOp) Delete ¶
func (s *ProductListingServiceOp) Delete(ctx context.Context, productID int64) error
Delete unpublishes an existing product from your sales channel app.
func (*ProductListingServiceOp) Get ¶
func (s *ProductListingServiceOp) Get(ctx context.Context, productID int64, options interface{}) (*ProductListing, error)
Get individual product_listing by product ID
func (*ProductListingServiceOp) GetProductIDs ¶
func (s *ProductListingServiceOp) GetProductIDs(ctx context.Context, options interface{}) ([]int64, error)
GetProductIDs lists all product IDs that are published to your sales channel
func (*ProductListingServiceOp) List ¶
func (s *ProductListingServiceOp) List(ctx context.Context, options interface{}) ([]ProductListing, error)
List products
func (*ProductListingServiceOp) ListWithPagination ¶
func (s *ProductListingServiceOp) ListWithPagination(ctx context.Context, options interface{}) ([]ProductListing, *Pagination, error)
ListWithPagination lists products and return pagination to retrieve next/previous results.
func (*ProductListingServiceOp) Publish ¶
func (s *ProductListingServiceOp) Publish(ctx context.Context, productID int64) (*ProductListing, error)
Publish an existing product listing to your sales channel app
type ProductOption ¶
type ProductOption struct { ID int64 `json:"id,omitempty"` ProductID int64 `json:"product_id,omitempty"` Name string `json:"name,omitempty"` Position int `json:"position,omitempty"` Values []string `json:"values,omitempty"` }
The options provided by Shopify
type ProductResource ¶
type ProductResource struct {
Product *Product `json:"product"`
}
Represents the result from the products/X.json endpoint
type ProductService ¶
type ProductService interface { List(context.Context, interface{}) ([]Product, error) ListWithPagination(context.Context, interface{}) ([]Product, *Pagination, error) Count(context.Context, interface{}) (int, error) Get(context.Context, int64, interface{}) (*Product, error) Create(context.Context, Product) (*Product, error) Update(context.Context, Product) (*Product, error) Delete(context.Context, int64) error // MetafieldsService used for Product resource to communicate with Metafields resource MetafieldsService }
ProductService is an interface for interfacing with the product endpoints of the Shopify API. See: https://help.shopify.com/api/reference/product
type ProductServiceOp ¶
type ProductServiceOp struct {
// contains filtered or unexported fields
}
ProductServiceOp handles communication with the product related methods of the Shopify API.
func (*ProductServiceOp) Count ¶
func (s *ProductServiceOp) Count(ctx context.Context, options interface{}) (int, error)
Count products
func (*ProductServiceOp) CountMetafields ¶
func (s *ProductServiceOp) CountMetafields(ctx context.Context, productID int64, options interface{}) (int, error)
Count metafields for a product
func (*ProductServiceOp) CreateMetafield ¶
func (s *ProductServiceOp) CreateMetafield(ctx context.Context, productID int64, metafield Metafield) (*Metafield, error)
CreateMetafield for a product
func (*ProductServiceOp) Delete ¶
func (s *ProductServiceOp) Delete(ctx context.Context, productID int64) error
Delete an existing product
func (*ProductServiceOp) DeleteMetafield ¶
func (s *ProductServiceOp) DeleteMetafield(ctx context.Context, productID int64, metafieldID int64) error
DeleteMetafield for a product
func (*ProductServiceOp) Get ¶
func (s *ProductServiceOp) Get(ctx context.Context, productID int64, options interface{}) (*Product, error)
Get individual product
func (*ProductServiceOp) GetMetafield ¶
func (s *ProductServiceOp) GetMetafield(ctx context.Context, productID int64, metafieldID int64, options interface{}) (*Metafield, error)
GetMetafield for a product
func (*ProductServiceOp) List ¶
func (s *ProductServiceOp) List(ctx context.Context, options interface{}) ([]Product, error)
List products
func (*ProductServiceOp) ListMetafields ¶
func (s *ProductServiceOp) ListMetafields(ctx context.Context, productID int64, options interface{}) ([]Metafield, error)
ListMetafields for a product
func (*ProductServiceOp) ListWithPagination ¶
func (s *ProductServiceOp) ListWithPagination(ctx context.Context, options interface{}) ([]Product, *Pagination, error)
ListWithPagination lists products and return pagination to retrieve next/previous results.
func (*ProductServiceOp) UpdateMetafield ¶
func (s *ProductServiceOp) UpdateMetafield(ctx context.Context, productID int64, metafield Metafield) (*Metafield, error)
UpdateMetafield for a product
type ProductStatus ¶
type ProductStatus string
ProductStatus represents a Shopify product status.
const ( // The product is ready to sell and is available to customers on the online store, // sales channels, and apps. By default, existing products are set to active. ProductStatusActive ProductStatus = "active" // The product is no longer being sold and isn't available to customers on sales // channels and apps. ProductStatusArchived ProductStatus = "archived" // The product isn't ready to sell and is unavailable to customers on sales // channels and apps. By default, duplicated and unarchived products are set to // draft. ProductStatucDraft ProductStatus = "draft" )
https://shopify.dev/docs/api/admin-rest/2023-07/resources/product#resource-object
type ProductsListingsResource ¶
type ProductsListingsResource struct {
ProductListings []ProductListing `json:"product_listings"`
}
Represents the result from the product_listings.json endpoint
type ProductsResource ¶
type ProductsResource struct {
Products []Product `json:"products"`
}
Represents the result from the products.json endpoint
type RateLimitError ¶
type RateLimitError struct { ResponseError RetryAfter int }
An error specific to a rate-limiting response. Embeds the ResponseError to allow consumers to handle it the same was a normal ResponseError.
type RateLimitInfo ¶
type RateLimitInfo struct { RequestCount int BucketSize int GraphQLCost *GraphQLCost RetryAfterSeconds float64 }
type Receipt ¶
type Receipt struct { TestCase bool `json:"testcase,omitempty"` Authorization string `json:"authorization,omitempty"` }
Receipt represents a Shopify receipt.
type RecurringApplicationCharge ¶
type RecurringApplicationCharge struct { APIClientID int64 `json:"api_client_id"` ActivatedOn *time.Time `json:"activated_on"` BalanceRemaining *decimal.Decimal `json:"balance_remaining"` BalanceUsed *decimal.Decimal `json:"balance_used"` BillingOn *time.Time `json:"billing_on"` CancelledOn *time.Time `json:"cancelled_on"` CappedAmount *decimal.Decimal `json:"capped_amount"` ConfirmationURL string `json:"confirmation_url"` CreatedAt *time.Time `json:"created_at"` DecoratedReturnURL string `json:"decorated_return_url"` ID int64 `json:"id"` Name string `json:"name"` Price *decimal.Decimal `json:"price"` ReturnURL string `json:"return_url"` RiskLevel *decimal.Decimal `json:"risk_level"` Status string `json:"status"` Terms string `json:"terms"` Test *bool `json:"test"` TrialDays int `json:"trial_days"` TrialEndsOn *time.Time `json:"trial_ends_on"` UpdateCappedAmountURL string `json:"update_capped_amount_url"` UpdatedAt *time.Time `json:"updated_at"` }
RecurringApplicationCharge represents a Shopify RecurringApplicationCharge.
func (*RecurringApplicationCharge) UnmarshalJSON ¶
func (r *RecurringApplicationCharge) UnmarshalJSON(data []byte) error
type RecurringApplicationChargeResource ¶
type RecurringApplicationChargeResource struct {
Charge *RecurringApplicationCharge `json:"recurring_application_charge"`
}
RecurringApplicationChargeResource represents the result from the admin/recurring_application_charges{/X{/activate.json}.json}.json endpoints.
type RecurringApplicationChargeService ¶
type RecurringApplicationChargeService interface { Create(context.Context, RecurringApplicationCharge) (*RecurringApplicationCharge, error) Get(context.Context, int64, interface{}) (*RecurringApplicationCharge, error) List(context.Context, interface{}) ([]RecurringApplicationCharge, error) Activate(context.Context, RecurringApplicationCharge) (*RecurringApplicationCharge, error) Delete(context.Context, int64) error Update(context.Context, int64, int64) (*RecurringApplicationCharge, error) }
RecurringApplicationChargeService is an interface for interacting with the RecurringApplicationCharge endpoints of the Shopify API. See https://help.shopify.com/api/reference/billing/recurringapplicationcharge
type RecurringApplicationChargeServiceOp ¶
type RecurringApplicationChargeServiceOp struct {
// contains filtered or unexported fields
}
RecurringApplicationChargeServiceOp handles communication with the RecurringApplicationCharge related methods of the Shopify API.
func (*RecurringApplicationChargeServiceOp) Activate ¶
func (r *RecurringApplicationChargeServiceOp) Activate(ctx context.Context, charge RecurringApplicationCharge) ( *RecurringApplicationCharge, error, )
Activate activates recurring application charge.
func (*RecurringApplicationChargeServiceOp) Create ¶
func (r *RecurringApplicationChargeServiceOp) Create(ctx context.Context, charge RecurringApplicationCharge) ( *RecurringApplicationCharge, error, )
Create creates new recurring application charge.
func (*RecurringApplicationChargeServiceOp) Delete ¶
func (r *RecurringApplicationChargeServiceOp) Delete(ctx context.Context, chargeID int64) error
Delete deletes recurring application charge.
func (*RecurringApplicationChargeServiceOp) Get ¶
func (r *RecurringApplicationChargeServiceOp) Get(ctx context.Context, chargeID int64, options interface{}) ( *RecurringApplicationCharge, error, )
Get gets individual recurring application charge.
func (*RecurringApplicationChargeServiceOp) List ¶
func (r *RecurringApplicationChargeServiceOp) List(ctx context.Context, options interface{}) ( []RecurringApplicationCharge, error, )
List gets all recurring application charges.
func (*RecurringApplicationChargeServiceOp) Update ¶
func (r *RecurringApplicationChargeServiceOp) Update(ctx context.Context, chargeID, newCappedAmount int64) ( *RecurringApplicationCharge, error, )
Update updates recurring application charge.
type RecurringApplicationChargesResource ¶
type RecurringApplicationChargesResource struct {
Charges []RecurringApplicationCharge `json:"recurring_application_charges"`
}
RecurringApplicationChargesResource represents the result from the admin/recurring_application_charges.json endpoint.
type Redirect ¶
type Redirect struct { ID int64 `json:"id"` Path string `json:"path"` Target string `json:"target"` }
Redirect represents a Shopify redirect.
type RedirectResource ¶
type RedirectResource struct {
Redirect *Redirect `json:"redirect"`
}
RedirectResource represents the result from the redirects/X.json endpoint
type RedirectService ¶
type RedirectService interface { List(context.Context, interface{}) ([]Redirect, error) Count(context.Context, interface{}) (int, error) Get(context.Context, int64, interface{}) (*Redirect, error) Create(context.Context, Redirect) (*Redirect, error) Update(context.Context, Redirect) (*Redirect, error) Delete(context.Context, int64) error }
RedirectService is an interface for interacting with the redirects endpoints of the Shopify API. See https://help.shopify.com/api/reference/online_store/redirect
type RedirectServiceOp ¶
type RedirectServiceOp struct {
// contains filtered or unexported fields
}
RedirectServiceOp handles communication with the redirect related methods of the Shopify API.
func (*RedirectServiceOp) Count ¶
func (s *RedirectServiceOp) Count(ctx context.Context, options interface{}) (int, error)
Count redirects
func (*RedirectServiceOp) Delete ¶
func (s *RedirectServiceOp) Delete(ctx context.Context, redirectID int64) error
Delete an existing redirect.
func (*RedirectServiceOp) Get ¶
func (s *RedirectServiceOp) Get(ctx context.Context, redirectID int64, options interface{}) (*Redirect, error)
Get individual redirect
type RedirectsResource ¶
type RedirectsResource struct {
Redirects []Redirect `json:"redirects"`
}
RedirectsResource represents the result from the redirects.json endpoint
type Refund ¶
type Refund struct { Id int64 `json:"id,omitempty"` OrderId int64 `json:"order_id,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` Note string `json:"note,omitempty"` Restock bool `json:"restock,omitempty"` UserId int64 `json:"user_id,omitempty"` RefundLineItems []RefundLineItem `json:"refund_line_items,omitempty"` Transactions []Transaction `json:"transactions,omitempty"` OrderAdjustments []OrderAdjustment `json:"order_adjustments,omitempty"` }
type RefundLineItem ¶
type RefundLineItem struct { Id int64 `json:"id,omitempty"` Quantity int `json:"quantity,omitempty"` LineItemId int64 `json:"line_item_id,omitempty"` LineItem *LineItem `json:"line_item,omitempty"` Subtotal *decimal.Decimal `json:"subtotal,omitempty"` TotalTax *decimal.Decimal `json:"total_tax,omitempty"` }
type ResponseDecodingError ¶
ResponseDecodingError occurs when the response body from Shopify could not be parsed.
func (ResponseDecodingError) Error ¶
func (e ResponseDecodingError) Error() string
type ResponseError ¶
A general response error that follows a similar layout to Shopify's response errors, i.e. either a single message or a list of messages.
func (ResponseError) Error ¶
func (e ResponseError) Error() string
func (ResponseError) GetErrors ¶
func (e ResponseError) GetErrors() []string
GetErrors returns response errors list
func (ResponseError) GetMessage ¶
func (e ResponseError) GetMessage() string
GetMessage returns response error message
func (ResponseError) GetStatus ¶
func (e ResponseError) GetStatus() int
GetStatus returns http response status
type ScriptTag ¶
type ScriptTag struct { CreatedAt *time.Time `json:"created_at"` Event string `json:"event"` ID int64 `json:"id"` Src string `json:"src"` DisplayScope string `json:"display_scope"` UpdatedAt *time.Time `json:"updated_at"` }
ScriptTag represents a Shopify ScriptTag.
type ScriptTagOption ¶
type ScriptTagOption struct { Limit int `url:"limit,omitempty"` Page int `url:"page,omitempty"` SinceID int64 `url:"since_id,omitempty"` 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"` Src string `url:"src,omitempty"` Fields string `url:"fields,omitempty"` }
The options provided by Shopify.
type ScriptTagResource ¶
type ScriptTagResource struct {
ScriptTag *ScriptTag `json:"script_tag"`
}
ScriptTagResource represents the result from the admin/script_tags/{#script_tag_id}.json endpoint.
type ScriptTagService ¶
type ScriptTagService interface { List(context.Context, interface{}) ([]ScriptTag, error) Count(context.Context, interface{}) (int, error) Get(context.Context, int64, interface{}) (*ScriptTag, error) Create(context.Context, ScriptTag) (*ScriptTag, error) Update(context.Context, ScriptTag) (*ScriptTag, error) Delete(context.Context, int64) error }
ScriptTagService is an interface for interfacing with the ScriptTag endpoints of the Shopify API. See: https://help.shopify.com/api/reference/scripttag
type ScriptTagServiceOp ¶
type ScriptTagServiceOp struct {
// contains filtered or unexported fields
}
ScriptTagServiceOp handles communication with the shop related methods of the Shopify API.
func (*ScriptTagServiceOp) Count ¶
func (s *ScriptTagServiceOp) Count(ctx context.Context, options interface{}) (int, error)
Count script tags
func (*ScriptTagServiceOp) Delete ¶
func (s *ScriptTagServiceOp) Delete(ctx context.Context, tagID int64) error
Delete an existing script tag
func (*ScriptTagServiceOp) Get ¶
func (s *ScriptTagServiceOp) Get(ctx context.Context, tagID int64, options interface{}) (*ScriptTag, error)
Get individual script tag
type ScriptTagsResource ¶
type ScriptTagsResource struct {
ScriptTags []ScriptTag `json:"script_tags"`
}
ScriptTagsResource represents the result from the admin/script_tags.json endpoint.
type ShippingCountry ¶
type ShippingCountry struct { ID int64 `json:"id,omitempty"` ShippingZoneID int64 `json:"shipping_zone_id,omitempty"` Name string `json:"name,omitempty"` Tax *decimal.Decimal `json:"tax,omitempty"` Code string `json:"code,omitempty"` TaxName string `json:"tax_name,omitempty"` Provinces []ShippingProvince `json:"provinces,omitempty"` }
ShippingCountry represents a Shopify shipping country
type ShippingLines ¶
type ShippingLines struct { ID int64 `json:"id,omitempty"` Title string `json:"title,omitempty"` Price *decimal.Decimal `json:"price,omitempty"` PriceSet *AmountSet `json:"price_set,omitempty"` DiscountedPrice *decimal.Decimal `json:"discounted_price,omitempty"` DiscountedPriceSet *AmountSet `json:"discounted_price_set,omitempty"` Code string `json:"code,omitempty"` Source string `json:"source,omitempty"` Phone string `json:"phone,omitempty"` RequestedFulfillmentServiceID string `json:"requested_fulfillment_service_id,omitempty"` DeliveryCategory string `json:"delivery_category,omitempty"` CarrierIdentifier string `json:"carrier_identifier,omitempty"` TaxLines []TaxLine `json:"tax_lines,omitempty"` Handle string `json:"handle,omitempty"` }
func (*ShippingLines) UnmarshalJSON ¶
func (sl *ShippingLines) UnmarshalJSON(data []byte) error
UnmarshalJSON custom unmarshaller for ShippingLines implemented to handle requested_fulfillment_service_id being returned as json numbers or json nulls instead of json strings
type ShippingProvince ¶
type ShippingProvince struct { ID int64 `json:"id,omitempty"` CountryID int64 `json:"country_id,omitempty"` ShippingZoneID int64 `json:"shipping_zone_id,omitempty"` Name string `json:"name,omitempty"` Code string `json:"code,omitempty"` Tax *decimal.Decimal `json:"tax,omitempty"` TaxName string `json:"tax_name,omitempty"` TaxType string `json:"tax_type,omitempty"` TaxPercentage *decimal.Decimal `json:"tax_percentage,omitempty"` }
ShippingProvince represents a Shopify shipping province
type ShippingRate ¶
type ShippingRate struct { // The name of the rate, which customers see at checkout. For example: Expedited Mail. ServiceName string `json:"service_name"` // A description of the rate, which customers see at checkout. For example: Includes tracking and insurance. Description string `json:"description"` // A unique code associated with the rate. For example: expedited_mail. ServiceCode string `json:"service_code"` // The currency of the shipping rate. Currency string `json:"currency"` // The total price based on the shipping rate currency. // In cents unit. See https://github.com/Shopify/shipping-fulfillment-app/issues/15#issuecomment-725996936 TotalPrice decimal.Decimal `json:"total_price"` // Whether the customer must provide a phone number at checkout. PhoneRequired bool `json:"phone_required,omitempty"` // The earliest delivery date for the displayed rate. MinDeliveryDate *time.Time `json:"min_delivery_date"` // "2013-04-12 14:48:45 -0400" // The latest delivery date for the displayed rate to still be valid. MaxDeliveryDate *time.Time `json:"max_delivery_date"` // "2013-04-12 14:48:45 -0400" }
type ShippingRateAddress ¶
type ShippingRateAddress struct { Country string `json:"country"` PostalCode string `json:"postal_code"` Province string `json:"province"` City string `json:"city"` Name string `json:"name"` Address1 string `json:"address1"` Address2 string `json:"address2"` Address3 string `json:"address3"` Phone string `json:"phone"` Fax string `json:"fax"` Email string `json:"email"` AddressType string `json:"address_type"` CompanyName string `json:"company_name"` }
The address3, fax, address_type, and company_name fields are returned by specific ActiveShipping providers. For API-created carrier services, you should use only the following shipping address fields: * address1 * address2 * city * zip * province * country Other values remain as null and are not sent to the callback URL.
type ShippingRateQuery ¶
type ShippingRateQuery struct { Origin ShippingRateAddress `json:"origin"` Destination ShippingRateAddress `json:"destination"` Items []LineItem `json:"items"` Currency string `json:"currency"` Locale string `json:"locale"` }
type ShippingRateRequest ¶
type ShippingRateRequest struct {
Rate ShippingRateQuery `json:"rate"`
}
type ShippingRateResponse ¶
type ShippingRateResponse struct {
Rates []ShippingRate `json:"rates"`
}
When Shopify requests shipping rates using your callback URL, the response object rates must be a JSON array of objects with the following fields. Required fields must be included in the response for the carrier service integration to work properly.
type ShippingZone ¶
type ShippingZone struct { ID int64 `json:"id,omitempty"` Name string `json:"name,omitempty"` ProfileID string `json:"profile_id,omitempty"` LocationGroupID string `json:"location_group_id,omitempty"` AdminGraphqlAPIID string `json:"admin_graphql_api_id,omitempty"` Countries []ShippingCountry `json:"countries,omitempty"` WeightBasedShippingRates []WeightBasedShippingRate `json:"weight_based_shipping_rates,omitempty"` PriceBasedShippingRates []PriceBasedShippingRate `json:"price_based_shipping_rates,omitempty"` CarrierShippingRateProviders []CarrierShippingRateProvider `json:"carrier_shipping_rate_providers,omitempty"` }
ShippingZone represents a Shopify shipping zone
type ShippingZoneService ¶
type ShippingZoneService interface {
List(context.Context) ([]ShippingZone, error)
}
ShippingZoneService is an interface for interfacing with the shipping zones endpoint of the Shopify API. See: https://help.shopify.com/api/reference/store-properties/shippingzone
type ShippingZoneServiceOp ¶
type ShippingZoneServiceOp struct {
// contains filtered or unexported fields
}
ShippingZoneServiceOp handles communication with the shipping zone related methods of the Shopify API.
func (*ShippingZoneServiceOp) List ¶
func (s *ShippingZoneServiceOp) List(ctx context.Context) ([]ShippingZone, error)
List shipping zones
type ShippingZonesResource ¶
type ShippingZonesResource struct {
ShippingZones []ShippingZone `json:"shipping_zones"`
}
Represents the result from the shipping_zones.json endpoint
type Shop ¶
type Shop struct { ID int64 `json:"id"` Name string `json:"name"` ShopOwner string `json:"shop_owner"` Email string `json:"email"` CustomerEmail string `json:"customer_email"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` Address1 string `json:"address1"` Address2 string `json:"address2"` City string `json:"city"` Country string `json:"country"` CountryCode string `json:"country_code"` CountryName string `json:"country_name"` Currency string `json:"currency"` Domain string `json:"domain"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Phone string `json:"phone"` Province string `json:"province"` ProvinceCode string `json:"province_code"` Zip string `json:"zip"` MoneyFormat string `json:"money_format"` MoneyWithCurrencyFormat string `json:"money_with_currency_format"` WeightUnit string `json:"weight_unit"` MyshopifyDomain string `json:"myshopify_domain"` PlanName string `json:"plan_name"` PlanDisplayName string `json:"plan_display_name"` PasswordEnabled bool `json:"password_enabled"` PrimaryLocale string `json:"primary_locale"` PrimaryLocationId int64 `json:"primary_location_id"` Timezone string `json:"timezone"` IanaTimezone string `json:"iana_timezone"` ForceSSL bool `json:"force_ssl"` TaxShipping bool `json:"tax_shipping"` TaxesIncluded bool `json:"taxes_included"` HasStorefront bool `json:"has_storefront"` HasDiscounts bool `json:"has_discounts"` HasGiftcards bool `json:"has_gift_cards"` SetupRequire bool `json:"setup_required"` CountyTaxes bool `json:"county_taxes"` CheckoutAPISupported bool `json:"checkout_api_supported"` Source string `json:"source"` GoogleAppsDomain string `json:"google_apps_domain"` GoogleAppsLoginEnabled bool `json:"google_apps_login_enabled"` MoneyInEmailsFormat string `json:"money_in_emails_format"` MoneyWithCurrencyInEmailsFormat string `json:"money_with_currency_in_emails_format"` EligibleForPayments bool `json:"eligible_for_payments"` RequiresExtraPaymentsAgreement bool `json:"requires_extra_payments_agreement"` PreLaunchEnabled bool `json:"pre_launch_enabled"` }
Shop represents a Shopify shop
type ShopResource ¶
type ShopResource struct {
Shop *Shop `json:"shop"`
}
Represents the result from the admin/shop.json endpoint
type ShopService ¶
type ShopService interface { Get(ctx context.Context, options interface{}) (*Shop, error) // MetafieldsService used for Shop resource to communicate with Metafields resource MetafieldsService }
ShopService is an interface for interfacing with the shop endpoint of the Shopify API. See: https://help.shopify.com/api/reference/shop
type ShopServiceOp ¶
type ShopServiceOp struct {
// contains filtered or unexported fields
}
ShopServiceOp handles communication with the shop related methods of the Shopify API.
func (*ShopServiceOp) CountMetafields ¶
func (s *ShopServiceOp) CountMetafields(ctx context.Context, _ int64, options interface{}) (int, error)
CountMetafields for a shop
func (*ShopServiceOp) CreateMetafield ¶
func (s *ShopServiceOp) CreateMetafield(ctx context.Context, _ int64, metafield Metafield) (*Metafield, error)
CreateMetafield for a shop
func (*ShopServiceOp) DeleteMetafield ¶
DeleteMetafield for a shop
func (*ShopServiceOp) Get ¶
func (s *ShopServiceOp) Get(ctx context.Context, options interface{}) (*Shop, error)
Get shop
func (*ShopServiceOp) GetMetafield ¶
func (s *ShopServiceOp) GetMetafield(ctx context.Context, _ int64, metafieldID int64, options interface{}) (*Metafield, error)
GetMetafield for a shop
func (*ShopServiceOp) ListMetafields ¶
func (s *ShopServiceOp) ListMetafields(ctx context.Context, _ int64, options interface{}) ([]Metafield, error)
ListMetafields for a shop
func (*ShopServiceOp) UpdateMetafield ¶
func (s *ShopServiceOp) UpdateMetafield(ctx context.Context, _ int64, metafield Metafield) (*Metafield, error)
UpdateMetafield for a shop
type SingleCarrierResource ¶
type SingleCarrierResource struct {
CarrierService *CarrierService `json:"carrier_service"`
}
type SmartCollection ¶
type SmartCollection struct { ID int64 `json:"id"` Handle string `json:"handle"` Title string `json:"title"` UpdatedAt *time.Time `json:"updated_at"` BodyHTML string `json:"body_html"` SortOrder string `json:"sort_order"` TemplateSuffix string `json:"template_suffix"` Image Image `json:"image"` Published bool `json:"published"` PublishedAt *time.Time `json:"published_at"` PublishedScope string `json:"published_scope"` Rules []Rule `json:"rules"` Disjunctive bool `json:"disjunctive"` Metafields []Metafield `json:"metafields,omitempty"` }
SmartCollection represents a Shopify smart collection.
type SmartCollectionResource ¶
type SmartCollectionResource struct {
Collection *SmartCollection `json:"smart_collection"`
}
SmartCollectionResource represents the result from the smart_collections/X.json endpoint
type SmartCollectionService ¶
type SmartCollectionService interface { List(context.Context, interface{}) ([]SmartCollection, error) Count(context.Context, interface{}) (int, error) Get(context.Context, int64, interface{}) (*SmartCollection, error) Create(context.Context, SmartCollection) (*SmartCollection, error) Update(context.Context, SmartCollection) (*SmartCollection, error) Delete(context.Context, int64) error // MetafieldsService used for SmartCollection resource to communicate with Metafields resource MetafieldsService }
SmartCollectionService is an interface for interacting with the smart collection endpoints of the Shopify API. See https://help.shopify.com/api/reference/smartcollection
type SmartCollectionServiceOp ¶
type SmartCollectionServiceOp struct {
// contains filtered or unexported fields
}
SmartCollectionServiceOp handles communication with the smart collection related methods of the Shopify API.
func (*SmartCollectionServiceOp) Count ¶
func (s *SmartCollectionServiceOp) Count(ctx context.Context, options interface{}) (int, error)
Count smart collections
func (*SmartCollectionServiceOp) CountMetafields ¶
func (s *SmartCollectionServiceOp) CountMetafields(ctx context.Context, smartCollectionID int64, options interface{}) (int, error)
Count metafields for a smart collection
func (*SmartCollectionServiceOp) Create ¶
func (s *SmartCollectionServiceOp) Create(ctx context.Context, collection SmartCollection) (*SmartCollection, error)
Create a new smart collection See Image for the details of the Image creation for a collection.
func (*SmartCollectionServiceOp) CreateMetafield ¶
func (s *SmartCollectionServiceOp) CreateMetafield(ctx context.Context, smartCollectionID int64, metafield Metafield) (*Metafield, error)
Create a new metafield for a smart collection
func (*SmartCollectionServiceOp) Delete ¶
func (s *SmartCollectionServiceOp) Delete(ctx context.Context, collectionID int64) error
Delete an existing smart collection.
func (*SmartCollectionServiceOp) DeleteMetafield ¶
func (s *SmartCollectionServiceOp) DeleteMetafield(ctx context.Context, smartCollectionID int64, metafieldID int64) error
// Delete an existing metafield for a smart collection
func (*SmartCollectionServiceOp) Get ¶
func (s *SmartCollectionServiceOp) Get(ctx context.Context, collectionID int64, options interface{}) (*SmartCollection, error)
Get individual smart collection
func (*SmartCollectionServiceOp) GetMetafield ¶
func (s *SmartCollectionServiceOp) GetMetafield(ctx context.Context, smartCollectionID int64, metafieldID int64, options interface{}) (*Metafield, error)
Get individual metafield for a smart collection
func (*SmartCollectionServiceOp) List ¶
func (s *SmartCollectionServiceOp) List(ctx context.Context, options interface{}) ([]SmartCollection, error)
List smart collections
func (*SmartCollectionServiceOp) ListMetafields ¶
func (s *SmartCollectionServiceOp) ListMetafields(ctx context.Context, smartCollectionID int64, options interface{}) ([]Metafield, error)
List metafields for a smart collection
func (*SmartCollectionServiceOp) Update ¶
func (s *SmartCollectionServiceOp) Update(ctx context.Context, collection SmartCollection) (*SmartCollection, error)
Update an existing smart collection
func (*SmartCollectionServiceOp) UpdateMetafield ¶
func (s *SmartCollectionServiceOp) UpdateMetafield(ctx context.Context, smartCollectionID int64, metafield Metafield) (*Metafield, error)
Update an existing metafield for a smart collection
type SmartCollectionsResource ¶
type SmartCollectionsResource struct {
Collections []SmartCollection `json:"smart_collections"`
}
SmartCollectionsResource represents the result from the smart_collections.json endpoint
type SmsMarketingConsent ¶
type StorefrontAccessToken ¶
type StorefrontAccessToken struct { ID int64 `json:"id,omitempty"` Title string `json:"title,omitempty"` AccessToken string `json:"access_token,omitempty"` AccessScope string `json:"access_scope,omitempty"` AdminGraphqlAPIID string `json:"admin_graphql_api_id,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` }
StorefrontAccessToken represents a Shopify storefront access token
type StorefrontAccessTokenResource ¶
type StorefrontAccessTokenResource struct {
StorefrontAccessToken *StorefrontAccessToken `json:"storefront_access_token"`
}
StorefrontAccessTokenResource represents the result from the admin/storefront_access_tokens.json endpoint
type StorefrontAccessTokenService ¶
type StorefrontAccessTokenService interface { List(context.Context, interface{}) ([]StorefrontAccessToken, error) Create(context.Context, StorefrontAccessToken) (*StorefrontAccessToken, error) Delete(context.Context, int64) error }
StorefrontAccessTokenService is an interface for interfacing with the storefront access token endpoints of the Shopify API. See: https://help.shopify.com/api/reference/access/storefrontaccesstoken
type StorefrontAccessTokenServiceOp ¶
type StorefrontAccessTokenServiceOp struct {
// contains filtered or unexported fields
}
StorefrontAccessTokenServiceOp handles communication with the storefront access token related methods of the Shopify API.
func (*StorefrontAccessTokenServiceOp) Create ¶
func (s *StorefrontAccessTokenServiceOp) Create(ctx context.Context, storefrontAccessToken StorefrontAccessToken) (*StorefrontAccessToken, error)
Create a new storefront access token
func (*StorefrontAccessTokenServiceOp) Delete ¶
func (s *StorefrontAccessTokenServiceOp) Delete(ctx context.Context, ID int64) error
Delete an existing storefront access token
func (*StorefrontAccessTokenServiceOp) List ¶
func (s *StorefrontAccessTokenServiceOp) List(ctx context.Context, options interface{}) ([]StorefrontAccessToken, error)
List storefront access tokens
type StorefrontAccessTokensResource ¶
type StorefrontAccessTokensResource struct {
StorefrontAccessTokens []StorefrontAccessToken `json:"storefront_access_tokens"`
}
StorefrontAccessTokensResource is the root object for a storefront access tokens get request.
type Theme ¶
type Theme struct { ID int64 `json:"id"` Name string `json:"name"` Previewable bool `json:"previewable"` Processing bool `json:"processing"` Role string `json:"role"` ThemeStoreID int64 `json:"theme_store_id"` AdminGraphQLApiID string `json:"admin_graphql_api_id"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` }
Theme represents a Shopify theme
type ThemeListOptions ¶
type ThemeListOptions struct { Role string `url:"role,omitempty"` Fields string `url:"fields,omitempty"` }
Options for theme list
type ThemeResource ¶
type ThemeResource struct {
Theme *Theme `json:"theme"`
}
ThemesResource is the result from the themes/X.json endpoint
type ThemeService ¶
type ThemeService interface { List(context.Context, interface{}) ([]Theme, error) Create(context.Context, Theme) (*Theme, error) Get(context.Context, int64, interface{}) (*Theme, error) Update(context.Context, Theme) (*Theme, error) Delete(context.Context, int64) error }
ThemeService is an interface for interfacing with the themes endpoints of the Shopify API. See: https://help.shopify.com/api/reference/theme
type ThemeServiceOp ¶
type ThemeServiceOp struct {
// contains filtered or unexported fields
}
ThemeServiceOp handles communication with the theme related methods of the Shopify API.
func (*ThemeServiceOp) Delete ¶
func (s *ThemeServiceOp) Delete(ctx context.Context, themeID int64) error
Delete a theme
func (*ThemeServiceOp) Get ¶
func (s *ThemeServiceOp) Get(ctx context.Context, themeID int64, options interface{}) (*Theme, error)
Get a theme
type ThemesResource ¶
type ThemesResource struct {
Themes []Theme `json:"themes"`
}
ThemesResource is the result from the themes.json endpoint
type Transaction ¶
type Transaction struct { ID int64 `json:"id,omitempty"` OrderID int64 `json:"order_id,omitempty"` Amount *decimal.Decimal `json:"amount,omitempty"` Kind string `json:"kind,omitempty"` Gateway string `json:"gateway,omitempty"` Status string `json:"status,omitempty"` Message string `json:"message,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` Test bool `json:"test,omitempty"` Authorization string `json:"authorization,omitempty"` Currency string `json:"currency,omitempty"` LocationID *int64 `json:"location_id,omitempty"` UserID *int64 `json:"user_id,omitempty"` ParentID *int64 `json:"parent_id,omitempty"` DeviceID *int64 `json:"device_id,omitempty"` ErrorCode string `json:"error_code,omitempty"` SourceName string `json:"source_name,omitempty"` Source string `json:"source,omitempty"` PaymentDetails *PaymentDetails `json:"payment_details,omitempty"` }
type TransactionResource ¶
type TransactionResource struct {
Transaction *Transaction `json:"transaction"`
}
TransactionResource represents the result from the orders/X/transactions/Y.json endpoint
type TransactionService ¶
type TransactionService interface { List(context.Context, int64, interface{}) ([]Transaction, error) Count(context.Context, int64, interface{}) (int, error) Get(context.Context, int64, int64, interface{}) (*Transaction, error) Create(context.Context, int64, Transaction) (*Transaction, error) }
TransactionService is an interface for interfacing with the transactions endpoints of the Shopify API. See: https://help.shopify.com/api/reference/transaction
type TransactionServiceOp ¶
type TransactionServiceOp struct {
// contains filtered or unexported fields
}
TransactionServiceOp handles communication with the transaction related methods of the Shopify API.
func (*TransactionServiceOp) Count ¶
func (s *TransactionServiceOp) Count(ctx context.Context, orderID int64, options interface{}) (int, error)
Count transactions
func (*TransactionServiceOp) Create ¶
func (s *TransactionServiceOp) Create(ctx context.Context, orderID int64, transaction Transaction) (*Transaction, error)
Create a new transaction
func (*TransactionServiceOp) Get ¶
func (s *TransactionServiceOp) Get(ctx context.Context, orderID int64, transactionID int64, options interface{}) (*Transaction, error)
Get individual transaction
func (*TransactionServiceOp) List ¶
func (s *TransactionServiceOp) List(ctx context.Context, orderID int64, options interface{}) ([]Transaction, error)
List transactions
type TransactionsResource ¶
type TransactionsResource struct {
Transactions []Transaction `json:"transactions"`
}
TransactionsResource represents the result from the orders/X/transactions.json endpoint
type UsageCharge ¶
type UsageCharge struct { BalanceRemaining *decimal.Decimal `json:"balance_remaining,omitempty"` BalanceUsed *decimal.Decimal `json:"balance_used,omitempty"` BillingOn *time.Time `json:"billing_on,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` Description string `json:"description,omitempty"` ID int64 `json:"id,omitempty"` Price *decimal.Decimal `json:"price,omitempty"` RiskLevel *decimal.Decimal `json:"risk_level,omitempty"` }
UsageCharge represents a Shopify UsageCharge.
func (*UsageCharge) UnmarshalJSON ¶
func (r *UsageCharge) UnmarshalJSON(data []byte) error
type UsageChargeResource ¶
type UsageChargeResource struct {
Charge *UsageCharge `json:"usage_charge"`
}
UsageChargeResource represents the result from the /admin/recurring_application_charges/X/usage_charges/X.json endpoints
type UsageChargeService ¶
type UsageChargeService interface { Create(context.Context, int64, UsageCharge) (*UsageCharge, error) Get(context.Context, int64, int64, interface{}) (*UsageCharge, error) List(context.Context, int64, interface{}) ([]UsageCharge, error) }
UsageChargeService is an interface for interacting with the UsageCharge endpoints of the Shopify API. See https://help.shopify.com/en/api/reference/billing/usagecharge#endpoints
type UsageChargeServiceOp ¶
type UsageChargeServiceOp struct {
// contains filtered or unexported fields
}
UsageChargeServiceOp handles communication with the UsageCharge related methods of the Shopify API.
func (*UsageChargeServiceOp) Create ¶
func (r *UsageChargeServiceOp) Create(ctx context.Context, chargeID int64, usageCharge UsageCharge) ( *UsageCharge, error, )
Create creates new usage charge given a recurring charge. *required fields: price and description
func (*UsageChargeServiceOp) Get ¶
func (r *UsageChargeServiceOp) Get(ctx context.Context, chargeID int64, usageChargeID int64, options interface{}) ( *UsageCharge, error, )
Get gets individual usage charge.
func (*UsageChargeServiceOp) List ¶
func (r *UsageChargeServiceOp) List(ctx context.Context, chargeID int64, options interface{}) ( []UsageCharge, error, )
List gets all usage charges associated with the recurring charge.
type UsageChargesResource ¶
type UsageChargesResource struct {
Charges []UsageCharge `json:"usage_charges"`
}
UsageChargesResource represents the result from the admin/recurring_application_charges/X/usage_charges.json endpoint.
type Variant ¶
type Variant struct { ID int64 `json:"id,omitempty"` ProductID int64 `json:"product_id,omitempty"` Title string `json:"title,omitempty"` Sku string `json:"sku,omitempty"` Position int `json:"position,omitempty"` Grams int `json:"grams,omitempty"` InventoryPolicy variantInventoryPolicy `json:"inventory_policy,omitempty"` Price *decimal.Decimal `json:"price,omitempty"` CompareAtPrice *decimal.Decimal `json:"compare_at_price,omitempty"` FulfillmentService string `json:"fulfillment_service,omitempty"` InventoryManagement string `json:"inventory_management,omitempty"` InventoryItemId int64 `json:"inventory_item_id,omitempty"` Option1 string `json:"option1,omitempty"` Option2 string `json:"option2,omitempty"` Option3 string `json:"option3,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` Taxable bool `json:"taxable,omitempty"` TaxCode string `json:"tax_code,omitempty"` Barcode string `json:"barcode,omitempty"` ImageID int64 `json:"image_id,omitempty"` InventoryQuantity int `json:"inventory_quantity,omitempty"` Weight *decimal.Decimal `json:"weight,omitempty"` WeightUnit string `json:"weight_unit,omitempty"` OldInventoryQuantity int `json:"old_inventory_quantity,omitempty"` RequireShipping bool `json:"requires_shipping"` AdminGraphqlAPIID string `json:"admin_graphql_api_id,omitempty"` Metafields []Metafield `json:"metafields,omitempty"` }
Variant represents a Shopify variant
type VariantResource ¶
type VariantResource struct {
Variant *Variant `json:"variant"`
}
VariantResource represents the result from the variants/X.json endpoint
type VariantService ¶
type VariantService interface { List(context.Context, int64, interface{}) ([]Variant, error) Count(context.Context, int64, interface{}) (int, error) Get(context.Context, int64, interface{}) (*Variant, error) Create(context.Context, int64, Variant) (*Variant, error) Update(context.Context, Variant) (*Variant, error) Delete(context.Context, int64, int64) error // MetafieldsService used for Variant resource to communicate with Metafields resource MetafieldsService }
VariantService is an interface for interacting with the variant endpoints of the Shopify API. See https://help.shopify.com/api/reference/product_variant
type VariantServiceOp ¶
type VariantServiceOp struct {
// contains filtered or unexported fields
}
VariantServiceOp handles communication with the variant related methods of the Shopify API.
func (*VariantServiceOp) Count ¶
func (s *VariantServiceOp) Count(ctx context.Context, productID int64, options interface{}) (int, error)
Count variants
func (*VariantServiceOp) CountMetafields ¶
func (s *VariantServiceOp) CountMetafields(ctx context.Context, variantID int64, options interface{}) (int, error)
CountMetafields for a variant
func (*VariantServiceOp) Create ¶
func (s *VariantServiceOp) Create(ctx context.Context, productID int64, variant Variant) (*Variant, error)
Create a new variant
func (*VariantServiceOp) CreateMetafield ¶
func (s *VariantServiceOp) CreateMetafield(ctx context.Context, variantID int64, metafield Metafield) (*Metafield, error)
CreateMetafield for a variant
func (*VariantServiceOp) DeleteMetafield ¶
func (s *VariantServiceOp) DeleteMetafield(ctx context.Context, variantID int64, metafieldID int64) error
DeleteMetafield for a variant
func (*VariantServiceOp) Get ¶
func (s *VariantServiceOp) Get(ctx context.Context, variantID int64, options interface{}) (*Variant, error)
Get individual variant
func (*VariantServiceOp) GetMetafield ¶
func (s *VariantServiceOp) GetMetafield(ctx context.Context, variantID int64, metafieldID int64, options interface{}) (*Metafield, error)
GetMetafield for a variant
func (*VariantServiceOp) List ¶
func (s *VariantServiceOp) List(ctx context.Context, productID int64, options interface{}) ([]Variant, error)
List variants
func (*VariantServiceOp) ListMetafields ¶
func (s *VariantServiceOp) ListMetafields(ctx context.Context, variantID int64, options interface{}) ([]Metafield, error)
ListMetafields for a variant
func (*VariantServiceOp) UpdateMetafield ¶
func (s *VariantServiceOp) UpdateMetafield(ctx context.Context, variantID int64, metafield Metafield) (*Metafield, error)
UpdateMetafield for a variant
type VariantsResource ¶
type VariantsResource struct {
Variants []Variant `json:"variants"`
}
VariantsResource represents the result from the products/X/variants.json endpoint
type Webhook ¶
type Webhook struct { ID int64 `json:"id"` Address string `json:"address"` Topic string `json:"topic"` Format string `json:"format"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` Fields []string `json:"fields"` MetafieldNamespaces []string `json:"metafield_namespaces"` PrivateMetafieldNamespaces []string `json:"private_metafield_namespaces"` ApiVersion string `json:"api_version,omitempty"` }
Webhook represents a Shopify webhook
type WebhookOptions ¶
type WebhookOptions struct { Address string `url:"address,omitempty"` Topic string `url:"topic,omitempty"` }
WebhookOptions can be used for filtering webhooks on a List request.
type WebhookResource ¶
type WebhookResource struct {
Webhook *Webhook `json:"webhook"`
}
WebhookResource represents the result from the admin/webhooks.json endpoint
type WebhookService ¶
type WebhookService interface { List(context.Context, interface{}) ([]Webhook, error) Count(context.Context, interface{}) (int, error) Get(context.Context, int64, interface{}) (*Webhook, error) Create(context.Context, Webhook) (*Webhook, error) Update(context.Context, Webhook) (*Webhook, error) Delete(context.Context, int64) error }
WebhookService is an interface for interfacing with the webhook endpoints of the Shopify API. See: https://help.shopify.com/api/reference/webhook
type WebhookServiceOp ¶
type WebhookServiceOp struct {
// contains filtered or unexported fields
}
WebhookServiceOp handles communication with the webhook-related methods of the Shopify API.
func (*WebhookServiceOp) Count ¶
func (s *WebhookServiceOp) Count(ctx context.Context, options interface{}) (int, error)
Count webhooks
func (*WebhookServiceOp) Delete ¶
func (s *WebhookServiceOp) Delete(ctx context.Context, ID int64) error
Delete an existing webhooks
func (*WebhookServiceOp) Get ¶
func (s *WebhookServiceOp) Get(ctx context.Context, webhookdID int64, options interface{}) (*Webhook, error)
Get individual webhook
type WebhooksResource ¶
type WebhooksResource struct {
Webhooks []Webhook `json:"webhooks"`
}
WebhooksResource is the root object for a webhook get request.
type WeightBasedShippingRate ¶
type WeightBasedShippingRate struct { ID int64 `json:"id,omitempty"` ShippingZoneID int64 `json:"shipping_zone_id,omitempty"` Name string `json:"name,omitempty"` Price *decimal.Decimal `json:"price,omitempty"` WeightLow *decimal.Decimal `json:"weight_low,omitempty"` WeightHigh *decimal.Decimal `json:"weight_high,omitempty"` }
WeightBasedShippingRate represents a Shopify weight-constrained shipping rate
Source Files ¶
- abandoned_checkout.go
- access_scopes.go
- applicationcharge.go
- asset.go
- assigned_fulfillment_order.go
- blog.go
- carrier.go
- collect.go
- collection.go
- customcollection.go
- customer.go
- customer_address.go
- discount_code.go
- draft_order.go
- fulfillment.go
- fulfillment_event.go
- fulfillment_order.go
- fulfillment_request.go
- fulfillment_service.go
- gift_card.go
- goshopify.go
- graphql.go
- image.go
- inventory_item.go
- inventory_level.go
- location.go
- logger.go
- metafield.go
- oauth.go
- options.go
- order.go
- order_risk.go
- page.go
- payments_transactions.go
- payouts.go
- price_rule.go
- product.go
- product_listing.go
- recurringapplicationcharge.go
- redirect.go
- scripttag.go
- shipping_zone.go
- shop.go
- smartcollection.go
- storefrontaccesstoken.go
- theme.go
- transaction.go
- usagecharge.go
- util.go
- variant.go
- webhook.go