Documentation
¶
Index ¶
- Constants
- Variables
- func CreateAPIError(dataResponse []byte) error
- type APIError
- type APIErrorsList
- type APIKey
- type Action
- type Activity
- type AdditionalCode
- type Address
- type Attachment
- type BasicLogger
- type Client
- func (c *Client) APICredentials() (CredentialResponse, int, error)
- func (c *Client) APIVersions() (VersionResponse, int, error)
- func (c *Client) CorporateCustomer(id, by, site string) (CorporateCustomerResponse, int, error)
- func (c *Client) CorporateCustomerAddresses(id string, parameters CorporateCustomerAddressesRequest) (CorporateCustomersAddressesResponse, int, error)
- func (c *Client) CorporateCustomerAddressesCreate(id string, by string, address CorporateCustomerAddress, site ...string) (CreateResponse, int, error)
- func (c *Client) CorporateCustomerAddressesEdit(customerID, customerBy, entityBy string, address CorporateCustomerAddress, ...) (CreateResponse, int, error)
- func (c *Client) CorporateCustomerCompanies(id string, parameters IdentifiersPairRequest) (CorporateCustomerCompaniesResponse, int, error)
- func (c *Client) CorporateCustomerCompaniesCreate(id string, by string, company Company, site ...string) (CreateResponse, int, error)
- func (c *Client) CorporateCustomerCompaniesEdit(customerID, customerBy, entityBy string, company Company, site ...string) (CreateResponse, int, error)
- func (c *Client) CorporateCustomerContacts(id string, parameters IdentifiersPairRequest) (CorporateCustomerContactsResponse, int, error)
- func (c *Client) CorporateCustomerContactsCreate(id string, by string, contact CorporateCustomerContact, site ...string) (CreateResponse, int, error)
- func (c *Client) CorporateCustomerContactsEdit(customerID, customerBy, entityBy string, contact CorporateCustomerContact, ...) (CreateResponse, int, error)
- func (c *Client) CorporateCustomerCreate(customer CorporateCustomer, site ...string) (CorporateCustomerChangeResponse, int, error)
- func (c *Client) CorporateCustomerEdit(customer CorporateCustomer, by string, site ...string) (CustomerChangeResponse, int, error)
- func (c *Client) CorporateCustomerNoteCreate(note CorporateCustomerNote, site ...string) (CreateResponse, int, error)
- func (c *Client) CorporateCustomerNoteDelete(id int) (SuccessfulResponse, int, error)
- func (c *Client) CorporateCustomers(parameters CorporateCustomersRequest) (CorporateCustomersResponse, int, error)
- func (c *Client) CorporateCustomersFixExternalIds(customers []IdentifiersPair) (SuccessfulResponse, int, error)
- func (c *Client) CorporateCustomersHistory(parameters CorporateCustomersHistoryRequest) (CorporateCustomersHistoryResponse, int, error)
- func (c *Client) CorporateCustomersNotes(parameters CorporateCustomersNotesRequest) (CorporateCustomersNotesResponse, int, error)
- func (c *Client) CorporateCustomersUpload(customers []CorporateCustomer, site ...string) (CorporateCustomersUploadResponse, int, error)
- func (c *Client) Cost(id int) (CostResponse, int, error)
- func (c *Client) CostCreate(cost CostRecord, site ...string) (CreateResponse, int, error)
- func (c *Client) CostDelete(id int) (SuccessfulResponse, int, error)
- func (c *Client) CostEdit(id int, cost CostRecord, site ...string) (CreateResponse, int, error)
- func (c *Client) CostGroupEdit(costGroup CostGroup) (SuccessfulResponse, int, error)
- func (c *Client) CostGroups() (CostGroupsResponse, int, error)
- func (c *Client) CostItemEdit(costItem CostItem) (SuccessfulResponse, int, error)
- func (c *Client) CostItems() (CostItemsResponse, int, error)
- func (c *Client) Costs(costs CostsRequest) (CostsResponse, int, error)
- func (c *Client) CostsDelete(ids []int) (CostsDeleteResponse, int, error)
- func (c *Client) CostsUpload(cost []CostRecord) (CostsUploadResponse, int, error)
- func (c *Client) Countries() (CountriesResponse, int, error)
- func (c *Client) CourierCreate(courier Courier) (CreateResponse, int, error)
- func (c *Client) CourierEdit(courier Courier) (SuccessfulResponse, int, error)
- func (c *Client) Couriers() (CouriersResponse, int, error)
- func (c *Client) CustomDictionaries(customDictionaries CustomDictionariesRequest) (CustomDictionariesResponse, int, error)
- func (c *Client) CustomDictionariesCreate(customDictionary CustomDictionary) (CustomResponse, int, error)
- func (c *Client) CustomDictionary(code string) (CustomDictionaryResponse, int, error)
- func (c *Client) CustomDictionaryEdit(customDictionary CustomDictionary) (CustomResponse, int, error)
- func (c *Client) CustomField(entity, code string) (CustomFieldResponse, int, error)
- func (c *Client) CustomFieldEdit(customFields CustomFields) (CustomResponse, int, error)
- func (c *Client) CustomFields(customFields CustomFieldsRequest) (CustomFieldsResponse, int, error)
- func (c *Client) CustomFieldsCreate(customFields CustomFields) (CustomResponse, int, error)
- func (c *Client) Customer(id, by, site string) (CustomerResponse, int, error)
- func (c *Client) CustomerCreate(customer Customer, site ...string) (CustomerChangeResponse, int, error)
- func (c *Client) CustomerEdit(customer Customer, by string, site ...string) (CustomerChangeResponse, int, error)
- func (c *Client) CustomerNoteCreate(note Note, site ...string) (CreateResponse, int, error)
- func (c *Client) CustomerNoteDelete(id int) (SuccessfulResponse, int, error)
- func (c *Client) CustomerNotes(parameters NotesRequest) (NotesResponse, int, error)
- func (c *Client) Customers(parameters CustomersRequest) (CustomersResponse, int, error)
- func (c *Client) CustomersCombine(customers []Customer, resultCustomer Customer) (SuccessfulResponse, int, error)
- func (c *Client) CustomersFixExternalIds(customers []IdentifiersPair) (SuccessfulResponse, int, error)
- func (c *Client) CustomersHistory(parameters CustomersHistoryRequest) (CustomersHistoryResponse, int, error)
- func (c *Client) CustomersUpload(customers []Customer, site ...string) (CustomersUploadResponse, int, error)
- func (c *Client) DeliveryServiceEdit(deliveryService DeliveryService) (SuccessfulResponse, int, error)
- func (c *Client) DeliveryServices() (DeliveryServiceResponse, int, error)
- func (c *Client) DeliveryShipment(id int) (DeliveryShipmentResponse, int, error)
- func (c *Client) DeliveryShipmentCreate(shipment DeliveryShipment, deliveryType string, site ...string) (DeliveryShipmentUpdateResponse, int, error)
- func (c *Client) DeliveryShipmentEdit(shipment DeliveryShipment, site ...string) (DeliveryShipmentUpdateResponse, int, error)
- func (c *Client) DeliveryShipments(parameters DeliveryShipmentsRequest) (DeliveryShipmentsResponse, int, error)
- func (c *Client) DeliveryTracking(parameters []DeliveryTrackingRequest, subcode string) (SuccessfulResponse, int, error)
- func (c *Client) DeliveryTypeEdit(deliveryType DeliveryType) (SuccessfulResponse, int, error)
- func (c *Client) DeliveryTypes() (DeliveryTypesResponse, int, error)
- func (c *Client) File(id int) (FileResponse, int, error)
- func (c *Client) FileDelete(id int) (SuccessfulResponse, int, error)
- func (c *Client) FileDownload(id int) (io.ReadCloser, int, error)
- func (c *Client) FileEdit(id int, file File) (FileResponse, int, error)
- func (c *Client) FileUpload(reader io.Reader) (FileUploadResponse, int, error)
- func (c *Client) Files(files FilesRequest) (FilesResponse, int, error)
- func (c *Client) GetRequest(urlWithParameters string, versioned ...bool) ([]byte, int, error)
- func (c *Client) IntegrationModule(code string) (IntegrationModuleResponse, int, error)
- func (c *Client) IntegrationModuleEdit(integrationModule IntegrationModule) (IntegrationModuleEditResponse, int, error)
- func (c *Client) Inventories(parameters InventoriesRequest) (InventoriesResponse, int, error)
- func (c *Client) InventoriesUpload(inventories []InventoryUpload, site ...string) (StoreUploadResponse, int, error)
- func (c *Client) LegalEntities() (LegalEntitiesResponse, int, error)
- func (c *Client) LegalEntityEdit(legalEntity LegalEntity) (SuccessfulResponse, int, error)
- func (c *Client) Order(id, by, site string) (OrderResponse, int, error)
- func (c *Client) OrderCreate(order Order, site ...string) (OrderCreateResponse, int, error)
- func (c *Client) OrderEdit(order Order, by string, site ...string) (CreateResponse, int, error)
- func (c *Client) OrderMethodEdit(orderMethod OrderMethod) (SuccessfulResponse, int, error)
- func (c *Client) OrderMethods() (OrderMethodsResponse, int, error)
- func (c *Client) OrderPaymentCreate(payment Payment, site ...string) (CreateResponse, int, error)
- func (c *Client) OrderPaymentDelete(id int) (SuccessfulResponse, int, error)
- func (c *Client) OrderPaymentEdit(payment Payment, by string, site ...string) (SuccessfulResponse, int, error)
- func (c *Client) OrderTypeEdit(orderType OrderType) (SuccessfulResponse, int, error)
- func (c *Client) OrderTypes() (OrderTypesResponse, int, error)
- func (c *Client) Orders(parameters OrdersRequest) (OrdersResponse, int, error)
- func (c *Client) OrdersCombine(technique string, order, resultOrder Order) (OperationResponse, int, error)
- func (c *Client) OrdersFixExternalIds(orders []IdentifiersPair) (SuccessfulResponse, int, error)
- func (c *Client) OrdersHistory(parameters OrdersHistoryRequest) (OrdersHistoryResponse, int, error)
- func (c *Client) OrdersStatuses(request OrdersStatusesRequest) (OrdersStatusesResponse, int, error)
- func (c *Client) OrdersUpload(orders []Order, site ...string) (OrdersUploadResponse, int, error)
- func (c *Client) Pack(id int) (PackResponse, int, error)
- func (c *Client) PackCreate(pack Pack) (CreateResponse, int, error)
- func (c *Client) PackDelete(id int) (SuccessfulResponse, int, error)
- func (c *Client) PackEdit(pack Pack) (CreateResponse, int, error)
- func (c *Client) Packs(parameters PacksRequest) (PacksResponse, int, error)
- func (c *Client) PacksHistory(parameters PacksHistoryRequest) (PacksHistoryResponse, int, error)
- func (c *Client) PaymentStatusEdit(paymentStatus PaymentStatus) (SuccessfulResponse, int, error)
- func (c *Client) PaymentStatuses() (PaymentStatusesResponse, int, error)
- func (c *Client) PaymentTypeEdit(paymentType PaymentType) (SuccessfulResponse, int, error)
- func (c *Client) PaymentTypes() (PaymentTypesResponse, int, error)
- func (c *Client) PostRequest(uri string, postData interface{}, contType ...string) ([]byte, int, error)
- func (c *Client) PriceTypeEdit(priceType PriceType) (SuccessfulResponse, int, error)
- func (c *Client) PriceTypes() (PriceTypesResponse, int, error)
- func (c *Client) PricesUpload(prices []OfferPriceUpload) (StoreUploadResponse, int, error)
- func (c *Client) ProductStatusEdit(productStatus ProductStatus) (SuccessfulResponse, int, error)
- func (c *Client) ProductStatuses() (ProductStatusesResponse, int, error)
- func (c *Client) Products(parameters ProductsRequest) (ProductsResponse, int, error)
- func (c *Client) ProductsGroup(parameters ProductsGroupsRequest) (ProductsGroupsResponse, int, error)
- func (c *Client) ProductsProperties(parameters ProductsPropertiesRequest) (ProductsPropertiesResponse, int, error)
- func (c *Client) Segments(parameters SegmentsRequest) (SegmentsResponse, int, error)
- func (c *Client) Settings() (SettingsResponse, int, error)
- func (c *Client) SiteEdit(site Site) (SuccessfulResponse, int, error)
- func (c *Client) Sites() (SitesResponse, int, error)
- func (c *Client) StaticticsUpdate() (SuccessfulResponse, int, error)
- func (c *Client) StatusEdit(st Status) (SuccessfulResponse, int, error)
- func (c *Client) StatusGroups() (StatusGroupsResponse, int, error)
- func (c *Client) Statuses() (StatusesResponse, int, error)
- func (c *Client) StoreEdit(store Store) (SuccessfulResponse, int, error)
- func (c *Client) Stores() (StoresResponse, int, error)
- func (c *Client) Task(id int) (TaskResponse, int, error)
- func (c *Client) TaskCreate(task Task, site ...string) (CreateResponse, int, error)
- func (c *Client) TaskEdit(task Task, site ...string) (SuccessfulResponse, int, error)
- func (c *Client) Tasks(parameters TasksRequest) (TasksResponse, int, error)
- func (c *Client) UnitEdit(unit Unit) (SuccessfulResponse, int, error)
- func (c *Client) Units() (UnitsResponse, int, error)
- func (c *Client) User(id int) (UserResponse, int, error)
- func (c *Client) UserGroups(parameters UserGroupsRequest) (UserGroupsResponse, int, error)
- func (c *Client) UserStatus(id int, status string) (SuccessfulResponse, int, error)
- func (c *Client) Users(parameters UsersRequest) (UsersResponse, int, error)
- func (c *Client) WithLogger(logger BasicLogger) *Client
- type Company
- type Contragent
- type CorporateCustomer
- type CorporateCustomerAddress
- type CorporateCustomerAddressesFilter
- type CorporateCustomerAddressesRequest
- type CorporateCustomerChangeResponse
- type CorporateCustomerCompaniesResponse
- type CorporateCustomerContact
- type CorporateCustomerContactCustomer
- type CorporateCustomerContactsResponse
- type CorporateCustomerHistoryRecord
- type CorporateCustomerNote
- type CorporateCustomerResponse
- type CorporateCustomersAddressesResponse
- type CorporateCustomersFilter
- type CorporateCustomersHistoryFilter
- type CorporateCustomersHistoryRequest
- type CorporateCustomersHistoryResponse
- type CorporateCustomersNotesFilter
- type CorporateCustomersNotesRequest
- type CorporateCustomersNotesResponse
- type CorporateCustomersRequest
- type CorporateCustomersResponse
- type CorporateCustomersUploadResponse
- type Cost
- type CostGroup
- type CostGroupsResponse
- type CostItem
- type CostItemsResponse
- type CostRecord
- type CostResponse
- type CostsDeleteResponse
- type CostsFilter
- type CostsRequest
- type CostsResponse
- type CostsUploadResponse
- type CountriesResponse
- type Courier
- type CouriersResponse
- type CreateResponse
- type CredentialResponse
- type CustomDictionariesFilter
- type CustomDictionariesRequest
- type CustomDictionariesResponse
- type CustomDictionary
- type CustomDictionaryResponse
- type CustomFieldResponse
- type CustomFields
- type CustomFieldsFilter
- type CustomFieldsRequest
- type CustomFieldsResponse
- type CustomResponse
- type Customer
- type CustomerChangeResponse
- type CustomerHistoryRecord
- type CustomerRequest
- type CustomerResponse
- type CustomersFilter
- type CustomersHistoryFilter
- type CustomersHistoryRequest
- type CustomersHistoryResponse
- type CustomersRequest
- type CustomersResponse
- type CustomersUploadRequest
- type CustomersUploadResponse
- type DebugLogger
- type Delivery
- type DeliveryDataField
- type DeliveryHistoryRecord
- type DeliveryService
- type DeliveryServiceResponse
- type DeliveryShipment
- type DeliveryShipmentResponse
- type DeliveryShipmentUpdateResponse
- type DeliveryShipmentsRequest
- type DeliveryShipmentsResponse
- type DeliveryStatus
- type DeliveryTime
- type DeliveryTrackingRequest
- type DeliveryType
- type DeliveryTypesResponse
- type Element
- type ExternalPhone
- type File
- type FileResponse
- type FileUploadResponse
- type FilesFilter
- type FilesRequest
- type FilesResponse
- type GeoHierarchyRow
- type IdentifiersPair
- type IdentifiersPairFilter
- type IdentifiersPairRequest
- type IntegrationModule
- type IntegrationModuleEditResponse
- type IntegrationModuleResponse
- type Integrations
- type InventoriesFilter
- type InventoriesRequest
- type InventoriesResponse
- type Inventory
- type InventoryUpload
- type InventoryUploadStore
- type LegalEntitiesResponse
- type LegalEntity
- type MgBot
- type MgInfo
- type MgTransport
- type Note
- type NotesFilter
- type NotesRequest
- type NotesResponse
- type Offer
- type OfferPrice
- type OfferPriceUpload
- type OperationResponse
- type Order
- type OrderCreateResponse
- type OrderDelivery
- type OrderDeliveryData
- type OrderDeliveryDataBasic
- type OrderDeliveryService
- type OrderDeliveryTime
- type OrderItem
- type OrderMarketplace
- type OrderMethod
- type OrderMethodsResponse
- type OrderPayment
- type OrderPayments
- type OrderRequest
- type OrderResponse
- type OrderType
- type OrderTypesResponse
- type OrdersFilter
- type OrdersHistoryFilter
- type OrdersHistoryRecord
- type OrdersHistoryRequest
- type OrdersHistoryResponse
- type OrdersRequest
- type OrdersResponse
- type OrdersStatus
- type OrdersStatusesRequest
- type OrdersStatusesResponse
- type OrdersUploadRequest
- type OrdersUploadResponse
- type Pack
- type PackItem
- type PackResponse
- type PacksFilter
- type PacksHistoryRecord
- type PacksHistoryRequest
- type PacksHistoryResponse
- type PacksRequest
- type PacksResponse
- type Pagination
- type Payment
- type PaymentStatus
- type PaymentStatusesResponse
- type PaymentType
- type PaymentTypesResponse
- type Phone
- type Plate
- type PriceType
- type PriceTypesResponse
- type PriceUpload
- type Product
- type ProductGroup
- type ProductStatus
- type ProductStatusesResponse
- type ProductsFilter
- type ProductsGroupsFilter
- type ProductsGroupsRequest
- type ProductsGroupsResponse
- type ProductsPropertiesFilter
- type ProductsPropertiesRequest
- type ProductsPropertiesResponse
- type ProductsRequest
- type ProductsResponse
- type Property
- type ResponseInfo
- type Segment
- type SegmentsFilter
- type SegmentsRequest
- type SegmentsResponse
- type Settings
- type SettingsNode
- type SettingsResponse
- type ShipmentFilter
- type Site
- type SitesResponse
- type Source
- type Status
- type StatusGroup
- type StatusGroupsResponse
- type StatusesResponse
- type Store
- type StoreUploadResponse
- type StoresResponse
- type StringMap
- type SuccessfulResponse
- type Tag
- type Task
- type TaskResponse
- type TasksFilter
- type TasksRequest
- type TasksResponse
- type Telephony
- type Unit
- type UnitsResponse
- type User
- type UserGroup
- type UserGroupsRequest
- type UserGroupsResponse
- type UserResponse
- type UsersFilter
- type UsersRequest
- type UsersResponse
- type VersionResponse
- type Warehouse
Constants ¶
const ByExternalID = "externalId"
ByExternalId is "externalId" constant to use as `by` property in methods.
const ByID = "id"
ByID is "id" constant to use as `by` property in methods.
Variables ¶
var ( // ErrMissingCredentials will be returned if no API key was provided to the API. ErrMissingCredentials = NewAPIError(`apiKey is missing`) // ErrInvalidCredentials will be returned if provided API key is invalid. ErrInvalidCredentials = NewAPIError(`wrong "apiKey" value`) // ErrAccessDenied will be returned in case of "Access denied" error. ErrAccessDenied = NewAPIError("access denied") // ErrAccountDoesNotExist will be returned if target system does not exist. ErrAccountDoesNotExist = NewAPIError("account does not exist") // ErrValidation will be returned in case of validation errors. ErrValidation = NewAPIError("validation error") // ErrMissingParameter will be returned if parameter is missing. // Underlying error messages list will contain parameter name in the "Name" key. ErrMissingParameter = NewAPIError("missing parameter") // ErrGeneric will be returned if error cannot be classified as one of the errors above. ErrGeneric = NewAPIError("API error") )
Functions ¶
func CreateAPIError ¶
CreateAPIError from the provided response data. Different error types will be returned depending on the response, all of them can be matched using errors.Is. APi errors will always implement APIError interface.
Types ¶
type APIError ¶
type APIError interface {
error
fmt.Stringer
Unwrap() error
Errors() APIErrorsList
// contains filtered or unexported methods
}
APIError returns when an API error was occurred.
func AsAPIError ¶
AsAPIError returns APIError and true if provided error is an APIError or contains wrapped APIError. Returns (nil, false) otherwise.
func CreateGenericAPIError ¶
CreateGenericAPIError for the situations when API response cannot be processed, but response was actually received.
func NewAPIError ¶
NewAPIError returns API error with the provided message.
type APIErrorsList ¶
APIErrorsList struct.
func (*APIErrorsList) UnmarshalJSON ¶
func (a *APIErrorsList) UnmarshalJSON(data []byte) error
type Action ¶
type Action struct {
Code string `json:"code,omitempty"`
URL string `json:"url,omitempty"`
CallPoints []string `json:"callPoints,omitempty"`
}
Action type.
type AdditionalCode ¶
type AdditionalCode struct {
Code string `json:"code,omitempty"`
UserID string `json:"userId,omitempty"`
}
AdditionalCode type.
type Address ¶
type Address struct {
Index string `json:"index,omitempty"`
CountryIso string `json:"countryIso,omitempty"`
Region string `json:"region,omitempty"`
RegionID int `json:"regionId,omitempty"`
City string `json:"city,omitempty"`
CityID int `json:"cityId,omitempty"`
CityType string `json:"cityType,omitempty"`
Street string `json:"street,omitempty"`
StreetID int `json:"streetId,omitempty"`
StreetType string `json:"streetType,omitempty"`
Building string `json:"building,omitempty"`
Flat string `json:"flat,omitempty"`
Floor int `json:"floor,omitempty"`
Block int `json:"block,omitempty"`
House string `json:"house,omitempty"`
Housing string `json:"housing,omitempty"`
Metro string `json:"metro,omitempty"`
Notes string `json:"notes,omitempty"`
Text string `json:"text,omitempty"`
}
Address type.
type Attachment ¶
type Attachment struct {
Customer *Customer `json:"customer,omitempty"`
Order *Order `json:"order,omitempty"`
}
Attachment type.
type BasicLogger ¶
type BasicLogger interface {
Printf(string, ...interface{})
}
BasicLogger provides basic functionality for logging.
func DebugLoggerAdapter ¶
func DebugLoggerAdapter(logger DebugLogger) BasicLogger
DebugLoggerAdapter returns BasicLogger that calls underlying DebugLogger.Debugf.
type Client ¶
Client type.
func (*Client) APICredentials ¶
func (c *Client) APICredentials() (CredentialResponse, int, error)
APICredentials get all available API methods for exact account
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-api-versions
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.APICredentials()
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.Scopes {
log.Printf("%v\n", value)
}
func (*Client) APIVersions ¶
func (c *Client) APIVersions() (VersionResponse, int, error)
APIVersions get all available API versions for exact account
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-api-versions
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.APIVersions()
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.versions {
log.Printf("%v\n", value)
}
func (*Client) CorporateCustomer ¶
func (c *Client) CorporateCustomer(id, by, site string) (CorporateCustomerResponse, int, error)
CorporateCustomer returns information about corporate customer
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-customers-corporate-externalId
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CorporateCustomer(12, retailcrm.ByExternalID, "")
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.CorporateCustomer)
}
func (*Client) CorporateCustomerAddresses ¶
func (c *Client) CorporateCustomerAddresses( id string, parameters CorporateCustomerAddressesRequest, ) (CorporateCustomersAddressesResponse, int, error)
CorporateCustomerAddresses returns information about corporate customer addresses
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-customers-corporate-externalId-addresses
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CorporateCustomerAddresses("ext-id", retailcrm.CorporateCustomerAddressesRequest{
Filter: v5,CorporateCustomerAddressesFilter{
Name: "Main Address",
},
By: retailcrm.ByExternalID,
Site: "site",
Limit: 20,
Page: 1,
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.Addresses)
}
func (*Client) CorporateCustomerAddressesCreate ¶
func (c *Client) CorporateCustomerAddressesCreate( id string, by string, address CorporateCustomerAddress, site ...string, ) (CreateResponse, int, error)
CorporateCustomerAddressesCreate creates corporate customer address
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#post--api-v5-customers-corporate-externalId-addresses-create
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := c.CorporateCustomerAddressesCreate("ext-id", retailcrm.ByExternalID, retailcrm.CorporateCustomerAddress{
Text: "this is new address",
Name: "New Address",
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
fmt.Printf("%v", data.ID)
}
func (*Client) CorporateCustomerAddressesEdit ¶
func (c *Client) CorporateCustomerAddressesEdit( customerID, customerBy, entityBy string, address CorporateCustomerAddress, site ...string, ) (CreateResponse, int, error)
CorporateCustomerAddressesEdit edit exact corporate customer address
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#post--api-v5-customers-corporate-externalId-addresses-entityExternalId-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := c.CorporateCustomerAddressesEdit(
"customer-ext-id",
retailcrm.ByExternalID,
retailcrm.ByExternalID,
CorporateCustomerAddress{
ExternalID: "addr-ext-id",
Name: "Main Address 2",
},
)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.Customer)
}
func (*Client) CorporateCustomerCompanies ¶
func (c *Client) CorporateCustomerCompanies( id string, parameters IdentifiersPairRequest, ) (CorporateCustomerCompaniesResponse, int, error)
CorporateCustomerCompanies returns information about corporate customer companies
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-customers-corporate-externalId-companies
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CorporateCustomerCompanies("ext-id", retailcrm.IdentifiersPairRequest{
Filter: v5,IdentifiersPairFilter{
Ids: []string{"1"},
},
By: retailcrm.ByExternalID,
Site: "site",
Limit: 20,
Page: 1,
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.Companies)
}
func (*Client) CorporateCustomerCompaniesCreate ¶
func (c *Client) CorporateCustomerCompaniesCreate( id string, by string, company Company, site ...string, ) (CreateResponse, int, error)
CorporateCustomerCompaniesCreate creates corporate customer company
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#post--api-v5-customers-corporate-externalId-companies-create
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := c.CorporateCustomerCompaniesCreate("ext-id", retailcrm.ByExternalID, retailcrm.Company{
Name: "Company name",
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
fmt.Printf("%v", data.ID)
}
func (*Client) CorporateCustomerCompaniesEdit ¶
func (c *Client) CorporateCustomerCompaniesEdit( customerID, customerBy, entityBy string, company Company, site ...string, ) (CreateResponse, int, error)
CorporateCustomerCompaniesEdit edit exact corporate customer company
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#post--api-v5-customers-corporate-externalId-companies-entityExternalId-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := c.CorporateCustomerCompaniesEdit(
"customer-ext-id",
retailcrm.ByExternalID,
retailcrm.ByExternalID,
Company{
ExternalID: "company-ext-id",
Name: "New Company Name",
},
)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.ID)
}
func (*Client) CorporateCustomerContacts ¶
func (c *Client) CorporateCustomerContacts( id string, parameters IdentifiersPairRequest, ) (CorporateCustomerContactsResponse, int, error)
CorporateCustomerContacts returns information about corporate customer contacts
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-customers-corporate-externalId-contacts
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CorporateCustomerContacts("ext-id", retailcrm.IdentifiersPairRequest{
Filter: retailcrm.IdentifiersPairFilter{
Ids: []string{"1"},
},
By: retailcrm.ByExternalID,
Site: "site",
Limit: 20,
Page: 1,
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.Contacts)
}
func (*Client) CorporateCustomerContactsCreate ¶
func (c *Client) CorporateCustomerContactsCreate( id string, by string, contact CorporateCustomerContact, site ...string, ) (CreateResponse, int, error)
CorporateCustomerContactsCreate creates corporate customer contact
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#post--api-v5-customers-corporate-externalId-contacts-create
Example (customer with specified id or externalId should exist in specified site):
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := c.CorporateCustomerContactsCreate("ext-id", retailcrm.ByExternalID, retailcrm.CorporateCustomerContact{
IsMain: false,
Customer: retailcrm.CorporateCustomerContactCustomer{
ExternalID: "external_id",
Site: "site",
},
Companies: []IdentifiersPair{},
}, "site")
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
fmt.Printf("%v", data.ID)
}
func (*Client) CorporateCustomerContactsEdit ¶
func (c *Client) CorporateCustomerContactsEdit( customerID, customerBy, entityBy string, contact CorporateCustomerContact, site ...string, ) (CreateResponse, int, error)
CorporateCustomerContactsEdit edit exact corporate customer contact
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#post--api-v5-customers-corporate-externalId-contacts-entityExternalId-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := c.CorporateCustomerContactsEdit("ext-id", retailcrm.ByExternalID, retailcrm.ByID, retailcrm.CorporateCustomerContact{
IsMain: false,
Customer: retailcrm.CorporateCustomerContactCustomer{
ID: 2350,
},
}, "site")
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.ID)
}
func (*Client) CorporateCustomerCreate ¶
func (c *Client) CorporateCustomerCreate(customer CorporateCustomer, site ...string) ( CorporateCustomerChangeResponse, int, error, )
CorporateCustomerCreate creates corporate customer
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#post--api-v5-customers-corporate-create
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CorporateCustomerCreate(retailcrm.CorporateCustomer{
Nickname: "Company",
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
fmt.Printf("%v", data.ID)
}
func (*Client) CorporateCustomerEdit ¶
func (c *Client) CorporateCustomerEdit(customer CorporateCustomer, by string, site ...string) ( CustomerChangeResponse, int, error, )
CorporateCustomerEdit edit exact corporate customer
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#post--api-v5-customers-corporate-externalId-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CorporateCustomerEdit(
retailcrm.CorporateCustomer{
FirstName: "Ivan",
LastName: "Ivanov",
Patronymic: "Ivanovich",
ID: 1,
Email: "ivanov@example.com",
},
retailcrm.ByID,
)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.Customer)
}
func (*Client) CorporateCustomerNoteCreate ¶
func (c *Client) CorporateCustomerNoteCreate(note CorporateCustomerNote, site ...string) (CreateResponse, int, error)
CorporateCustomerNoteCreate creates corporate customer note
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#post--api-v5-customers-corporate-notes-create
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CorporateCustomerNoteCreate(retailcrm.CorporateCustomerNote{
Text: "text",
Customer: &retailcrm.IdentifiersPair{
ID: 1,
}
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
fmt.Printf("%v", data.ID)
}
func (*Client) CorporateCustomerNoteDelete ¶
func (c *Client) CorporateCustomerNoteDelete(id int) (SuccessfulResponse, int, error)
CorporateCustomerNoteDelete removes note from corporate customer
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#post--api-v5-customers-corporate-notes-id-delete
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CorporateCustomerNoteDelete(12)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) CorporateCustomers ¶
func (c *Client) CorporateCustomers(parameters CorporateCustomersRequest) (CorporateCustomersResponse, int, error)
CorporateCustomers returns list of corporate customers matched the specified filter
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-customers-corporate
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CorporateCustomers(retailcrm.CorporateCustomersRequest{
Filter: CorporateCustomersFilter{
City: "Moscow",
},
Page: 3,
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.CustomersCorporate {
log.Printf("%v\n", value)
}
func (*Client) CorporateCustomersFixExternalIds ¶
func (c *Client) CorporateCustomersFixExternalIds(customers []IdentifiersPair) (SuccessfulResponse, int, error)
CorporateCustomersFixExternalIds will fix corporate customers external ID's
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#post--api-v5-customers-corporate-fix-external-ids
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CorporateCustomersFixExternalIds([]retailcrm.IdentifiersPair{{
ID: 1,
ExternalID: 12,
}})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) CorporateCustomersHistory ¶
func (c *Client) CorporateCustomersHistory(parameters CorporateCustomersHistoryRequest) ( CorporateCustomersHistoryResponse, int, error, )
CorporateCustomersHistory returns corporate customer's history
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#post--api-v5-customers-corporate-fix-external-ids
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CorporateCustomersHistory(retailcrm.CorporateCustomersHistoryRequest{
Filter: retailcrm.CorporateCustomersHistoryFilter{
SinceID: 20,
},
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.History {
log.Printf("%v\n", value)
}
func (*Client) CorporateCustomersNotes ¶
func (c *Client) CorporateCustomersNotes(parameters CorporateCustomersNotesRequest) ( CorporateCustomersNotesResponse, int, error, )
CorporateCustomersNotes returns list of corporate customers notes matched the specified filter
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-customers-corporate-notes
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CorporateCustomersNotes(retailcrm.CorporateCustomersNotesRequest{
Filter: CorporateCustomersNotesFilter{
Text: "text",
},
Page: 3,
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.Notes {
log.Printf("%v\n", value)
}
func (*Client) CorporateCustomersUpload ¶
func (c *Client) CorporateCustomersUpload( customers []CorporateCustomer, site ...string, ) (CorporateCustomersUploadResponse, int, error)
CorporateCustomersUpload corporate customers batch upload
For more information see http://help.retailcrm.pro/Developers/ApiVersion5#post--api-v5-customers-corporate-upload
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CorporateCustomersUpload([]retailcrm.CorporateCustomer{
{
Nickname: "Company",
ExternalID: 1,
},
{
Nickname: "Company 2",
ExternalID: 2,
},
}}
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.UploadedCustomers)
}
func (*Client) Cost ¶
func (c *Client) Cost(id int) (CostResponse, int, error)
Cost returns information about specified cost
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-costs-id
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Cost(1)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
If data.Success == true {
log.Printf("%v", data.Cost)
}
func (*Client) CostCreate ¶
func (c *Client) CostCreate(cost CostRecord, site ...string) (CreateResponse, int, error)
CostCreate create the cost
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-costs-create
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CostCreate(
retailcrm.CostRecord{
DateFrom: "2012-12-12",
DateTo: "2012-12-12",
Summ: 12,
CostItem: "calculation-of-costs",
Order: Order{
Number: "1"
},
Sites: []string{"store"},
},
"store"
)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
If data.Success == true {
log.Printf("%v", data.ID)
}
func (*Client) CostDelete ¶
func (c *Client) CostDelete(id int) (SuccessfulResponse, int, error)
CostDelete removes cost
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-costs-id-delete
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CostDelete(1)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) CostEdit ¶
func (c *Client) CostEdit(id int, cost CostRecord, site ...string) (CreateResponse, int, error)
CostEdit edit a cost
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-costs-id-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CostEdit(1, retailcrm.Cost{
DateFrom: "2012-12-12",
DateTo: "2018-12-13",
Summ: 321,
CostItem: "seo",
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
If data.Success == true {
log.Printf("%v", data.ID)
}
func (*Client) CostGroupEdit ¶
func (c *Client) CostGroupEdit(costGroup CostGroup) (SuccessfulResponse, int, error)
CostGroupEdit edit costs groups
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-reference-cost-groups-code-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CostGroupEdit(retailcrm.CostGroup{
Code: "group-1",
Color: "#da5c98",
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) CostGroups ¶
func (c *Client) CostGroups() (CostGroupsResponse, int, error)
CostGroups returns costs groups list
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-cost-groups
func (*Client) CostItemEdit ¶
func (c *Client) CostItemEdit(costItem CostItem) (SuccessfulResponse, int, error)
CostItemEdit edit costs items
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-reference-cost-items-code-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CostItemEdit(retailcrm.CostItem{
Code: "seo",
Active: false,
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) CostItems ¶
func (c *Client) CostItems() (CostItemsResponse, int, error)
CostItems returns costs items list
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-cost-items
func (*Client) Costs ¶
func (c *Client) Costs(costs CostsRequest) (CostsResponse, int, error)
Costs returns costs list
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-costs
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Costs(CostsRequest{
Filter: CostsFilter{
Ids: []string{"1","2","3"},
MinSumm: "1000"
},
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.Costs {
log.Printf("%v\n", value.Summ)
}
func (*Client) CostsDelete ¶
func (c *Client) CostsDelete(ids []int) (CostsDeleteResponse, int, error)
CostsDelete removes a cost
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-costs-delete
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.client.CostsDelete([]int{1, 2, 3, 48, 49, 50})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
If data.Success == true {
log.Printf("Not removed costs: %v", data.NotRemovedIds)
}
func (*Client) CostsUpload ¶
func (c *Client) CostsUpload(cost []CostRecord) (CostsUploadResponse, int, error)
CostsUpload batch costs upload
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-costs-upload
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CostCreate([]retailcrm.CostRecord{
{
DateFrom: "2012-12-12",
DateTo: "2012-12-12",
Summ: 12,
CostItem: "calculation-of-costs",
Order: Order{
Number: "1"
},
Sites: []string{"store"},
},
{
DateFrom: "2012-12-13",
DateTo: "2012-12-13",
Summ: 13,
CostItem: "seo",
}
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
If data.Success == true {
log.Printf("Uploaded costs: %v", data.UploadedCosts)
}
func (*Client) Countries ¶
func (c *Client) Countries() (CountriesResponse, int, error)
Countries returns list of available country codes
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-countries
func (*Client) CourierCreate ¶
func (c *Client) CourierCreate(courier Courier) (CreateResponse, int, error)
CourierCreate creates a courier
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-couriers
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CostItemEdit(retailcrm.Courier{
Active: true,
Email: "courier1@example.com",
FirstName: "Ivan",
LastName: "Ivanov",
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v", data.ID)
}
func (*Client) CourierEdit ¶
func (c *Client) CourierEdit(courier Courier) (SuccessfulResponse, int, error)
CourierEdit edit a courier
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-reference-couriers-id-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CostItemEdit(retailcrm.Courier{
ID: 1,
Patronymic: "Ivanovich",
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) Couriers ¶
func (c *Client) Couriers() (CouriersResponse, int, error)
Couriers returns list of couriers
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-couriers
func (*Client) CustomDictionaries ¶
func (c *Client) CustomDictionaries(customDictionaries CustomDictionariesRequest) ( CustomDictionariesResponse, int, error, )
CustomDictionaries returns list of custom directory
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-custom-fields-dictionaries
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CustomDictionaries(retailcrm.CustomDictionariesRequest{
Filter: retailcrm.CustomDictionariesFilter{
Name: "Dictionary-1",
},
})
if err.Error() != "" {
fmt.Printf("%v", err.Error())
}
if status >= http.StatusBadRequest {
fmt.Printf("%v", err.Error())
}
for _, value := range data.CustomDictionaries {
fmt.Printf("%v\n", value.Elements)
}
func (*Client) CustomDictionariesCreate ¶
func (c *Client) CustomDictionariesCreate(customDictionary CustomDictionary) (CustomResponse, int, error)
CustomDictionariesCreate creates a custom dictionary
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-custom-fields-dictionaries-create
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CustomDictionariesCreate(retailcrm.CustomDictionary{
Name: "Courier profiles",
Code: "courier-profiles",
Elements: []Element{
{
Name: "Name",
Code: "name",
},
{
Name: "Lastname",
Code: "lastname",
}
},
})
if err.Error() != "" {
fmt.Printf("%v", err.Error())
}
if status >= http.StatusBadRequest {
fmt.Printf("%v", err.Error())
}
If data.Success == true {
fmt.Printf("%v", data.Code)
}
func (*Client) CustomDictionary ¶
func (c *Client) CustomDictionary(code string) (CustomDictionaryResponse, int, error)
CustomDictionary returns information about dictionary
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-custom-fields-entity-code
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CustomDictionary("courier-profiles")
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
If data.Success == true {
log.Printf("%v", data.CustomDictionary.Name)
}
func (*Client) CustomDictionaryEdit ¶
func (c *Client) CustomDictionaryEdit(customDictionary CustomDictionary) (CustomResponse, int, error)
CustomDictionaryEdit edit custom dictionary
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-custom-fields-dictionaries-code-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CustomDictionaryEdit(retailcrm.CustomDictionary{
Name: "Courier profiles",
Code: "courier-profiles",
Elements: []Element{
{
Name: "Name",
Code: "name",
},
{
Name: "Lastname",
Code: "lastname",
}
},
})
if err.Error() != "" {
fmt.Printf("%v", err.Error())
}
if status >= http.StatusBadRequest {
fmt.Printf("%v", err.Error())
}
If data.Success == true {
fmt.Printf("%v", data.Code)
}
func (*Client) CustomField ¶
func (c *Client) CustomField(entity, code string) (CustomFieldResponse, int, error)
CustomField returns information about custom fields
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-custom-fields-entity-code
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CustomField("order", "first-order")
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
If data.Success == true {
log.Printf("%v", data.CustomField)
}
func (*Client) CustomFieldEdit ¶
func (c *Client) CustomFieldEdit(customFields CustomFields) (CustomResponse, int, error)
CustomFieldEdit list method
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-custom-fields-entity-code-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CustomFieldEdit(CustomFields{
Code: "first-order",
Entity: "order",
DisplayArea: "delivery",
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
If data.Success == true {
log.Printf("%v", data.Code)
}
func (*Client) CustomFields ¶
func (c *Client) CustomFields(customFields CustomFieldsRequest) (CustomFieldsResponse, int, error)
CustomFields returns list of custom fields
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-custom-fields
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CustomFields(retailcrm.CustomFieldsRequest{
Type: "string",
Entity: "customer",
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.CustomFields {
fmt.Printf("%v\n", value)
}
func (*Client) CustomFieldsCreate ¶
func (c *Client) CustomFieldsCreate(customFields CustomFields) (CustomResponse, int, error)
CustomFieldsCreate creates custom field
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-custom-fields-entity-create
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CustomFieldsCreate(CustomFields{
Name: "First order",
Code: "first-order",
Type: "bool",
Entity: "order",
DisplayArea: "customer",
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
If data.Success == true {
log.Printf("%v", data.Code)
}
func (*Client) Customer ¶
func (c *Client) Customer(id, by, site string) (CustomerResponse, int, error)
Customer returns information about customer
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-customers-externalId
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Customer(12, retailcrm.ByExternalID, "")
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.Customer)
}
func (*Client) CustomerCreate ¶
func (c *Client) CustomerCreate(customer Customer, site ...string) (CustomerChangeResponse, int, error)
CustomerCreate creates customer
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-customers-create
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CustomersCombine(retailcrm.Customer{
FirstName: "Ivan",
LastName: "Ivanov",
Patronymic: "Ivanovich",
ExternalID: 1,
Email: "ivanov@example.com",
Address: &retailcrm.Address{
City: "Moscow",
Street: "Kutuzovsky",
},
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
fmt.Printf("%v", data.ID)
}
func (*Client) CustomerEdit ¶
func (c *Client) CustomerEdit(customer Customer, by string, site ...string) (CustomerChangeResponse, int, error)
CustomerEdit edit exact customer
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-customers-externalId-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CustomerEdit(
retailcrm.Customer{
FirstName: "Ivan",
LastName: "Ivanov",
Patronymic: "Ivanovich",
ID: 1,
Email: "ivanov@example.com",
},
retailcrm.ByID,
)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.Customer)
}
func (*Client) CustomerNoteCreate ¶
CustomerNoteCreate note creation
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-customers-notes-create
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CustomerNoteCreate(retailcrm.Note{
Text: "some text",
ManagerID: 12,
Customer: &retailcrm.Customer{
ID: 1,
},
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.ID)
}
func (*Client) CustomerNoteDelete ¶
func (c *Client) CustomerNoteDelete(id int) (SuccessfulResponse, int, error)
CustomerNoteDelete remove customer related note
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-customers-notes-id-delete
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CustomerNoteDelete(12)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) CustomerNotes ¶
func (c *Client) CustomerNotes(parameters NotesRequest) (NotesResponse, int, error)
CustomerNotes returns customer related notes
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-customers-notes
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CustomerNotes(retailcrm.NotesRequest{
Filter: retailcrm.NotesFilter{
CustomerIds: []int{1,2,3}
},
Page: 1,
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.Notes {
log.Printf("%v\n", value)
}
func (*Client) Customers ¶
func (c *Client) Customers(parameters CustomersRequest) (CustomersResponse, int, error)
Customers returns list of customers matched the specified filter
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-customers
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Customers(retailcrm.CustomersRequest{
Filter: CustomersFilter{
City: "Moscow",
},
Page: 3,
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.Customers {
log.Printf("%v\n", value)
}
func (*Client) CustomersCombine ¶
func (c *Client) CustomersCombine(customers []Customer, resultCustomer Customer) (SuccessfulResponse, int, error)
CustomersCombine combine given customers
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-customers-combine
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CustomersCombine([]retailcrm.Customer{{ID: 1}, {ID: 2}}, Customer{ID: 3})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) CustomersFixExternalIds ¶
func (c *Client) CustomersFixExternalIds(customers []IdentifiersPair) (SuccessfulResponse, int, error)
CustomersFixExternalIds customers external ID
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-customers-fix-external-ids
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CustomersFixExternalIds([]retailcrm.IdentifiersPair{{
ID: 1,
ExternalID: 12,
}})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) CustomersHistory ¶
func (c *Client) CustomersHistory(parameters CustomersHistoryRequest) (CustomersHistoryResponse, int, error)
CustomersHistory returns customer's history
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-customers-history
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CustomersHistory(retailcrm.CustomersHistoryRequest{
Filter: retailcrm.CustomersHistoryFilter{
SinceID: 20,
},
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.History {
log.Printf("%v\n", value)
}
func (*Client) CustomersUpload ¶
func (c *Client) CustomersUpload(customers []Customer, site ...string) (CustomersUploadResponse, int, error)
CustomersUpload customers batch upload
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-customers-upload
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.CustomersUpload([]retailcrm.Customer{
{
FirstName: "Ivan",
LastName: "Ivanov",
Patronymic: "Ivanovich",
ExternalID: 1,
Email: "ivanov@example.com",
},
{
FirstName: "Petr",
LastName: "Petrov",
Patronymic: "Petrovich",
ExternalID: 2,
Email: "petrov@example.com",
},
}}
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.UploadedCustomers)
}
func (*Client) DeliveryServiceEdit ¶
func (c *Client) DeliveryServiceEdit(deliveryService DeliveryService) (SuccessfulResponse, int, error)
DeliveryServiceEdit delivery service create/edit
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-reference-delivery-services-code-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.DeliveryServiceEdit(retailcrm.DeliveryService{
Active: false,
Code: "delivery-1",
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) DeliveryServices ¶
func (c *Client) DeliveryServices() (DeliveryServiceResponse, int, error)
DeliveryServices returns list of delivery services
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-delivery-services
func (*Client) DeliveryShipment ¶
func (c *Client) DeliveryShipment(id int) (DeliveryShipmentResponse, int, error)
DeliveryShipment get information about shipment
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-delivery-shipments-id
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.DeliveryShipment(12)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.DeliveryShipment)
}
func (*Client) DeliveryShipmentCreate ¶
func (c *Client) DeliveryShipmentCreate( shipment DeliveryShipment, deliveryType string, site ...string, ) (DeliveryShipmentUpdateResponse, int, error)
DeliveryShipmentCreate creates shipment
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-delivery-shipments-create
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.DeliveryShipmentCreate(
retailcrm.DeliveryShipment{
Date: "2012-12-12",
Time: retailcrm.DeliveryTime{
From: "18:00",
To: "20:00",
},
Orders: []retailcrm.Order{{Number: "12"}},
},
"sdek",
)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.ID)
}
func (*Client) DeliveryShipmentEdit ¶
func (c *Client) DeliveryShipmentEdit(shipment DeliveryShipment, site ...string) ( DeliveryShipmentUpdateResponse, int, error, )
DeliveryShipmentEdit shipment editing
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-delivery-shipments-id-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.DeliveryShipmentEdit(retailcrm.DeliveryShipment{
ID: "12",
Time: retailcrm.DeliveryTime{
From: "14:00",
To: "18:00",
},
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) DeliveryShipments ¶
func (c *Client) DeliveryShipments(parameters DeliveryShipmentsRequest) (DeliveryShipmentsResponse, int, error)
DeliveryShipments returns list of shipments
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-delivery-shipments
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.DeliveryShipments(retailcrm.DeliveryShipmentsRequest{
Limit: 12,
Filter: retailcrm.ShipmentFilter{
DateFrom: "2012-12-12",
},
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.DeliveryShipments {
log.Printf("%v\n", value)
}
func (*Client) DeliveryTracking ¶
func (c *Client) DeliveryTracking(parameters []DeliveryTrackingRequest, subcode string) ( SuccessfulResponse, int, error, )
DeliveryTracking updates tracking data
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-delivery-generic-subcode-tracking
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
t, _ := time.Parse("2006-01-02 15:04:05", "2012-12-12 12:12:12")
data, status, err := client.DeliveryTracking(
[]retailcrm.DeliveryTrackingRequest{{
DeliveryID: "1",
TrackNumber: "123",
History: []retailcrm.DeliveryHistoryRecord{
{
Code: "cancel",
UpdatedAt: t.Format(time.RFC3339),
},
},
}},
"delivery-1",
)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) DeliveryTypeEdit ¶
func (c *Client) DeliveryTypeEdit(deliveryType DeliveryType) (SuccessfulResponse, int, error)
DeliveryTypeEdit delivery type create/edit
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-reference-delivery-types-code-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.DeliveryTypeEdit(retailcrm.DeliveryType{
Active: false,
Code: "type-1",
DefaultCost: 300,
DefaultForCrm: false,
}
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) DeliveryTypes ¶
func (c *Client) DeliveryTypes() (DeliveryTypesResponse, int, error)
DeliveryTypes returns list of delivery types
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-delivery-types
func (*Client) File ¶
func (c *Client) File(id int) (FileResponse, int, error)
File returns a file info
For more information see https://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-files
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.File(112)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.File)
}
func (*Client) FileDelete ¶
func (c *Client) FileDelete(id int) (SuccessfulResponse, int, error)
FileDelete removes file from RetailCRM
For more information see https://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-files
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.FileDelete(123)
if err.Error() != "" {
fmt.Printf("%v", err.Error())
}
if status >= http.StatusBadRequest {
fmt.Printf("%v", err.Error())
}
func (*Client) FileDownload ¶
FileDownload downloads file from RetailCRM
For more information see https://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-files
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
fileData, status, err := client.FileDownload(123)
if err.Error() != "" {
fmt.Printf("%v", err.Error())
}
if status >= http.StatusBadRequest {
fmt.Printf("%v", err.Error())
}
func (*Client) FileEdit ¶
FileEdit edits file name and relations with orders and customers in RetailCRM
For more information see https://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-files
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.FileEdit(123, File{Filename: "image2.jpg"})
if err.Error() != "" {
fmt.Printf("%v", err.Error())
}
if status >= http.StatusBadRequest {
fmt.Printf("%v", err.Error())
}
func (*Client) FileUpload ¶
FileUpload uploads file to RetailCRM
For more information see https://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-files
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
file, err := os.Open("file.jpg")
if err != nil {
fmt.Print(err)
}
data, status, err := client.FileUpload(file)
if err.Error() != "" {
fmt.Printf("%v", err.Error())
}
if status >= http.StatusBadRequest {
fmt.Printf("%v", err.Error())
}
func (*Client) Files ¶
func (c *Client) Files(files FilesRequest) (FilesResponse, int, error)
Files returns files list
For more information see https://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-files
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Files(FilesRequest{
Filter: FilesFilter{
Filename: "image.jpeg",
},
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) GetRequest ¶
GetRequest implements GET Request.
func (*Client) IntegrationModule ¶
func (c *Client) IntegrationModule(code string) (IntegrationModuleResponse, int, error)
IntegrationModule returns integration module
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-integration-modules-code
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.IntegrationModule("moysklad3")
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.IntegrationModule)
}
func (*Client) IntegrationModuleEdit ¶
func (c *Client) IntegrationModuleEdit(integrationModule IntegrationModule) ( IntegrationModuleEditResponse, int, error, )
IntegrationModuleEdit integration module create/edit
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-integration-modules-code
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
name := "MS"
code := "moysklad3"
data, status, err := client.IntegrationModuleEdit(retailcrm.IntegrationModule{
Code: code,
IntegrationCode: code,
Active: false,
Name: fmt.Sprintf("Integration module %s", name),
AccountURL: fmt.Sprintf("http://example.com/%s/account", name),
BaseURL: fmt.Sprintf("http://example.com/%s", name),
ClientID: "123",
Logo: "https://cdn.worldvectorlogo.com/logos/github-icon.svg",
})
if err.Error() != "" {
fmt.Printf("%v", err.Error())
}
if status >= http.StatusBadRequest {
fmt.Printf("%v", err.Error())
}
if data.Success == true {
fmt.Printf("%v\n", data.Info)
}
func (*Client) Inventories ¶
func (c *Client) Inventories(parameters InventoriesRequest) (InventoriesResponse, int, error)
Inventories returns leftover stocks and purchasing prices
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-store-inventories
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Inventories(retailcrm.InventoriesRequest{Filter: retailcrm.InventoriesFilter{Details: 1, ProductActive: 1}, Page: 1})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.Offers {
log.Printf("%v\n", value)
}
func (*Client) InventoriesUpload ¶
func (c *Client) InventoriesUpload(inventories []InventoryUpload, site ...string) (StoreUploadResponse, int, error)
InventoriesUpload updates the leftover stocks and purchasing prices
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-store-inventories-upload
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.InventoriesUpload(
[]retailcrm.InventoryUpload{
{
XMLID: "pT22K9YzX21HTdzFCe1",
Stores: []InventoryUploadStore{
{Code: "test-store-v5", Available: 10, PurchasePrice: 1500},
{Code: "test-store-v4", Available: 20, PurchasePrice: 1530},
{Code: "test-store", Available: 30, PurchasePrice: 1510},
},
},
{
XMLID: "JQICtiSpOV3AAfMiQB3",
Stores: []InventoryUploadStore{
{Code: "test-store-v5", Available: 45, PurchasePrice: 1500},
{Code: "test-store-v4", Available: 32, PurchasePrice: 1530},
{Code: "test-store", Available: 46, PurchasePrice: 1510},
},
},
},
)
if err.Error() != "" {
fmt.Printf("%v", err.Error())
}
if status >= http.StatusBadRequest {
fmt.Printf("%v", err.Error())
}
fmt.Printf("%v\n", data.NotFoundOffers)
func (*Client) LegalEntities ¶
func (c *Client) LegalEntities() (LegalEntitiesResponse, int, error)
LegalEntities returns list of legal entities
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-legal-entities
func (*Client) LegalEntityEdit ¶
func (c *Client) LegalEntityEdit(legalEntity LegalEntity) (SuccessfulResponse, int, error)
LegalEntityEdit change information about legal entity
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-reference-legal-entities-code-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.LegalEntityEdit(retailcrm.LegalEntity{
Code: "legal-entity-1",
CertificateDate: "2012-12-12",
}
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) Order ¶
func (c *Client) Order(id, by, site string) (OrderResponse, int, error)
Order returns information about order
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-orders-externalId
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Order(12, retailcrm.ByExternalID, "")
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.Order)
}
func (*Client) OrderCreate ¶
OrderCreate creates an order
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-create
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.OrderCreate(retailcrm.Order{
FirstName: "Ivan",
LastName: "Ivanov",
Patronymic: "Ivanovich",
Email: "ivanov@example.com",
Items: []retailcrm.OrderItem{{Offer: retailcrm.Offer{ID: 12}, Quantity: 5}},
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.ID)
}
func (*Client) OrderEdit ¶
OrderEdit edit an order
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-externalId-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.OrderEdit(
retailcrm.Order{
ID: 12,
Items: []retailcrm.OrderItem{{Offer: retailcrm.Offer{ID: 13}, Quantity: 6}},
},
retailcrm.ByID,
)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) OrderMethodEdit ¶
func (c *Client) OrderMethodEdit(orderMethod OrderMethod) (SuccessfulResponse, int, error)
OrderMethodEdit order method create/edit
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-reference-order-methods-code-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.OrderMethodEdit(retailcrm.OrderMethod{
Code: "method-1",
Active: false,
DefaultForCRM: false,
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) OrderMethods ¶
func (c *Client) OrderMethods() (OrderMethodsResponse, int, error)
OrderMethods returns list of order methods
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-order-methods
func (*Client) OrderPaymentCreate ¶
OrderPaymentCreate creates payment
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-payments-create
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.OrderPaymentCreate(retailcrm.Payment{
Order: &retailcrm.Order{
ID: 12,
},
Amount: 300,
Type: "cash",
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.ID)
}
func (*Client) OrderPaymentDelete ¶
func (c *Client) OrderPaymentDelete(id int) (SuccessfulResponse, int, error)
OrderPaymentDelete payment removing
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-payments-id-delete
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.OrderPaymentDelete(12)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) OrderPaymentEdit ¶
func (c *Client) OrderPaymentEdit(payment Payment, by string, site ...string) (SuccessfulResponse, int, error)
OrderPaymentEdit edit payment
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-payments-id-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.OrderPaymentEdit(
retailcrm.Payment{
ID: 12,
Amount: 500,
},
retailcrm.ByID,
)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) OrderTypeEdit ¶
func (c *Client) OrderTypeEdit(orderType OrderType) (SuccessfulResponse, int, error)
OrderTypeEdit create/edit order type
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-reference-order-methods-code-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.OrderTypeEdit(retailcrm.OrderType{
Code: "order-type-1",
Active: false,
DefaultForCRM: false,
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) OrderTypes ¶
func (c *Client) OrderTypes() (OrderTypesResponse, int, error)
OrderTypes return list of order types
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-order-types
func (*Client) Orders ¶
func (c *Client) Orders(parameters OrdersRequest) (OrdersResponse, int, error)
Orders returns list of orders matched the specified filters
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-orders
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Orders(retailcrm.OrdersRequest{Filter: retailcrm.OrdersFilter{City: "Moscow"}, Page: 1})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.Orders {
log.Printf("%v\n", value)
}
func (*Client) OrdersCombine ¶
func (c *Client) OrdersCombine(technique string, order, resultOrder Order) (OperationResponse, int, error)
OrdersCombine combines given orders
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-combine
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.OrdersCombine("ours", retailcrm.Order{ID: 1}, retailcrm.Order{ID: 1})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) OrdersFixExternalIds ¶
func (c *Client) OrdersFixExternalIds(orders []IdentifiersPair) (SuccessfulResponse, int, error)
OrdersFixExternalIds set order external ID
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-fix-external-ids
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.OrdersFixExternalIds(([]retailcrm.IdentifiersPair{{
ID: 1,
ExternalID: 12,
}})
if err.Error() != "" {
fmt.Printf("%v", err.Error())
}
if status >= http.StatusBadRequest {
fmt.Printf("%v", err.Error())
}
if data.Success == true {
fmt.Printf("%v\n", data.ID)
}
func (*Client) OrdersHistory ¶
func (c *Client) OrdersHistory(parameters OrdersHistoryRequest) (OrdersHistoryResponse, int, error)
OrdersHistory returns orders history
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-orders-history
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.OrdersHistory(retailcrm.OrdersHistoryRequest{Filter: retailcrm.OrdersHistoryFilter{SinceID: 20}})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.History {
log.Printf("%v\n", value)
}
func (*Client) OrdersStatuses ¶
func (c *Client) OrdersStatuses(request OrdersStatusesRequest) (OrdersStatusesResponse, int, error)
OrdersStatuses returns orders statuses
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-orders-statuses
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.OrdersStatuses(retailcrm.OrdersStatusesRequest{
IDs: []int{1},
ExternalIDs: []string{"2"},
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) OrdersUpload ¶
OrdersUpload batch orders uploading
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-upload
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.OrdersUpload([]retailcrm.Order{
{
FirstName: "Ivan",
LastName: "Ivanov",
Patronymic: "Ivanovich",
Email: "ivanov@example.com",
Items: []retailcrm.OrderItem{{Offer: retailcrm.Offer{ID: 12}, Quantity: 5}},
},
{
FirstName: "Pert",
LastName: "Petrov",
Patronymic: "Petrovich",
Email: "petrov@example.com",
Items: []retailcrm.OrderItem{{Offer: retailcrm.Offer{ID: 13}, Quantity: 1}},
}
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.UploadedOrders)
}
func (*Client) Pack ¶
func (c *Client) Pack(id int) (PackResponse, int, error)
Pack returns a pack info
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-orders-packs-id
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Pack(112)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.Pack)
}
func (*Client) PackCreate ¶
func (c *Client) PackCreate(pack Pack) (CreateResponse, int, error)
PackCreate creates a pack
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-packs-create
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.PackCreate(Pack{
Store: "store-1",
ItemID: 12,
Quantity: 1,
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.ID)
}
func (*Client) PackDelete ¶
func (c *Client) PackDelete(id int) (SuccessfulResponse, int, error)
PackDelete removes a pack
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-packs-id-delete
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.PackDelete(112)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) PackEdit ¶
func (c *Client) PackEdit(pack Pack) (CreateResponse, int, error)
PackEdit edit a pack
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-packs-id-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.PackEdit(Pack{ID: 12, Quantity: 2})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) Packs ¶
func (c *Client) Packs(parameters PacksRequest) (PacksResponse, int, error)
Packs returns list of packs matched the specified filters
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-orders-packs
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Packs(retailcrm.PacksRequest{Filter: retailcrm.PacksFilter{OrderID: 12}})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.Packs {
log.Printf("%v\n", value)
}
func (*Client) PacksHistory ¶
func (c *Client) PacksHistory(parameters PacksHistoryRequest) (PacksHistoryResponse, int, error)
PacksHistory returns a history of order packing
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-orders-packs-history
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.PacksHistory(retailcrm.PacksHistoryRequest{Filter: retailcrm.OrdersHistoryFilter{SinceID: 5}})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.History {
log.Printf("%v\n", value)
}
func (*Client) PaymentStatusEdit ¶
func (c *Client) PaymentStatusEdit(paymentStatus PaymentStatus) (SuccessfulResponse, int, error)
PaymentStatusEdit payment status creation/editing
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-reference-payment-statuses-code-edit
func (*Client) PaymentStatuses ¶
func (c *Client) PaymentStatuses() (PaymentStatusesResponse, int, error)
PaymentStatuses returns list of payment statuses
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-payment-statuses
func (*Client) PaymentTypeEdit ¶
func (c *Client) PaymentTypeEdit(paymentType PaymentType) (SuccessfulResponse, int, error)
PaymentTypeEdit payment type create/edit
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-reference-payment-types-code-edit
func (*Client) PaymentTypes ¶
func (c *Client) PaymentTypes() (PaymentTypesResponse, int, error)
PaymentTypes returns list of payment types
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-payment-types
func (*Client) PostRequest ¶
func (c *Client) PostRequest( uri string, postData interface{}, contType ...string, ) ([]byte, int, error)
PostRequest implements POST Request with generic body data.
func (*Client) PriceTypeEdit ¶
func (c *Client) PriceTypeEdit(priceType PriceType) (SuccessfulResponse, int, error)
PriceTypeEdit price type create/edit
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-reference-price-types-code-edit
func (*Client) PriceTypes ¶
func (c *Client) PriceTypes() (PriceTypesResponse, int, error)
PriceTypes returns list of price types
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-price-types
func (*Client) PricesUpload ¶
func (c *Client) PricesUpload(prices []OfferPriceUpload) (StoreUploadResponse, int, error)
PricesUpload updates prices
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-store-prices-upload
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.PricesUpload([]retailcrm.OfferPriceUpload{
{
ID 1
Site "store-1"
Prices []PriceUpload{{Code: "price-1"}}
},
{
ID 2
Site "store-1"
Prices []PriceUpload{{Code: "price-2"}}
},
})
if err.Error() != "" {
fmt.Printf("%v", err.Error())
}
if status >= http.StatusBadRequest {
fmt.Printf("%v", err.Error())
}
fmt.Printf("%v\n", data.NotFoundOffers)
func (*Client) ProductStatusEdit ¶
func (c *Client) ProductStatusEdit(productStatus ProductStatus) (SuccessfulResponse, int, error)
ProductStatusEdit order item status create/edit
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-reference-product-statuses-code-edit
func (*Client) ProductStatuses ¶
func (c *Client) ProductStatuses() (ProductStatusesResponse, int, error)
ProductStatuses returns list of item statuses in order
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-product-statuses
func (*Client) Products ¶
func (c *Client) Products(parameters ProductsRequest) (ProductsResponse, int, error)
Products returns list of products and SKU
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-store-products
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Products(retailcrm.ProductsRequest{
Filter: retailcrm.ProductsFilter{
Active: 1,
MinPrice: 1000,
},
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.Products {
log.Printf("%v\n", value)
}
func (*Client) ProductsGroup ¶
func (c *Client) ProductsGroup(parameters ProductsGroupsRequest) (ProductsGroupsResponse, int, error)
ProductsGroup returns list of product groups
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-store-product-groups
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.ProductsGroup(retailcrm.ProductsGroupsRequest{
Filter: retailcrm.ProductsGroupsFilter{
Active: 1,
},
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.ProductGroup {
log.Printf("%v\n", value)
}
func (*Client) ProductsProperties ¶
func (c *Client) ProductsProperties(parameters ProductsPropertiesRequest) (ProductsPropertiesResponse, int, error)
ProductsProperties returns list of item properties, matching the specified filters
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-store-products-properties
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.ProductsProperties(retailcrm.ProductsPropertiesRequest{
Filter: retailcrm.ProductsPropertiesFilter{
Sites: []string["store"],
},
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.Properties {
log.Printf("%v\n", value)
}
func (*Client) Segments ¶
func (c *Client) Segments(parameters SegmentsRequest) (SegmentsResponse, int, error)
Segments returns segments
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-segments
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Segments(SegmentsRequest{
Filter: retailcrm.SegmentsFilter{
Ids: []int{1,2,3}
}
})
if err.Error() != "" {
fmt.Printf("%v", err.Error())
}
if status >= http.StatusBadRequest {
fmt.Printf("%v", err.Error())
}
for _, value := range data.Segments {
fmt.Printf("%v\n", value)
}
func (*Client) Settings ¶
func (c *Client) Settings() (SettingsResponse, int, error)
Settings returns system settings
For more information see https://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-settings
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Settings()
if err.Error() != "" {
fmt.Printf("%v", err.Error())
}
if status >= http.StatusBadRequest {
fmt.Printf("%v", err.Error())
}
fmt.Printf("%#v\n", data)
func (*Client) SiteEdit ¶
func (c *Client) SiteEdit(site Site) (SuccessfulResponse, int, error)
SiteEdit site create/edit
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-reference-sites-code-edit
func (*Client) Sites ¶
func (c *Client) Sites() (SitesResponse, int, error)
Sites returns the sites list
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-sites
func (*Client) StaticticsUpdate ¶
func (c *Client) StaticticsUpdate() (SuccessfulResponse, int, error)
StaticticsUpdate updates statistics
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-statistic-update
func (*Client) StatusEdit ¶
func (c *Client) StatusEdit(st Status) (SuccessfulResponse, int, error)
StatusEdit order status create/edit
For more information see www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-reference-sites-code-edit.
func (*Client) StatusGroups ¶
func (c *Client) StatusGroups() (StatusGroupsResponse, int, error)
StatusGroups returns list of order status groups
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-status-groups
func (*Client) Statuses ¶
func (c *Client) Statuses() (StatusesResponse, int, error)
Statuses returns list of order statuses
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-statuses
func (*Client) StoreEdit ¶
func (c *Client) StoreEdit(store Store) (SuccessfulResponse, int, error)
StoreEdit warehouse create/edit
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-reference-stores-code-edit
func (*Client) Stores ¶
func (c *Client) Stores() (StoresResponse, int, error)
Stores returns list of warehouses
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-stores
func (*Client) Task ¶
func (c *Client) Task(id int) (TaskResponse, int, error)
Task returns task
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-tasks-id
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Task(12)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.Task)
}
func (*Client) TaskCreate ¶
TaskCreate create a task
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-tasks-create
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Tasks(retailcrm.Task{
Text: "task №1",
PerformerID: 12,
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.ID)
}
func (*Client) TaskEdit ¶
TaskEdit edit a task
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-tasks-id-edit
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Task(retailcrm.Task{
ID: 12
Text: "task №2",
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) Tasks ¶
func (c *Client) Tasks(parameters TasksRequest) (TasksResponse, int, error)
Tasks returns task list
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-tasks
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Tasks(retailcrm.TasksRequest{
Filter: TasksFilter{
DateFrom: "2012-12-12",
},
})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.Tasks {
log.Printf("%v\n", value)
}
func (*Client) UnitEdit ¶
func (c *Client) UnitEdit(unit Unit) (SuccessfulResponse, int, error)
UnitEdit unit create/edit
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-reference-units-code-edit
func (*Client) Units ¶
func (c *Client) Units() (UnitsResponse, int, error)
Units returns units list
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-units
func (*Client) User ¶
func (c *Client) User(id int) (UserResponse, int, error)
User returns information about user
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-users-id
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.User(12)
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
if data.Success == true {
log.Printf("%v\n", data.User)
}
func (*Client) UserGroups ¶
func (c *Client) UserGroups(parameters UserGroupsRequest) (UserGroupsResponse, int, error)
UserGroups returns list of user groups
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-user-groups
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.UserGroups(retailcrm.UserGroupsRequest{Page: 1})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.Groups {
log.Printf("%v\n", value)
}
func (*Client) UserStatus ¶
UserStatus change user status
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-users
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.UserStatus(12, "busy")
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
func (*Client) Users ¶
func (c *Client) Users(parameters UsersRequest) (UsersResponse, int, error)
Users returns list of users matched the specified filters
For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-users
Example:
var client = retailcrm.New("https://demo.url", "09jIJ")
data, status, err := client.Users(retailcrm.UsersRequest{Filter: retailcrm.UsersFilter{Active: 1}, Page: 1})
if err != nil {
if apiErr, ok := retailcrm.AsAPIError(err); ok {
log.Fatalf("http status: %d, %s", status, apiErr.String())
}
log.Fatalf("http status: %d, error: %s", status, err)
}
for _, value := range data.Users {
log.Printf("%v\n", value)
}
func (*Client) WithLogger ¶
func (c *Client) WithLogger(logger BasicLogger) *Client
WithLogger sets the provided logger instance into the Client.
type Company ¶
type Company struct {
ID int `json:"id,omitempty"`
IsMain bool `json:"isMain,omitempty"`
ExternalID string `json:"externalId,omitempty"`
Active bool `json:"active,omitempty"`
Name string `json:"name,omitempty"`
Brand string `json:"brand,omitempty"`
Site string `json:"site,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
Contragent *Contragent `json:"contragent,omitempty"`
Address *IdentifiersPair `json:"address,omitempty"`
CustomFields StringMap `json:"customFields,omitempty"`
}
type Contragent ¶
type Contragent struct {
ContragentType string `json:"contragentType,omitempty"`
LegalName string `json:"legalName,omitempty"`
LegalAddress string `json:"legalAddress,omitempty"`
INN string `json:"INN,omitempty"`
OKPO string `json:"OKPO,omitempty"`
KPP string `json:"KPP,omitempty"`
OGRN string `json:"OGRN,omitempty"`
OGRNIP string `json:"OGRNIP,omitempty"`
CertificateNumber string `json:"certificateNumber,omitempty"`
CertificateDate string `json:"certificateDate,omitempty"`
BIK string `json:"BIK,omitempty"`
Bank string `json:"bank,omitempty"`
BankAddress string `json:"bankAddress,omitempty"`
CorrAccount string `json:"corrAccount,omitempty"`
BankAccount string `json:"bankAccount,omitempty"`
}
Contragent type.
type CorporateCustomer ¶
type CorporateCustomer struct {
ID int `json:"id,omitempty"`
ExternalID string `json:"externalId,omitempty"`
Nickname string `json:"nickName,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
Vip bool `json:"vip,omitempty"`
Bad bool `json:"bad,omitempty"`
CustomFields StringMap `json:"customFields,omitempty"`
PersonalDiscount float32 `json:"personalDiscount,omitempty"`
DiscountCardNumber string `json:"discountCardNumber,omitempty"`
ManagerID int `json:"managerId,omitempty"`
Source *Source `json:"source,omitempty"`
CustomerContacts []CorporateCustomerContact `json:"customerContacts,omitempty"`
Companies []Company `json:"companies,omitempty"`
Addresses []CorporateCustomerAddress `json:"addresses,omitempty"`
}
CorporateCustomer type.
type CorporateCustomerAddress ¶
type CorporateCustomerAddress struct {
ID int `json:"id,omitempty"`
Index string `json:"index,omitempty"`
CountryISO string `json:"countryIso,omitempty"`
Region string `json:"region,omitempty"`
RegionID int `json:"regionId,omitempty"`
City string `json:"city,omitempty"`
CityID int `json:"cityId,omitempty"`
CityType string `json:"cityType,omitempty"`
Street string `json:"street,omitempty"`
StreetID int `json:"streetId,omitempty"`
StreetType string `json:"streetType,omitempty"`
Building string `json:"building,omitempty"`
Flat string `json:"flat,omitempty"`
IntercomCode string `json:"intercomCode,omitempty"`
Floor int `json:"floor,omitempty"`
Block int `json:"block,omitempty"`
House string `json:"house,omitempty"`
Housing string `json:"housing,omitempty"`
Metro string `json:"metro,omitempty"`
Notes string `json:"notes,omitempty"`
Text string `json:"text,omitempty"`
ExternalID string `json:"externalId,omitempty"`
Name string `json:"name,omitempty"`
}
CorporateCustomerAddress type. Address didn't inherited in order to simplify declaration.
type CorporateCustomerAddressesFilter ¶
type CorporateCustomerAddressesFilter struct {
Ids []string `url:"ids,omitempty,brackets"`
Name string `url:"name,omitempty"`
City string `url:"city,omitempty"`
Region string `url:"region,omitempty"`
}
CorporateCustomerAddressesFilter type.
type CorporateCustomerAddressesRequest ¶
type CorporateCustomerAddressesRequest struct {
Filter CorporateCustomerAddressesFilter `url:"filter,omitempty"`
By string `url:"by,omitempty"`
Site string `url:"site,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
CorporateCustomerAddressesRequest type.
type CorporateCustomerChangeResponse ¶
type CorporateCustomerChangeResponse CustomerChangeResponse
CorporateCustomerChangeResponse type.
type CorporateCustomerCompaniesResponse ¶
type CorporateCustomerCompaniesResponse struct {
Success bool `json:"success"`
Companies []Company `json:"companies"`
}
CorporateCustomerCompaniesResponse type.
type CorporateCustomerContact ¶
type CorporateCustomerContact struct {
IsMain bool `json:"isMain,omitempty"`
Customer CorporateCustomerContactCustomer `json:"customer,omitempty"`
Companies []IdentifiersPair `json:"companies,omitempty"`
}
type CorporateCustomerContactsResponse ¶
type CorporateCustomerContactsResponse struct {
Success bool `json:"success"`
Contacts []CorporateCustomerContact `json:"contacts"`
}
CorporateCustomerContactsResponse type.
type CorporateCustomerHistoryRecord ¶
type CorporateCustomerHistoryRecord struct {
ID int `json:"id,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
Created bool `json:"created,omitempty"`
Deleted bool `json:"deleted,omitempty"`
Source string `json:"source,omitempty"`
Field string `json:"field,omitempty"`
User *User `json:"user,omitempty"`
APIKey *APIKey `json:"apiKey,omitempty"`
CorporateCustomer *CorporateCustomer `json:"corporateCustomer,omitempty"`
}
CorporateCustomerHistoryRecord type.
type CorporateCustomerNote ¶
type CorporateCustomerNote struct {
ManagerID int `json:"managerId,omitempty"`
Text string `json:"text,omitempty"`
Customer *IdentifiersPair `json:"customer,omitempty"`
}
CorporateCustomerNote type.
type CorporateCustomerResponse ¶
type CorporateCustomerResponse struct {
Success bool `json:"success"`
CorporateCustomer *CorporateCustomer `json:"customerCorporate,omitempty"`
}
CorporateCustomerResponse type.
type CorporateCustomersAddressesResponse ¶
type CorporateCustomersAddressesResponse struct {
Success bool `json:"success"`
Addresses []CorporateCustomerAddress `json:"addresses"`
}
CorporateCustomersAddressesResponse type.
type CorporateCustomersFilter ¶
type CorporateCustomersFilter struct {
ContragentName string `url:"contragentName,omitempty"`
ContragentInn string `url:"contragentInn,omitempty"`
ContragentKpp string `url:"contragentKpp,omitempty"`
ContragentBik string `url:"contragentBik,omitempty"`
ContragentCorrAccount string `url:"contragentCorrAccount,omitempty"`
ContragentBankAccount string `url:"contragentBankAccount,omitempty"`
ContragentTypes []string `url:"contragentTypes,omitempty,brackets"`
ExternalIds []string `url:"externalIds,omitempty,brackets"`
Name string `url:"name,omitempty"`
City string `url:"city,omitempty"`
Region string `url:"region,omitempty"`
Email string `url:"email,omitempty"`
Notes string `url:"notes,omitempty"`
MinOrdersCount int `url:"minOrdersCount,omitempty"`
MaxOrdersCount int `url:"maxOrdersCount,omitempty"`
MinAverageSumm float32 `url:"minAverageSumm,omitempty"`
MaxAverageSumm float32 `url:"maxAverageSumm,omitempty"`
MinTotalSumm float32 `url:"minTotalSumm,omitempty"`
MaxTotalSumm float32 `url:"maxTotalSumm,omitempty"`
ClassSegment string `url:"classSegment,omitempty"`
DiscountCardNumber string `url:"discountCardNumber,omitempty"`
Attachments int `url:"attachments,omitempty"`
MinCostSumm float32 `url:"minCostSumm,omitempty"`
MaxCostSumm float32 `url:"maxCostSumm,omitempty"`
Vip int `url:"vip,omitempty"`
Bad int `url:"bad,omitempty"`
TasksCount int `url:"tasksCounts,omitempty"`
Ids []string `url:"ids,omitempty,brackets"`
Sites []string `url:"sites,omitempty,brackets"`
Managers []string `url:"managers,omitempty,brackets"`
ManagerGroups []string `url:"managerGroups,omitempty,brackets"`
DateFrom string `url:"dateFrom,omitempty"`
DateTo string `url:"dateTo,omitempty"`
FirstOrderFrom string `url:"firstOrderFrom,omitempty"`
FirstOrderTo string `url:"firstOrderTo,omitempty"`
LastOrderFrom string `url:"lastOrderFrom,omitempty"`
LastOrderTo string `url:"lastOrderTo,omitempty"`
CustomFields map[string]string `url:"customFields,omitempty,brackets"`
}
CorporateCustomersFilter type.
type CorporateCustomersHistoryFilter ¶
type CorporateCustomersHistoryFilter struct {
CustomerID int `url:"customerId,omitempty"`
SinceID int `url:"sinceId,omitempty"`
CustomerExternalID string `url:"customerExternalId,omitempty"`
ContactIds []string `url:"contactIds,omitempty,brackets"`
StartDate string `url:"startDate,omitempty"`
EndDate string `url:"endDate,omitempty"`
}
CorporateCustomersHistoryFilter type.
type CorporateCustomersHistoryRequest ¶
type CorporateCustomersHistoryRequest struct {
Filter CorporateCustomersHistoryFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
CorporateCustomersHistoryRequest type.
type CorporateCustomersHistoryResponse ¶
type CorporateCustomersHistoryResponse struct {
Success bool `json:"success,omitempty"`
GeneratedAt string `json:"generatedAt,omitempty"`
History []CorporateCustomerHistoryRecord `json:"history,omitempty"`
Pagination *Pagination `json:"pagination,omitempty"`
}
CorporateCustomersHistoryResponse type.
type CorporateCustomersNotesFilter ¶
type CorporateCustomersNotesFilter struct {
Ids []string `url:"ids,omitempty,brackets"`
CustomerIds []string `url:"ids,omitempty,brackets"`
CustomerExternalIds []string `url:"customerExternalIds,omitempty,brackets"`
ManagerIds []string `url:"managerIds,omitempty,brackets"`
Text string `url:"text,omitempty"`
CreatedAtFrom string `url:"createdAtFrom,omitempty"`
CreatedAtTo string `url:"createdAtTo,omitempty"`
}
CorporateCustomersNotesFilter type.
type CorporateCustomersNotesRequest ¶
type CorporateCustomersNotesRequest struct {
Filter CorporateCustomersNotesFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
CorporateCustomersNotesRequest type.
type CorporateCustomersNotesResponse ¶
type CorporateCustomersNotesResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
Notes []Note `json:"notes,omitempty"`
}
CorporateCustomersNotesResponse type.
type CorporateCustomersRequest ¶
type CorporateCustomersRequest struct {
Filter CorporateCustomersFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
CorporateCustomersRequest type.
type CorporateCustomersResponse ¶
type CorporateCustomersResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
CustomersCorporate []CorporateCustomer `json:"customersCorporate,omitempty"`
}
CorporateCustomersResponse type.
type CorporateCustomersUploadResponse ¶
type CorporateCustomersUploadResponse CustomersUploadResponse
CorporateCustomersUploadResponse type.
type Cost ¶
type Cost struct {
Source *Source `json:"source,omitempty"`
ID int `json:"id,omitempty"`
DateFrom string `json:"dateFrom,omitempty"`
DateTo string `json:"dateTo,omitempty"`
Summ float32 `json:"summ,omitempty"`
CostItem string `json:"costItem,omitempty"`
Comment string `json:"comment,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
CreatedBy string `json:"createdBy,omitempty"`
Order *Order `json:"order,omitempty"`
UserID int `json:"userId,omitempty"`
Sites []string `json:"sites,omitempty"`
}
Cost type.
type CostGroup ¶
type CostGroup struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Color string `json:"color,omitempty"`
Active bool `json:"active,omitempty"`
Ordering int `json:"ordering,omitempty"`
}
CostGroup type.
type CostGroupsResponse ¶
type CostGroupsResponse struct {
Success bool `json:"success"`
CostGroups []CostGroup `json:"costGroups,omitempty"`
}
CostGroupsResponse type.
type CostItem ¶
type CostItem struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Group string `json:"group,omitempty"`
Type string `json:"type,omitempty"`
Active bool `json:"active,omitempty"`
AppliesToOrders bool `json:"appliesToOrders,omitempty"`
AppliesToUsers bool `json:"appliesToUsers,omitempty"`
Ordering int `json:"ordering,omitempty"`
Source *Source `json:"source,omitempty"`
}
CostItem type.
type CostItemsResponse ¶
type CostItemsResponse struct {
Success bool `json:"success"`
CostItems []CostItem `json:"costItems,omitempty"`
}
CostItemsResponse type.
type CostRecord ¶
type CostRecord struct {
Source *Source `json:"source,omitempty"`
Comment string `json:"comment,omitempty"`
DateFrom string `json:"dateFrom,omitempty"`
DateTo string `json:"dateTo,omitempty"`
Summ float32 `json:"summ,omitempty"`
CostItem string `json:"costItem,omitempty"`
UserID int `json:"userId,omitempty"`
Order *Order `json:"order,omitempty"`
Sites []string `json:"sites,omitempty"`
}
CostRecord type.
type CostResponse ¶
CostResponse type.
type CostsDeleteResponse ¶
type CostsDeleteResponse struct {
Success bool `json:"success"`
Count int `json:"count,omitempty"`
NotRemovedIds []int `json:"notRemovedIds,omitempty"`
}
CostsDeleteResponse type.
type CostsFilter ¶
type CostsFilter struct {
MinSumm string `url:"minSumm,omitempty"`
MaxSumm string `url:"maxSumm,omitempty"`
OrderNumber string `url:"orderNumber,omitempty"`
Comment string `url:"orderNumber,omitempty"`
Ids []string `url:"ids,omitempty,brackets"`
Sites []string `url:"sites,omitempty,brackets"`
CreatedBy []string `url:"createdBy,omitempty,brackets"`
CostGroups []string `url:"costGroups,omitempty,brackets"`
CostItems []string `url:"costItems,omitempty,brackets"`
Users []string `url:"users,omitempty,brackets"`
DateFrom string `url:"dateFrom,omitempty"`
DateTo string `url:"dateTo,omitempty"`
CreatedAtFrom string `url:"createdAtFrom,omitempty"`
CreatedAtTo string `url:"createdAtTo,omitempty"`
OrderIds []string `url:"orderIds,omitempty,brackets"`
OrderExternalIds []string `url:"orderIds,omitempty,brackets"`
}
CostsFilter type.
type CostsRequest ¶
type CostsRequest struct {
Filter CostsFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
CostsRequest type.
type CostsResponse ¶
type CostsResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
Costs []Cost `json:"costs,omitempty"`
}
CostsResponse type.
type CostsUploadResponse ¶
type CostsUploadResponse struct {
Success bool `json:"success"`
UploadedCosts []int `json:"uploadedCosts,omitempty"`
}
CostsUploadResponse type.
type CountriesResponse ¶
type CountriesResponse struct {
Success bool `json:"success"`
CountriesIso []string `json:"countriesIso,omitempty"`
}
CountriesResponse type.
type Courier ¶
type Courier struct {
ID int `json:"id,omitempty"`
FirstName string `json:"firstName,omitempty"`
LastName string `json:"lastName,omitempty"`
Patronymic string `json:"patronymic,omitempty"`
Email string `json:"email,omitempty"`
Description string `json:"description,omitempty"`
Active bool `json:"active,omitempty"`
Phone *Phone `json:"phone,omitempty"`
}
Courier type.
type CouriersResponse ¶
type CouriersResponse struct {
Success bool `json:"success"`
Couriers []Courier `json:"couriers,omitempty"`
}
CouriersResponse type.
type CreateResponse ¶
CreateResponse type.
type CredentialResponse ¶
type CredentialResponse struct {
Success bool `json:"success,omitempty"`
// deprecated
Credentials []string `json:"credentials,omitempty"`
Scopes []string `json:"scopes,omitempty"`
SiteAccess string `json:"siteAccess,omitempty"`
SitesAvailable []string `json:"sitesAvailable,omitempty"`
}
CredentialResponse return available API methods.
type CustomDictionariesFilter ¶
type CustomDictionariesFilter struct {
Name string `url:"name,omitempty"`
Code string `url:"code,omitempty"`
}
CustomDictionariesFilter type.
type CustomDictionariesRequest ¶
type CustomDictionariesRequest struct {
Filter CustomDictionariesFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
CustomDictionariesRequest type.
type CustomDictionariesResponse ¶
type CustomDictionariesResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
CustomDictionaries *[]CustomDictionary `json:"customDictionaries,omitempty"`
}
CustomDictionariesResponse type.
type CustomDictionary ¶
type CustomDictionary struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Elements []Element `json:"elements,omitempty"`
}
CustomDictionary type.
type CustomDictionaryResponse ¶
type CustomDictionaryResponse struct {
Success bool `json:"success"`
CustomDictionary *CustomDictionary `json:"CustomDictionary,omitempty"`
}
CustomDictionaryResponse type.
type CustomFieldResponse ¶
type CustomFieldResponse struct {
Success bool `json:"success"`
CustomField CustomFields `json:"customField,omitempty"`
}
CustomFieldResponse type.
type CustomFields ¶
type CustomFields struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Required bool `json:"required,omitempty"`
InFilter bool `json:"inFilter,omitempty"`
InList bool `json:"inList,omitempty"`
InGroupActions bool `json:"inGroupActions,omitempty"`
Type string `json:"type,omitempty"`
Entity string `json:"entity,omitempty"`
Default string `json:"default,omitempty"`
Ordering int `json:"ordering,omitempty"`
DisplayArea string `json:"displayArea,omitempty"`
ViewMode string `json:"viewMode,omitempty"`
Dictionary string `json:"dictionary,omitempty"`
}
CustomFields type.
type CustomFieldsFilter ¶
type CustomFieldsFilter struct {
Name string `url:"name,omitempty"`
Code string `url:"code,omitempty"`
Type string `url:"type,omitempty"`
Entity string `url:"entity,omitempty"`
ViewMode string `url:"viewMode,omitempty"`
DisplayArea string `url:"displayArea,omitempty"`
}
CustomFieldsFilter type.
type CustomFieldsRequest ¶
type CustomFieldsRequest struct {
Filter CustomFieldsFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
CustomFieldsRequest type.
type CustomFieldsResponse ¶
type CustomFieldsResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
CustomFields []CustomFields `json:"customFields,omitempty"`
}
CustomFieldsResponse type.
type CustomResponse ¶
CustomResponse type.
type Customer ¶
type Customer struct {
ID int `json:"id,omitempty"`
ExternalID string `json:"externalId,omitempty"`
FirstName string `json:"firstName,omitempty"`
LastName string `json:"lastName,omitempty"`
Patronymic string `json:"patronymic,omitempty"`
Sex string `json:"sex,omitempty"`
Email string `json:"email,omitempty"`
Phones []Phone `json:"phones,omitempty"`
Address *Address `json:"address,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
Birthday string `json:"birthday,omitempty"`
ManagerID int `json:"managerId,omitempty"`
Vip bool `json:"vip,omitempty"`
Bad bool `json:"bad,omitempty"`
Site string `json:"site,omitempty"`
Source *Source `json:"source,omitempty"`
Contragent *Contragent `json:"contragent,omitempty"`
PersonalDiscount float32 `json:"personalDiscount,omitempty"`
CumulativeDiscount float32 `json:"cumulativeDiscount,omitempty"`
DiscountCardNumber string `json:"discountCardNumber,omitempty"`
EmailMarketingUnsubscribedAt string `json:"emailMarketingUnsubscribedAt,omitempty"`
AvgMarginSumm float32 `json:"avgMarginSumm,omitempty"`
MarginSumm float32 `json:"marginSumm,omitempty"`
TotalSumm float32 `json:"totalSumm,omitempty"`
AverageSumm float32 `json:"averageSumm,omitempty"`
OrdersCount int `json:"ordersCount,omitempty"`
CostSumm float32 `json:"costSumm,omitempty"`
MaturationTime int `json:"maturationTime,omitempty"`
FirstClientID string `json:"firstClientId,omitempty"`
LastClientID string `json:"lastClientId,omitempty"`
BrowserID string `json:"browserId,omitempty"`
MgCustomerID string `json:"mgCustomerId,omitempty"`
PhotoURL string `json:"photoUrl,omitempty"`
CustomFields StringMap `json:"customFields,omitempty"`
Tags []Tag `json:"tags,omitempty"`
}
Customer type.
type CustomerChangeResponse ¶
type CustomerChangeResponse struct {
Success bool `json:"success"`
ID int `json:"id,omitempty"`
State string `json:"state,omitempty"`
}
CustomerChangeResponse type.
type CustomerHistoryRecord ¶
type CustomerHistoryRecord struct {
ID int `json:"id,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
Created bool `json:"created,omitempty"`
Deleted bool `json:"deleted,omitempty"`
Source string `json:"source,omitempty"`
Field string `json:"field,omitempty"`
User *User `json:"user,omitempty"`
APIKey *APIKey `json:"apiKey,omitempty"`
Customer *Customer `json:"customer,omitempty"`
}
CustomerHistoryRecord type.
type CustomerRequest ¶
CustomerRequest type.
type CustomerResponse ¶
type CustomerResponse struct {
Success bool `json:"success"`
Customer *Customer `json:"customer,omitempty"`
}
CustomerResponse type.
type CustomersFilter ¶
type CustomersFilter struct {
Ids []string `url:"ids,omitempty,brackets"`
ExternalIds []string `url:"externalIds,omitempty,brackets"`
City string `url:"city,omitempty"`
Region string `url:"region,omitempty"`
Name string `url:"name,omitempty"`
Email string `url:"email,omitempty"`
Notes string `url:"notes,omitempty"`
MinOrdersCount int `url:"minOrdersCount,omitempty"`
MaxOrdersCount int `url:"maxOrdersCount,omitempty"`
MinAverageSumm float32 `url:"minAverageSumm,omitempty"`
MaxAverageSumm float32 `url:"maxAverageSumm,omitempty"`
MinTotalSumm float32 `url:"minTotalSumm,omitempty"`
MaxTotalSumm float32 `url:"maxTotalSumm,omitempty"`
MinCostSumm float32 `url:"minCostSumm,omitempty"`
MaxCostSumm float32 `url:"maxCostSumm,omitempty"`
ClassSegment string `url:"classSegment,omitempty"`
Vip int `url:"vip,omitempty"`
Bad int `url:"bad,omitempty"`
Attachments int `url:"attachments,omitempty"`
Online int `url:"online,omitempty"`
EmailMarketingUnsubscribed int `url:"emailMarketingUnsubscribed,omitempty"`
Sex string `url:"sex,omitempty"`
Segment string `url:"segment,omitempty"`
DiscountCardNumber string `url:"discountCardNumber,omitempty"`
ContragentName string `url:"contragentName,omitempty"`
ContragentInn string `url:"contragentInn,omitempty"`
ContragentKpp string `url:"contragentKpp,omitempty"`
ContragentBik string `url:"contragentBik,omitempty"`
ContragentCorrAccount string `url:"contragentCorrAccount,omitempty"`
ContragentBankAccount string `url:"contragentBankAccount,omitempty"`
ContragentTypes []string `url:"contragentTypes,omitempty,brackets"`
Sites []string `url:"sites,omitempty,brackets"`
Managers []string `url:"managers,omitempty,brackets"`
ManagerGroups []string `url:"managerGroups,omitempty,brackets"`
DateFrom string `url:"dateFrom,omitempty"`
DateTo string `url:"dateTo,omitempty"`
FirstWebVisitFrom string `url:"firstWebVisitFrom,omitempty"`
FirstWebVisitTo string `url:"firstWebVisitTo,omitempty"`
LastWebVisitFrom string `url:"lastWebVisitFrom,omitempty"`
LastWebVisitTo string `url:"lastWebVisitTo,omitempty"`
FirstOrderFrom string `url:"firstOrderFrom,omitempty"`
FirstOrderTo string `url:"firstOrderTo,omitempty"`
LastOrderFrom string `url:"lastOrderFrom,omitempty"`
LastOrderTo string `url:"lastOrderTo,omitempty"`
BrowserID string `url:"browserId,omitempty"`
Commentary string `url:"commentary,omitempty"`
SourceName string `url:"sourceName,omitempty"`
MediumName string `url:"mediumName,omitempty"`
CampaignName string `url:"campaignName,omitempty"`
KeywordName string `url:"keywordName,omitempty"`
AdContentName string `url:"adContentName,omitempty"`
MgCustomerID string `url:"mgCustomerId,omitempty"`
CustomFields map[string]string `url:"customFields,omitempty,brackets"`
}
CustomersFilter type.
type CustomersHistoryFilter ¶
type CustomersHistoryFilter struct {
CustomerID int `url:"customerId,omitempty"`
SinceID int `url:"sinceId,omitempty"`
CustomerExternalID string `url:"customerExternalId,omitempty"`
StartDate string `url:"startDate,omitempty"`
EndDate string `url:"endDate,omitempty"`
}
CustomersHistoryFilter type.
type CustomersHistoryRequest ¶
type CustomersHistoryRequest struct {
Filter CustomersHistoryFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
CustomersHistoryRequest type.
type CustomersHistoryResponse ¶
type CustomersHistoryResponse struct {
Success bool `json:"success,omitempty"`
GeneratedAt string `json:"generatedAt,omitempty"`
History []CustomerHistoryRecord `json:"history,omitempty"`
Pagination *Pagination `json:"pagination,omitempty"`
}
CustomersHistoryResponse type.
type CustomersRequest ¶
type CustomersRequest struct {
Filter CustomersFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
CustomersRequest type.
type CustomersResponse ¶
type CustomersResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
Customers []Customer `json:"customers,omitempty"`
}
CustomersResponse type.
type CustomersUploadRequest ¶
type CustomersUploadRequest struct {
Customers []Customer `url:"customers,omitempty,brackets"`
Site string `url:"site,omitempty"`
}
CustomersUploadRequest type.
type CustomersUploadResponse ¶
type CustomersUploadResponse struct {
Success bool `json:"success"`
UploadedCustomers []IdentifiersPair `json:"uploadedCustomers,omitempty"`
}
CustomersUploadResponse type.
type DebugLogger ¶
type DebugLogger interface {
Debugf(string, ...interface{})
}
DebugLogger can be used to easily wrap any logger with Debugf method into the BasicLogger instance.
type Delivery ¶
type Delivery struct {
Description string `json:"description,omitempty"`
Actions StringMap `json:"actions,omitempty"`
PayerType []string `json:"payerType,omitempty"`
PlatePrintLimit int `json:"platePrintLimit,omitempty"`
RateDeliveryCost bool `json:"rateDeliveryCost,omitempty"`
AllowPackages bool `json:"allowPackages,omitempty"`
CodAvailable bool `json:"codAvailable,omitempty"`
SelfShipmentAvailable bool `json:"selfShipmentAvailable,omitempty"`
AllowTrackNumber bool `json:"allowTrackNumber,omitempty"`
AvailableCountries []string `json:"availableCountries,omitempty"`
RequiredFields []string `json:"requiredFields,omitempty"`
StatusList []DeliveryStatus `json:"statusList,omitempty"`
PlateList []Plate `json:"plateList,omitempty"`
DeliveryDataFieldList []DeliveryDataField `json:"deliveryDataFieldList,omitempty"`
ShipmentDataFieldList []DeliveryDataField `json:"shipmentDataFieldList,omitempty"`
}
Delivery type.
type DeliveryDataField ¶
type DeliveryDataField struct {
Code string `json:"code,omitempty"`
Label string `json:"label,omitempty"`
Hint string `json:"hint,omitempty"`
Type string `json:"type,omitempty"`
AutocompleteURL string `json:"autocompleteUrl,omitempty"`
Multiple bool `json:"multiple,omitempty"`
Required bool `json:"required,omitempty"`
AffectsCost bool `json:"affectsCost,omitempty"`
Editable bool `json:"editable,omitempty"`
}
DeliveryDataField type.
type DeliveryHistoryRecord ¶
type DeliveryHistoryRecord struct {
Code string `json:"code,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
Comment string `json:"comment,omitempty"`
}
DeliveryHistoryRecord type.
type DeliveryService ¶
type DeliveryService struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Active bool `json:"active,omitempty"`
}
DeliveryService type.
type DeliveryServiceResponse ¶
type DeliveryServiceResponse struct {
Success bool `json:"success"`
DeliveryServices map[string]DeliveryService `json:"deliveryServices,omitempty"`
}
DeliveryServiceResponse type.
type DeliveryShipment ¶
type DeliveryShipment struct {
IntegrationCode string `json:"integrationCode,omitempty"`
ID int `json:"id,omitempty"`
ExternalID string `json:"externalId,omitempty"`
DeliveryType string `json:"deliveryType,omitempty"`
Store string `json:"store,omitempty"`
ManagerID int `json:"managerId,omitempty"`
Status string `json:"status,omitempty"`
Date string `json:"date,omitempty"`
Time *DeliveryTime `json:"time,omitempty"`
LunchTime string `json:"lunchTime,omitempty"`
Comment string `json:"comment,omitempty"`
Orders []Order `json:"orders,omitempty"`
ExtraData StringMap `json:"extraData,omitempty"`
}
DeliveryShipment type.
type DeliveryShipmentResponse ¶
type DeliveryShipmentResponse struct {
Success bool `json:"success"`
DeliveryShipment *DeliveryShipment `json:"deliveryShipment,omitempty"`
}
DeliveryShipmentResponse type.
type DeliveryShipmentUpdateResponse ¶
type DeliveryShipmentUpdateResponse struct {
Success bool `json:"success"`
ID int `json:"id,omitempty"`
Status string `json:"status,omitempty"`
}
DeliveryShipmentUpdateResponse type.
type DeliveryShipmentsRequest ¶
type DeliveryShipmentsRequest struct {
Filter ShipmentFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
DeliveryShipmentsRequest type.
type DeliveryShipmentsResponse ¶
type DeliveryShipmentsResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
DeliveryShipments []DeliveryShipment `json:"deliveryShipments,omitempty"`
}
DeliveryShipmentsResponse type.
type DeliveryStatus ¶
type DeliveryStatus struct {
Code string `json:"code,omitempty"`
Name string `json:"name,omitempty"`
IsEditable bool `json:"isEditable,omitempty"`
}
DeliveryStatus type.
type DeliveryTime ¶
type DeliveryTime struct {
From string `json:"from,omitempty"`
To string `json:"to,omitempty"`
Custom string `json:"custom,omitempty"`
}
DeliveryTime type.
type DeliveryTrackingRequest ¶
type DeliveryTrackingRequest struct {
DeliveryID string `json:"deliveryId,omitempty"`
TrackNumber string `json:"trackNumber,omitempty"`
History []DeliveryHistoryRecord `json:"history,omitempty"`
ExtraData map[string]string `json:"extraData,omitempty"`
}
DeliveryTrackingRequest type.
type DeliveryType ¶
type DeliveryType struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Active bool `json:"active,omitempty"`
DefaultCost float32 `json:"defaultCost,omitempty"`
DefaultNetCost float32 `json:"defaultNetCost,omitempty"`
Description string `json:"description,omitempty"`
IntegrationCode string `json:"integrationCode,omitempty"`
VatRate string `json:"vatRate,omitempty"`
DefaultForCrm bool `json:"defaultForCrm,omitempty"`
DeliveryServices []string `json:"deliveryServices,omitempty"`
PaymentTypes []string `json:"paymentTypes,omitempty"`
}
DeliveryType type.
type DeliveryTypesResponse ¶
type DeliveryTypesResponse struct {
Success bool `json:"success"`
DeliveryTypes map[string]DeliveryType `json:"deliveryTypes,omitempty"`
}
DeliveryTypesResponse type.
type Element ¶
type Element struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Ordering int `json:"ordering,omitempty"`
}
Element type.
type ExternalPhone ¶
type ExternalPhone struct {
SiteCode string `json:"siteCode,omitempty"`
ExternalPhone string `json:"externalPhone,omitempty"`
}
ExternalPhone type.
type File ¶
type File struct {
ID int `json:"id,omitempty"`
Filename string `json:"filename,omitempty"`
Type string `json:"type,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
Size int `json:"size,omitempty"`
Attachment []Attachment `json:"attachment,omitempty"`
}
File type.
type FileResponse ¶
FileResponse type.
type FileUploadResponse ¶
FileUpload response.
type FilesFilter ¶
type FilesFilter struct {
Ids []int `url:"ids,omitempty,brackets"`
OrderIds []int `url:"orderIds,omitempty,brackets"`
OrderExternalIds []string `url:"orderExternalIds,omitempty,brackets"`
CustomerIds []int `url:"customerIds,omitempty,brackets"`
CustomerExternalIds []string `url:"customerExternalIds,omitempty,brackets"`
CreatedAtFrom string `url:"createdAtFrom,omitempty"`
CreatedAtTo string `url:"createdAtTo,omitempty"`
SizeFrom int `url:"sizeFrom,omitempty"`
SizeTo int `url:"sizeTo,omitempty"`
Type []string `url:"type,omitempty,brackets"`
Filename string `url:"filename,omitempty"`
IsAttached string `url:"isAttached,omitempty"`
Sites []string `url:"sites,omitempty,brackets"`
}
FilesFilter type.
type FilesRequest ¶
type FilesRequest struct {
Filter FilesFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
FilesRequest type.
type FilesResponse ¶
type FilesResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
Files []File `json:"files,omitempty"`
}
FilesResponse type.
type GeoHierarchyRow ¶
type GeoHierarchyRow struct {
Country string `json:"country,omitempty"`
Region string `json:"region,omitempty"`
RegionID int `json:"regionId,omitempty"`
City string `json:"city,omitempty"`
CityID int `json:"cityId,omitempty"`
}
GeoHierarchyRow type.
type IdentifiersPair ¶
type IdentifiersPair struct {
ID int `json:"id,omitempty"`
ExternalID string `json:"externalId,omitempty"`
}
IdentifiersPair type.
type IdentifiersPairFilter ¶
type IdentifiersPairFilter struct {
Ids []string `url:"ids,omitempty,brackets"`
ExternalIds []string `url:"externalIds,omitempty,brackets"`
}
IdentifiersPairFilter type.
type IdentifiersPairRequest ¶
type IdentifiersPairRequest struct {
Filter IdentifiersPairFilter `url:"filter,omitempty"`
By string `url:"by,omitempty"`
Site string `url:"site,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
IdentifiersPairRequest type.
type IntegrationModule ¶
type IntegrationModule struct {
Code string `json:"code,omitempty"`
IntegrationCode string `json:"integrationCode,omitempty"`
Active bool `json:"active,omitempty"`
Freeze bool `json:"freeze,omitempty"`
Native bool `json:"native,omitempty"`
Name string `json:"name,omitempty"`
Logo string `json:"logo,omitempty"`
ClientID string `json:"clientId,omitempty"`
BaseURL string `json:"baseUrl,omitempty"`
AccountURL string `json:"accountUrl,omitempty"`
AvailableCountries []string `json:"availableCountries,omitempty"`
Actions StringMap `json:"actions,omitempty"`
Integrations *Integrations `json:"integrations,omitempty"`
}
IntegrationModule type.
type IntegrationModuleEditResponse ¶
type IntegrationModuleEditResponse struct {
Success bool `json:"success"`
Info ResponseInfo `json:"info,omitempty"`
}
IntegrationModuleEditResponse type.
type IntegrationModuleResponse ¶
type IntegrationModuleResponse struct {
Success bool `json:"success"`
IntegrationModule *IntegrationModule `json:"integrationModule,omitempty"`
}
IntegrationModuleResponse type.
type Integrations ¶
type Integrations struct {
Telephony *Telephony `json:"telephony,omitempty"`
Delivery *Delivery `json:"delivery,omitempty"`
Store *Warehouse `json:"store,omitempty"`
MgTransport *MgTransport `json:"mgTransport,omitempty"`
MgBot *MgBot `json:"mgBot,omitempty"`
}
Integrations type.
type InventoriesFilter ¶
type InventoriesFilter struct {
Ids []int `url:"ids,omitempty,brackets"`
ProductExternalID string `url:"productExternalId,omitempty"`
ProductArticle string `url:"productArticle,omitempty"`
OfferExternalID string `url:"offerExternalId,omitempty"`
OfferXMLID string `url:"offerXmlId,omitempty"`
OfferArticle string `url:"offerArticle,omitempty"`
ProductActive int `url:"productActive,omitempty"`
Details int `url:"details,omitempty"`
Sites []string `url:"sites,omitempty,brackets"`
}
InventoriesFilter type.
type InventoriesRequest ¶
type InventoriesRequest struct {
Filter InventoriesFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
InventoriesRequest type.
type InventoriesResponse ¶
type InventoriesResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
Offers []Offer `json:"offers,omitempty"`
}
InventoriesResponse type.
type Inventory ¶
type Inventory struct {
PurchasePrice float32 `json:"purchasePrice,omitempty"`
Quantity float32 `json:"quantity,omitempty"`
Store string `json:"store,omitempty"`
}
Inventory type.
type InventoryUpload ¶
type InventoryUpload struct {
ID int `json:"id,omitempty"`
ExternalID string `json:"externalId,omitempty"`
XMLID string `json:"xmlId,omitempty"`
Stores []InventoryUploadStore `json:"stores,omitempty"`
}
InventoryUpload type.
type InventoryUploadStore ¶
type InventoryUploadStore struct {
PurchasePrice float32 `json:"purchasePrice,omitempty"`
Available float32 `json:"available,omitempty"`
Code string `json:"code,omitempty"`
}
InventoryUploadStore type.
type LegalEntitiesResponse ¶
type LegalEntitiesResponse struct {
Success bool `json:"success"`
LegalEntities []LegalEntity `json:"legalEntities,omitempty"`
}
LegalEntitiesResponse type.
type LegalEntity ¶
type LegalEntity struct {
Code string `json:"code,omitempty"`
VatRate string `json:"vatRate,omitempty"`
CountryIso string `json:"countryIso,omitempty"`
ContragentType string `json:"contragentType,omitempty"`
LegalName string `json:"legalName,omitempty"`
LegalAddress string `json:"legalAddress,omitempty"`
INN string `json:"INN,omitempty"`
OKPO string `json:"OKPO,omitempty"`
KPP string `json:"KPP,omitempty"`
OGRN string `json:"OGRN,omitempty"`
OGRNIP string `json:"OGRNIP,omitempty"`
CertificateNumber string `json:"certificateNumber,omitempty"`
CertificateDate string `json:"certificateDate,omitempty"`
BIK string `json:"BIK,omitempty"`
Bank string `json:"bank,omitempty"`
BankAddress string `json:"bankAddress,omitempty"`
CorrAccount string `json:"corrAccount,omitempty"`
BankAccount string `json:"bankAccount,omitempty"`
}
LegalEntity type.
type MgTransport ¶
type MgTransport struct {
WebhookURL string `json:"webhookUrl,omitempty"`
}
MgTransport type.
type Note ¶
type Note struct {
ID int `json:"id,omitempty"`
ManagerID int `json:"managerId,omitempty"`
Text string `json:"text,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
Customer *Customer `json:"customer,omitempty"`
}
Note type.
type NotesFilter ¶
type NotesFilter struct {
Ids []int `url:"ids,omitempty,brackets"`
CustomerIds []int `url:"customerIds,omitempty,brackets"`
CustomerExternalIds []string `url:"customerExternalIds,omitempty,brackets"`
ManagerIds []int `url:"managerIds,omitempty,brackets"`
Text string `url:"text,omitempty"`
CreatedAtFrom string `url:"createdAtFrom,omitempty"`
CreatedAtTo string `url:"createdAtTo,omitempty"`
}
NotesFilter type.
type NotesRequest ¶
type NotesRequest struct {
Filter NotesFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
NotesRequest type.
type NotesResponse ¶
type NotesResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
Notes []Note `json:"notes,omitempty"`
}
NotesResponse type.
type Offer ¶
type Offer struct {
ID int `json:"id,omitempty"`
ExternalID string `json:"externalId,omitempty"`
Name string `json:"name,omitempty"`
XMLID string `json:"xmlId,omitempty"`
Article string `json:"article,omitempty"`
VatRate string `json:"vatRate,omitempty"`
Price float32 `json:"price,omitempty"`
PurchasePrice float32 `json:"purchasePrice,omitempty"`
Quantity float32 `json:"quantity,omitempty"`
Height float32 `json:"height,omitempty"`
Width float32 `json:"width,omitempty"`
Length float32 `json:"length,omitempty"`
Weight float32 `json:"weight,omitempty"`
Stores []Inventory `json:"stores,omitempty"`
Properties StringMap `json:"properties,omitempty"`
Prices []OfferPrice `json:"prices,omitempty"`
Images []string `json:"images,omitempty"`
Unit *Unit `json:"unit,omitempty"`
}
Offer type.
type OfferPrice ¶
type OfferPrice struct {
Price float32 `json:"price,omitempty"`
Ordering int `json:"ordering,omitempty"`
PriceType string `json:"priceType,omitempty"`
}
OfferPrice type.
type OfferPriceUpload ¶
type OfferPriceUpload struct {
ID int `json:"id,omitempty"`
ExternalID string `json:"externalId,omitempty"`
XMLID string `json:"xmlId,omitempty"`
Site string `json:"site,omitempty"`
Prices []PriceUpload `json:"prices,omitempty"`
}
OfferPriceUpload type.
type OperationResponse ¶
type OperationResponse struct {
Success bool `json:"success"`
Errors map[string]string `json:"ErrorsList,omitempty"`
}
OperationResponse type.
type Order ¶
type Order struct {
ID int `json:"id,omitempty"`
ExternalID string `json:"externalId,omitempty"`
Number string `json:"number,omitempty"`
FirstName string `json:"firstName,omitempty"`
LastName string `json:"lastName,omitempty"`
Patronymic string `json:"patronymic,omitempty"`
Email string `json:"email,omitempty"`
Phone string `json:"phone,omitempty"`
AdditionalPhone string `json:"additionalPhone,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
StatusUpdatedAt string `json:"statusUpdatedAt,omitempty"`
ManagerID int `json:"managerId,omitempty"`
Mark int `json:"mark,omitempty"`
Call bool `json:"call,omitempty"`
Expired bool `json:"expired,omitempty"`
FromAPI bool `json:"fromApi,omitempty"`
MarkDatetime string `json:"markDatetime,omitempty"`
CustomerComment string `json:"customerComment,omitempty"`
ManagerComment string `json:"managerComment,omitempty"`
Status string `json:"status,omitempty"`
StatusComment string `json:"statusComment,omitempty"`
FullPaidAt string `json:"fullPaidAt,omitempty"`
Site string `json:"site,omitempty"`
OrderType string `json:"orderType,omitempty"`
OrderMethod string `json:"orderMethod,omitempty"`
CountryIso string `json:"countryIso,omitempty"`
Summ float32 `json:"summ,omitempty"`
TotalSumm float32 `json:"totalSumm,omitempty"`
PrepaySum float32 `json:"prepaySum,omitempty"`
PurchaseSumm float32 `json:"purchaseSumm,omitempty"`
DiscountManualAmount float32 `json:"discountManualAmount,omitempty"`
DiscountManualPercent float32 `json:"discountManualPercent,omitempty"`
Weight float32 `json:"weight,omitempty"`
Length int `json:"length,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
ShipmentStore string `json:"shipmentStore,omitempty"`
ShipmentDate string `json:"shipmentDate,omitempty"`
ClientID string `json:"clientId,omitempty"`
Shipped bool `json:"shipped,omitempty"`
UploadedToExternalStoreSystem bool `json:"uploadedToExternalStoreSystem,omitempty"`
Source *Source `json:"source,omitempty"`
Contragent *Contragent `json:"contragent,omitempty"`
Customer *Customer `json:"customer,omitempty"`
Delivery *OrderDelivery `json:"delivery,omitempty"`
Marketplace *OrderMarketplace `json:"marketplace,omitempty"`
Items []OrderItem `json:"items,omitempty"`
CustomFields StringMap `json:"customFields,omitempty"`
Payments OrderPayments `json:"payments,omitempty"`
}
Order type.
type OrderCreateResponse ¶
type OrderCreateResponse struct {
CreateResponse
Order Order `json:"order,omitempty"`
}
OrderCreateResponse type.
type OrderDelivery ¶
type OrderDelivery struct {
Code string `json:"code,omitempty"`
IntegrationCode string `json:"integrationCode,omitempty"`
Cost float32 `json:"cost,omitempty"`
NetCost float32 `json:"netCost,omitempty"`
VatRate string `json:"vatRate,omitempty"`
Date string `json:"date,omitempty"`
Time *OrderDeliveryTime `json:"time,omitempty"`
Address *Address `json:"address,omitempty"`
Service *OrderDeliveryService `json:"service,omitempty"`
Data *OrderDeliveryData `json:"data,omitempty"`
}
OrderDelivery type.
type OrderDeliveryData ¶
type OrderDeliveryData struct {
OrderDeliveryDataBasic
AdditionalFields map[string]interface{}
}
OrderDeliveryData type.
func (OrderDeliveryData) MarshalJSON ¶
func (v OrderDeliveryData) MarshalJSON() ([]byte, error)
MarshalJSON method.
func (*OrderDeliveryData) UnmarshalJSON ¶
func (v *OrderDeliveryData) UnmarshalJSON(b []byte) error
UnmarshalJSON method.
type OrderDeliveryDataBasic ¶
type OrderDeliveryDataBasic struct {
TrackNumber string `json:"trackNumber,omitempty"`
Status string `json:"status,omitempty"`
PickuppointAddress string `json:"pickuppointAddress,omitempty"`
PayerType string `json:"payerType,omitempty"`
}
OrderDeliveryDataBasic type.
type OrderDeliveryService ¶
type OrderDeliveryService struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Active bool `json:"active,omitempty"`
}
OrderDeliveryService type.
type OrderDeliveryTime ¶
type OrderDeliveryTime struct {
From string `json:"from,omitempty"`
To string `json:"to,omitempty"`
Custom string `json:"custom,omitempty"`
}
OrderDeliveryTime type.
type OrderItem ¶
type OrderItem struct {
ID int `json:"id,omitempty"`
InitialPrice float32 `json:"initialPrice,omitempty"`
PurchasePrice float32 `json:"purchasePrice,omitempty"`
DiscountTotal float32 `json:"discountTotal,omitempty"`
DiscountManualAmount float32 `json:"discountManualAmount,omitempty"`
DiscountManualPercent float32 `json:"discountManualPercent,omitempty"`
ProductName string `json:"productName,omitempty"`
VatRate string `json:"vatRate,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
Quantity float32 `json:"quantity,omitempty"`
Status string `json:"status,omitempty"`
Comment string `json:"comment,omitempty"`
IsCanceled bool `json:"isCanceled,omitempty"`
Offer Offer `json:"offer,omitempty"`
Properties map[string]Property `json:"properties,omitempty"`
PriceType *PriceType `json:"priceType,omitempty"`
}
OrderItem type.
type OrderMarketplace ¶
type OrderMarketplace struct {
Code string `json:"code,omitempty"`
OrderID string `json:"orderId,omitempty"`
}
OrderMarketplace type.
type OrderMethod ¶
type OrderMethod struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Active bool `json:"active,omitempty"`
DefaultForCRM bool `json:"defaultForCrm,omitempty"`
DefaultForAPI bool `json:"defaultForApi,omitempty"`
}
OrderMethod type.
type OrderMethodsResponse ¶
type OrderMethodsResponse struct {
Success bool `json:"success"`
OrderMethods map[string]OrderMethod `json:"orderMethods,omitempty"`
}
OrderMethodsResponse type.
type OrderPayment ¶
type OrderPayment struct {
ID int `json:"id,omitempty"`
ExternalID string `json:"externalId,omitempty"`
Type string `json:"type,omitempty"`
Status string `json:"status,omitempty"`
PaidAt string `json:"paidAt,omitempty"`
Amount float32 `json:"amount,omitempty"`
Comment string `json:"comment,omitempty"`
}
OrderPayment type.
type OrderPayments ¶
type OrderPayments map[string]OrderPayment
func (*OrderPayments) UnmarshalJSON ¶
func (p *OrderPayments) UnmarshalJSON(data []byte) error
type OrderRequest ¶
OrderRequest type.
type OrderResponse ¶
OrderResponse type.
type OrderType ¶
type OrderType struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Active bool `json:"active,omitempty"`
DefaultForCRM bool `json:"defaultForCrm,omitempty"`
DefaultForAPI bool `json:"defaultForApi,omitempty"`
}
OrderType type.
type OrderTypesResponse ¶
type OrderTypesResponse struct {
Success bool `json:"success"`
OrderTypes map[string]OrderType `json:"orderTypes,omitempty"`
}
OrderTypesResponse type.
type OrdersFilter ¶
type OrdersFilter struct {
Ids []int `url:"ids,omitempty,brackets"`
ExternalIds []string `url:"externalIds,omitempty,brackets"`
Numbers []string `url:"numbers,omitempty,brackets"`
Customer string `url:"customer,omitempty"`
CustomerID string `url:"customerId,omitempty"`
CustomerExternalID string `url:"customerExternalId,omitempty"`
Countries []string `url:"countries,omitempty,brackets"`
City string `url:"city,omitempty"`
Region string `url:"region,omitempty"`
Index string `url:"index,omitempty"`
Metro string `url:"metro,omitempty"`
Email string `url:"email,omitempty"`
DeliveryTimeFrom string `url:"deliveryTimeFrom,omitempty"`
DeliveryTimeTo string `url:"deliveryTimeTo,omitempty"`
MinPrepaySumm string `url:"minPrepaySumm,omitempty"`
MaxPrepaySumm string `url:"maxPrepaySumm,omitempty"`
MinPrice string `url:"minPrice,omitempty"`
MaxPrice string `url:"maxPrice,omitempty"`
Product string `url:"product,omitempty"`
Vip int `url:"vip,omitempty"`
Bad int `url:"bad,omitempty"`
Attachments int `url:"attachments,omitempty"`
Expired int `url:"expired,omitempty"`
Call int `url:"call,omitempty"`
Online int `url:"online,omitempty"`
Shipped int `url:"shipped,omitempty"`
UploadedToExtStoreSys int `url:"uploadedToExtStoreSys,omitempty"`
ReceiptFiscalDocumentAttribute int `url:"receiptFiscalDocumentAttribute,omitempty"`
ReceiptStatus int `url:"receiptStatus,omitempty"`
ReceiptOperation int `url:"receiptOperation,omitempty"`
MinDeliveryCost string `url:"minDeliveryCost,omitempty"`
MaxDeliveryCost string `url:"maxDeliveryCost,omitempty"`
MinDeliveryNetCost string `url:"minDeliveryNetCost,omitempty"`
MaxDeliveryNetCost string `url:"maxDeliveryNetCost,omitempty"`
ManagerComment string `url:"managerComment,omitempty"`
CustomerComment string `url:"customerComment,omitempty"`
MinMarginSumm string `url:"minMarginSumm,omitempty"`
MaxMarginSumm string `url:"maxMarginSumm,omitempty"`
MinPurchaseSumm string `url:"minPurchaseSumm,omitempty"`
MaxPurchaseSumm string `url:"maxPurchaseSumm,omitempty"`
MinCostSumm string `url:"minCostSumm,omitempty"`
MaxCostSumm string `url:"maxCostSumm,omitempty"`
TrackNumber string `url:"trackNumber,omitempty"`
ContragentName string `url:"contragentName,omitempty"`
ContragentInn string `url:"contragentInn,omitempty"`
ContragentKpp string `url:"contragentKpp,omitempty"`
ContragentBik string `url:"contragentBik,omitempty"`
ContragentCorrAccount string `url:"contragentCorrAccount,omitempty"`
ContragentBankAccount string `url:"contragentBankAccount,omitempty"`
ContragentTypes []string `url:"contragentTypes,omitempty,brackets"`
OrderTypes []string `url:"orderTypes,omitempty,brackets"`
PaymentStatuses []string `url:"paymentStatuses,omitempty,brackets"`
PaymentTypes []string `url:"paymentTypes,omitempty,brackets"`
DeliveryTypes []string `url:"deliveryTypes,omitempty,brackets"`
OrderMethods []string `url:"orderMethods,omitempty,brackets"`
ShipmentStores []string `url:"shipmentStores,omitempty,brackets"`
Couriers []string `url:"couriers,omitempty,brackets"`
Managers []string `url:"managers,omitempty,brackets"`
ManagerGroups []string `url:"managerGroups,omitempty,brackets"`
Sites []string `url:"sites,omitempty,brackets"`
CreatedAtFrom string `url:"createdAtFrom,omitempty"`
CreatedAtTo string `url:"createdAtTo,omitempty"`
FullPaidAtFrom string `url:"fullPaidAtFrom,omitempty"`
FullPaidAtTo string `url:"fullPaidAtTo,omitempty"`
DeliveryDateFrom string `url:"deliveryDateFrom,omitempty"`
DeliveryDateTo string `url:"deliveryDateTo,omitempty"`
StatusUpdatedAtFrom string `url:"statusUpdatedAtFrom,omitempty"`
StatusUpdatedAtTo string `url:"statusUpdatedAtTo,omitempty"`
DpdParcelDateFrom string `url:"dpdParcelDateFrom,omitempty"`
DpdParcelDateTo string `url:"dpdParcelDateTo,omitempty"`
FirstWebVisitFrom string `url:"firstWebVisitFrom,omitempty"`
FirstWebVisitTo string `url:"firstWebVisitTo,omitempty"`
LastWebVisitFrom string `url:"lastWebVisitFrom,omitempty"`
LastWebVisitTo string `url:"lastWebVisitTo,omitempty"`
FirstOrderFrom string `url:"firstOrderFrom,omitempty"`
FirstOrderTo string `url:"firstOrderTo,omitempty"`
LastOrderFrom string `url:"lastOrderFrom,omitempty"`
LastOrderTo string `url:"lastOrderTo,omitempty"`
ShipmentDateFrom string `url:"shipmentDateFrom,omitempty"`
ShipmentDateTo string `url:"shipmentDateTo,omitempty"`
ExtendedStatus []string `url:"extendedStatus,omitempty,brackets"`
SourceName string `url:"sourceName,omitempty"`
MediumName string `url:"mediumName,omitempty"`
CampaignName string `url:"campaignName,omitempty"`
KeywordName string `url:"keywordName,omitempty"`
AdContentName string `url:"adContentName,omitempty"`
CustomFields map[string]string `url:"customFields,omitempty,brackets"`
}
OrdersFilter type.
type OrdersHistoryFilter ¶
type OrdersHistoryFilter struct {
OrderID int `url:"orderId,omitempty"`
SinceID int `url:"sinceId,omitempty"`
OrderExternalID string `url:"orderExternalId,omitempty"`
StartDate string `url:"startDate,omitempty"`
EndDate string `url:"endDate,omitempty"`
}
OrdersHistoryFilter type.
type OrdersHistoryRecord ¶
type OrdersHistoryRecord struct {
ID int `json:"id,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
Created bool `json:"created,omitempty"`
Deleted bool `json:"deleted,omitempty"`
Source string `json:"source,omitempty"`
Field string `json:"field,omitempty"`
User *User `json:"user,omitempty"`
APIKey *APIKey `json:"apiKey,omitempty"`
Order *Order `json:"order,omitempty"`
}
OrdersHistoryRecord type.
type OrdersHistoryRequest ¶
type OrdersHistoryRequest struct {
Filter OrdersHistoryFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
OrdersHistoryRequest type.
type OrdersHistoryResponse ¶
type OrdersHistoryResponse struct {
Success bool `json:"success,omitempty"`
GeneratedAt string `json:"generatedAt,omitempty"`
History []OrdersHistoryRecord `json:"history,omitempty"`
Pagination *Pagination `json:"pagination,omitempty"`
}
OrdersHistoryResponse type.
type OrdersRequest ¶
type OrdersRequest struct {
Filter OrdersFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
OrdersRequest type.
type OrdersResponse ¶
type OrdersResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
Orders []Order `json:"orders,omitempty"`
}
OrdersResponse type.
type OrdersStatus ¶
type OrdersStatus struct {
ID int `json:"id"`
ExternalID string `json:"externalId,omitempty"`
Status string `json:"status"`
Group string `json:"group"`
}
OrdersStatus type.
type OrdersStatusesRequest ¶
type OrdersStatusesRequest struct {
IDs []int `url:"ids,omitempty,brackets"`
ExternalIDs []string `url:"externalIds,omitempty,brackets"`
}
OrdersStatusesRequest type.
type OrdersStatusesResponse ¶
type OrdersStatusesResponse struct {
Success bool `json:"success"`
Orders []OrdersStatus `json:"orders"`
}
OrdersStatusesResponse type.
type OrdersUploadRequest ¶
type OrdersUploadRequest struct {
Orders []Order `url:"orders,omitempty,brackets"`
Site string `url:"site,omitempty"`
}
OrdersUploadRequest type.
type OrdersUploadResponse ¶
type OrdersUploadResponse struct {
Success bool `json:"success"`
UploadedOrders []IdentifiersPair `json:"uploadedOrders,omitempty"`
}
OrdersUploadResponse type.
type Pack ¶
type Pack struct {
ID int `json:"id,omitempty"`
PurchasePrice float32 `json:"purchasePrice,omitempty"`
Quantity float32 `json:"quantity,omitempty"`
Store string `json:"store,omitempty"`
ShipmentDate string `json:"shipmentDate,omitempty"`
InvoiceNumber string `json:"invoiceNumber,omitempty"`
DeliveryNoteNumber string `json:"deliveryNoteNumber,omitempty"`
Item *PackItem `json:"item,omitempty"`
ItemID int `json:"itemId,omitempty"`
Unit *Unit `json:"unit,omitempty"`
}
Pack type.
type PackItem ¶
type PackItem struct {
ID int `json:"id,omitempty"`
Order *Order `json:"order,omitempty"`
Offer *Offer `json:"offer,omitempty"`
}
PackItem type.
type PackResponse ¶
PackResponse type.
type PacksFilter ¶
type PacksFilter struct {
Ids []int `url:"ids,omitempty,brackets"`
Stores []string `url:"stores,omitempty"`
ItemID int `url:"itemId,omitempty"`
OfferXMLID string `url:"offerXmlId,omitempty"`
OfferExternalID string `url:"offerExternalId,omitempty"`
OrderID int `url:"orderId,omitempty"`
OrderExternalID string `url:"orderExternalId,omitempty"`
ShipmentDateFrom string `url:"shipmentDateFrom,omitempty"`
ShipmentDateTo string `url:"shipmentDateTo,omitempty"`
InvoiceNumber string `url:"invoiceNumber,omitempty"`
DeliveryNoteNumber string `url:"deliveryNoteNumber,omitempty"`
}
PacksFilter type.
type PacksHistoryRecord ¶
type PacksHistoryRecord struct {
ID int `json:"id,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
Created bool `json:"created,omitempty"`
Deleted bool `json:"deleted,omitempty"`
Source string `json:"source,omitempty"`
Field string `json:"field,omitempty"`
User *User `json:"user,omitempty"`
Pack *Pack `json:"pack,omitempty"`
}
PacksHistoryRecord type.
type PacksHistoryRequest ¶
type PacksHistoryRequest struct {
Filter OrdersHistoryFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
PacksHistoryRequest type.
type PacksHistoryResponse ¶
type PacksHistoryResponse struct {
Success bool `json:"success,omitempty"`
GeneratedAt string `json:"generatedAt,omitempty"`
History []PacksHistoryRecord `json:"history,omitempty"`
Pagination *Pagination `json:"pagination,omitempty"`
}
PacksHistoryResponse type.
type PacksRequest ¶
type PacksRequest struct {
Filter PacksFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
PacksRequest type.
type PacksResponse ¶
type PacksResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
Packs []Pack `json:"packs,omitempty"`
}
PacksResponse type.
type Pagination ¶
type Pagination struct {
Limit int `json:"limit,omitempty"`
TotalCount int `json:"totalCount,omitempty"`
CurrentPage int `json:"currentPage,omitempty"`
TotalPageCount int `json:"totalPageCount,omitempty"`
}
Pagination type.
type Payment ¶
type Payment struct {
ID int `json:"id,omitempty"`
ExternalID string `json:"externalId,omitempty"`
PaidAt string `json:"paidAt,omitempty"`
Amount float32 `json:"amount,omitempty"`
Comment string `json:"comment,omitempty"`
Status string `json:"status,omitempty"`
Type string `json:"type,omitempty"`
Order *Order `json:"order,omitempty"`
}
Payment type.
type PaymentStatus ¶
type PaymentStatus struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Active bool `json:"active,omitempty"`
DefaultForCRM bool `json:"defaultForCrm,omitempty"`
DefaultForAPI bool `json:"defaultForApi,omitempty"`
PaymentComplete bool `json:"paymentComplete,omitempty"`
Description string `json:"description,omitempty"`
Ordering int `json:"ordering,omitempty"`
PaymentTypes []string `json:"paymentTypes,omitempty"`
}
PaymentStatus type.
type PaymentStatusesResponse ¶
type PaymentStatusesResponse struct {
Success bool `json:"success"`
PaymentStatuses map[string]PaymentStatus `json:"paymentStatuses,omitempty"`
}
PaymentStatusesResponse type.
type PaymentType ¶
type PaymentType struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Active bool `json:"active,omitempty"`
DefaultForCRM bool `json:"defaultForCrm,omitempty"`
DefaultForAPI bool `json:"defaultForApi,omitempty"`
Description string `json:"description,omitempty"`
DeliveryTypes []string `json:"deliveryTypes,omitempty"`
PaymentStatuses []string `json:"PaymentStatuses,omitempty"`
}
PaymentType type.
type PaymentTypesResponse ¶
type PaymentTypesResponse struct {
Success bool `json:"success"`
PaymentTypes map[string]PaymentType `json:"paymentTypes,omitempty"`
}
PaymentTypesResponse type.
type PriceType ¶
type PriceType struct {
ID int `json:"id,omitempty"`
Code string `json:"code,omitempty"`
Name string `json:"name,omitempty"`
Active bool `json:"active,omitempty"`
Default bool `json:"default,omitempty"`
Description string `json:"description,omitempty"`
FilterExpression string `json:"filterExpression,omitempty"`
Ordering int `json:"ordering,omitempty"`
Groups []string `json:"groups,omitempty"`
Geo []GeoHierarchyRow `json:"geo,omitempty"`
}
PriceType type.
type PriceTypesResponse ¶
type PriceTypesResponse struct {
Success bool `json:"success"`
PriceTypes []PriceType `json:"priceTypes,omitempty"`
}
PriceTypesResponse type.
type PriceUpload ¶
type PriceUpload struct {
Code string `json:"code,omitempty"`
Price float32 `json:"price,omitempty"`
}
PriceUpload type.
type Product ¶
type Product struct {
ID int `json:"id,omitempty"`
MaxPrice float32 `json:"maxPrice,omitempty"`
MinPrice float32 `json:"minPrice,omitempty"`
Name string `json:"name,omitempty"`
URL string `json:"url,omitempty"`
Article string `json:"article,omitempty"`
ExternalID string `json:"externalId,omitempty"`
Manufacturer string `json:"manufacturer,omitempty"`
ImageURL string `json:"imageUrl,omitempty"`
Description string `json:"description,omitempty"`
Popular bool `json:"popular,omitempty"`
Stock bool `json:"stock,omitempty"`
Novelty bool `json:"novelty,omitempty"`
Recommended bool `json:"recommended,omitempty"`
Active bool `json:"active,omitempty"`
Quantity float32 `json:"quantity,omitempty"`
Offers []Offer `json:"offers,omitempty"`
Groups []ProductGroup `json:"groups,omitempty"`
Properties StringMap `json:"properties,omitempty"`
}
Product type.
type ProductGroup ¶
type ProductGroup struct {
ID int `json:"id,omitempty"`
ParentID int `json:"parentId,omitempty"`
Name string `json:"name,omitempty"`
Site string `json:"site,omitempty"`
Active bool `json:"active,omitempty"`
}
ProductGroup type.
type ProductStatus ¶
type ProductStatus struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Active bool `json:"active,omitempty"`
Ordering int `json:"ordering,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
CancelStatus bool `json:"cancelStatus,omitempty"`
OrderStatusByProductStatus string `json:"orderStatusByProductStatus,omitempty"`
OrderStatusForProductStatus string `json:"orderStatusForProductStatus,omitempty"`
}
ProductStatus type.
type ProductStatusesResponse ¶
type ProductStatusesResponse struct {
Success bool `json:"success"`
ProductStatuses map[string]ProductStatus `json:"productStatuses,omitempty"`
}
ProductStatusesResponse type.
type ProductsFilter ¶
type ProductsFilter struct {
Ids []int `url:"ids,omitempty,brackets"`
OfferIds []int `url:"offerIds,omitempty,brackets"`
Active int `url:"active,omitempty"`
Recommended int `url:"recommended,omitempty"`
Novelty int `url:"novelty,omitempty"`
Stock int `url:"stock,omitempty"`
Popular int `url:"popular,omitempty"`
MaxQuantity float32 `url:"maxQuantity,omitempty"`
MinQuantity float32 `url:"minQuantity,omitempty"`
MaxPurchasePrice float32 `url:"maxPurchasePrice,omitempty"`
MinPurchasePrice float32 `url:"minPurchasePrice,omitempty"`
MaxPrice float32 `url:"maxPrice,omitempty"`
MinPrice float32 `url:"minPrice,omitempty"`
Groups string `url:"groups,omitempty"`
Name string `url:"name,omitempty"`
ClassSegment string `url:"classSegment,omitempty"`
XMLID string `url:"xmlId,omitempty"`
ExternalID string `url:"externalId,omitempty"`
Manufacturer string `url:"manufacturer,omitempty"`
URL string `url:"url,omitempty"`
PriceType string `url:"priceType,omitempty"`
OfferExternalID string `url:"offerExternalId,omitempty"`
Sites []string `url:"sites,omitempty,brackets"`
Properties map[string]string `url:"properties,omitempty,brackets"`
}
ProductsFilter type.
type ProductsGroupsFilter ¶
type ProductsGroupsFilter struct {
Ids []int `url:"ids,omitempty,brackets"`
Sites []string `url:"sites,omitempty,brackets"`
Active int `url:"active,omitempty"`
ParentGroupID string `url:"parentGroupId,omitempty"`
}
ProductsGroupsFilter type.
type ProductsGroupsRequest ¶
type ProductsGroupsRequest struct {
Filter ProductsGroupsFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
ProductsGroupsRequest type.
type ProductsGroupsResponse ¶
type ProductsGroupsResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
ProductGroup []ProductGroup `json:"productGroup,omitempty"`
}
ProductsGroupsResponse type.
type ProductsPropertiesFilter ¶
type ProductsPropertiesFilter struct {
Code string `url:"code,omitempty"`
Name string `url:"name,omitempty"`
Sites []string `url:"sites,omitempty,brackets"`
}
ProductsPropertiesFilter type.
type ProductsPropertiesRequest ¶
type ProductsPropertiesRequest struct {
Filter ProductsPropertiesFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
ProductsPropertiesRequest type.
type ProductsPropertiesResponse ¶
type ProductsPropertiesResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
Properties []Property `json:"properties,omitempty"`
}
ProductsPropertiesResponse type.
type ProductsRequest ¶
type ProductsRequest struct {
Filter ProductsFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
ProductsRequest type.
type ProductsResponse ¶
type ProductsResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
Products []Product `json:"products,omitempty"`
}
ProductsResponse type.
type Property ¶
type Property struct {
Code string `json:"code,omitempty"`
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
Sites []string `json:"Sites,omitempty"`
}
Property type.
type ResponseInfo ¶
type ResponseInfo struct {
MgTransportInfo MgInfo `json:"mgTransport,omitempty"`
MgBotInfo MgInfo `json:"mgBot,omitempty"`
}
ResponseInfo type.
type Segment ¶
type Segment struct {
ID int `json:"id,omitempty"`
Code string `json:"code,omitempty"`
Name string `json:"name,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
CustomersCount int `json:"customersCount,omitempty"`
IsDynamic bool `json:"isDynamic,omitempty"`
Active bool `json:"active,omitempty"`
}
Segment type.
type SegmentsFilter ¶
type SegmentsFilter struct {
Ids []int `url:"ids,omitempty,brackets"`
Active int `url:"active,omitempty"`
Name string `url:"name,omitempty"`
Type string `url:"type,omitempty"`
MinCustomersCount int `url:"minCustomersCount,omitempty"`
MaxCustomersCount int `url:"maxCustomersCount,omitempty"`
DateFrom string `url:"dateFrom,omitempty"`
DateTo string `url:"dateTo,omitempty"`
}
SegmentsFilter type.
type SegmentsRequest ¶
type SegmentsRequest struct {
Filter SegmentsFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
SegmentsRequest type.
type SegmentsResponse ¶
type SegmentsResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
Segments []Segment `json:"segments,omitempty"`
}
SegmentsResponse type.
type Settings ¶
type Settings struct {
DefaultCurrency SettingsNode `json:"default_currency"`
SystemLanguage SettingsNode `json:"system_language"`
Timezone SettingsNode `json:"timezone"`
}
Settings type. Contains retailCRM configuration.
type SettingsNode ¶
SettingsNode represents an item in settings. All settings nodes contains only string value and update time for now.
type SettingsResponse ¶
type SettingsResponse struct {
Success bool `json:"success"`
Settings Settings `json:"settings,omitempty"`
}
SettingsResponse type.
type ShipmentFilter ¶
type ShipmentFilter struct {
Ids []int `url:"ids,omitempty,brackets"`
ExternalID string `url:"externalId,omitempty"`
OrderNumber string `url:"orderNumber,omitempty"`
DateFrom string `url:"dateFrom,omitempty"`
DateTo string `url:"dateTo,omitempty"`
Stores []string `url:"stores,omitempty,brackets"`
Managers []string `url:"managers,omitempty,brackets"`
DeliveryTypes []string `url:"deliveryTypes,omitempty,brackets"`
Statuses []string `url:"statuses,omitempty,brackets"`
}
ShipmentFilter type.
type Site ¶
type Site struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
URL string `json:"url,omitempty"`
Description string `json:"description,omitempty"`
Phones string `json:"phones,omitempty"`
Zip string `json:"zip,omitempty"`
Address string `json:"address,omitempty"`
CountryIso string `json:"countryIso,omitempty"`
YmlURL string `json:"ymlUrl,omitempty"`
LoadFromYml bool `json:"loadFromYml,omitempty"`
CatalogUpdatedAt string `json:"catalogUpdatedAt,omitempty"`
CatalogLoadingAt string `json:"catalogLoadingAt,omitempty"`
Contragent *LegalEntity `json:"contragent,omitempty"`
}
Site type.
type SitesResponse ¶
type SitesResponse struct {
Success bool `json:"success"`
Sites map[string]Site `json:"sites,omitempty"`
}
SitesResponse type.
type Source ¶
type Source struct {
Source string `json:"source,omitempty"`
Medium string `json:"medium,omitempty"`
Campaign string `json:"campaign,omitempty"`
Keyword string `json:"keyword,omitempty"`
Content string `json:"content,omitempty"`
}
Source type.
type Status ¶
type Status struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Active bool `json:"active,omitempty"`
Ordering int `json:"ordering,omitempty"`
Group string `json:"group,omitempty"`
}
Status type.
type StatusGroup ¶
type StatusGroup struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Active bool `json:"active,omitempty"`
Ordering int `json:"ordering,omitempty"`
Process bool `json:"process,omitempty"`
Statuses []string `json:"statuses,omitempty"`
}
StatusGroup type.
type StatusGroupsResponse ¶
type StatusGroupsResponse struct {
Success bool `json:"success"`
StatusGroups map[string]StatusGroup `json:"statusGroups,omitempty"`
}
StatusGroupsResponse type.
type StatusesResponse ¶
type StatusesResponse struct {
Success bool `json:"success"`
Statuses map[string]Status `json:"statuses,omitempty"`
}
StatusesResponse type.
type Store ¶
type Store struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
ExternalID string `json:"externalId,omitempty"`
Description string `json:"description,omitempty"`
XMLID string `json:"xmlId,omitempty"`
Email string `json:"email,omitempty"`
Type string `json:"type,omitempty"`
InventoryType string `json:"inventoryType,omitempty"`
Active bool `json:"active,omitempty"`
Phone *Phone `json:"phone,omitempty"`
Address *Address `json:"address,omitempty"`
}
Store type.
type StoreUploadResponse ¶
type StoreUploadResponse struct {
Success bool `json:"success"`
ProcessedOffersCount int `json:"processedOffersCount,omitempty"`
NotFoundOffers []Offer `json:"notFoundOffers,omitempty"`
}
StoreUploadResponse type.
type StoresResponse ¶
type StoresResponse struct {
Success bool `json:"success"`
Stores []Store `json:"stores,omitempty"`
}
StoresResponse type.
type StringMap ¶ added in v2.0.1
func (*StringMap) UnmarshalJSON ¶ added in v2.0.1
type SuccessfulResponse ¶
type SuccessfulResponse struct {
Success bool `json:"success,omitempty"`
}
SuccessfulResponse type.
type Tag ¶
type Tag struct {
Name string `json:"name,omitempty"`
Color string `json:"color,omitempty"`
Attached bool `json:"attached,omitempty"`
}
Tag struct.
func (Tag) MarshalJSON ¶
type Task ¶
type Task struct {
ID int `json:"id,omitempty"`
PerformerID int `json:"performerId,omitempty"`
Text string `json:"text,omitempty"`
Commentary string `json:"commentary,omitempty"`
Datetime string `json:"datetime,omitempty"`
Complete bool `json:"complete,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
Creator int `json:"creator,omitempty"`
Performer int `json:"performer,omitempty"`
Phone string `json:"phone,omitempty"`
PhoneSite string `json:"phoneSite,omitempty"`
Customer *Customer `json:"customer,omitempty"`
Order *Order `json:"order,omitempty"`
}
Task type.
type TaskResponse ¶
TaskResponse type.
type TasksFilter ¶
type TasksFilter struct {
OrderNumber string `url:"orderNumber,omitempty"`
Status string `url:"status,omitempty"`
Customer string `url:"customer,omitempty"`
Text string `url:"text,omitempty"`
DateFrom string `url:"dateFrom,omitempty"`
DateTo string `url:"dateTo,omitempty"`
Creators []int `url:"creators,omitempty,brackets"`
Performers []int `url:"performers,omitempty,brackets"`
}
TasksFilter type.
type TasksRequest ¶
type TasksRequest struct {
Filter TasksFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
TasksRequest type.
type TasksResponse ¶
type TasksResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
Tasks []Task `json:"tasks,omitempty"`
}
TasksResponse type.
type Telephony ¶
type Telephony struct {
MakeCallURL string `json:"makeCallUrl,omitempty"`
AllowEdit bool `json:"allowEdit,omitempty"`
InputEventSupported bool `json:"inputEventSupported,omitempty"`
OutputEventSupported bool `json:"outputEventSupported,omitempty"`
HangupEventSupported bool `json:"hangupEventSupported,omitempty"`
ChangeUserStatusURL string `json:"changeUserStatusUrl,omitempty"`
AdditionalCodes []AdditionalCode `json:"additionalCodes,omitempty"`
ExternalPhones []ExternalPhone `json:"externalPhones,omitempty"`
}
Telephony type.
type Unit ¶
type Unit struct {
Code string `json:"code"`
Name string `json:"name"`
Sym string `json:"sym"`
Default bool `json:"default,omitempty"`
Active bool `json:"active,omitempty"`
}
Unit type.
type UnitsResponse ¶
UnitsResponse type.
type User ¶
type User struct {
ID int `json:"id,omitempty"`
FirstName string `json:"firstName,omitempty"`
LastName string `json:"lastName,omitempty"`
Patronymic string `json:"patronymic,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
Active bool `json:"active,omitempty"`
Online bool `json:"online,omitempty"`
IsAdmin bool `json:"isAdmin,omitempty"`
IsManager bool `json:"isManager,omitempty"`
Email string `json:"email,omitempty"`
Phone string `json:"phone,omitempty"`
Status string `json:"status,omitempty"`
Groups []UserGroup `json:"groups,omitempty"`
MGUserID uint64 `json:"mgUserId,omitempty"`
}
User type.
type UserGroup ¶
type UserGroup struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
SignatureTemplate string `json:"signatureTemplate,omitempty"`
IsManager bool `json:"isManager,omitempty"`
IsDeliveryMen bool `json:"isDeliveryMen,omitempty"`
DeliveryTypes []string `json:"deliveryTypes,omitempty"`
BreakdownOrderTypes []string `json:"breakdownOrderTypes,omitempty"`
BreakdownSites []string `json:"breakdownSites,omitempty"`
BreakdownOrderMethods []string `json:"breakdownOrderMethods,omitempty"`
GrantedOrderTypes []string `json:"grantedOrderTypes,omitempty"`
GrantedSites []string `json:"grantedSites,omitempty"`
}
UserGroup type.
type UserGroupsRequest ¶
UserGroupsRequest type.
type UserGroupsResponse ¶
type UserGroupsResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
Groups []UserGroup `json:"groups,omitempty"`
}
UserGroupsResponse type.
type UserResponse ¶
UserResponse type.
type UsersFilter ¶
type UsersFilter struct {
Email string `url:"email,omitempty"`
Status string `url:"status,omitempty"`
Online int `url:"online,omitempty"`
Active int `url:"active,omitempty"`
IsManager int `url:"isManager,omitempty"`
IsAdmin int `url:"isAdmin,omitempty"`
CreatedAtFrom string `url:"createdAtFrom,omitempty"`
CreatedAtTo string `url:"createdAtTo,omitempty"`
Groups []string `url:"groups,omitempty,brackets"`
}
UsersFilter type.
type UsersRequest ¶
type UsersRequest struct {
Filter UsersFilter `url:"filter,omitempty"`
Limit int `url:"limit,omitempty"`
Page int `url:"page,omitempty"`
}
UsersRequest type.
type UsersResponse ¶
type UsersResponse struct {
Success bool `json:"success"`
Pagination *Pagination `json:"pagination,omitempty"`
Users []User `json:"users,omitempty"`
}
UsersResponse type.
type VersionResponse ¶
type VersionResponse struct {
Success bool `json:"success,omitempty"`
Versions []string `json:"versions,omitempty"`
}
VersionResponse return available API versions.