- Shell 100%
Go API client for products
С помощью методов этого раздела вы можете:
- создать и редактировать карточки товаров
- получить категории, предметы и характеристики товаров
- загрузить медиафайлы в карточки товаров
- настроить ярлыки для поиска товаров
- установить цены и скидки
- управлять остатками товаров и складами, если вы работаете по модели продаж со склада продавца
Overview
This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.
- API version: products
- Package version: 1.0.0
- Generator version: 7.17.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen
Installation
Install the following dependencies:
go get github.com/stretchr/testify/assert
go get golang.org/x/net/context
Put the package under your project folder and add the following in import:
import products "github.com/GIT_USER_ID/GIT_REPO_ID"
To use a proxy, set the environment variable HTTP_PROXY:
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
Configuration of Server URL
Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.
Select Server Configuration
For using other server than the one defined on index 0 set context value products.ContextServerIndex of type int.
ctx := context.WithValue(context.Background(), products.ContextServerIndex, 1)
Templated Server URL
Templated server URL is formatted using default variables from configuration or from context value products.ContextServerVariables of type map[string]string.
ctx := context.WithValue(context.Background(), products.ContextServerVariables, map[string]string{
"basePath": "v2",
})
Note, enum values are always validated and all unused variables are silently ignored.
URLs Configuration per Operation
Each operation can use different server URL defined using OperationServers map in the Configuration.
An operation is uniquely identified by "{classname}Service.{nickname}" string.
Similar rules for overriding default operation server index and variables applies by using products.ContextOperationServerIndices and products.ContextOperationServerVariables context maps.
ctx := context.WithValue(context.Background(), products.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), products.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
Documentation for API Endpoints
All URIs are relative to http://localhost
| Class | Method | HTTP request | Description |
|---|---|---|---|
| DefaultApi | ApiV2BufferGoodsTaskGet | Get /api/v2/buffer/goods/task | Детализация необработанной загрузки |
| DefaultApi | ApiV2BufferTasksGet | Get /api/v2/buffer/tasks | Состояние необработанной загрузки |
| DefaultApi | ApiV2HistoryGoodsTaskGet | Get /api/v2/history/goods/task | Детализация обработанной загрузки |
| DefaultApi | ApiV2HistoryTasksGet | Get /api/v2/history/tasks | Состояние обработанной загрузки |
| DefaultApi | ApiV2ListGoodsFilterGet | Get /api/v2/list/goods/filter | Получить товары с ценами |
| DefaultApi | ApiV2ListGoodsFilterPost | Post /api/v2/list/goods/filter | Получить товары с ценами по артикулам |
| DefaultApi | ApiV2ListGoodsSizeNmGet | Get /api/v2/list/goods/size/nm | Получить размеры товара с ценами |
| DefaultApi | ApiV2QuarantineGoodsGet | Get /api/v2/quarantine/goods | Получить товары в карантине |
| DefaultApi | ApiV2UploadTaskClubDiscountPost | Post /api/v2/upload/task/club-discount | Установить скидки WB Клуба |
| DefaultApi | ApiV2UploadTaskPost | Post /api/v2/upload/task | Установить цены и скидки |
| DefaultApi | ApiV2UploadTaskSizePost | Post /api/v2/upload/task/size | Установить цены для размеров |
| DefaultApi | ApiV3DbwWarehousesWarehouseIdContactsGet | Get /api/v3/dbw/warehouses/{warehouseId}/contacts | Список контактов |
| DefaultApi | ApiV3DbwWarehousesWarehouseIdContactsPut | Put /api/v3/dbw/warehouses/{warehouseId}/contacts | Обновить список контактов |
| DefaultApi | ApiV3OfficesGet | Get /api/v3/offices | Получить список складов WB |
| DefaultApi | ApiV3StocksWarehouseIdDelete | Delete /api/v3/stocks/{warehouseId} | Удалить остатки товаров |
| DefaultApi | ApiV3StocksWarehouseIdPost | Post /api/v3/stocks/{warehouseId} | Получить остатки товаров |
| DefaultApi | ApiV3StocksWarehouseIdPut | Put /api/v3/stocks/{warehouseId} | Обновить остатки товаров |
| DefaultApi | ApiV3WarehousesGet | Get /api/v3/warehouses | Получить список складов продавца |
| DefaultApi | ApiV3WarehousesPost | Post /api/v3/warehouses | Создать склад продавца |
| DefaultApi | ApiV3WarehousesWarehouseIdDelete | Delete /api/v3/warehouses/{warehouseId} | Удалить склад продавца |
| DefaultApi | ApiV3WarehousesWarehouseIdPut | Put /api/v3/warehouses/{warehouseId} | Обновить склад продавца |
| DefaultApi | ContentV2BarcodesPost | Post /content/v2/barcodes | Генерация баркодов |
| DefaultApi | ContentV2CardsDeleteTrashPost | Post /content/v2/cards/delete/trash | Перенос карточек товаров в корзину |
| DefaultApi | ContentV2CardsErrorListPost | Post /content/v2/cards/error/list | Список несозданных карточек товаров с ошибками |
| DefaultApi | ContentV2CardsLimitsGet | Get /content/v2/cards/limits | Лимиты карточек товаров |
| DefaultApi | ContentV2CardsMoveNmPost | Post /content/v2/cards/moveNm | Объединение и разъединение карточек товаров |
| DefaultApi | ContentV2CardsRecoverPost | Post /content/v2/cards/recover | Восстановление карточек товаров из корзины |
| DefaultApi | ContentV2CardsUpdatePost | Post /content/v2/cards/update | Редактирование карточек товаров |
| DefaultApi | ContentV2CardsUploadAddPost | Post /content/v2/cards/upload/add | Создание карточек товаров с присоединением |
| DefaultApi | ContentV2CardsUploadPost | Post /content/v2/cards/upload | Создание карточек товаров |
| DefaultApi | ContentV2DirectoryColorsGet | Get /content/v2/directory/colors | Цвет |
| DefaultApi | ContentV2DirectoryCountriesGet | Get /content/v2/directory/countries | Страна производства |
| DefaultApi | ContentV2DirectoryKindsGet | Get /content/v2/directory/kinds | Пол |
| DefaultApi | ContentV2DirectorySeasonsGet | Get /content/v2/directory/seasons | Сезон |
| DefaultApi | ContentV2DirectoryTnvedGet | Get /content/v2/directory/tnved | ТНВЭД-код |
| DefaultApi | ContentV2DirectoryVatGet | Get /content/v2/directory/vat | Ставка НДС |
| DefaultApi | ContentV2GetCardsListPost | Post /content/v2/get/cards/list | Список карточек товаров |
| DefaultApi | ContentV2GetCardsTrashPost | Post /content/v2/get/cards/trash | Список карточек товаров в корзине |
| DefaultApi | ContentV2ObjectAllGet | Get /content/v2/object/all | Список предметов |
| DefaultApi | ContentV2ObjectCharcsSubjectIdGet | Get /content/v2/object/charcs/{subjectId} | Характеристики предмета |
| DefaultApi | ContentV2ObjectParentAllGet | Get /content/v2/object/parent/all | Родительские категории товаров |
| DefaultApi | ContentV2TagIdDelete | Delete /content/v2/tag/{id} | Удаление ярлыка |
| DefaultApi | ContentV2TagIdPatch | Patch /content/v2/tag/{id} | Изменение ярлыка |
| DefaultApi | ContentV2TagNomenclatureLinkPost | Post /content/v2/tag/nomenclature/link | Управление ярлыками в карточке товара |
| DefaultApi | ContentV2TagPost | Post /content/v2/tag | Создание ярлыка |
| DefaultApi | ContentV2TagsGet | Get /content/v2/tags | Список ярлыков |
| DefaultApi | ContentV3MediaFilePost | Post /content/v3/media/file | Загрузить медиафайл |
| DefaultApi | ContentV3MediaSavePost | Post /content/v3/media/save | Загрузить медиафайлы по ссылкам |
Documentation For Models
- ApiV2BufferGoodsTaskGet200Response
- ApiV2BufferGoodsTaskGet200ResponseData
- ApiV2BufferTasksGet200Response
- ApiV2HistoryGoodsTaskGet200Response
- ApiV2HistoryGoodsTaskGet200ResponseData
- ApiV2HistoryTasksGet200Response
- ApiV2ListGoodsFilterGet200Response
- ApiV2ListGoodsFilterGet200ResponseData
- ApiV2ListGoodsFilterPostRequest
- ApiV2ListGoodsSizeNmGet200Response
- ApiV2ListGoodsSizeNmGet200ResponseData
- ApiV2QuarantineGoodsGet200Response
- ApiV2QuarantineGoodsGet200ResponseData
- ApiV2UploadTaskClubDiscountPostRequest
- ApiV2UploadTaskPostRequest
- ApiV2UploadTaskSizePostRequest
- ApiV3DbwWarehousesWarehouseIdContactsGet200Response
- ApiV3DbwWarehousesWarehouseIdContactsGet200ResponseContactsInner
- ApiV3StocksWarehouseIdDeleteRequest
- ApiV3StocksWarehouseIdPost200Response
- ApiV3StocksWarehouseIdPost200ResponseStocksInner
- ApiV3StocksWarehouseIdPostRequest
- ApiV3StocksWarehouseIdPut406Response
- ApiV3StocksWarehouseIdPutRequest
- ApiV3StocksWarehouseIdPutRequestStocksInner
- ApiV3WarehousesPost201Response
- ApiV3WarehousesPostRequest
- ClubDiscReq
- ContentV2BarcodesPost200Response
- ContentV2BarcodesPostRequest
- ContentV2CardsDeleteTrashPost200Response
- ContentV2CardsDeleteTrashPostRequest
- ContentV2CardsLimitsGet200Response
- ContentV2CardsLimitsGet200ResponseData
- ContentV2CardsMoveNmPost400Response
- ContentV2CardsMoveNmPostRequest
- ContentV2CardsUpdatePost413Response
- ContentV2CardsUpdatePostRequestInner
- ContentV2CardsUpdatePostRequestInnerCharacteristicsInner
- ContentV2CardsUpdatePostRequestInnerDimensions
- ContentV2CardsUpdatePostRequestInnerSizesInner
- ContentV2CardsUploadAddPostRequest
- ContentV2CardsUploadAddPostRequestCardsToAddInner
- ContentV2CardsUploadAddPostRequestCardsToAddInnerDimensions
- ContentV2CardsUploadPostRequestInner
- ContentV2CardsUploadPostRequestInnerVariantsInner
- ContentV2CardsUploadPostRequestInnerVariantsInnerDimensions
- ContentV2CardsUploadPostRequestInnerVariantsInnerSizesInner
- ContentV2DirectoryColorsGet200Response
- ContentV2DirectoryColorsGet200ResponseDataInner
- ContentV2DirectoryCountriesGet200Response
- ContentV2DirectoryCountriesGet200ResponseDataInner
- ContentV2DirectoryKindsGet200Response
- ContentV2DirectorySeasonsGet200Response
- ContentV2DirectoryTnvedGet200Response
- ContentV2DirectoryTnvedGet200ResponseDataInner
- ContentV2DirectoryVatGet200Response
- ContentV2GetCardsListPost200Response
- ContentV2GetCardsListPost200ResponseCardsInner
- ContentV2GetCardsListPost200ResponseCardsInnerCharacteristicsInner
- ContentV2GetCardsListPost200ResponseCardsInnerDimensions
- ContentV2GetCardsListPost200ResponseCardsInnerPhotosInner
- ContentV2GetCardsListPost200ResponseCardsInnerSizesInner
- ContentV2GetCardsListPost200ResponseCardsInnerTagsInner
- ContentV2GetCardsListPost200ResponseCardsInnerWholesale
- ContentV2GetCardsListPost200ResponseCursor
- ContentV2GetCardsListPostRequest
- ContentV2GetCardsListPostRequestSettings
- ContentV2GetCardsListPostRequestSettingsCursor
- ContentV2GetCardsListPostRequestSettingsFilter
- ContentV2GetCardsListPostRequestSettingsSort
- ContentV2GetCardsTrashPost200Response
- ContentV2GetCardsTrashPost200ResponseCardsInner
- ContentV2GetCardsTrashPost200ResponseCardsInnerSizesInner
- ContentV2GetCardsTrashPost200ResponseCursor
- ContentV2GetCardsTrashPostRequest
- ContentV2GetCardsTrashPostRequestSettings
- ContentV2GetCardsTrashPostRequestSettingsCursor
- ContentV2GetCardsTrashPostRequestSettingsFilter
- ContentV2GetCardsTrashPostRequestSettingsSort
- ContentV2ObjectAllGet200Response
- ContentV2ObjectAllGet200ResponseDataInner
- ContentV2ObjectCharcsSubjectIdGet200Response
- ContentV2ObjectCharcsSubjectIdGet200ResponseDataInner
- ContentV2ObjectParentAllGet200Response
- ContentV2ObjectParentAllGet200ResponseDataInner
- ContentV2ObjectParentAllGet401Response
- ContentV2TagIdPatchRequest
- ContentV2TagNomenclatureLinkPostRequest
- ContentV2TagPostRequest
- ContentV2TagsGet200Response
- ContentV2TagsGet200ResponseData
- ContentV3MediaFilePost200Response
- ContentV3MediaSavePostRequest
- Error
- Good
- GoodBufferHistory
- GoodHistory
- GoodsList
- GoodsListSizesInner
- MediaErrors
- ModelsErrorBrand
- ModelsErrorSubject
- ModelsErrorTableListPublicRespV2
- ModelsErrorTableListPublicRespV2Item
- Office
- QuarantineGoods
- RequestAlreadyExistsError
- RequestAlreadyExistsErrorData
- RequestMoveNmsImtConn
- RequestMoveNmsImtDisconn
- RequestPublicViewerPublicErrorsTableListV2
- ResponseBodyContentError400
- ResponseBodyContentError403
- ResponseCardCreate
- ResponseCardCreateAdditionalErrors
- ResponseCardCreateAdditionalErrorsOneOf
- ResponseCardCreateAdditionalErrorsOneOf1
- ResponseContentError
- ResponseError
- ResponseIncorrectDate
- ResponsePublicViewerPublicErrorsTableListV2
- SizeGood
- SizeGoodReq
- StocksWarehouseErrorInner
- StocksWarehouseErrorInnerDataInner
- StoreContactRequestBody
- StoreContactRequestBodyContactsInner
- SupplierTaskMetadata
- SupplierTaskMetadataBuffer
- SwaggerPublicErrorsCursorInput
- SwaggerPublicErrorsOrderV2
- TaskCreated
- TaskCreatedData
- ViewerContractPublicErrorsCursorOutput
- Warehouse
Documentation For Authorization
Authentication schemes defined for the API:
HeaderApiKey
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
Note, each API key must be added to a map of map[string]APIKey where the key is: HeaderApiKey and passed in as the auth context for each request.
Example
auth := context.WithValue(
context.Background(),
products.ContextAPIKeys,
map[string]products.APIKey{
"HeaderApiKey": {Key: "API_KEY_STRING"},
},
)
r, err := client.Service.Operation(auth, args)
Documentation for Utility Methods
Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:
PtrBoolPtrIntPtrInt32PtrInt64PtrFloatPtrFloat32PtrFloat64PtrStringPtrTime