Documentation
¶
Index ¶
- Constants
- Variables
- type APIError
- type AuthenticationError
- type AutomaticDiscount
- type AutomaticDiscountCreateRequest
- type AutomaticDiscountUpdateRequest
- type Balance
- type BalanceListTransactionsOptions
- type BalanceService
- func (s *BalanceService) AllTransactions(ctx context.Context, opts *BalanceListTransactionsOptions) iter.Seq2[Transaction, error]
- func (s *BalanceService) Get(ctx context.Context) ([]Balance, error)
- func (s *BalanceService) GetTransaction(ctx context.Context, orderID string) (*Transaction, error)
- func (s *BalanceService) ListTransactions(ctx context.Context, opts *BalanceListTransactionsOptions) (*PageResponse[Transaction], error)
- type Category
- type CategoryCreateRequest
- type CategoryService
- func (s *CategoryService) All(ctx context.Context, opts *ListOptions) iter.Seq2[Category, error]
- func (s *CategoryService) Create(ctx context.Context, req *CategoryCreateRequest) (*Category, error)
- func (s *CategoryService) Delete(ctx context.Context, id string) error
- func (s *CategoryService) Get(ctx context.Context, id string) (*Category, error)
- func (s *CategoryService) List(ctx context.Context, opts *ListOptions) (*PageResponse[Category], error)
- func (s *CategoryService) Update(ctx context.Context, id string, req *CategoryUpdateRequest) (*Category, error)
- type CategoryUpdateRequest
- type Client
- type DiscountCode
- type DiscountCodeCreateRequest
- type DiscountCodeUpdateRequest
- type DiscountService
- func (s *DiscountService) AllAutomatic(ctx context.Context, opts *ListOptions) iter.Seq2[AutomaticDiscount, error]
- func (s *DiscountService) AllCodes(ctx context.Context, opts *ListOptions) iter.Seq2[DiscountCode, error]
- func (s *DiscountService) CreateAutomatic(ctx context.Context, req *AutomaticDiscountCreateRequest) (*AutomaticDiscount, error)
- func (s *DiscountService) CreateCode(ctx context.Context, req *DiscountCodeCreateRequest) (*DiscountCode, error)
- func (s *DiscountService) DeleteAutomatic(ctx context.Context, id string) error
- func (s *DiscountService) DeleteCode(ctx context.Context, id string) error
- func (s *DiscountService) GetAutomatic(ctx context.Context, id string) (*AutomaticDiscount, error)
- func (s *DiscountService) GetCode(ctx context.Context, id string) (*DiscountCode, error)
- func (s *DiscountService) ListAutomatic(ctx context.Context, opts *ListOptions) (*PageResponse[AutomaticDiscount], error)
- func (s *DiscountService) ListCodes(ctx context.Context, opts *ListOptions) (*PageResponse[DiscountCode], error)
- func (s *DiscountService) UpdateAutomatic(ctx context.Context, id string, req *AutomaticDiscountUpdateRequest) (*AutomaticDiscount, error)
- func (s *DiscountService) UpdateCode(ctx context.Context, id string, req *DiscountCodeUpdateRequest) (*DiscountCode, error)
- type ListOptions
- type Option
- func WithBaseURL(url string) Option
- func WithHTTPClient(client *http.Client) Option
- func WithLogger(logger *slog.Logger) Option
- func WithMaxRetries(retries int) Option
- func WithOAuthBaseURL(url string) Option
- func WithRetryDelay(initial, max time.Duration) Option
- func WithTimeout(timeout time.Duration) Option
- func WithUserAgent(userAgent string) Option
- type Order
- type OrderBillingInfo
- type OrderDiscount
- type OrderFulfillments
- type OrderLineItem
- type OrderLineItemOption
- type OrderLineItemSelection
- type OrderListOptions
- type OrderService
- func (s *OrderService) All(ctx context.Context, opts *OrderListOptions) iter.Seq2[Order, error]
- func (s *OrderService) Get(ctx context.Context, id string) (*Order, error)
- func (s *OrderService) GetTransaction(ctx context.Context, orderID string) (*OrderTransaction, error)
- func (s *OrderService) List(ctx context.Context, opts *OrderListOptions) (*PageResponse[Order], error)
- func (s *OrderService) Update(ctx context.Context, id string, req *OrderUpdateRequest) (*Order, error)
- type OrderShippingInfo
- type OrderTotals
- type OrderTransaction
- type OrderUpdateRequest
- type PageResponse
- type PaginationInfo
- type Payout
- type PayoutDestination
- type PayoutService
- func (s *PayoutService) All(ctx context.Context, opts *ListOptions) iter.Seq2[Payout, error]
- func (s *PayoutService) AllTransactions(ctx context.Context, id string, opts *ListOptions) iter.Seq2[Transaction, error]
- func (s *PayoutService) Get(ctx context.Context, id string) (*Payout, error)
- func (s *PayoutService) List(ctx context.Context, opts *ListOptions) (*PageResponse[Payout], error)
- func (s *PayoutService) ListTransactions(ctx context.Context, id string, opts *ListOptions) (*PageResponse[Transaction], error)
- type Product
- type ProductCategoryRef
- type ProductCreateRequest
- type ProductListOptions
- type ProductMedia
- type ProductOption
- type ProductPriceData
- type ProductService
- func (s *ProductService) All(ctx context.Context, opts *ProductListOptions) iter.Seq2[Product, error]
- func (s *ProductService) Create(ctx context.Context, req *ProductCreateRequest) (*Product, error)
- func (s *ProductService) Delete(ctx context.Context, id string) error
- func (s *ProductService) Get(ctx context.Context, id string) (*Product, error)
- func (s *ProductService) List(ctx context.Context, opts *ProductListOptions) (*PageResponse[Product], error)
- func (s *ProductService) Update(ctx context.Context, id string, req *ProductUpdateRequest) (*Product, error)
- type ProductUpdateRequest
- type ProductVariant
- type QuickCheckoutBuyer
- type QuickCheckoutError
- type QuickCheckoutOption
- type QuickCheckoutRequest
- type QuickCheckoutResult
- type QuickCheckoutService
- type QuickCheckoutStage
- type RateLimitError
- type Refund
- type RefundCreateRequest
- type RefundListOptions
- type RefundService
- func (s *RefundService) All(ctx context.Context, opts *RefundListOptions) iter.Seq2[Refund, error]
- func (s *RefundService) Create(ctx context.Context, req *RefundCreateRequest) (*Refund, error)
- func (s *RefundService) Get(ctx context.Context, id string) (*Refund, error)
- func (s *RefundService) List(ctx context.Context, opts *RefundListOptions) (*PageResponse[Refund], error)
- type Selection
- type SelectionCreateRequest
- type SelectionListOptions
- type SelectionService
- func (s *SelectionService) All(ctx context.Context, opts *SelectionListOptions) iter.Seq2[Selection, error]
- func (s *SelectionService) Create(ctx context.Context, req *SelectionCreateRequest) (*Selection, error)
- func (s *SelectionService) Delete(ctx context.Context, id string) error
- func (s *SelectionService) Get(ctx context.Context, id string) (*Selection, error)
- func (s *SelectionService) List(ctx context.Context, opts *SelectionListOptions) (*PageResponse[Selection], error)
- func (s *SelectionService) Update(ctx context.Context, id string, req *SelectionUpdateRequest) (*Selection, error)
- type SelectionUpdateRequest
- type Shipping
- type ShippingCreateRequest
- type ShippingListOptions
- type ShippingService
- func (s *ShippingService) All(ctx context.Context, opts *ShippingListOptions) iter.Seq2[Shipping, error]
- func (s *ShippingService) Create(ctx context.Context, req *ShippingCreateRequest) (*Shipping, error)
- func (s *ShippingService) Delete(ctx context.Context, code string) error
- func (s *ShippingService) Get(ctx context.Context, code string) (*Shipping, error)
- func (s *ShippingService) List(ctx context.Context, opts *ShippingListOptions) (*PageResponse[Shipping], error)
- type ShopOwner
- type ShopOwnerBankAccount
- type ShopOwnerCompany
- type ShopOwnerContact
- type ShopService
- type ShopSettings
- type ShopSettingsUpdateRequest
- type Transaction
- type TransactionAmount
- type TransactionFee
- type Variation
- type VariationCreateRequest
- type VariationService
- func (s *VariationService) All(ctx context.Context, opts *ListOptions) iter.Seq2[Variation, error]
- func (s *VariationService) Create(ctx context.Context, req *VariationCreateRequest) (*Variation, error)
- func (s *VariationService) Delete(ctx context.Context, id string) error
- func (s *VariationService) Get(ctx context.Context, id string) (*Variation, error)
- func (s *VariationService) List(ctx context.Context, opts *ListOptions) (*PageResponse[Variation], error)
- func (s *VariationService) Update(ctx context.Context, id string, req *VariationUpdateRequest) (*Variation, error)
- type VariationUpdateRequest
- type WebhookCreateRequest
- type WebhookService
- type WebhookSubscription
Constants ¶
const ( // DefaultBaseURL is the standard Shopier REST API v1 endpoint. DefaultBaseURL = "https://api.shopier.com/v1" // DefaultOAuthBaseURL is the Shopier OAuth 2.0 endpoint running on port 8443. DefaultOAuthBaseURL = "https://api.shopier.com:8443/v1" // Version is the current release version of this SDK. Version = "1.0.0" // DefaultUserAgent sent with outbound API requests. DefaultUserAgent = "shopier-go/" + Version )
Variables ¶
var ( // ErrMissingToken indicates that an API request was attempted without an access token. ErrMissingToken = errors.New("shopier: access token is required") // ErrInvalidBaseURL indicates that the provided API base URL is malformed. ErrInvalidBaseURL = errors.New("shopier: invalid base URL") )
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct {
StatusCode int `json:"status_code"`
ErrorCode string `json:"error,omitempty"`
Message string `json:"message,omitempty"`
Detail string `json:"error_description,omitempty"`
RawBody []byte `json:"-"`
Header http.Header `json:"-"`
}
APIError represents a non-2xx HTTP response from the Shopier REST API.
type AuthenticationError ¶
type AuthenticationError struct {
APIError
}
AuthenticationError represents a 401 Unauthorized response, typically caused by an expired, invalid, or revoked Personal Access Token or OAuth2 access token.
func (*AuthenticationError) Error ¶
func (e *AuthenticationError) Error() string
type AutomaticDiscount ¶
type AutomaticDiscount struct {
ID string `json:"id"`
Title string `json:"title"`
Scope string `json:"scope"` // "all", "selectedProducts", "selectedCategories"
ProductIDs []string `json:"productIds,omitempty"`
CategoryIDs []string `json:"categoryIds,omitempty"`
DateCreated string `json:"dateCreated"`
Type string `json:"type"` // "amount" or "percent"
AmountOff string `json:"amountOff,omitempty"`
PercentOff string `json:"percentOff,omitempty"`
Requirement string `json:"requirement"` // "amount" or "quantity"
AmountMinimum string `json:"amountMinimum,omitempty"`
QuantityMinimum int `json:"quantityMinimum,omitempty"`
Currency string `json:"currency"`
StartsAt string `json:"startsAt,omitempty"`
ExpiresAt string `json:"expiresAt,omitempty"`
}
AutomaticDiscount represents a rule-based promotion applied without user entry.
type AutomaticDiscountCreateRequest ¶
type AutomaticDiscountCreateRequest struct {
Title string `json:"title"`
Scope string `json:"scope"`
ProductIDs []string `json:"productIds,omitempty"`
CategoryIDs []string `json:"categoryIds,omitempty"`
Type string `json:"type"`
AmountOff string `json:"amountOff,omitempty"`
PercentOff string `json:"percentOff,omitempty"`
Requirement string `json:"requirement"`
AmountMinimum string `json:"amountMinimum,omitempty"`
QuantityMinimum int `json:"quantityMinimum,omitempty"`
Currency string `json:"currency"`
StartsAt string `json:"startsAt,omitempty"`
ExpiresAt string `json:"expiresAt,omitempty"`
}
AutomaticDiscountCreateRequest defines parameters for POST /discounts/automatic.
type AutomaticDiscountUpdateRequest ¶
type AutomaticDiscountUpdateRequest struct {
Title string `json:"title,omitempty"`
Scope string `json:"scope,omitempty"`
ProductIDs []string `json:"productIds,omitempty"`
CategoryIDs []string `json:"categoryIds,omitempty"`
AmountMinimum string `json:"amountMinimum,omitempty"`
QuantityMinimum int `json:"quantityMinimum,omitempty"`
StartsAt string `json:"startsAt,omitempty"`
ExpiresAt string `json:"expiresAt,omitempty"`
}
AutomaticDiscountUpdateRequest defines parameters for PUT /discounts/automatic/{id}.
type BalanceListTransactionsOptions ¶
type BalanceListTransactionsOptions struct {
ListOptions
DateStart string `url:"dateStart,omitempty"`
DateEnd string `url:"dateEnd,omitempty"`
}
BalanceListTransactionsOptions holds query filters for GET /balance/transactions.
func (*BalanceListTransactionsOptions) Values ¶
func (o *BalanceListTransactionsOptions) Values() url.Values
Values compiles BalanceListTransactionsOptions into URL query parameters.
type BalanceService ¶
type BalanceService struct {
// contains filtered or unexported fields
}
BalanceService exposes balance inquiries and transaction ledger queries.
func (*BalanceService) AllTransactions ¶
func (s *BalanceService) AllTransactions(ctx context.Context, opts *BalanceListTransactionsOptions) iter.Seq2[Transaction, error]
AllTransactions returns a Go 1.23+ iterator traversing all balance transactions across pages.
func (*BalanceService) Get ¶
func (s *BalanceService) Get(ctx context.Context) ([]Balance, error)
Get retrieves current net balances across all active currencies.
func (*BalanceService) GetTransaction ¶
func (s *BalanceService) GetTransaction(ctx context.Context, orderID string) (*Transaction, error)
GetTransaction retrieves a specific balance transaction by its associated order ID.
func (*BalanceService) ListTransactions ¶
func (s *BalanceService) ListTransactions(ctx context.Context, opts *BalanceListTransactionsOptions) (*PageResponse[Transaction], error)
ListTransactions returns paginated balance transactions contributing to net funds.
type Category ¶
type Category struct {
ID string `json:"id"`
Title string `json:"title"`
Placement int `json:"placement"`
}
Category represents a grouping container for products.
type CategoryCreateRequest ¶
type CategoryCreateRequest struct {
Title string `json:"title"`
}
CategoryCreateRequest defines parameters for POST /categories.
type CategoryService ¶
type CategoryService struct {
// contains filtered or unexported fields
}
CategoryService exposes product category management endpoints.
func (*CategoryService) All ¶
func (s *CategoryService) All(ctx context.Context, opts *ListOptions) iter.Seq2[Category, error]
All returns a Go 1.23+ iterator traversing every category across all pages.
func (*CategoryService) Create ¶
func (s *CategoryService) Create(ctx context.Context, req *CategoryCreateRequest) (*Category, error)
Create registers a new product category.
func (*CategoryService) Delete ¶
func (s *CategoryService) Delete(ctx context.Context, id string) error
Delete permanently removes a product category.
func (*CategoryService) List ¶
func (s *CategoryService) List(ctx context.Context, opts *ListOptions) (*PageResponse[Category], error)
List returns paginated product categories.
func (*CategoryService) Update ¶
func (s *CategoryService) Update(ctx context.Context, id string, req *CategoryUpdateRequest) (*Category, error)
Update renames an existing product category.
type CategoryUpdateRequest ¶
type CategoryUpdateRequest struct {
Title string `json:"title"`
}
CategoryUpdateRequest defines parameters for PUT /categories/{id}.
type Client ¶
type Client struct {
// Resource services
Balance *BalanceService
Categories *CategoryService
Discounts *DiscountService
Orders *OrderService
Payouts *PayoutService
Products *ProductService
Refunds *RefundService
Selections *SelectionService
Shippings *ShippingService
Shop *ShopService
Variations *VariationService
Webhooks *WebhookService
QuickCheckout *QuickCheckoutService
// contains filtered or unexported fields
}
Client coordinates API requests across all Shopier resource services.
type DiscountCode ¶
type DiscountCode struct {
ID string `json:"id"`
Code string `json:"code"`
DateCreated string `json:"dateCreated"`
Type string `json:"type"` // "amount" or "percent"
AmountOff string `json:"amountOff,omitempty"`
PercentOff string `json:"percentOff,omitempty"`
AmountMinimum string `json:"amountMinimum,omitempty"`
Currency string `json:"currency"`
NumAvailable int `json:"numAvailable"`
NumUsed int `json:"numUsed"`
ExpiresAt string `json:"expiresAt,omitempty"`
}
DiscountCode represents a promotional code redeemed at checkout.
type DiscountCodeCreateRequest ¶
type DiscountCodeCreateRequest struct {
Code string `json:"code"`
Type string `json:"type"` // "amount" or "percent"
AmountOff string `json:"amountOff,omitempty"`
PercentOff string `json:"percentOff,omitempty"`
AmountMinimum string `json:"amountMinimum,omitempty"`
Currency string `json:"currency"`
NumAvailable int `json:"numAvailable"`
ExpiresAt string `json:"expiresAt,omitempty"`
}
DiscountCodeCreateRequest defines parameters for POST /discounts/codes.
type DiscountCodeUpdateRequest ¶
type DiscountCodeUpdateRequest struct {
Code string `json:"code,omitempty"`
NumAvailable int `json:"numAvailable,omitempty"`
ExpiresAt string `json:"expiresAt,omitempty"`
AmountMinimum string `json:"amountMinimum,omitempty"`
}
DiscountCodeUpdateRequest defines parameters for PUT /discounts/codes/{id}.
type DiscountService ¶
type DiscountService struct {
// contains filtered or unexported fields
}
DiscountService exposes promotional code and automatic discount endpoints.
func (*DiscountService) AllAutomatic ¶
func (s *DiscountService) AllAutomatic(ctx context.Context, opts *ListOptions) iter.Seq2[AutomaticDiscount, error]
AllAutomatic returns a Go 1.23+ iterator traversing all automatic discounts.
func (*DiscountService) AllCodes ¶
func (s *DiscountService) AllCodes(ctx context.Context, opts *ListOptions) iter.Seq2[DiscountCode, error]
AllCodes returns a Go 1.23+ iterator traversing all discount codes across pages.
func (*DiscountService) CreateAutomatic ¶
func (s *DiscountService) CreateAutomatic(ctx context.Context, req *AutomaticDiscountCreateRequest) (*AutomaticDiscount, error)
CreateAutomatic creates a new automatic discount campaign.
func (*DiscountService) CreateCode ¶
func (s *DiscountService) CreateCode(ctx context.Context, req *DiscountCodeCreateRequest) (*DiscountCode, error)
CreateCode publishes a new discount code.
func (*DiscountService) DeleteAutomatic ¶
func (s *DiscountService) DeleteAutomatic(ctx context.Context, id string) error
DeleteAutomatic permanently deletes an automatic discount campaign.
func (*DiscountService) DeleteCode ¶
func (s *DiscountService) DeleteCode(ctx context.Context, id string) error
DeleteCode permanently deletes a discount code.
func (*DiscountService) GetAutomatic ¶
func (s *DiscountService) GetAutomatic(ctx context.Context, id string) (*AutomaticDiscount, error)
GetAutomatic retrieves an automatic discount by ID.
func (*DiscountService) GetCode ¶
func (s *DiscountService) GetCode(ctx context.Context, id string) (*DiscountCode, error)
GetCode retrieves a discount code by ID.
func (*DiscountService) ListAutomatic ¶
func (s *DiscountService) ListAutomatic(ctx context.Context, opts *ListOptions) (*PageResponse[AutomaticDiscount], error)
ListAutomatic returns paginated automatic discount campaigns.
func (*DiscountService) ListCodes ¶
func (s *DiscountService) ListCodes(ctx context.Context, opts *ListOptions) (*PageResponse[DiscountCode], error)
ListCodes returns paginated discount codes.
func (*DiscountService) UpdateAutomatic ¶
func (s *DiscountService) UpdateAutomatic(ctx context.Context, id string, req *AutomaticDiscountUpdateRequest) (*AutomaticDiscount, error)
UpdateAutomatic updates an existing automatic discount campaign.
func (*DiscountService) UpdateCode ¶
func (s *DiscountService) UpdateCode(ctx context.Context, id string, req *DiscountCodeUpdateRequest) (*DiscountCode, error)
UpdateCode updates attributes of an existing discount code.
type ListOptions ¶
type ListOptions struct {
// Page specifies the page of results to return (default: 1, min: 1).
Page int `url:"page,omitempty"`
// Limit specifies the maximum number of items returned (default: 10, min: 1, max: 50).
Limit int `url:"limit,omitempty"`
// Sort specifies sort order or field where supported by the endpoint.
Sort string `url:"sort,omitempty"`
}
ListOptions specifies common query parameters for all Shopier list endpoints.
func (*ListOptions) Values ¶
func (o *ListOptions) Values() url.Values
Values converts ListOptions into standard url.Values.
type Option ¶
type Option func(*Client)
Option represents a functional configuration option for Client.
func WithBaseURL ¶
WithBaseURL overrides the default REST API base URL (default: "https://api.shopier.com/v1").
func WithHTTPClient ¶
WithHTTPClient sets a custom http.Client for network transport.
func WithLogger ¶
WithLogger configures a structured logger using Go's standard log/slog.
func WithMaxRetries ¶
WithMaxRetries sets the maximum retry attempts for transient server errors (5xx) and rate limit throttling (429). Setting 0 disables automatic retries.
func WithOAuthBaseURL ¶
WithOAuthBaseURL overrides the default OAuth base URL (default: "https://api.shopier.com:8443/v1"). Shopier routes OAuth token exchanges and revocations via port 8443.
func WithRetryDelay ¶
WithRetryDelay configures initial delay and maximum delay cap for exponential backoff.
func WithTimeout ¶
WithTimeout configures a default client-level timeout applied when a request context does not specify its own deadline.
func WithUserAgent ¶
WithUserAgent customizes the User-Agent request header string.
type Order ¶
type Order struct {
ID string `json:"id"`
Status string `json:"status"`
PaymentStatus string `json:"paymentStatus"`
Installments bool `json:"installments"`
DateCreated string `json:"dateCreated"`
Currency string `json:"currency"`
PaymentMethod string `json:"paymentMethod"`
Totals OrderTotals `json:"totals"`
Discounts []OrderDiscount `json:"discounts,omitempty"`
ShippingInfo OrderShippingInfo `json:"shippingInfo"`
BillingInfo *OrderBillingInfo `json:"billingInfo,omitempty"`
Note string `json:"note,omitempty"`
LineItems []OrderLineItem `json:"lineItems"`
}
Order represents an order placed through Shopier.
type OrderBillingInfo ¶
type OrderBillingInfo struct {
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
NationalID string `json:"nationalId,omitempty"`
Email string `json:"email"`
Phone string `json:"phone"`
Company string `json:"company,omitempty"`
TaxOffice string `json:"taxOffice,omitempty"`
TaxNumber string `json:"taxNumber,omitempty"`
Address string `json:"address"`
District string `json:"district"`
City string `json:"city"`
State string `json:"state,omitempty"`
Postcode string `json:"postcode,omitempty"`
Country string `json:"country"`
}
OrderBillingInfo represents corporate or separate invoicing details.
type OrderDiscount ¶
OrderDiscount describes a discount applied to an order.
type OrderFulfillments ¶
type OrderFulfillments struct {
ProductType string `json:"productType,omitempty"`
ShippingCompany string `json:"shippingCompany,omitempty"`
TrackingNumber string `json:"trackingNumber,omitempty"`
Note string `json:"note,omitempty"`
}
OrderFulfillments defines delivery execution status and carrier details.
type OrderLineItem ¶
type OrderLineItem struct {
ProductID string `json:"productId"`
Title string `json:"title"`
Type string `json:"type"`
Selection []OrderLineItemSelection `json:"selection,omitempty"`
Options []OrderLineItemOption `json:"options,omitempty"`
Quantity int `json:"quantity"`
Price string `json:"price"`
}
OrderLineItem represents an individual item within an order.
type OrderLineItemOption ¶
type OrderLineItemOption struct {
ID string `json:"id"`
Title string `json:"title"`
Price string `json:"price"`
}
OrderLineItemOption represents buyer-selected addon options for a line item.
type OrderLineItemSelection ¶
type OrderLineItemSelection struct {
ID string `json:"id"`
Title string `json:"title"`
VariationTitle string `json:"variationTitle"`
}
OrderLineItemSelection represents variant choices for a line item.
type OrderListOptions ¶
type OrderListOptions struct {
ListOptions
DateStart string `url:"dateStart,omitempty"`
DateEnd string `url:"dateEnd,omitempty"`
FulfillmentStatus string `url:"fulfillmentStatus,omitempty"`
RefundType string `url:"refundType,omitempty"`
CustomerEmail string `url:"customerEmail,omitempty"`
CustomerPhone string `url:"customerPhone,omitempty"`
ProductID string `url:"productId,omitempty"`
}
OrderListOptions holds query filters accepted by GET /orders. Shopier defaults dateStart/dateEnd to the last 60 days when omitted.
func (*OrderListOptions) Values ¶
func (o *OrderListOptions) Values() url.Values
Values compiles OrderListOptions into URL query parameters.
type OrderService ¶
type OrderService struct {
// contains filtered or unexported fields
}
OrderService exposes order management endpoints.
func (*OrderService) All ¶
func (s *OrderService) All(ctx context.Context, opts *OrderListOptions) iter.Seq2[Order, error]
All returns a Go 1.23+ range iterator traversing every order matching opts. Pages are fetched lazily as the loop progresses.
func (*OrderService) GetTransaction ¶
func (s *OrderService) GetTransaction(ctx context.Context, orderID string) (*OrderTransaction, error)
GetTransaction retrieves settlement and fee breakdown for an order.
func (*OrderService) List ¶
func (s *OrderService) List(ctx context.Context, opts *OrderListOptions) (*PageResponse[Order], error)
List queries orders matching the specified filter parameters.
func (*OrderService) Update ¶
func (s *OrderService) Update(ctx context.Context, id string, req *OrderUpdateRequest) (*Order, error)
Update updates an order's fulfillment tracking or buyer shipping address.
type OrderShippingInfo ¶
type OrderShippingInfo struct {
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
NationalID string `json:"nationalId,omitempty"`
Email string `json:"email"`
Phone string `json:"phone"`
Company string `json:"company,omitempty"`
Address string `json:"address"`
District string `json:"district"`
City string `json:"city"`
State string `json:"state,omitempty"`
Postcode string `json:"postcode,omitempty"`
Country string `json:"country"`
}
OrderShippingInfo represents the recipient and destination delivery details.
type OrderTotals ¶
type OrderTotals struct {
Subtotal string `json:"subtotal"`
Shipping string `json:"shipping"`
Discount string `json:"discount"`
Total string `json:"total"`
}
OrderTotals specifies price breakdowns for an order.
type OrderTransaction ¶
type OrderTransaction struct {
OrderID string `json:"orderId"`
Type string `json:"type"`
Description string `json:"description,omitempty"`
DateCreated string `json:"dateCreated"`
Gross TransactionAmount `json:"gross"`
Fee TransactionFee `json:"fee"`
Net TransactionAmount `json:"net"`
}
OrderTransaction provides financial breakdown details for an order payment.
type OrderUpdateRequest ¶
type OrderUpdateRequest struct {
Fulfillments *OrderFulfillments `json:"fulfillments,omitempty"`
ShippingInfo *OrderShippingInfo `json:"shippingInfo,omitempty"`
}
OrderUpdateRequest defines payload parameters accepted by PUT /orders/{id}.
type PageResponse ¶
type PageResponse[T any] struct { Items []T `json:"items"` Pagination PaginationInfo `json:"pagination"` }
PageResponse wraps an item slice alongside its Shopier pagination metadata.
type PaginationInfo ¶
type PaginationInfo struct {
Page int `json:"page"`
Limit int `json:"limit"`
TotalPages int `json:"total_pages"`
TotalItems int `json:"total_items"`
}
PaginationInfo holds pagination metadata extracted from Shopier response headers. Shopier delivers pagination state via custom HTTP headers rather than response bodies: - Shopier-Pagination-Page - Shopier-Pagination-Limit - Shopier-Pagination-Total-Pages - Shopier-Pagination-Total-Items
func ParsePaginationHeaders ¶
func ParsePaginationHeaders(header http.Header) PaginationInfo
ParsePaginationHeaders reads Shopier-Pagination-* headers from an HTTP response.
func (PaginationInfo) HasNextPage ¶
func (p PaginationInfo) HasNextPage() bool
HasNextPage returns true if more pages are available after the current page.
func (PaginationInfo) NextPage ¶
func (p PaginationInfo) NextPage() int
NextPage returns the index for the next page, or 0 if no subsequent pages exist.
type Payout ¶
type Payout struct {
ID string `json:"id"`
Status string `json:"status"` // "pending" or "paid"
DateCreated string `json:"dateCreated"`
Amount string `json:"amount"`
Currency string `json:"currency"`
Destination PayoutDestination `json:"destination"`
}
Payout represents a fund disbursement transferred to the merchant's bank account.
type PayoutDestination ¶
type PayoutDestination struct {
Type string `json:"type"` // "bankAccount"
IBAN string `json:"iban"`
}
PayoutDestination specifies the bank details receiving transferred funds.
type PayoutService ¶
type PayoutService struct {
// contains filtered or unexported fields
}
PayoutService exposes merchant disbursement endpoints.
func (*PayoutService) All ¶
func (s *PayoutService) All(ctx context.Context, opts *ListOptions) iter.Seq2[Payout, error]
All returns a Go 1.23+ iterator traversing all payouts across pages.
func (*PayoutService) AllTransactions ¶
func (s *PayoutService) AllTransactions(ctx context.Context, id string, opts *ListOptions) iter.Seq2[Transaction, error]
AllTransactions returns a Go 1.23+ iterator traversing all transactions of a payout across pages.
func (*PayoutService) List ¶
func (s *PayoutService) List(ctx context.Context, opts *ListOptions) (*PageResponse[Payout], error)
List returns paginated payout transfer records.
func (*PayoutService) ListTransactions ¶
func (s *PayoutService) ListTransactions(ctx context.Context, id string, opts *ListOptions) (*PageResponse[Transaction], error)
ListTransactions returns paginated transactions included in a specific payout.
type Product ¶
type Product struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Type string `json:"type"`
DateCreated string `json:"dateCreated,omitempty"`
URL string `json:"url,omitempty"`
Media []ProductMedia `json:"media"`
PriceData ProductPriceData `json:"priceData"`
StockStatus string `json:"stockStatus,omitempty"`
StockQuantity int `json:"stockQuantity"`
ShippingPayer string `json:"shippingPayer"`
Categories []ProductCategoryRef `json:"categories,omitempty"`
Variants []ProductVariant `json:"variants,omitempty"`
Options []ProductOption `json:"options,omitempty"`
SingleOption bool `json:"singleOption"`
CustomListing bool `json:"customListing"`
CustomNote string `json:"customNote,omitempty"`
PlacementScore int `json:"placementScore,omitempty"`
DispatchDuration int `json:"dispatchDuration,omitempty"`
}
Product represents a merchandise listing in a Shopier storefront.
type ProductCategoryRef ¶
type ProductCategoryRef struct {
ID string `json:"id,omitempty"`
CategoryID string `json:"categoryId,omitempty"`
Title string `json:"title,omitempty"`
}
ProductCategoryRef links a product to an existing category.
type ProductCreateRequest ¶
type ProductCreateRequest struct {
Title string `json:"title"`
Description string `json:"description,omitempty"`
Type string `json:"type"`
Media []ProductMedia `json:"media"`
PriceData ProductPriceData `json:"priceData"`
StockQuantity int `json:"stockQuantity,omitempty"`
ShippingPayer string `json:"shippingPayer"`
Categories []ProductCategoryRef `json:"categories,omitempty"`
Variants []ProductVariant `json:"variants,omitempty"`
Options []ProductOption `json:"options,omitempty"`
SingleOption bool `json:"singleOption,omitempty"`
CustomListing bool `json:"customListing,omitempty"`
CustomNote string `json:"customNote,omitempty"`
PlacementScore int `json:"placementScore,omitempty"`
DispatchDuration int `json:"dispatchDuration,omitempty"`
}
ProductCreateRequest defines parameters required by POST /products.
type ProductListOptions ¶
type ProductListOptions struct {
ListOptions
Title string `url:"title,omitempty"`
Status string `url:"status,omitempty"`
Category string `url:"category,omitempty"`
}
ProductListOptions holds filter parameters accepted by GET /products.
func (*ProductListOptions) Values ¶
func (o *ProductListOptions) Values() url.Values
Values compiles ProductListOptions into URL query parameters.
type ProductMedia ¶
type ProductMedia struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
URL string `json:"url"`
Placement int `json:"placement"`
}
ProductMedia describes an image asset attached to a product listing.
type ProductOption ¶
type ProductOption struct {
ID string `json:"id,omitempty"`
OptionID string `json:"optionId,omitempty"`
Title string `json:"title,omitempty"`
OptionTitle string `json:"optionTitle,omitempty"`
Price string `json:"price,omitempty"`
OptionPrice string `json:"optionPrice,omitempty"`
}
ProductOption defines an optional addon item configurable by the buyer.
type ProductPriceData ¶
type ProductPriceData struct {
Currency string `json:"currency"`
Price string `json:"price"`
Discount bool `json:"discount"`
DiscountedPrice string `json:"discountedPrice,omitempty"`
ShippingPrice string `json:"shippingPrice,omitempty"`
}
ProductPriceData holds currency, unit price, discounts, and shipping cost.
type ProductService ¶
type ProductService struct {
// contains filtered or unexported fields
}
ProductService exposes product catalog management endpoints.
func (*ProductService) All ¶
func (s *ProductService) All(ctx context.Context, opts *ProductListOptions) iter.Seq2[Product, error]
All returns a Go 1.23+ range iterator across all products matching opts.
func (*ProductService) Create ¶
func (s *ProductService) Create(ctx context.Context, req *ProductCreateRequest) (*Product, error)
Create publishes a new product to the shop.
func (*ProductService) Delete ¶
func (s *ProductService) Delete(ctx context.Context, id string) error
Delete permanently removes a product listing from the storefront.
func (*ProductService) List ¶
func (s *ProductService) List(ctx context.Context, opts *ProductListOptions) (*PageResponse[Product], error)
List queries products matching the filter criteria.
func (*ProductService) Update ¶
func (s *ProductService) Update(ctx context.Context, id string, req *ProductUpdateRequest) (*Product, error)
Update updates an existing product's attributes.
type ProductUpdateRequest ¶
type ProductUpdateRequest struct {
Title *string `json:"title,omitempty"`
Description *string `json:"description,omitempty"`
Type *string `json:"type,omitempty"`
Media []ProductMedia `json:"media,omitempty"`
PriceData *ProductPriceData `json:"priceData,omitempty"`
StockQuantity *int `json:"stockQuantity,omitempty"`
ShippingPayer *string `json:"shippingPayer,omitempty"`
Categories []ProductCategoryRef `json:"categories,omitempty"`
Variants []ProductVariant `json:"variants,omitempty"`
Options []ProductOption `json:"options,omitempty"`
SingleOption *bool `json:"singleOption,omitempty"`
CustomListing *bool `json:"customListing,omitempty"`
CustomNote *string `json:"customNote,omitempty"`
PlacementScore *int `json:"placementScore,omitempty"`
DispatchDuration *int `json:"dispatchDuration,omitempty"`
}
ProductUpdateRequest defines parameters accepted by PUT /products/{id}.
type ProductVariant ¶
type ProductVariant struct {
VariationID string `json:"variationId,omitempty"`
VariationTitle string `json:"variationTitle,omitempty"`
SelectionID any `json:"selectionId,omitempty"` // array of strings on input, string or array on response
SelectionTitle string `json:"selectionTitle,omitempty"`
StockStatus string `json:"stockStatus,omitempty"`
StockQuantity int `json:"stockQuantity"`
Media []ProductMedia `json:"media,omitempty"`
PriceData *ProductPriceData `json:"priceData,omitempty"`
Primary bool `json:"primary,omitempty"`
}
ProductVariant defines variant stock and pricing tied to variation selections.
type QuickCheckoutBuyer ¶
type QuickCheckoutBuyer struct {
Email string `json:"email"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Phone string `json:"phone"` // e.g. "+90 532 477 02 10" or "5324770210"
PhoneCode string `json:"phone_code,omitempty"` // defaults to "TR"
Country string `json:"country,omitempty"` // defaults to "Türkiye"
City string `json:"city,omitempty"`
State string `json:"state,omitempty"`
Address string `json:"address,omitempty"`
ZipCode string `json:"zip_code,omitempty"`
TCIDNo string `json:"tcid_no,omitempty"`
Comment string `json:"comment,omitempty"`
}
QuickCheckoutBuyer holds buyer and delivery details for the checkout session.
type QuickCheckoutError ¶
type QuickCheckoutError struct {
Stage QuickCheckoutStage `json:"stage"`
StatusCode int `json:"status_code,omitempty"`
Message string `json:"message"`
Body string `json:"body,omitempty"`
Err error `json:"-"`
}
QuickCheckoutError captures failures during unofficial checkout link creation.
func (*QuickCheckoutError) Error ¶
func (e *QuickCheckoutError) Error() string
func (*QuickCheckoutError) Unwrap ¶
func (e *QuickCheckoutError) Unwrap() error
type QuickCheckoutOption ¶
type QuickCheckoutOption func(*QuickCheckoutService)
QuickCheckoutOption configures the QuickCheckoutService.
func WithQuickCheckoutBaseURL ¶
func WithQuickCheckoutBaseURL(baseURL string) QuickCheckoutOption
WithQuickCheckoutBaseURL sets a custom base URL (default: "https://www.shopier.com").
func WithQuickCheckoutHTTPClient ¶
func WithQuickCheckoutHTTPClient(client *http.Client) QuickCheckoutOption
WithQuickCheckoutHTTPClient provides a custom base HTTP client (transport/proxy settings).
func WithQuickCheckoutTimeout ¶
func WithQuickCheckoutTimeout(timeout time.Duration) QuickCheckoutOption
WithQuickCheckoutTimeout sets request timeout.
func WithQuickCheckoutUserAgent ¶
func WithQuickCheckoutUserAgent(ua string) QuickCheckoutOption
WithQuickCheckoutUserAgent sets a custom User-Agent header.
type QuickCheckoutRequest ¶
type QuickCheckoutRequest struct {
// ProductURL can be provided instead of Account and ProductID (e.g. "https://www.shopier.com/adisgroup/50900391").
ProductURL string `json:"product_url,omitempty"`
// Account is the seller username / shop slug (e.g. "adisgroup").
Account string `json:"account,omitempty"`
// ProductID is the unique numeric or alphanumeric product identifier.
ProductID string `json:"product_id,omitempty"`
// Quantity defaults to 1 if omitted.
Quantity int `json:"quantity,omitempty"`
// Options can contain optional variant or selection parameters.
Options map[string]string `json:"options,omitempty"`
// Buyer contains shipping and contact information.
Buyer QuickCheckoutBuyer `json:"buyer"`
}
QuickCheckoutRequest defines inputs to generate a checkout link.
type QuickCheckoutResult ¶
type QuickCheckoutResult struct {
OrderID string `json:"order_id"`
PaymentURL string `json:"payment_url"`
Account string `json:"account"`
ProductID string `json:"product_id"`
RawResponse map[string]any `json:"raw_response,omitempty"`
}
QuickCheckoutResult contains the generated order ID and direct checkout link.
type QuickCheckoutService ¶
type QuickCheckoutService struct {
// contains filtered or unexported fields
}
QuickCheckoutService generates direct checkout and payment links.
func NewQuickCheckoutService ¶
func NewQuickCheckoutService(opts ...QuickCheckoutOption) *QuickCheckoutService
NewQuickCheckoutService creates an isolated QuickCheckoutService instance.
func (*QuickCheckoutService) Create ¶
func (s *QuickCheckoutService) Create(ctx context.Context, req *QuickCheckoutRequest) (*QuickCheckoutResult, error)
Create executes the 4-step frontend flow and returns a direct payment URL. Each execution uses a fresh, isolated cookie jar for total concurrency safety.
type QuickCheckoutStage ¶
type QuickCheckoutStage string
QuickCheckoutStage represents a step in the unofficial checkout process.
const ( StageParseInput QuickCheckoutStage = "parse_input" StageFetchProduct QuickCheckoutStage = "fetch_product" StageExtractCSRF QuickCheckoutStage = "extract_csrf" StageCheckPayment QuickCheckoutStage = "check_payment" StageFetchShippingForm QuickCheckoutStage = "fetch_shipping_form" StageProcessShipment QuickCheckoutStage = "process_shipment" )
type RateLimitError ¶
type RateLimitError struct {
APIError
// RetryAfter indicates the duration requested by the server before retrying.
// Parsed from the 'Retry-After' response header (in seconds).
RetryAfter time.Duration
}
RateLimitError represents a 429 Too Many Requests response. Shopier enforces rate limits on a 60-second sliding window (default: 200 req/min).
func (*RateLimitError) Error ¶
func (e *RateLimitError) Error() string
type Refund ¶
type Refund struct {
ID string `json:"id"`
Type string `json:"type"` // "full" or "partial"
Status string `json:"status"` // "pending", "failed", "succeeded"
OrderID string `json:"orderId"`
DateCreated string `json:"dateCreated"`
DateRefunded string `json:"dateRefunded,omitempty"`
Currency string `json:"currency"`
Total string `json:"total"`
Note string `json:"note,omitempty"`
}
Refund represents a payment reimbursement for an order.
type RefundCreateRequest ¶
type RefundCreateRequest struct {
OrderID string `json:"orderId"`
Amount string `json:"amount,omitempty"`
Note string `json:"note,omitempty"`
}
RefundCreateRequest defines parameters for POST /refunds.
type RefundListOptions ¶
type RefundListOptions struct {
ListOptions
OrderID string `url:"orderId,omitempty"`
}
RefundListOptions holds query filters for GET /refunds.
func (*RefundListOptions) Values ¶
func (o *RefundListOptions) Values() url.Values
Values compiles RefundListOptions into URL query parameters.
type RefundService ¶
type RefundService struct {
// contains filtered or unexported fields
}
RefundService exposes order refund management endpoints.
func (*RefundService) All ¶
func (s *RefundService) All(ctx context.Context, opts *RefundListOptions) iter.Seq2[Refund, error]
All returns a Go 1.23+ iterator traversing all refunds across pages.
func (*RefundService) Create ¶
func (s *RefundService) Create(ctx context.Context, req *RefundCreateRequest) (*Refund, error)
Create initiates a full or partial refund on a paid order.
func (*RefundService) List ¶
func (s *RefundService) List(ctx context.Context, opts *RefundListOptions) (*PageResponse[Refund], error)
List returns paginated refund records.
type Selection ¶
type Selection struct {
ID string `json:"id"`
Title string `json:"title"`
VariationID string `json:"variationId"`
}
Selection represents a concrete option within an attribute variation (e.g. "Red" in "Color").
type SelectionCreateRequest ¶
type SelectionCreateRequest struct {
VariationID string `json:"variationId"`
Title string `json:"title"`
}
SelectionCreateRequest defines parameters for POST /selections.
type SelectionListOptions ¶
type SelectionListOptions struct {
ListOptions
VariationIDs []string `url:"variationId,omitempty"`
}
SelectionListOptions holds query filters for GET /selections.
func (*SelectionListOptions) Values ¶
func (o *SelectionListOptions) Values() url.Values
Values compiles SelectionListOptions into URL query parameters.
type SelectionService ¶
type SelectionService struct {
// contains filtered or unexported fields
}
SelectionService exposes variation selection endpoints.
func (*SelectionService) All ¶
func (s *SelectionService) All(ctx context.Context, opts *SelectionListOptions) iter.Seq2[Selection, error]
All returns a Go 1.23+ iterator traversing selections across all pages.
func (*SelectionService) Create ¶
func (s *SelectionService) Create(ctx context.Context, req *SelectionCreateRequest) (*Selection, error)
Create adds a new option value to a variation.
func (*SelectionService) Delete ¶
func (s *SelectionService) Delete(ctx context.Context, id string) error
Delete permanently removes a selection.
func (*SelectionService) List ¶
func (s *SelectionService) List(ctx context.Context, opts *SelectionListOptions) (*PageResponse[Selection], error)
List returns paginated variation selections.
func (*SelectionService) Update ¶
func (s *SelectionService) Update(ctx context.Context, id string, req *SelectionUpdateRequest) (*Selection, error)
Update renames an existing selection.
type SelectionUpdateRequest ¶
type SelectionUpdateRequest struct {
Title string `json:"title"`
}
SelectionUpdateRequest defines parameters for PUT /selections/{id}.
type Shipping ¶
type Shipping struct {
OrderID string `json:"orderId"`
Status string `json:"status"`
Method string `json:"method"`
Type string `json:"type"`
DateCreated string `json:"dateCreated"`
DateDispatched string `json:"dateDispatched,omitempty"`
Company string `json:"company"`
Code string `json:"code"`
TrackingNumber string `json:"trackingNumber,omitempty"`
TrackingURL string `json:"trackingUrl,omitempty"`
Size string `json:"size,omitempty"`
SizeUnit string `json:"sizeUnit,omitempty"`
Weight string `json:"weight,omitempty"`
WeightUnit string `json:"weightUnit,omitempty"`
Cost string `json:"cost,omitempty"`
Currency string `json:"currency,omitempty"`
}
Shipping represents shipment tracking and carrier dispatch status.
type ShippingCreateRequest ¶
type ShippingCreateRequest struct {
OrderID string `json:"orderId"`
Company string `json:"company"`
}
ShippingCreateRequest defines parameters for POST /shippings.
type ShippingListOptions ¶
type ShippingListOptions struct {
ListOptions
Status string `url:"status,omitempty"`
Method string `url:"method,omitempty"`
Type string `url:"type,omitempty"`
OrderID string `url:"orderId,omitempty"`
}
ShippingListOptions holds query filters for GET /shippings.
func (*ShippingListOptions) Values ¶
func (o *ShippingListOptions) Values() url.Values
Values compiles ShippingListOptions into URL query parameters.
type ShippingService ¶
type ShippingService struct {
// contains filtered or unexported fields
}
ShippingService exposes shipping code and tracking management endpoints.
func (*ShippingService) All ¶
func (s *ShippingService) All(ctx context.Context, opts *ShippingListOptions) iter.Seq2[Shipping, error]
All returns a Go 1.23+ iterator traversing all shipping records.
func (*ShippingService) Create ¶
func (s *ShippingService) Create(ctx context.Context, req *ShippingCreateRequest) (*Shipping, error)
Create generates a new contracted shipping code for an order.
func (*ShippingService) Delete ¶
func (s *ShippingService) Delete(ctx context.Context, code string) error
Delete cancels an unmanifested shipping code.
func (*ShippingService) List ¶
func (s *ShippingService) List(ctx context.Context, opts *ShippingListOptions) (*PageResponse[Shipping], error)
List returns paginated shipping records.
type ShopOwner ¶
type ShopOwner struct {
ID string `json:"id"`
Type string `json:"type"` // "personal" or "business"
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Contact ShopOwnerContact `json:"contact"`
Company *ShopOwnerCompany `json:"company,omitempty"`
BankAccount ShopOwnerBankAccount `json:"bankAccount"`
}
ShopOwner represents identity and registration details of the merchant.
type ShopOwnerBankAccount ¶
type ShopOwnerBankAccount struct {
AccountHolder string `json:"accountHolder"`
IBAN string `json:"iban"`
}
ShopOwnerBankAccount specifies registered merchant settlement account.
type ShopOwnerCompany ¶
type ShopOwnerCompany struct {
Name string `json:"name"`
TaxOffice string `json:"taxOffice"`
TaxNumber string `json:"taxNumber"`
}
ShopOwnerCompany specifies business legal registration details.
type ShopOwnerContact ¶
type ShopOwnerContact struct {
Email string `json:"email"`
Phone string `json:"phone"`
Address string `json:"address"`
District string `json:"district"`
City string `json:"city"`
State string `json:"state,omitempty"`
Country string `json:"country"`
}
ShopOwnerContact represents merchant communication coordinates.
type ShopService ¶
type ShopService struct {
// contains filtered or unexported fields
}
ShopService exposes merchant profile and store preference endpoints.
func (*ShopService) GetOwner ¶
func (s *ShopService) GetOwner(ctx context.Context) (*ShopOwner, error)
GetOwner retrieves legal entity and contact information of the merchant.
func (*ShopService) GetSettings ¶
func (s *ShopService) GetSettings(ctx context.Context) (*ShopSettings, error)
GetSettings retrieves current storefront display and configuration settings.
func (*ShopService) UpdateSettings ¶
func (s *ShopService) UpdateSettings(ctx context.Context, req *ShopSettingsUpdateRequest) (*ShopSettings, error)
UpdateSettings modifies storefront preferences and contact coordinates.
type ShopSettings ¶
type ShopSettings struct {
Name string `json:"name"`
URL string `json:"url"`
Title string `json:"title"`
Slogan string `json:"slogan,omitempty"`
Announcement string `json:"announcement,omitempty"`
Confirmation string `json:"confirmation,omitempty"`
Email string `json:"email"`
Phone string `json:"phone"`
Access bool `json:"access"`
Cart bool `json:"cart"`
MobileView string `json:"mobileView"` // "singleColumn" or "doubleColumn"
Filter bool `json:"filter"`
OutOfStock bool `json:"outOfStock"`
Language string `json:"language"` // "TR" or "EN"
Vacation bool `json:"vacation"`
}
ShopSettings encapsulates public storefront display and behavior configuration.
type ShopSettingsUpdateRequest ¶
type ShopSettingsUpdateRequest struct {
Title *string `json:"title,omitempty"`
Slogan *string `json:"slogan,omitempty"`
Announcement *string `json:"announcement,omitempty"`
Confirmation *string `json:"confirmation,omitempty"`
Email *string `json:"email,omitempty"`
Phone *string `json:"phone,omitempty"`
Access *bool `json:"access,omitempty"`
Cart *bool `json:"cart,omitempty"`
MobileView *string `json:"mobileView,omitempty"`
Filter *bool `json:"filter,omitempty"`
OutOfStock *bool `json:"outOfStock,omitempty"`
Language *string `json:"language,omitempty"`
Vacation *bool `json:"vacation,omitempty"`
}
ShopSettingsUpdateRequest defines mutable parameters for PUT /shop/settings.
type Transaction ¶
type Transaction struct {
OrderID string `json:"orderId,omitempty"`
Type string `json:"type"`
Description string `json:"description,omitempty"`
DateCreated string `json:"dateCreated"`
Gross TransactionAmount `json:"gross"`
Fee TransactionFee `json:"fee"`
Net TransactionAmount `json:"net"`
}
Transaction represents a financial ledger entry (charge, fee, adjustment, payout item).
type TransactionAmount ¶
type TransactionAmount struct {
OriginCurrency string `json:"originCurrency"`
OriginAmount string `json:"originAmount"`
Currency string `json:"currency"`
Amount string `json:"amount"`
}
TransactionAmount contains amount details in original and settlement currencies.
type TransactionFee ¶
TransactionFee contains fee deductions applied to a transaction.
type Variation ¶
type Variation struct {
ID string `json:"id"`
Title string `json:"title"`
Placement int `json:"placement"`
}
Variation represents an attribute axis (e.g. Size, Color) applicable to products.
type VariationCreateRequest ¶
type VariationCreateRequest struct {
Title string `json:"title"`
}
VariationCreateRequest defines parameters for POST /variations.
type VariationService ¶
type VariationService struct {
// contains filtered or unexported fields
}
VariationService exposes product variation management endpoints.
func (*VariationService) All ¶
func (s *VariationService) All(ctx context.Context, opts *ListOptions) iter.Seq2[Variation, error]
All returns a Go 1.23+ iterator traversing variations across all pages.
func (*VariationService) Create ¶
func (s *VariationService) Create(ctx context.Context, req *VariationCreateRequest) (*Variation, error)
Create registers a new variation.
func (*VariationService) Delete ¶
func (s *VariationService) Delete(ctx context.Context, id string) error
Delete permanently removes a variation.
func (*VariationService) List ¶
func (s *VariationService) List(ctx context.Context, opts *ListOptions) (*PageResponse[Variation], error)
List returns paginated product variations.
func (*VariationService) Update ¶
func (s *VariationService) Update(ctx context.Context, id string, req *VariationUpdateRequest) (*Variation, error)
Update updates an existing variation title.
type VariationUpdateRequest ¶
type VariationUpdateRequest struct {
Title string `json:"title"`
}
VariationUpdateRequest defines parameters for PUT /variations/{id}.
type WebhookCreateRequest ¶
WebhookCreateRequest defines parameters for POST /webhooks.
type WebhookService ¶
type WebhookService struct {
// contains filtered or unexported fields
}
WebhookService exposes webhook registration and subscription lifecycle endpoints.
func (*WebhookService) Create ¶
func (s *WebhookService) Create(ctx context.Context, req *WebhookCreateRequest) (*WebhookSubscription, error)
Create registers a new notification URL for a specific webhook event. Save the returned Token securely, as Shopier will not expose it in subsequent List queries.
func (*WebhookService) Delete ¶
func (s *WebhookService) Delete(ctx context.Context, id string) error
Delete permanently removes a webhook subscription by its ID.
func (*WebhookService) List ¶
func (s *WebhookService) List(ctx context.Context) ([]WebhookSubscription, error)
List retrieves all active webhook event subscriptions.
type WebhookSubscription ¶
type WebhookSubscription struct {
ID string `json:"id"`
Event string `json:"event"`
URL string `json:"url"`
// Token is the secret signing key used to compute HMAC-SHA256 signatures.
// Shopier returns this value only on the initial subscription creation response.
Token string `json:"token,omitempty"`
}
WebhookSubscription represents an event callback registration with Shopier.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
01_quickstart
command
|
|
|
02_oauth_flow
command
|
|
|
03_webhook_receiver
command
|
|
|
04_iterators
command
|
|
|
05_quick_checkout
command
|
|