v5

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ByExternalID = "externalId"

ByExternalId is "externalId" constant to use as `by` property in methods

View Source
const ByID = "id"

ByID is "id" constant to use as `by` property in methods

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	Current bool `json:"current,omitempty"`
}

APIKey type

type Action

type Action struct {
	Code       string   `json:"code,omitempty"`
	URL        string   `json:"url,omitempty"`
	CallPoints []string `json:"callPoints,omitempty"`
}

Action type

type Activity added in v1.0.4

type Activity struct {
	Active bool `json:"active"`
	Freeze bool `json:"freeze"`
}

Activity struct

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"`
	Metro      string `json:"metro,omitempty"`
	Notes      string `json:"notes,omitempty"`
	Text       string `json:"text,omitempty"`
}

Address type

type Attachment added in v1.3.0

type Attachment struct {
	Customer *Customer `json:"customer,omitempty"`
	Order    *Order    `json:"order,omitempty"`
}

Attachment type

type Client

type Client struct {
	URL   string
	Key   string
	Debug bool
	// contains filtered or unexported fields
}

Client type

func New

func New(url string, key string) *Client

New initialize client

func (*Client) APICredentials

func (c *Client) APICredentials() (CredentialResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.APICredentials()

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.credentials {
	fmt.Printf("%v\n", value)
}

func (*Client) APIVersions

func (c *Client) APIVersions() (VersionResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.APIVersions()

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.versions {
	fmt.Printf("%v\n", value)
}

func (*Client) CorporateCustomer added in v1.3.2

func (c *Client) CorporateCustomer(id, by, site string) (CorporateCustomerResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CorporateCustomer(12, v5.ByExternalID, "")

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.CorporateCustomer)
}

func (*Client) CorporateCustomerAddresses added in v1.3.2

func (c *Client) CorporateCustomerAddresses(id string, parameters CorporateCustomerAddressesRequest) (CorporateCustomersAddressesResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CorporateCustomerAddresses("ext-id", v5.CorporateCustomerAddressesRequest{
	Filter: v5,CorporateCustomerAddressesFilter{
		Name: "Main Address",
	},
	By:    v5.ByExternalID,
	Site:  "site",
	Limit: 20,
	Page:  1,
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.Addresses)
}

func (*Client) CorporateCustomerAddressesCreate added in v1.3.2

func (c *Client) CorporateCustomerAddressesCreate(id string, by string, address CorporateCustomerAddress, site ...string) (CreateResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := c.CorporateCustomerAddressesCreate("ext-id", v5.ByExternalID, v5.CorporateCustomerAddress{
	Text: "this is new address",
	Name: "New Address",
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v", data.ID)
}

func (*Client) CorporateCustomerAddressesEdit added in v1.3.2

func (c *Client) CorporateCustomerAddressesEdit(customerID, customerBy, entityBy string, address CorporateCustomerAddress, site ...string) (CreateResponse, int, *errs.Failure)

CorporateCustomersAddressesEdit 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 = v5.New("https://demo.url", "09jIJ")

data, status, err := c.CorporateCustomerAddressesEdit(
	"customer-ext-id",
	v5.ByExternalID,
	v5.ByExternalID,
	CorporateCustomerAddress{
		ExternalID: "addr-ext-id",
		Name:       "Main Address 2",
	},
)

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.Customer)
}

func (*Client) CorporateCustomerCompanies added in v1.3.2

func (c *Client) CorporateCustomerCompanies(id string, parameters IdentifiersPairRequest) (CorporateCustomerCompaniesResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CorporateCustomerCompanies("ext-id", v5.IdentifiersPairRequest{
	Filter: v5,IdentifiersPairFilter{
		Ids: []string{"1"},
	},
	By:    v5.ByExternalID,
	Site:  "site",
	Limit: 20,
	Page:  1,
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.Companies)
}

func (*Client) CorporateCustomerCompaniesCreate added in v1.3.2

func (c *Client) CorporateCustomerCompaniesCreate(id string, by string, company Company, site ...string) (CreateResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := c.CorporateCustomerCompaniesCreate("ext-id", v5.ByExternalID, v5.Company{
	Name: "Company name",
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v", data.ID)
}

func (*Client) CorporateCustomerCompaniesEdit added in v1.3.2

func (c *Client) CorporateCustomerCompaniesEdit(customerID, customerBy, entityBy string, company Company, site ...string) (CreateResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := c.CorporateCustomerCompaniesEdit(
	"customer-ext-id",
	v5.ByExternalID,
	v5.ByExternalID,
	Company{
		ExternalID: "company-ext-id",
		Name:       "New Company Name",
	},
)

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.ID)
}

func (*Client) CorporateCustomerContacts added in v1.3.2

func (c *Client) CorporateCustomerContacts(id string, parameters IdentifiersPairRequest) (CorporateCustomerContactsResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CorporateCustomerContacts("ext-id", v5.IdentifiersPairRequest{
	Filter: v5.IdentifiersPairFilter{
		Ids: []string{"1"},
	},
	By:    v5.ByExternalID,
	Site:  "site",
	Limit: 20,
	Page:  1,
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.Contacts)
}

func (*Client) CorporateCustomerContactsCreate added in v1.3.2

func (c *Client) CorporateCustomerContactsCreate(id string, by string, contact CorporateCustomerContact, site ...string) (CreateResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := c.CorporateCustomerContactsCreate("ext-id", v5.ByExternalID, v5.CorporateCustomerContact{
	IsMain: false,
	Customer: v5.CorporateCustomerContactCustomer{
		ExternalID: "external_id",
		Site:       "site",
	},
	Companies: []IdentifiersPair{},
}, "site")

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v", data.ID)
}

func (*Client) CorporateCustomerContactsEdit added in v1.3.2

func (c *Client) CorporateCustomerContactsEdit(customerID, customerBy, entityBy string, contact CorporateCustomerContact, site ...string) (CreateResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := c.CorporateCustomerContactsEdit("ext-id", v5.ByExternalID, v5.ByID, v5.CorporateCustomerContact{
	IsMain: false,
	Customer: v5.CorporateCustomerContactCustomer{
		ID: 2350,
	},
}, "site")

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.ID)
}

func (*Client) CorporateCustomerCreate added in v1.3.2

func (c *Client) CorporateCustomerCreate(customer CorporateCustomer, site ...string) (CorporateCustomerChangeResponse, int, *errs.Failure)

CorporateCustomerCreate creates corporate customer

For more information see http://help.retailcrm.pro/Developers/ApiVersion5#post--api-v5-customers-corporate-create

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CorporateCustomerCreate(v5.CorporateCustomer{
	Nickname:  "Company",
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v", err.Id)
}

func (*Client) CorporateCustomerEdit added in v1.3.2

func (c *Client) CorporateCustomerEdit(customer CorporateCustomer, by string, site ...string) (CustomerChangeResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CorporateCustomerEdit(
	v5.CorporateCustomer{
		FirstName:  "Ivan",
		LastName:   "Ivanov",
		Patronymic: "Ivanovich",
		ID: 		1,
		Email:      "ivanov@example.com",
	},
	v5.ByID,
)

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.Customer)
}

func (*Client) CorporateCustomerNoteCreate added in v1.3.2

func (c *Client) CorporateCustomerNoteCreate(note CorporateCustomerNote, site ...string) (CreateResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

	data, status, err := client.CorporateCustomerNoteCreate(v5.CorporateCustomerNote{
		Text:  "text",
     Customer: &v5.IdentifiersPair{
			ID: 1,
		}
	})

	if err != nil {
		fmt.Printf("%v", err.Error())
	}

	if status >= http.StatusBadRequest {
		fmt.Printf("%v", err.ApiError())
	}

	if data.Success == true {
		fmt.Printf("%v", err.Id)
	}

func (*Client) CorporateCustomerNoteDelete added in v1.3.2

func (c *Client) CorporateCustomerNoteDelete(id int) (SuccessfulResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CorporateCustomerNoteDelete(12)

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) CorporateCustomers added in v1.3.2

func (c *Client) CorporateCustomers(parameters CorporateCustomersRequest) (CorporateCustomersResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CorporateCustomers(v5.CorporateCustomersRequest{
	Filter: CorporateCustomersFilter{
		City: "Moscow",
	},
	Page: 3,
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.CustomersCorporate {
	fmt.Printf("%v\n", value)
}

func (*Client) CorporateCustomersFixExternalIds added in v1.3.2

func (c *Client) CorporateCustomersFixExternalIds(customers []IdentifiersPair) (SuccessfulResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CorporateCustomersFixExternalIds([]v5.IdentifiersPair{{
	ID:         1,
	ExternalID: 12,
}})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) CorporateCustomersHistory added in v1.3.2

func (c *Client) CorporateCustomersHistory(parameters CorporateCustomersHistoryRequest) (CorporateCustomersHistoryResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CorporateCustomersHistory(v5.CorporateCustomersHistoryRequest{
	Filter: v5.CorporateCustomersHistoryFilter{
		SinceID: 20,
	},
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.History {
	fmt.Printf("%v\n", value)
}

func (*Client) CorporateCustomersNotes added in v1.3.2

func (c *Client) CorporateCustomersNotes(parameters CorporateCustomersNotesRequest) (CorporateCustomersNotesResponse, int, *errs.Failure)

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-notes

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CorporateCustomersNotes(v5.CorporateCustomersNotesRequest{
	Filter: CorporateCustomersNotesFilter{
		Text: "text",
	},
	Page: 3,
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.Notes {
	fmt.Printf("%v\n", value)
}

func (*Client) CorporateCustomersUpload added in v1.3.2

func (c *Client) CorporateCustomersUpload(customers []CorporateCustomer, site ...string) (CorporateCustomersUploadResponse, int, *errs.Failure)

CorporateCustomersUpload corporate customers batch upload

For more information see http://help.retailcrm.pro/Developers/ApiVersion5#post--api-v5-customers-corporate-upload

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CorporateCustomersUpload([]v5.CorporateCustomer{
	{
		Nickname:  "Company",
		ExternalID: 1,
	},
	{
		Nickname:  "Company 2",
		ExternalID: 2,
	},
}}

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.UploadedCustomers)
}

func (*Client) Cost added in v1.0.3

func (c *Client) Cost(id int) (CostResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.Cost(1)

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

If data.Success == true {
	fmt.Printf("%v", data.Cost)
}

func (*Client) CostCreate added in v1.0.3

func (c *Client) CostCreate(cost CostRecord, site ...string) (CreateResponse, int, *errs.Failure)

CostCreate create an cost

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-costs-create

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CostCreate(
	v5.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 {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

If data.Success == true {
	fmt.Printf("%v", data.ID)
}

func (*Client) CostDelete added in v1.0.3

func (c *Client) CostDelete(id int) (SuccessfulResponse, int, *errs.Failure)

CostDelete removes cost

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-costs-id-delete

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CostDelete(1)

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) CostEdit added in v1.0.3

func (c *Client) CostEdit(id int, cost CostRecord, site ...string) (CreateResponse, int, *errs.Failure)

CostEdit edit a cost

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-costs-id-edit

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CostEdit(1, v5.Cost{
	DateFrom:  "2012-12-12",
	DateTo:    "2018-12-13",
	Summ:      321,
	CostItem:  "seo",
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

If data.Success == true {
	fmt.Printf("%v", data.Id)
}

func (*Client) CostGroupEdit

func (c *Client) CostGroupEdit(costGroup CostGroup) (SuccessfulResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CostGroupEdit(v5.CostGroup{
	Code:   "group-1",
	Color:  "#da5c98",
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) CostGroups

func (c *Client) CostGroups() (CostGroupsResponse, int, *errs.Failure)

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, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CostItemEdit(v5.CostItem{
	Code:            "seo",
	Active:          false,
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) CostItems

func (c *Client) CostItems() (CostItemsResponse, int, *errs.Failure)

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 added in v1.0.3

func (c *Client) Costs(costs CostsRequest) (CostsResponse, int, *errs.Failure)

Costs returns costs list

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-costs

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.Costs(CostsRequest{
	Filter: CostsFilter{
		Ids: []string{"1","2","3"},
		MinSumm: "1000"
	},
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.Costs {
	fmt.Printf("%v\n", value.Summ)
}

func (*Client) CostsDelete added in v1.0.3

func (c *Client) CostsDelete(ids []int) (CostsDeleteResponse, int, *errs.Failure)

CostsDelete removes a cost

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-costs-delete

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.client.CostsDelete([]int{1, 2, 3, 48, 49, 50})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

If data.Success == true {
	fmt.Printf("Not removed costs: %v", data.NotRemovedIds)
}

func (*Client) CostsUpload added in v1.0.3

func (c *Client) CostsUpload(cost []CostRecord) (CostsUploadResponse, int, *errs.Failure)

CostsUpload batch costs upload

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-costs-upload

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CostCreate([]v5.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 {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

If data.Success == true {
	fmt.Printf("Uploaded costs: %v", data.UploadedCosts)
}

func (*Client) Countries

func (c *Client) Countries() (CountriesResponse, int, *errs.Failure)

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, *errs.Failure)

CourierCreate creates a courier

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-couriers

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CostItemEdit(v5.Courier{
	Active:    true,
	Email:     "courier1@example.com",
	FirstName: "Ivan",
	LastName:  "Ivanov",
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v", data.ID)
}

func (*Client) CourierEdit

func (c *Client) CourierEdit(courier Courier) (SuccessfulResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CostItemEdit(v5.Courier{
	ID:    	  1,
	Patronymic: "Ivanovich",
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) Couriers

func (c *Client) Couriers() (CouriersResponse, int, *errs.Failure)

Couriers returns list of couriers

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-reference-couriers

func (*Client) CustomDictionaries added in v1.0.3

func (c *Client) CustomDictionaries(customDictionaries CustomDictionariesRequest) (CustomDictionariesResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CustomDictionaries(v5.CustomDictionariesRequest{
	Filter: v5.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 added in v1.0.3

func (c *Client) CustomDictionariesCreate(customDictionary CustomDictionary) (CustomResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CustomDictionariesCreate(v5.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 added in v1.0.3

func (c *Client) CustomDictionary(code string) (CustomDictionaryResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CustomDictionary("courier-profiles")

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

If data.Success == true {
	fmt.Printf("%v", data.CustomDictionary.Name)
}

func (*Client) CustomDictionaryEdit added in v1.0.3

func (c *Client) CustomDictionaryEdit(customDictionary CustomDictionary) (CustomResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CustomDictionaryEdit(v5.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 added in v1.0.3

func (c *Client) CustomField(entity, code string) (CustomFieldResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CustomField("order", "first-order")

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

If data.Success == true {
	fmt.Printf("%v", data.CustomField)
}

func (*Client) CustomFieldEdit added in v1.0.3

func (c *Client) CustomFieldEdit(customFields CustomFields) (CustomResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CustomFieldEdit(CustomFields{
	Code:        "first-order",
	Entity:      "order",
	DisplayArea: "delivery",
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

If data.Success == true {
	fmt.Printf("%v", data.Code)
}

func (*Client) CustomFields added in v1.0.3

func (c *Client) CustomFields(customFields CustomFieldsRequest) (CustomFieldsResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CustomFields(v5.CustomFieldsRequest{
	Type: "string",
	Entity: "customer",
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.CustomFields {
	fmt.Printf("%v\n", value)
}

func (*Client) CustomFieldsCreate added in v1.0.3

func (c *Client) CustomFieldsCreate(customFields CustomFields) (CustomResponse, int, *errs.Failure)

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 = v5.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 {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

If data.Success == true {
	fmt.Printf("%v", data.Code)
}

func (*Client) Customer

func (c *Client) Customer(id, by, site string) (CustomerResponse, int, *errs.Failure)

Customer returns information about customer

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-customers-externalId

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.Customer(12, v5.ByExternalID, "")

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.Customer)
}

func (*Client) CustomerCreate

func (c *Client) CustomerCreate(customer Customer, site ...string) (CustomerChangeResponse, int, *errs.Failure)

CustomerCreate creates customer

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-customers-create

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CustomersCombine(v5.Customer{
	FirstName:  "Ivan",
	LastName:   "Ivanov",
	Patronymic: "Ivanovich",
	ExternalID: 1,
	Email:      "ivanov@example.com",
	Address: &v5.Address{
		City:     "Moscow",
		Street:   "Kutuzovsky",
	},
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v", err.Id)
}

func (*Client) CustomerEdit

func (c *Client) CustomerEdit(customer Customer, by string, site ...string) (CustomerChangeResponse, int, *errs.Failure)

CustomerEdit edit exact customer

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-customers-externalId-edit

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CustomerEdit(
	v5.Customer{
		FirstName:  "Ivan",
		LastName:   "Ivanov",
		Patronymic: "Ivanovich",
		ID: 		1,
		Email:      "ivanov@example.com",
	},
	v5.ByID,
)

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.Customer)
}

func (*Client) CustomerNoteCreate

func (c *Client) CustomerNoteCreate(note Note, site ...string) (CreateResponse, int, *errs.Failure)

CustomerNoteCreate note creation

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-customers-notes-create

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CustomerNoteCreate(v5.Note{
	Text:      "some text",
	ManagerID: 12,
	Customer: &v5.Customer{
		ID: 1,
	},
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.ID)
}

func (*Client) CustomerNoteDelete

func (c *Client) CustomerNoteDelete(id int) (SuccessfulResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CustomerNoteDelete(12)
if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) CustomerNotes

func (c *Client) CustomerNotes(parameters NotesRequest) (NotesResponse, int, *errs.Failure)

CustomerNotes returns customer related notes

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-customers-notes

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CustomerNotes(v5.NotesRequest{
	Filter: v5.NotesFilter{
		CustomerIds: []int{1,2,3}
	},
	Page: 1,
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.Notes {
	fmt.Printf("%v\n", value)
}

func (*Client) Customers

func (c *Client) Customers(parameters CustomersRequest) (CustomersResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.Customers(v5.CustomersRequest{
	Filter: CustomersFilter{
		City: "Moscow",
	},
	Page: 3,
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.Customers {
	fmt.Printf("%v\n", value)
}

func (*Client) CustomersCombine

func (c *Client) CustomersCombine(customers []Customer, resultCustomer Customer) (SuccessfulResponse, int, *errs.Failure)

CustomersCombine combine given customers

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-customers-combine

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CustomersCombine([]v5.Customer{{ID: 1}, {ID: 2}}, Customer{ID: 3})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) CustomersFixExternalIds

func (c *Client) CustomersFixExternalIds(customers []IdentifiersPair) (SuccessfulResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CustomersFixExternalIds([]v5.IdentifiersPair{{
	ID:         1,
	ExternalID: 12,
}})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) CustomersHistory

func (c *Client) CustomersHistory(parameters CustomersHistoryRequest) (CustomersHistoryResponse, int, *errs.Failure)

CustomersHistory returns customer's history

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-customers-history

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CustomersHistory(v5.CustomersHistoryRequest{
	Filter: v5.CustomersHistoryFilter{
		SinceID: 20,
	},
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.History {
	fmt.Printf("%v\n", value)
}

func (*Client) CustomersUpload

func (c *Client) CustomersUpload(customers []Customer, site ...string) (CustomersUploadResponse, int, *errs.Failure)

CustomersUpload customers batch upload

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-customers-upload

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.CustomersUpload([]v5.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 {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.UploadedCustomers)
}

func (*Client) DeliveryServiceEdit

func (c *Client) DeliveryServiceEdit(deliveryService DeliveryService) (SuccessfulResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.DeliveryServiceEdit(v5.DeliveryService{
	Active: false,
	Code:   "delivery-1",
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) DeliveryServices

func (c *Client) DeliveryServices() (DeliveryServiceResponse, int, *errs.Failure)

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, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.DeliveryShipment(12)

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.DeliveryShipment)
}

func (*Client) DeliveryShipmentCreate

func (c *Client) DeliveryShipmentCreate(shipment DeliveryShipment, deliveryType string, site ...string) (DeliveryShipmentUpdateResponse, int, *errs.Failure)

DeliveryShipmentCreate creates shipment

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-delivery-shipments-create

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.DeliveryShipmentCreate(
	v5.DeliveryShipment{
		Date: "2012-12-12",
		Time: v5.DeliveryTime{
			From: "18:00",
			To: "20:00",
		},
		Orders: []v5.Order{{Number: "12"}},
	},
	"sdek",
)

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.ID)
}

func (*Client) DeliveryShipmentEdit

func (c *Client) DeliveryShipmentEdit(shipment DeliveryShipment, site ...string) (DeliveryShipmentUpdateResponse, int, *errs.Failure)

DeliveryShipmentEdit shipment editing

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-delivery-shipments-id-edit

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.DeliveryShipmentEdit(v5.DeliveryShipment{
	ID: "12",
	Time: v5.DeliveryTime{
		From: "14:00",
		To: "18:00",
	},
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) DeliveryShipments

func (c *Client) DeliveryShipments(parameters DeliveryShipmentsRequest) (DeliveryShipmentsResponse, int, *errs.Failure)

DeliveryShipments returns list of shipments

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-delivery-shipments

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.DeliveryShipments(v5.DeliveryShipmentsRequest{
	Limit: 12,
	Filter: v5.ShipmentFilter{
		DateFrom: "2012-12-12",
	},
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.DeliveryShipments {
	fmt.Printf("%v\n", value)
}

func (*Client) DeliveryTracking

func (c *Client) DeliveryTracking(parameters []DeliveryTrackingRequest, subcode string) (SuccessfulResponse, int, *errs.Failure)

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 = v5.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(
		[]v5.DeliveryTrackingRequest{{
			DeliveryID: "1",
			TrackNumber: "123",
			History: []v5.DeliveryHistoryRecord{
				{
					Code: "cancel",
					UpdatedAt: t.Format(time.RFC3339),
				},
			},
		}},
		"delivery-1",
	)

	if err != nil {
		fmt.Printf("%v", err.Error())
	}

	if status >= http.StatusBadRequest {
		fmt.Printf("%v", err.ApiError())
	}

func (*Client) DeliveryTypeEdit

func (c *Client) DeliveryTypeEdit(deliveryType DeliveryType) (SuccessfulResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.DeliveryTypeEdit(v5.DeliveryType{
	Active:        false,
	Code:          "type-1",
	DefaultCost:   300,
	DefaultForCrm: false,
}

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) DeliveryTypes

func (c *Client) DeliveryTypes() (DeliveryTypesResponse, int, *errs.Failure)

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 added in v1.3.0

func (c *Client) File(id int) (FileResponse, int, *errs.Failure)

File returns a file info

For more information see https://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-files

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.File(112)

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.File)
}

func (*Client) FileDelete added in v1.3.0

func (c *Client) FileDelete(id int) (SuccessfulResponse, int, *errs.Failure)

FileDelete removes file from RetailCRM

For more information see https://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-files

Example:

	var client = v5.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 added in v1.3.0

func (c *Client) FileDownload(id int) (io.ReadCloser, int, *errs.Failure)

FileDownload downloads file from RetailCRM

For more information see https://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-files

Example:

	var client = v5.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 added in v1.3.0

func (c *Client) FileEdit(id int, file File) (FileResponse, int, *errs.Failure)

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 = v5.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 added in v1.3.0

func (c *Client) FileUpload(reader io.Reader) (FileUploadResponse, int, *errs.Failure)

FileUpload uploads file to RetailCRM

For more information see https://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-files

Example:

	var client = v5.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 added in v1.3.0

func (c *Client) Files(files FilesRequest) (FilesResponse, int, *errs.Failure)

Files returns files list

For more information see https://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-files

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.Files(FilesRequest{
	Filter: FilesFilter{
		Filename: "image.jpeg",
	},
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) GetRequest

func (c *Client) GetRequest(urlWithParameters string, versioned ...bool) ([]byte, int, *errs.Failure)

GetRequest implements GET Request

func (*Client) IntegrationModule

func (c *Client) IntegrationModule(code string) (IntegrationModuleResponse, int, *errs.Failure)

IntegrationModule returns integration module

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-integration-modules-code

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.IntegrationModule("moysklad3")

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.IntegrationModule)
}

func (*Client) IntegrationModuleEdit

func (c *Client) IntegrationModuleEdit(integrationModule IntegrationModule) (IntegrationModuleEditResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

name := "MS"
code := "moysklad3"

data, status, err := client.IntegrationModuleEdit(v5.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, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.Inventories(v5.InventoriesRequest{Filter: v5.InventoriesFilter{Details: 1, ProductActive: 1}, Page: 1})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.Offers {
	fmt.Printf("%v\n", value)
}

func (*Client) InventoriesUpload

func (c *Client) InventoriesUpload(inventories []InventoryUpload, site ...string) (StoreUploadResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.InventoriesUpload(
   []v5.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, *errs.Failure)

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, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.LegalEntityEdit(v5.LegalEntity{
	Code:          "legal-entity-1",
	CertificateDate:   "2012-12-12",
}

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) Order

func (c *Client) Order(id, by, site string) (OrderResponse, int, *errs.Failure)

Order returns information about order

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-orders-externalId

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.Order(12, v5.ByExternalID, "")

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.Order)
}

func (*Client) OrderCreate

func (c *Client) OrderCreate(order Order, site ...string) (OrderCreateResponse, int, *errs.Failure)

OrderCreate creates an order

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-create

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.OrderCreate(v5.Order{
	FirstName:  "Ivan",
	LastName:   "Ivanov",
	Patronymic: "Ivanovich",
	Email:      "ivanov@example.com",
	Items:      []v5.OrderItem{{Offer: v5.Offer{ID: 12}, Quantity: 5}},
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.ID)
}

func (*Client) OrderEdit

func (c *Client) OrderEdit(order Order, by string, site ...string) (CreateResponse, int, *errs.Failure)

OrderEdit edit an order

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-externalId-edit

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.OrderEdit(
	v5.Order{
		ID:    12,
		Items: []v5.OrderItem{{Offer: v5.Offer{ID: 13}, Quantity: 6}},
	},
	v5.ByID,
)

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) OrderMethodEdit

func (c *Client) OrderMethodEdit(orderMethod OrderMethod) (SuccessfulResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.OrderMethodEdit(v5.OrderMethod{
	Code:          "method-1",
	Active:        false,
	DefaultForCRM: false,
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) OrderMethods

func (c *Client) OrderMethods() (OrderMethodsResponse, int, *errs.Failure)

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

func (c *Client) OrderPaymentCreate(payment Payment, site ...string) (CreateResponse, int, *errs.Failure)

OrderPaymentCreate creates payment

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-payments-create

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.OrderPaymentCreate(v5.Payment{
	Order: &v5.Order{
		ID: 12,
	},
	Amount: 300,
	Type:   "cash",
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.ID)
}

func (*Client) OrderPaymentDelete

func (c *Client) OrderPaymentDelete(id int) (SuccessfulResponse, int, *errs.Failure)

OrderPaymentDelete payment removing

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-payments-id-delete

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.OrderPaymentDelete(12)

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) OrderPaymentEdit

func (c *Client) OrderPaymentEdit(payment Payment, by string, site ...string) (SuccessfulResponse, int, *errs.Failure)

OrderPaymentEdit edit payment

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-payments-id-edit

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.OrderPaymentEdit(
	v5.Payment{
		ID:     12,
		Amount: 500,
	},
	v5.ByID,
)

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) OrderTypeEdit

func (c *Client) OrderTypeEdit(orderType OrderType) (SuccessfulResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.OrderTypeEdit(v5.OrderType{
	Code:          "order-type-1",
	Active:        false,
	DefaultForCRM: false,
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) OrderTypes

func (c *Client) OrderTypes() (OrderTypesResponse, int, *errs.Failure)

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, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.Orders(v5.OrdersRequest{Filter: v5.OrdersFilter{City: "Moscow"}, Page: 1})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.Orders {
	fmt.Printf("%v\n", value)
}

func (*Client) OrdersCombine

func (c *Client) OrdersCombine(technique string, order, resultOrder Order) (OperationResponse, int, *errs.Failure)

OrdersCombine combines given orders

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-combine

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.OrdersCombine("ours", v5.Order{ID: 1}, v5.Order{ID: 1})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) OrdersFixExternalIds

func (c *Client) OrdersFixExternalIds(orders []IdentifiersPair) (SuccessfulResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.OrdersFixExternalIds(([]v5.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, *errs.Failure)

OrdersHistory returns orders history

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-orders-history

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.OrdersHistory(v5.OrdersHistoryRequest{Filter: v5.OrdersHistoryFilter{SinceID: 20}})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.History {
	fmt.Printf("%v\n", value)
}

func (*Client) OrdersStatuses added in v1.3.2

func (c *Client) OrdersStatuses(request OrdersStatusesRequest) (OrdersStatusesResponse, int, *errs.Failure)

OrdersStatuses returns orders statuses

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-orders-statuses

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.OrdersStatuses(v5.OrdersStatusesRequest{
	IDs:         []int{1},
	ExternalIDs: []string{"2"},
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) OrdersUpload

func (c *Client) OrdersUpload(orders []Order, site ...string) (OrdersUploadResponse, int, *errs.Failure)

OrdersUpload batch orders uploading

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-upload

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.OrdersUpload([]v5.Order{
	{
		FirstName:  "Ivan",
		LastName:   "Ivanov",
		Patronymic: "Ivanovich",
		Email:      "ivanov@example.com",
		Items:      []v5.OrderItem{{Offer: v5.Offer{ID: 12}, Quantity: 5}},
	},
	{
		FirstName:  "Pert",
		LastName:   "Petrov",
		Patronymic: "Petrovich",
		Email:      "petrov@example.com",
		Items:      []v5.OrderItem{{Offer: v5.Offer{ID: 13}, Quantity: 1}},
	}
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.UploadedOrders)
}

func (*Client) Pack

func (c *Client) Pack(id int) (PackResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.Pack(112)

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.Pack)
}

func (*Client) PackCreate

func (c *Client) PackCreate(pack Pack) (CreateResponse, int, *errs.Failure)

PackCreate creates a pack

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-orders-packs-create

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.PackCreate(Pack{
	Store:    "store-1",
	ItemID:   12,
	Quantity: 1,
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.ID)
}

func (*Client) PackDelete

func (c *Client) PackDelete(id int) (SuccessfulResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.PackDelete(112)

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) PackEdit

func (c *Client) PackEdit(pack Pack) (CreateResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.PackEdit(Pack{ID: 12, Quantity: 2})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) Packs

func (c *Client) Packs(parameters PacksRequest) (PacksResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.Packs(v5.PacksRequest{Filter: v5.PacksFilter{OrderID: 12}})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.Packs {
	fmt.Printf("%v\n", value)
}

func (*Client) PacksHistory

func (c *Client) PacksHistory(parameters PacksHistoryRequest) (PacksHistoryResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.PacksHistory(v5.PacksHistoryRequest{Filter: v5.OrdersHistoryFilter{SinceID: 5}})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.History {
	fmt.Printf("%v\n", value)
}

func (*Client) PaymentStatusEdit

func (c *Client) PaymentStatusEdit(paymentStatus PaymentStatus) (SuccessfulResponse, int, *errs.Failure)

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, *errs.Failure)

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, *errs.Failure)

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, *errs.Failure)

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, *errs.Failure)

PostRequest implements POST Request with generic body data

func (*Client) PriceTypeEdit

func (c *Client) PriceTypeEdit(priceType PriceType) (SuccessfulResponse, int, *errs.Failure)

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, *errs.Failure)

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, *errs.Failure)

PricesUpload updates prices

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-store-prices-upload

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.PricesUpload([]v5.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, *errs.Failure)

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, *errs.Failure)

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, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.Products(v5.ProductsRequest{
	Filter: v5.ProductsFilter{
		Active:   1,
		MinPrice: 1000,
	},
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.Products {
	fmt.Printf("%v\n", value)
}

func (*Client) ProductsGroup

func (c *Client) ProductsGroup(parameters ProductsGroupsRequest) (ProductsGroupsResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.ProductsGroup(v5.ProductsGroupsRequest{
	Filter: v5.ProductsGroupsFilter{
		Active: 1,
	},
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.ProductGroup {
	fmt.Printf("%v\n", value)
}

func (*Client) ProductsProperties

func (c *Client) ProductsProperties(parameters ProductsPropertiesRequest) (ProductsPropertiesResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.ProductsProperties(v5.ProductsPropertiesRequest{
	Filter: v5.ProductsPropertiesFilter{
		Sites: []string["store"],
	},
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.Properties {
	fmt.Printf("%v\n", value)
}

func (*Client) Segments

func (c *Client) Segments(parameters SegmentsRequest) (SegmentsResponse, int, *errs.Failure)

Segments returns segments

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-segments

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.Segments(SegmentsRequest{
	Filter: v5.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 added in v1.3.4

func (c *Client) Settings() (SettingsResponse, int, *errs.Failure)

Settings returns system settings

For more information see https://help.retailcrm.pro/Developers/ApiVersion5#get--api-v5-settings

Example:

var client = v5.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, *errs.Failure)

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, *errs.Failure)

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, *errs.Failure)

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, *errs.Failure)

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, *errs.Failure)

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, *errs.Failure)

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, *errs.Failure)

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, *errs.Failure)

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, *errs.Failure)

Task returns task

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-tasks-id

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.Task(12)

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.Task)
}

func (*Client) TaskCreate

func (c *Client) TaskCreate(task Task, site ...string) (CreateResponse, int, *errs.Failure)

TaskCreate create a task

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-tasks-create

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.Tasks(v5.Task{
	Text:        "task №1",
	PerformerID: 12,
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.ID)
}

func (*Client) TaskEdit

func (c *Client) TaskEdit(task Task, site ...string) (SuccessfulResponse, int, *errs.Failure)

TaskEdit edit a task

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#post--api-v5-tasks-id-edit

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.Task(v5.Task{
	ID:   12
	Text: "task №2",
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) Tasks

func (c *Client) Tasks(parameters TasksRequest) (TasksResponse, int, *errs.Failure)

Tasks returns task list

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-tasks

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.Tasks(v5.TasksRequest{
	Filter: TasksFilter{
		DateFrom: "2012-12-12",
	},
})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.Tasks {
	fmt.Printf("%v\n", value)
}

func (*Client) UnitEdit added in v1.1.2

func (c *Client) UnitEdit(unit Unit) (SuccessfulResponse, int, *errs.Failure)

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 added in v1.1.2

func (c *Client) Units() (UnitsResponse, int, *errs.Failure)

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, *errs.Failure)

User returns information about user

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-users-id

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.User(12)

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

if data.Success == true {
	fmt.Printf("%v\n", data.User)
}

func (*Client) UserGroups

func (c *Client) UserGroups(parameters UserGroupsRequest) (UserGroupsResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.UserGroups(v5.UserGroupsRequest{Page: 1})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.Groups {
	fmt.Printf("%v\n", value)
}

func (*Client) UserStatus

func (c *Client) UserStatus(id int, status string) (SuccessfulResponse, int, *errs.Failure)

UserStatus change user status

For more information see http://www.retailcrm.pro/docs/Developers/ApiVersion5#get--api-v5-users

Example:

var client = v5.New("https://demo.url", "09jIJ")

data, status, err := client.UserStatus(12, "busy")

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

func (*Client) Users

func (c *Client) Users(parameters UsersRequest) (UsersResponse, int, *errs.Failure)

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 = v5.New("https://demo.url", "09jIJ")

data, status, err := client.Users(v5.UsersRequest{Filter: v5.UsersFilter{Active: 1}, Page: 1})

if err != nil {
	fmt.Printf("%v", err.Error())
}

if status >= http.StatusBadRequest {
	fmt.Printf("%v", err.ApiError())
}

for _, value := range data.Users {
	fmt.Printf("%v\n", value)
}

type Company added in v1.3.2

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 map[string]string `json:"customFields,omitempty,brackets"`
}

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 added in v1.3.2

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       map[string]string          `json:"customFields,omitempty,brackets"`
	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 added in v1.3.2

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 added in v1.3.2

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 added in v1.3.2

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 added in v1.3.2

type CorporateCustomerChangeResponse CustomerChangeResponse

CorporateCustomerChangeResponse type

type CorporateCustomerCompaniesResponse added in v1.3.2

type CorporateCustomerCompaniesResponse struct {
	Success   bool      `json:"success"`
	Companies []Company `json:"companies"`
}

CorporateCustomerCompaniesResponse type

type CorporateCustomerContact added in v1.3.2

type CorporateCustomerContact struct {
	IsMain    bool                             `json:"isMain,omitempty"`
	Customer  CorporateCustomerContactCustomer `json:"customer,omitempty"`
	Companies []IdentifiersPair                `json:"companies,omitempty"`
}

type CorporateCustomerContactCustomer added in v1.3.2

type CorporateCustomerContactCustomer struct {
	ID         int    `json:"id,omitempty"`
	ExternalID string `json:"externalId,omitempty"`
	BrowserID  string `json:"browserId,omitempty"`
	Site       string `json:"site,omitempty"`
}

type CorporateCustomerContactsResponse added in v1.3.2

type CorporateCustomerContactsResponse struct {
	Success  bool                       `json:"success"`
	Contacts []CorporateCustomerContact `json:"contacts"`
}

CorporateCustomerContactsResponse type

type CorporateCustomerHistoryRecord added in v1.3.2

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,brackets"`
	APIKey            *APIKey            `json:"apiKey,omitempty,brackets"`
	CorporateCustomer *CorporateCustomer `json:"corporateCustomer,omitempty,brackets"`
}

CorporateCustomerHistoryRecord type

type CorporateCustomerNote added in v1.3.2

type CorporateCustomerNote struct {
	ManagerID int              `json:"managerId,omitempty"`
	Text      string           `json:"text,omitempty"`
	Customer  *IdentifiersPair `json:"customer,omitempty"`
}

CorporateCustomerNote type

type CorporateCustomerResponse added in v1.3.2

type CorporateCustomerResponse struct {
	Success           bool               `json:"success"`
	CorporateCustomer *CorporateCustomer `json:"customerCorporate,omitempty,brackets"`
}

CorporateCustomerResponse type

type CorporateCustomersAddressesResponse added in v1.3.2

type CorporateCustomersAddressesResponse struct {
	Success   bool                       `json:"success"`
	Addresses []CorporateCustomerAddress `json:"addresses"`
}

CorporateCustomersAddressesResponse type

type CorporateCustomersFilter added in v1.3.2

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 added in v1.3.2

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 added in v1.3.2

type CorporateCustomersHistoryRequest struct {
	Filter CorporateCustomersHistoryFilter `url:"filter,omitempty"`
	Limit  int                             `url:"limit,omitempty"`
	Page   int                             `url:"page,omitempty"`
}

CorporateCustomersHistoryRequest type

type CorporateCustomersHistoryResponse added in v1.3.2

type CorporateCustomersHistoryResponse struct {
	Success     bool                             `json:"success,omitempty"`
	GeneratedAt string                           `json:"generatedAt,omitempty"`
	History     []CorporateCustomerHistoryRecord `json:"history,omitempty,brackets"`
	Pagination  *Pagination                      `json:"pagination,omitempty"`
}

CorporateCustomersHistoryResponse type

type CorporateCustomersNotesFilter added in v1.3.2

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 added in v1.3.2

type CorporateCustomersNotesRequest struct {
	Filter CorporateCustomersNotesFilter `url:"filter,omitempty"`
	Limit  int                           `url:"limit,omitempty"`
	Page   int                           `url:"page,omitempty"`
}

CorporateCustomersNotesRequest type

type CorporateCustomersNotesResponse added in v1.3.2

type CorporateCustomersNotesResponse struct {
	Success    bool        `json:"success"`
	Pagination *Pagination `json:"pagination,omitempty"`
	Notes      []Note      `json:"notes,omitempty,brackets"`
}

CorporateCustomersNotesResponse type

type CorporateCustomersRequest added in v1.3.2

type CorporateCustomersRequest struct {
	Filter CorporateCustomersFilter `url:"filter,omitempty"`
	Limit  int                      `url:"limit,omitempty"`
	Page   int                      `url:"page,omitempty"`
}

CorporateCustomersRequest type

type CorporateCustomersResponse added in v1.3.2

type CorporateCustomersResponse struct {
	Success            bool                `json:"success"`
	Pagination         *Pagination         `json:"pagination,omitempty"`
	CustomersCorporate []CorporateCustomer `json:"customersCorporate,omitempty,brackets"`
}

CorporateCustomersResponse type

type CorporateCustomersUploadResponse added in v1.3.2

type CorporateCustomersUploadResponse CustomersUploadResponse

CorporateCustomersUploadResponse type

type Cost added in v1.0.3

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,brackets"`
}

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,brackets"`
}

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,brackets"`
}

CostItemsResponse type

type CostRecord added in v1.0.3

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,brackets"`
}

CostRecord type

type CostResponse added in v1.0.3

type CostResponse struct {
	Success bool  `json:"success"`
	Cost    *Cost `json:"cost,omitempty,brackets"`
}

CostResponse type

type CostsDeleteResponse added in v1.0.3

type CostsDeleteResponse struct {
	Success       bool  `json:"success"`
	Count         int   `json:"count,omitempty,brackets"`
	NotRemovedIds []int `json:"notRemovedIds,omitempty,brackets"`
}

CostsDeleteResponse type

type CostsFilter added in v1.0.3

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 added in v1.0.3

type CostsRequest struct {
	Filter CostsFilter `url:"filter,omitempty"`
	Limit  int         `url:"limit,omitempty"`
	Page   int         `url:"page,omitempty"`
}

CostsRequest type

type CostsResponse added in v1.0.3

type CostsResponse struct {
	Success    bool        `json:"success"`
	Pagination *Pagination `json:"pagination,omitempty"`
	Costs      []Cost      `json:"costs,omitempty,brackets"`
}

CostsResponse type

type CostsUploadResponse added in v1.0.3

type CostsUploadResponse struct {
	Success       bool  `json:"success"`
	UploadedCosts []int `json:"uploadedCosts,omitempty,brackets"`
}

CostsUploadResponse type

type CountriesResponse

type CountriesResponse struct {
	Success      bool     `json:"success"`
	CountriesIso []string `json:"countriesIso,omitempty,brackets"`
}

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,brackets"`
}

CouriersResponse type

type CreateResponse

type CreateResponse struct {
	Success bool `json:"success"`
	ID      int  `json:"id,omitempty"`
}

CreateResponse type

type CredentialResponse

type CredentialResponse struct {
	Success        bool     `json:"success,omitempty"`
	Credentials    []string `json:"credentials,brackets,omitempty"`
	SiteAccess     string   `json:"siteAccess,omitempty"`
	SitesAvailable []string `json:"sitesAvailable,brackets,omitempty"`
}

CredentialResponse return available API methods

type CustomDictionariesFilter added in v1.0.3

type CustomDictionariesFilter struct {
	Name string `url:"name,omitempty"`
	Code string `url:"code,omitempty"`
}

CustomDictionariesFilter type

type CustomDictionariesRequest added in v1.0.3

type CustomDictionariesRequest struct {
	Filter CustomDictionariesFilter `url:"filter,omitempty"`
	Limit  int                      `url:"limit,omitempty"`
	Page   int                      `url:"page,omitempty"`
}

CustomDictionariesRequest type

type CustomDictionariesResponse added in v1.0.3

type CustomDictionariesResponse struct {
	Success            bool                `json:"success"`
	Pagination         *Pagination         `json:"pagination,omitempty"`
	CustomDictionaries *[]CustomDictionary `json:"customDictionaries,omitempty,brackets"`
}

CustomDictionariesResponse type

type CustomDictionary added in v1.0.3

type CustomDictionary struct {
	Name     string    `json:"name,omitempty"`
	Code     string    `json:"code,omitempty"`
	Elements []Element `json:"elements,omitempty,brackets"`
}

CustomDictionary type

type CustomDictionaryResponse added in v1.0.3

type CustomDictionaryResponse struct {
	Success          bool              `json:"success"`
	CustomDictionary *CustomDictionary `json:"CustomDictionary,omitempty,brackets"`
}

CustomDictionaryResponse type

type CustomFieldResponse added in v1.0.3

type CustomFieldResponse struct {
	Success     bool         `json:"success"`
	CustomField CustomFields `json:"customField,omitempty,brackets"`
}

CustomFieldResponse type

type CustomFields added in v1.0.3

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 added in v1.0.3

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 added in v1.0.3

type CustomFieldsRequest struct {
	Filter CustomFieldsFilter `url:"filter,omitempty"`
	Limit  int                `url:"limit,omitempty"`
	Page   int                `url:"page,omitempty"`
}

CustomFieldsRequest type

type CustomFieldsResponse added in v1.0.3

type CustomFieldsResponse struct {
	Success      bool           `json:"success"`
	Pagination   *Pagination    `json:"pagination,omitempty"`
	CustomFields []CustomFields `json:"customFields,omitempty,brackets"`
}

CustomFieldsResponse type

type CustomResponse added in v1.0.3

type CustomResponse struct {
	Success bool   `json:"success"`
	Code    string `json:"code,omitempty"`
}

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,brackets,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                 map[string]string `json:"customFields,omitempty,brackets"`
	Tags                         []Tag             `json:"tags,brackets,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,brackets"`
	APIKey    *APIKey   `json:"apiKey,omitempty,brackets"`
	Customer  *Customer `json:"customer,omitempty,brackets"`
}

CustomerHistoryRecord type

type CustomerRequest

type CustomerRequest struct {
	By   string `url:"by,omitempty"`
	Site string `url:"site,omitempty"`
}

CustomerRequest type

type CustomerResponse

type CustomerResponse struct {
	Success  bool      `json:"success"`
	Customer *Customer `json:"customer,omitempty,brackets"`
}

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,brackets"`
	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,brackets"`
}

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,brackets"`
}

CustomersUploadResponse type

type Delivery

type Delivery struct {
	Description           string              `json:"description,omitempty"`
	Actions               map[string]string   `json:"actions,omitempty,brackets"`
	PayerType             []string            `json:"payerType,omitempty,brackets"`
	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,brackets"`
}

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,brackets"`
	ExtraData       map[string]string `json:"extraData,omitempty,brackets"`
}

DeliveryShipment type

type DeliveryShipmentResponse

type DeliveryShipmentResponse struct {
	Success          bool              `json:"success"`
	DeliveryShipment *DeliveryShipment `json:"deliveryShipment,omitempty,brackets"`
}

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,brackets"`
}

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,brackets"`
	ExtraData   map[string]string       `json:"extraData,omitempty,brackets"`
}

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,brackets"`
}

DeliveryTypesResponse type

type Element added in v1.0.3

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 added in v1.3.0

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 added in v1.3.0

type FileResponse struct {
	Success bool  `json:"success"`
	File    *File `json:"file,omitempty"`
}

FileResponse type

type FileUploadResponse added in v1.3.0

type FileUploadResponse struct {
	Success bool  `json:"success"`
	File    *File `json:"file,omitempty"`
}

FileUpload response

type FilesFilter added in v1.3.0

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 added in v1.3.0

type FilesRequest struct {
	Filter FilesFilter `url:"filter,omitempty"`
	Limit  int         `url:"limit,omitempty"`
	Page   int         `url:"page,omitempty"`
}

FilesRequest type

type FilesResponse added in v1.3.0

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 added in v1.3.2

type IdentifiersPairFilter struct {
	Ids         []string `url:"ids,omitempty,brackets"`
	ExternalIds []string `url:"externalIds,omitempty,brackets"`
}

IdentifiersPairFilter type

type IdentifiersPairRequest added in v1.3.2

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"`
	ClientID           string            `json:"clientId,omitempty"`
	BaseURL            string            `json:"baseUrl,omitempty"`
	AccountURL         string            `json:"accountUrl,omitempty"`
	AvailableCountries []string          `json:"availableCountries,omitempty"`
	Actions            map[string]string `json:"actions,omitempty"`
	Integrations       *Integrations     `json:"integrations,omitempty"`
}

IntegrationModule type

type IntegrationModuleEditResponse

type IntegrationModuleEditResponse struct {
	Success bool         `json:"success"`
	Info    ResponseInfo `json:"info,omitempty,brackets"`
}

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,brackets"`
}

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 MgBot added in v1.0.6

type MgBot struct{}

MgBot type

type MgInfo added in v1.0.5

type MgInfo struct {
	EndpointUrl string `json:"endpointUrl"`
	Token       string `json:"token"`
}

MgInfo type

type MgTransport added in v1.0.3

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,brackets"`
}

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,brackets"`
	Properties    map[string]string `json:"properties,omitempty,brackets"`
	Prices        []OfferPrice      `json:"prices,omitempty,brackets"`
	Images        []string          `json:"images,omitempty,brackets"`
	Unit          *Unit             `json:"unit,omitempty,brackets"`
}

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:"errors,omitempty,brackets"`
}

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,brackets"`
	CustomFields                  map[string]string       `json:"customFields,omitempty,brackets"`
	Payments                      map[string]OrderPayment `json:"payments,omitempty,brackets"`
}

Order type

type OrderCreateResponse added in v1.3.5

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 added in v1.3.6

func (v OrderDeliveryData) MarshalJSON() ([]byte, error)

MarshalJSON method

func (*OrderDeliveryData) UnmarshalJSON added in v1.3.6

func (v *OrderDeliveryData) UnmarshalJSON(b []byte) error

UnmarshalJSON method

type OrderDeliveryDataBasic added in v1.3.6

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,brackets"`
	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,brackets"`
}

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 OrderRequest

type OrderRequest struct {
	By   string `url:"by,omitempty"`
	Site string `url:"site,omitempty"`
}

OrderRequest type

type OrderResponse

type OrderResponse struct {
	Success bool   `json:"success"`
	Order   *Order `json:"order,omitempty,brackets"`
}

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,brackets"`
}

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,brackets"`
	APIKey    *APIKey `json:"apiKey,omitempty,brackets"`
	Order     *Order  `json:"order,omitempty,brackets"`
}

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,brackets"`
	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,brackets"`
}

OrdersResponse type

type OrdersStatus added in v1.3.2

type OrdersStatus struct {
	ID         int    `json:"id"`
	ExternalID string `json:"externalId,omitempty"`
	Status     string `json:"status"`
	Group      string `json:"group"`
}

OrdersStatus type

type OrdersStatusesRequest added in v1.3.2

type OrdersStatusesRequest struct {
	IDs         []int    `url:"ids,omitempty,brackets"`
	ExternalIDs []string `url:"externalIds,omitempty,brackets"`
}

OrdersStatusesRequest type

type OrdersStatusesResponse added in v1.3.2

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,brackets"`
}

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

type PackResponse struct {
	Success bool  `json:"success"`
	Pack    *Pack `json:"pack,omitempty,brackets"`
}

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,brackets"`
	Pack      *Pack  `json:"pack,omitempty,brackets"`
}

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,brackets"`
	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,brackets"`
}

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,brackets"`
}

PaymentStatus type

type PaymentStatusesResponse

type PaymentStatusesResponse struct {
	Success         bool                     `json:"success"`
	PaymentStatuses map[string]PaymentStatus `json:"paymentStatuses,omitempty,brackets"`
}

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,brackets"`
	PaymentStatuses []string `json:"PaymentStatuses,omitempty,brackets"`
}

PaymentType type

type PaymentTypesResponse

type PaymentTypesResponse struct {
	Success      bool                   `json:"success"`
	PaymentTypes map[string]PaymentType `json:"paymentTypes,omitempty,brackets"`
}

PaymentTypesResponse type

type Phone

type Phone struct {
	Number string `json:"number,omitempty"`
}

Phone type

type Plate

type Plate struct {
	Code  string `json:"code,omitempty"`
	Label string `json:"label,omitempty"`
}

Plate 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,brackets"`
	Geo              []GeoHierarchyRow `json:"geo,omitempty,brackets"`
}

PriceType type

type PriceTypesResponse

type PriceTypesResponse struct {
	Success    bool        `json:"success"`
	PriceTypes []PriceType `json:"priceTypes,omitempty,brackets"`
}

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,brackets"`
	Groups       []ProductGroup    `json:"groups,omitempty,brackets"`
	Properties   map[string]string `json:"properties,omitempty,brackets"`
}

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,brackets"`
}

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,brackets"`
}

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,brackets"`
}

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,brackets"`
}

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,brackets"`
}

Property type

type ResponseInfo added in v1.0.5

type ResponseInfo struct {
	MgTransportInfo MgInfo `json:"mgTransport,omitempty,brackets"`
	MgBotInfo       MgInfo `json:"mgBot,omitempty,brackets"`
}

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,brackets"`
}

SegmentsResponse type

type Settings added in v1.3.4

type Settings struct {
	DefaultCurrency SettingsNode `json:"default_currency"`
	SystemLanguage  SettingsNode `json:"system_language"`
	Timezone        SettingsNode `json:"timezone"`
}

Settings type. Contains retailCRM configuration.

type SettingsNode added in v1.3.4

type SettingsNode struct {
	Value     string `json:"value"`
	UpdatedAt string `json:"updated_at"`
}

SettingsNode represents an item in settings. All settings nodes contains only string value and update time for now.

type SettingsResponse added in v1.3.4

type SettingsResponse struct {
	Success  bool     `json:"success"`
	Settings Settings `json:"settings,omitempty,brackets"`
}

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,brackets"`
}

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,brackets"`
}

StatusGroup type

type StatusGroupsResponse

type StatusGroupsResponse struct {
	Success      bool                   `json:"success"`
	StatusGroups map[string]StatusGroup `json:"statusGroups,omitempty,brackets"`
}

StatusGroupsResponse type

type StatusesResponse

type StatusesResponse struct {
	Success  bool              `json:"success"`
	Statuses map[string]Status `json:"statuses,omitempty,brackets"`
}

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,brackets"`
}

StoresResponse type

type SuccessfulResponse

type SuccessfulResponse struct {
	Success bool `json:"success,omitempty"`
}

SuccessfulResponse type

type Tag added in v1.3.6

type Tag struct {
	Name     string `json:"name,omitempty"`
	Color    string `json:"color,omitempty"`
	Attached bool   `json:"attached,omitempty"`
}

Tag struct

func (Tag) MarshalJSON added in v1.3.8

func (t Tag) MarshalJSON() ([]byte, error)

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

type TaskResponse struct {
	Success bool  `json:"success"`
	Task    *Task `json:"task,omitempty,brackets"`
}

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,brackets"`
}

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,brackets"`
	ExternalPhones       []ExternalPhone  `json:"externalPhones,omitempty,brackets"`
}

Telephony type

type Unit added in v1.1.2

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 added in v1.1.2

type UnitsResponse struct {
	Success bool    `json:"success"`
	Units   *[]Unit `json:"units,omitempty,brackets"`
}

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,brackets"`
	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,brackets"`
	BreakdownOrderTypes   []string `json:"breakdownOrderTypes,omitempty,brackets"`
	BreakdownSites        []string `json:"breakdownSites,omitempty,brackets"`
	BreakdownOrderMethods []string `json:"breakdownOrderMethods,omitempty,brackets"`
	GrantedOrderTypes     []string `json:"grantedOrderTypes,omitempty,brackets"`
	GrantedSites          []string `json:"grantedSites,omitempty,brackets"`
}

UserGroup type

type UserGroupsRequest

type UserGroupsRequest struct {
	Limit int `url:"limit,omitempty"`
	Page  int `url:"page,omitempty"`
}

UserGroupsRequest type

type UserGroupsResponse

type UserGroupsResponse struct {
	Success    bool        `json:"success"`
	Pagination *Pagination `json:"pagination,omitempty"`
	Groups     []UserGroup `json:"groups,omitempty,brackets"`
}

UserGroupsResponse type

type UserResponse

type UserResponse struct {
	Success bool  `json:"success"`
	User    *User `json:"user,omitempty,brackets"`
}

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,brackets"`
}

UsersResponse type

type VersionResponse

type VersionResponse struct {
	Success  bool     `json:"success,omitempty"`
	Versions []string `json:"versions,brackets,omitempty"`
}

VersionResponse return available API versions

type Warehouse

type Warehouse struct {
	Actions []Action `json:"actions,omitempty,brackets"`
}

Warehouse type

Jump to

Keyboard shortcuts

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