commmented all data types and methods

This commit is contained in:
diPhantxm
2023-06-23 23:21:36 +03:00
committed by Kirill
parent f81e4ed350
commit 006ecdf877
3 changed files with 487 additions and 106 deletions

View File

@@ -12,208 +12,479 @@ type FBS struct {
} }
type ListUnprocessedShipmentsParams struct { type ListUnprocessedShipmentsParams struct {
Direction string `json:"dir"` // Sorting direction
Filter ListUnprocessedShipmentsFilter `json:"filter"` Direction Order `json:"dir"`
Limit int64 `json:"limit"`
Offset int64 `json:"offset"` // Request filter
With ListUnprocessedShipmentsWith `json:"with"` Filter ListUnprocessedShipmentsFilter `json:"filter"`
// Number of values in the response:
//
// maximum — 1000,
// minimum — 1.
Limit int64 `json:"limit"`
// Number of elements that will be skipped in the response.
// For example, if `offset` = 10, the response will start with the 11th element found
Offset int64 `json:"offset"`
// Additional fields that should be added to the response
With ListUnprocessedShipmentsWith `json:"with"`
} }
type ListUnprocessedShipmentsFilter struct { type ListUnprocessedShipmentsFilter struct {
CutoffFrom time.Time `json:"cutoff_from"` // Filter by the time by which the seller should pack the order. Period start.
CutoffTo time.Time `json:"cutoff_to"` //
// Format: YYYY-MM-DDThh: mm:ss. mcsZ. Example: 2020-03-18T07:34:50.359 Z
CutoffFrom time.Time `json:"cutoff_from"`
// Filter by the time by which the seller should pack the order. Period end.
//
// Format: YYYY-MM-DDThh: mm:ss. mcsZ. Example: 2020-03-18T07:34:50.359 Z
CutoffTo time.Time `json:"cutoff_to"`
// Minimum date when shipment should be handed over for delivery
DeliveringDateFrom time.Time `json:"delivering_date_from"` DeliveringDateFrom time.Time `json:"delivering_date_from"`
DeliveringDateTo time.Time `json:"delivering_date_to"`
DeliveryMethodId []int64 `json:"deliveryMethodId"` // Maximum date when shipment should be handed over for delivery
ProviderId []int64 `json:"provider_id"` DeliveringDateTo time.Time `json:"delivering_date_to"`
Status string `json:"status"`
WarehouseId []int64 `json:"warehouse_id"` // Delivery method identifier
DeliveryMethodId []int64 `json:"delivery_method_id"`
// Delivery service identifier
ProviderId []int64 `json:"provider_id"`
// Shipment status
Status string `json:"status"`
// Warehouse identifier
WarehouseId []int64 `json:"warehouse_id"`
} }
type ListUnprocessedShipmentsWith struct { type ListUnprocessedShipmentsWith struct {
// Add analytics data to the response
AnalyticsData bool `json:"analytics_data"` AnalyticsData bool `json:"analytics_data"`
Barcodes bool `json:"barcodes"`
// Add the shipment barcodes to the response
Barcodes bool `json:"barcodes"`
// Add financial data to the response
FinancialData bool `json:"financial_data"` FinancialData bool `json:"financial_data"`
Translit bool `json:"translit"`
// Transliterate the return values
Translit bool `json:"translit"`
} }
type ListUnprocessedShipmentsResponse struct { type ListUnprocessedShipmentsResponse struct {
core.CommonResponse core.CommonResponse
// Request result
Result ListUnprocessedShipmentsResult `json:"result"` Result ListUnprocessedShipmentsResult `json:"result"`
} }
type ListUnprocessedShipmentsResult struct { type ListUnprocessedShipmentsResult struct {
Count int64 `json:"count"` // Element counter in the response
Count int64 `json:"count"`
// List of shipments and detailed information on each one
Postings []FBSPosting `json:"postings"` Postings []FBSPosting `json:"postings"`
} }
type FBSPosting struct { type FBSPosting struct {
// Recipient details
Addressee FBSPostingAddressee `json:"addressee"` Addressee FBSPostingAddressee `json:"addressee"`
// Analytics data
AnalyticsData FBSPostingAnalyticsData `json:"analytics_data"` AnalyticsData FBSPostingAnalyticsData `json:"analytics_data"`
// Shipment barcodes
Barcodes FBSBarcode `json:"barcodes"` Barcodes FBSBarcode `json:"barcodes"`
// Cancellation details
Cancellation FBSCancellation `json:"cancellation"` Cancellation FBSCancellation `json:"cancellation"`
// Customer details
Customer FBSCustomer `json:"customer"` Customer FBSCustomer `json:"customer"`
// Date when the shipment was transferred for delivery
DeliveringDate time.Time `json:"delivering_date"` DeliveringDate time.Time `json:"delivering_date"`
// Delivery method
DeliveryMethod FBSDeliveryMethod `json:"delivery_method"` DeliveryMethod FBSDeliveryMethod `json:"delivery_method"`
// Data on the product cost, discount amount, payout and commission
FinancialData FBSFinancialData `json:"financial_data"` FinancialData FBSFinancialData `json:"financial_data"`
InProccessAt time.Time `json:"in_process_at"` // Start date and time of shipment processing
IsExpress bool `json:"is_express"` InProccessAt time.Time `json:"in_process_at"`
IsMultibox bool `json:"is_multibox"`
MultiBoxQuantity int32 `json:"multi_box_qty"`
OrderId int64 `json:"order_id"`
OrderNumber string `json:"order_number"`
ParentPostingNumber string `json:"parent_posting_number"`
PostingNumber string `json:"posting_number"`
// If Ozon Express fast delivery was used — `true`
IsExpress bool `json:"is_express"`
// Indication that there is a multi-box product in the shipment
// and you need to pass the number of boxes for it
IsMultibox bool `json:"is_multibox"`
// Number of boxes in which the product is packed
MultiBoxQuantity int32 `json:"multi_box_qty"`
// Identifier of the order to which the shipment belongs
OrderId int64 `json:"order_id"`
// Number of the order to which the shipment belongs
OrderNumber string `json:"order_number"`
// Number of the parent shipment which split resulted in the current shipment
ParentPostingNumber string `json:"parent_posting_number"`
// Shipment number
PostingNumber string `json:"posting_number"`
// List of products in the shipment
Products []PostingProduct `json:"products"` Products []PostingProduct `json:"products"`
// The parameter is only relevant for bulky products // The parameter is only relevant for bulky products
// with a delivery by a third-party or integrated service // with a delivery by a third-party or integrated service
PRROption PRROptionStatus `json:"prr_option"` PRROption PRROptionStatus `json:"prr_option"`
// Array of Ozon Product IDs (SKU) for which you need to pass the
// customs cargo declaration (CCD) number, the manufacturing country,
// product batch registration number, or "Chestny ZNAK" labeling to
// change the shipment status to the next one
Requirements FBSRequirements `json:"requirements"` Requirements FBSRequirements `json:"requirements"`
ShipmentDate time.Time `json:"shipment_date"` // Date and time before which the shipment must be packaged.
Status string `json:"status"` // If the shipment is not packaged by this date, it will be
TPLIntegrationType string `json:"tpl_integration_type"` // canceled automatically
TrackingNumber string `json:"tracking_number"` ShipmentDate time.Time `json:"shipment_date"`
// Shipment status
Status string `json:"status"`
// Shipment substatus
Substatus string `json:"substatus"`
// Type of integration with the delivery service
TPLIntegrationType string `json:"tpl_integration_type"`
// Shipment tracking number
TrackingNumber string `json:"tracking_number"`
} }
type FBSPostingAddressee struct { type FBSPostingAddressee struct {
Name string `json:"name"` // Recipient name
Name string `json:"name"`
// Recipient phone number.
//
// Returns an empty string
Phone string `json:"phone"` Phone string `json:"phone"`
} }
type FBSPostingAnalyticsData struct { type FBSPostingAnalyticsData struct {
City string `json:"city"` // Delivery city
DeliveryDateBegin time.Time `json:"delivery_date_begin"` City string `json:"city"`
DeliveryDateEnd time.Time `json:"delivery_date_end"`
DeliveryType string `json:"delivery_type"` // Delivery start date and time
IsLegal bool `json:"is_legal"` DeliveryDateBegin time.Time `json:"delivery_date_begin"`
IsPremium bool `json:"is_premium"`
PaymentTypeGroupName string `json:"payment_type_group_name"` // Delivery end date and time
Region string `json:"region"` DeliveryDateEnd time.Time `json:"delivery_date_end"`
TPLProvider string `json:"tpl_provider"`
TPLProviderId int64 `json:"tpl_provider_id"` // Delivery method
Warehouse string `json:"warehouse"` DeliveryType string `json:"delivery_type"`
WarehouseId int64 `json:"warehouse_id"`
// Indication that the recipient is a legal entity:
//
// true — a legal entity,
// false — a natural person
IsLegal bool `json:"is_legal"`
// Premium subscription availability
IsPremium bool `json:"is_premium"`
// Payment method
PaymentTypeGroupName string `json:"payment_type_group_name"`
// Delivery region
Region string `json:"region"`
// Delivery service
TPLProvider string `json:"tpl_provider"`
// Delivery service identifier
TPLProviderId int64 `json:"tpl_provider_id"`
// Order shipping warehouse name
Warehouse string `json:"warehouse"`
// Warehouse identifier
WarehouseId int64 `json:"warehouse_id"`
} }
type FBSBarcode struct { type FBSBarcode struct {
// Lower barcode on the shipment label
LowerBarcode string `json:"lower_barcode"` LowerBarcode string `json:"lower_barcode"`
// Upper barcode on the shipment label
UpperBarcode string `json:"upper_barcode"` UpperBarcode string `json:"upper_barcode"`
} }
type FBSCancellation struct { type FBSCancellation struct {
AffectCancellationRating bool `json:"affect_cancellation_rating"` // If the cancellation affects the seller's rating—true
CancelReason string `json:"cancel_reason"` AffectCancellationRating bool `json:"affect_cancellation_rating"`
CancelReasonId int64 `json:"cancel_reason_id"`
CancellationInitiator string `json:"cancellation_initiator"` // Cancellation reason
CancellationType string `json:"cancellation_type"` CancelReason string `json:"cancel_reason"`
CancelledAfterShip bool `json:"cancelled_after_ship"`
// Cancellation reason identifier
CancelReasonId int64 `json:"cancel_reason_id"`
// Shipment cancellation initiator:
//
// Клиент—client,
// Ozon,
// Продавец—seller
CancellationInitiator string `json:"cancellation_initiator"`
// Cancellation type:
//
// client—canceled by client.
// ozon—canceled by Ozon.
// seller—canceled by seller
CancellationType string `json:"cancellation_type"`
// If the cancellation occurred after the shipment had been packaged—true
CancelledAfterShip bool `json:"cancelled_after_ship"`
} }
type FBSDeliveryMethod struct { type FBSDeliveryMethod struct {
Id int64 `json:"id"` // Delivery method identifier
Name string `json:"name"` Id int64 `json:"id"`
TPLProvider string `json:"tpl_provider"`
TPLProviderId int64 `json:"tpl_provider_id"` // Delivery method name
Warehouse string `json:"warehouse"` Name string `json:"name"`
WarehouseId int64 `json:"warehouse_id"`
// Delivery service
TPLProvider string `json:"tpl_provider"`
// Delivery service identifier
TPLProviderId int64 `json:"tpl_provider_id"`
// Warehouse name
Warehouse string `json:"warehouse"`
// Warehouse identifier
WarehouseId int64 `json:"warehouse_id"`
} }
type FBSFinancialData struct { type FBSFinancialData struct {
ClusterFrom string `json:"cluster_from"` // Identifier of the cluster, where the shipment is sent from
ClusterTo string `json:"cluster_to"` ClusterFrom string `json:"cluster_from"`
PostingServices MarketplaceServices `json:"posting_services"`
Products []FinancialDataProduct `json:"products"` // Identifier of the cluster, where the shipment is delivered
ClusterTo string `json:"cluster_to"`
// Services
PostingServices MarketplaceServices `json:"posting_services"`
// List of products in the shipment
Products []FinancialDataProduct `json:"products"`
} }
type FBSRequirements struct { type FBSRequirements struct {
ProductsRequiringGTD []string `json:"products_requiring_gtd"` // Array of Ozon Product IDs (SKU) for which you need to pass the customs cargo declaration (CCD) numbers.
ProductsRequiringCountry []string `json:"products_requiring_country"` //
// To pack the shipment, pass the CCD number for all listed SKUs.
// If you do not have a CCD number, pass the value `is_gtd_absent` = true
// via the `/v3/posting/fbs/ship/package` or `/v3/posting/fbs/ship` method
ProductsRequiringGTD []string `json:"products_requiring_gtd"`
// Array of Ozon Product IDs (SKU) for which
// you need to pass the manufacturing country.
//
// To pack the shipment, pass the manufacturing
// country value for all listed SKUs via the `/v2/posting/fbs/product/country/set` method
ProductsRequiringCountry []string `json:"products_requiring_country"`
// Array of Ozon Product IDs (SKU) for which you need to pass the "Chestny ZNAK" labeling
ProductsRequiringMandatoryMark []string `json:"products_requiring_mandatory_mark"` ProductsRequiringMandatoryMark []string `json:"products_requiring_mandatory_mark"`
ProductsRequiringRNPT []string `json:"products_requiring_rnpt"`
// Array of Ozon Product IDs (SKU) for which you need to pass a product batch registration number
ProductsRequiringRNPT []string `json:"products_requiring_rnpt"`
} }
type PostingProduct struct { type PostingProduct struct {
// Mandatory product labeling
MandatoryMark []string `json:"mandatory_mark"` MandatoryMark []string `json:"mandatory_mark"`
Name string `json:"name"`
OfferId string `json:"offer_id"` // Product name
CurrencyCode string `json:"currency_code"` Name string `json:"name"`
Price string `json:"price"`
Quantity int32 `json:"quantity"` // Product identifier in the seller's system
SKU int64 `json:"sku"` OfferId string `json:"offer_id"`
// Currency of your prices. It matches the one set in the personal account settings
CurrencyCode string `json:"currency_code"`
// Product price
Price string `json:"price"`
// Product quantity in the shipment
Quantity int32 `json:"quantity"`
// Product identifier in the Ozon system, SKU
SKU int64 `json:"sku"`
} }
type FBSCustomer struct { type FBSCustomer struct {
// Delivery address details
Address FBSCustomerAddress `json:"customer"` Address FBSCustomerAddress `json:"customer"`
// Customer e-mail
CustomerEmail string `json:"customer_email"` CustomerEmail string `json:"customer_email"`
CustomerId int64 `json:"customer_id"`
Name string `json:"name"` // Customer identifier
Phone string `json:"phone"` CustomerId int64 `json:"customer_id"`
// Customer name
Name string `json:"name"`
// Customer phone number.
//
// Returns an empty string
Phone string `json:"phone"`
} }
type FBSCustomerAddress struct { type FBSCustomerAddress struct {
AddressTail string `json:"address_tail"` // Address in text format
City string `json:"city"` AddressTail string `json:"address_tail"`
Comment string `json:"comment"`
Country string `json:"country"` // Delivery city
District string `json:"district"` City string `json:"city"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"` // Comment on the order
ProviderPVZCode string `json:"provider_pvz_code"` Comment string `json:"comment"`
PVZCode int64 `json:"pvz_code"`
Region string `json:"region"` // Delivery country
ZIPCode string `json:"zip_code"` Country string `json:"country"`
// Delivery area
District string `json:"district"`
// Latitude
Latitude float64 `json:"latitude"`
// Longitude
Longitude float64 `json:"longitude"`
// 3PL pick-up point code
ProviderPVZCode string `json:"provider_pvz_code"`
// Pick-up point code
PVZCode int64 `json:"pvz_code"`
// Delivery region
Region string `json:"region"`
// Recipient postal code
ZIPCode string `json:"zip_code"`
} }
type MarketplaceServices struct { type MarketplaceServices struct {
DeliveryToCustomer float64 `json:"marketplace_service_item_deliv_to_customer"` // Last mile
DirectFlowTrans float64 `json:"marketplace_service_item_direct_flow_trans"` DeliveryToCustomer float64 `json:"marketplace_service_item_deliv_to_customer"`
DropoffFF float64 `json:"marketplace_service_item_item_dropoff_ff"`
DropoffPVZ float64 `json:"marketplace_service_item_dropoff_pvz"` // Pipeline
DropoffSC float64 `json:"marketplace_service_item_dropoff_sc"` DirectFlowTrans float64 `json:"marketplace_service_item_direct_flow_trans"`
Fulfillment float64 `json:"marketplace_service_item_fulfillment"`
Pickup float64 `json:"marketplace_service_item_pickup"` // Shipment processing in the fulfilment warehouse (FF)
DropoffFF float64 `json:"marketplace_service_item_item_dropoff_ff"`
// Shipment processing at the pick up point
DropoffPVZ float64 `json:"marketplace_service_item_dropoff_pvz"`
// Shipment processing at the sorting center
DropoffSC float64 `json:"marketplace_service_item_dropoff_sc"`
// Order packaging
Fulfillment float64 `json:"marketplace_service_item_fulfillment"`
// Transport arrival to the seller's address for shipments pick-up (Pick-up)
Pickup float64 `json:"marketplace_service_item_pickup"`
// Return processing
ReturnAfterDeliveryToCustomer float64 `json:"marketplace_service_item_return_after_deliv_to_customer"` ReturnAfterDeliveryToCustomer float64 `json:"marketplace_service_item_return_after_deliv_to_customer"`
ReturnFlowTrans float64 `json:"marketplace_service_item_return_flow_trans"`
ReturnNotDeliveryToCustomer float64 `json:"marketplace_service_item_return_not_deliv_to_customer"` // Reverse pipeline
ReturnPartGoodsCustomer float64 `json:"marketplace_service_item_return_part_goods_customer"` ReturnFlowTrans float64 `json:"marketplace_service_item_return_flow_trans"`
// Cancellations processing
ReturnNotDeliveryToCustomer float64 `json:"marketplace_service_item_return_not_deliv_to_customer"`
// Non-purchase processing
ReturnPartGoodsCustomer float64 `json:"marketplace_service_item_return_part_goods_customer"`
} }
type FinancialDataProduct struct { type FinancialDataProduct struct {
Actions []string `json:"actions"` // Actions
ClientPrice string `json:"client_price"` Actions []string `json:"actions"`
CommissionAmount float64 `json:"commission_amount"`
CommissionPercent int64 `json:"commission_percent"` // Customer price
CommissionsCurrencyCode string `json:"commissions_currency_code"` ClientPrice string `json:"client_price"`
ItemServices MarketplaceServices `json:"item_services"`
CurrencyCode string `json:"currency_code"` // Commission amount for the product
OldPrice float64 `json:"old_price"` CommissionAmount float64 `json:"commission_amount"`
Payout float64 `json:"payout"`
Picking FinancialDataProductPicking `json:"picking"` // Commission percentage
Price float64 `json:"price"` CommissionPercent int64 `json:"commission_percent"`
ProductId int64 `json:"product_id"`
Quantity int64 `json:"quantity"` // Code of the currency used to calculate the commissions
TotalDiscountPercent float64 `json:"total_discount_percent"` CommissionsCurrencyCode string `json:"commissions_currency_code"`
TotalDiscountValue float64 `json:"total_discount_value"`
// Services
ItemServices MarketplaceServices `json:"item_services"`
// Currency of your prices. It matches the currency set in the personal account settings
CurrencyCode string `json:"currency_code"`
// Price before discounts. Displayed strikethrough on the product description page
OldPrice float64 `json:"old_price"`
// Payment to the seller
Payout float64 `json:"payout"`
// Delivery details.
//
// Returns `null`
Picking FinancialDataProductPicking `json:"picking"`
// Product price including discounts. This value is shown on the product description page
Price float64 `json:"price"`
// Product identifier
ProductId int64 `json:"product_id"`
// Product quantity in the shipment
Quantity int64 `json:"quantity"`
// Discount percentage
TotalDiscountPercent float64 `json:"total_discount_percent"`
// Discount amount
TotalDiscountValue float64 `json:"total_discount_value"`
} }
type FinancialDataProductPicking struct { type FinancialDataProductPicking struct {
Amount float64 `json:"amount"` // Delivery cost
Amount float64 `json:"amount"`
// Delivery date and time
Moment time.Time `json:"moment"` Moment time.Time `json:"moment"`
Tag string `json:"tag"`
// Bulky products or not
Tag string `json:"tag"`
} }
func (c FBS) ListUnprocessedShipments(params *ListUnprocessedShipmentsParams) (*ListUnprocessedShipmentsResponse, error) { func (c FBS) ListUnprocessedShipments(params *ListUnprocessedShipmentsParams) (*ListUnprocessedShipmentsResponse, error) {

View File

@@ -239,114 +239,156 @@ type GetFinancialResultResultDetail struct {
// Orders // Orders
Delivery GetFinancialResultResultDetailDelivery `json:"delivery"` Delivery GetFinancialResultResultDetailDelivery `json:"delivery"`
// Amount to be paid for the period
InvoiceTransfer float64 `json:"invoice_transfer"` InvoiceTransfer float64 `json:"invoice_transfer"`
// Transfer under loan agreements
Loan float64 `json:"loan"` Loan float64 `json:"loan"`
// Paid for the period
Payments []GetFinancialResultResultDetailPayment `json:"payments"` Payments []GetFinancialResultResultDetailPayment `json:"payments"`
// Period data
Period GetFinancialResultResultDetailPeriod `json:"period"` Period GetFinancialResultResultDetailPeriod `json:"period"`
// Returns and cancellations
Return GetFinancialResultResultDetailReturn `json:"return"` Return GetFinancialResultResultDetailReturn `json:"return"`
// rFBS transfers
RFBS GetFinancialResultResultDetailRFBS `json:"rfbs"` RFBS GetFinancialResultResultDetailRFBS `json:"rfbs"`
// Services
Services GetFinancialResultResultDetailService `json:"services"` Services GetFinancialResultResultDetailService `json:"services"`
// Compensation and other accruals
Others GetFinancialResultResultDetailOthers `json:"others"` Others GetFinancialResultResultDetailOthers `json:"others"`
// Balance at the end of the period
EndBalanceAmount float64 `json:"end_balance_amount"` EndBalanceAmount float64 `json:"end_balance_amount"`
} }
type GetFinancialResultResultDetailDelivery struct { type GetFinancialResultResultDetailDelivery struct {
// Total amount
Total float64 `json:"total"` Total float64 `json:"total"`
// Amount for which products were purchased, including commission fees
Amount float64 `json:"amount"` Amount float64 `json:"amount"`
// Processing and delivery fees
DeliveryServices GetFinancialResultResultDetailDeliveryServices `json:"delivery_services"` DeliveryServices GetFinancialResultResultDetailDeliveryServices `json:"delivery_services"`
} }
type GetFinancialResultResultDetailDeliveryServices struct { type GetFinancialResultResultDetailDeliveryServices struct {
// Total amount
Total float64 `json:"total"` Total float64 `json:"total"`
// Details
Items []GetFinancialResultResultDetailDeliveryServicesItem `json:"items"` Items []GetFinancialResultResultDetailDeliveryServicesItem `json:"items"`
} }
type GetFinancialResultResultDetailDeliveryServicesItem struct { type GetFinancialResultResultDetailDeliveryServicesItem struct {
// Operation name
Name DetailsDeliveryItemName `json:"name"` Name DetailsDeliveryItemName `json:"name"`
// Amount by operation
Price float64 `json:"price"` Price float64 `json:"price"`
} }
type GetFinancialResultResultDetailPayment struct { type GetFinancialResultResultDetailPayment struct {
// Currency
CurrencyCode string `json:"currency_code"` CurrencyCode string `json:"currency_code"`
// Payment amount
Payment float64 `json:"payment"` Payment float64 `json:"payment"`
} }
type GetFinancialResultResultDetailPeriod struct { type GetFinancialResultResultDetailPeriod struct {
// Period start
Begin time.Time `json:"begin"` Begin time.Time `json:"begin"`
// Period end
End time.Time `json:"end"` End time.Time `json:"end"`
// Period identifier
Id int64 `json:"id"` Id int64 `json:"id"`
} }
type GetFinancialResultResultDetailReturn struct { type GetFinancialResultResultDetailReturn struct {
// Total amount
Total float64 `json:"total"` Total float64 `json:"total"`
// Amount of returns received, including commission fees
Amount float64 `json:"amount"` Amount float64 `json:"amount"`
// Returns and cancellation fees
ReturnServices GetFinancialResultResultDetailReturnServices `json:"return_services"` ReturnServices GetFinancialResultResultDetailReturnServices `json:"return_services"`
} }
type GetFinancialResultResultDetailReturnServices struct { type GetFinancialResultResultDetailReturnServices struct {
// Total amount
Total float64 `json:"total"` Total float64 `json:"total"`
// Details
Items []GetFinancialResultResultDetailReturnServicesItem `json:"items"` Items []GetFinancialResultResultDetailReturnServicesItem `json:"items"`
} }
type GetFinancialResultResultDetailReturnServicesItem struct { type GetFinancialResultResultDetailReturnServicesItem struct {
// Operation name
Name DetailsReturnServiceName `json:"name"` Name DetailsReturnServiceName `json:"name"`
// Amount by operation
Price float64 `json:"price"` Price float64 `json:"price"`
} }
type GetFinancialResultResultDetailRFBS struct { type GetFinancialResultResultDetailRFBS struct {
// Total amount
Total float64 `json:"total"` Total float64 `json:"total"`
// Transfers from customers
TransferDelivery float64 `json:"transfer_delivery"` TransferDelivery float64 `json:"transfer_delivery"`
// Return of transfers to customers
TransferDeliveryReturn float64 `json:"transfer_delivery_return"` TransferDeliveryReturn float64 `json:"transfer_delivery_return"`
// Compensation of delivery fees
CompensationDeliveryReturn float64 `json:"compensation_delivery_return"` CompensationDeliveryReturn float64 `json:"compensation_delivery_return"`
// Transfers of partial refunds to customers
PartialCompensation float64 `json:"partial_compensation"` PartialCompensation float64 `json:"partial_compensation"`
// Compensation of partial refunds
PartialCompensationReturn float64 `json:"partial_compensation_return"` PartialCompensationReturn float64 `json:"partial_compensation_return"`
} }
type GetFinancialResultResultDetailService struct { type GetFinancialResultResultDetailService struct {
// Total amount
Total float64 `json:"total"` Total float64 `json:"total"`
// Details
Items []GetFinancialResultResultDetailServiceItem `json:"items"` Items []GetFinancialResultResultDetailServiceItem `json:"items"`
} }
type GetFinancialResultResultDetailServiceItem struct { type GetFinancialResultResultDetailServiceItem struct {
// Operation name
Name DetailsServiceItemName `json:"name"` Name DetailsServiceItemName `json:"name"`
// Amount by operation
Price float64 `json:"price"` Price float64 `json:"price"`
} }
type GetFinancialResultResultDetailOthers struct { type GetFinancialResultResultDetailOthers struct {
// Total amount
Total float64 `json:"total"` Total float64 `json:"total"`
// Details
Items []GetFinancialResultResultDetailOthersItem `json:"items"` Items []GetFinancialResultResultDetailOthersItem `json:"items"`
} }
type GetFinancialResultResultDetailOthersItem struct { type GetFinancialResultResultDetailOthersItem struct {
// Operation name
Name DetailsOtherItemName `json:"name"` Name DetailsOtherItemName `json:"name"`
// Amount by operation
Price float64 `json:"price"` Price float64 `json:"price"`
} }

View File

@@ -11,25 +11,33 @@ type Strategies struct {
} }
type ListCompetitorsParams struct { type ListCompetitorsParams struct {
// Page number from which you want to download the list of competitors.
// The minimum value is 1
Page int64 `json:"page"` Page int64 `json:"page"`
// Maximum number of competitors on the page. Allowed values: 150
Limit int64 `json:"limit"` Limit int64 `json:"limit"`
} }
type ListCompetitorsResponse struct { type ListCompetitorsResponse struct {
core.CommonResponse core.CommonResponse
// List of competitors
Competitors []ListCompetitorsCompetitor `json:"competitors"` Competitors []ListCompetitorsCompetitor `json:"competitors"`
// Total number of competitors
Total int32 `json:"total"` Total int32 `json:"total"`
} }
type ListCompetitorsCompetitor struct { type ListCompetitorsCompetitor struct {
// Competitor's name
Name string `json:"name"` Name string `json:"name"`
// Competitor identifier
Id int64 `json:"id"` Id int64 `json:"id"`
} }
// Method for getting a list of competitors—sellers with similar products in other online stores and marketplaces
func (c Strategies) ListCompetitors(params *ListCompetitorsParams) (*ListCompetitorsResponse, error) { func (c Strategies) ListCompetitors(params *ListCompetitorsParams) (*ListCompetitorsResponse, error) {
url := "/v1/pricing-strategy/competitors/list" url := "/v1/pricing-strategy/competitors/list"
@@ -45,34 +53,47 @@ func (c Strategies) ListCompetitors(params *ListCompetitorsParams) (*ListCompeti
} }
type ListStrategiesParams struct { type ListStrategiesParams struct {
// Page number from which you want to download the list of competitors.
// The minimum value is 1
Page int64 `json:"page"` Page int64 `json:"page"`
// Maximum number of competitors on the page. Allowed values: 150
Limit int64 `json:"limit"` Limit int64 `json:"limit"`
} }
type ListStrategiesResponse struct { type ListStrategiesResponse struct {
core.CommonResponse core.CommonResponse
// List of strategies
Strategies []ListStrategiesStrategy `json:"strategies"` Strategies []ListStrategiesStrategy `json:"strategies"`
// Total number of strategies
Total int32 `json:"total"` Total int32 `json:"total"`
} }
type ListStrategiesStrategy struct { type ListStrategiesStrategy struct {
// Strategy identifier
Id string `json:"id"` Id string `json:"id"`
// Strategy name
Name string `json:"name"` Name string `json:"name"`
// Strategy type
Type StrategyType `json:"type"` Type StrategyType `json:"type"`
// Type of the last strategy change
UpdateType StrategyUpdateType `json:"update_type"` UpdateType StrategyUpdateType `json:"update_type"`
// Date of last change
UpdatedAt string `json:"updated_at"` UpdatedAt string `json:"updated_at"`
// Number of products in the strategy
ProductsCount int64 `json:"products_count"` ProductsCount int64 `json:"products_count"`
// Number of selected competitors
CompetitorsCount int64 `json:"competitors_count"` CompetitorsCount int64 `json:"competitors_count"`
// Strategy status
Enabled bool `json:"enabled"` Enabled bool `json:"enabled"`
} }
@@ -91,24 +112,31 @@ func (c Strategies) List(params *ListStrategiesParams) (*ListStrategiesResponse,
} }
type CreateStrategyParams struct { type CreateStrategyParams struct {
// List of competitors
Competitors []CreateStrategyCompetitor `json:"competitors"` Competitors []CreateStrategyCompetitor `json:"competitors"`
// Strategy name
StrategyName string `json:"strategy_name"` StrategyName string `json:"strategy_name"`
} }
type CreateStrategyCompetitor struct { type CreateStrategyCompetitor struct {
// Coefficient by which the minimum price among competitors will be multiplied.
// The allowed range is from 0.5 to 1.2
Coefficient float32 `json:"coefficient"` Coefficient float32 `json:"coefficient"`
// Competitor identifier
CompetitorId int64 `json:"competitor_id"` CompetitorId int64 `json:"competitor_id"`
} }
type CreateStrategyResponse struct { type CreateStrategyResponse struct {
core.CommonResponse core.CommonResponse
// Method result
Result CreateStrategyResult `json:"result"` Result CreateStrategyResult `json:"result"`
} }
type CreateStrategyResult struct { type CreateStrategyResult struct {
// Strategy identifier
StrategyId string `json:"strategy_id"` StrategyId string `json:"strategy_id"`
} }
@@ -127,24 +155,31 @@ func (c Strategies) Create(params *CreateStrategyParams) (*CreateStrategyRespons
} }
type InfoStrategyParams struct { type InfoStrategyParams struct {
// Strategy identifier
StrategyId string `json:"strategy_id"` StrategyId string `json:"strategy_id"`
} }
type InfoStrategyResponse struct { type InfoStrategyResponse struct {
core.CommonResponse core.CommonResponse
// Method result
Result InfoStrategyResult `json:"result"` Result InfoStrategyResult `json:"result"`
} }
type InfoStrategyResult struct { type InfoStrategyResult struct {
// List of competitors
Competitors []CreateStrategyCompetitor `json:"competitors"` Competitors []CreateStrategyCompetitor `json:"competitors"`
// Strategy status
Enabled bool `json:"enabled"` Enabled bool `json:"enabled"`
// Strategy name
Name string `json:"name"` Name string `json:"name"`
// Strategy type
Type StrategyType `json:"type"` Type StrategyType `json:"type"`
// Type of the last strategy change
UpdateType StrategyUpdateType `json:"update_type"` UpdateType StrategyUpdateType `json:"update_type"`
} }
@@ -163,10 +198,13 @@ func (c Strategies) Info(params *InfoStrategyParams) (*InfoStrategyResponse, err
} }
type UpdateStrategyParams struct { type UpdateStrategyParams struct {
// List of competitors
Competitors []CreateStrategyCompetitor `json:"competitors"` Competitors []CreateStrategyCompetitor `json:"competitors"`
// Product identifier
StrategyId string `json:"strategy_id"` StrategyId string `json:"strategy_id"`
// Strategy name
StrategyName string `json:"strategy_name"` StrategyName string `json:"strategy_name"`
} }
@@ -189,28 +227,36 @@ func (c Strategies) Update(params *UpdateStrategyParams) (*UpdateStrategyRespons
} }
type AddProductsToStrategyParams struct { type AddProductsToStrategyParams struct {
// List of product identifiers. The maximum number is 50
ProductId []int64 `json:"product_id"` ProductId []int64 `json:"product_id"`
// Product identifier
StrategyId string `json:"strategy_id"` StrategyId string `json:"strategy_id"`
} }
type AddProductsToStrategyResponse struct { type AddProductsToStrategyResponse struct {
core.CommonResponse core.CommonResponse
// Method result
Result AddProductsToStrategyResult `json:"result"` Result AddProductsToStrategyResult `json:"result"`
} }
type AddProductsToStrategyResult struct { type AddProductsToStrategyResult struct {
// Products with errors
Errors []AddProductsToStrategyResultError `json:"errors"` Errors []AddProductsToStrategyResultError `json:"errors"`
// Number of products with errors
FailedProductCount int32 `json:"failed_product_count"` FailedProductCount int32 `json:"failed_product_count"`
} }
type AddProductsToStrategyResultError struct { type AddProductsToStrategyResultError struct {
// Error code
Code string `json:"code"` Code string `json:"code"`
// Error message
Error string `json:"error"` Error string `json:"error"`
// Product identifier
ProductId int64 `json:"product_id"` ProductId int64 `json:"product_id"`
} }
@@ -229,22 +275,27 @@ func (c Strategies) AddProducts(params *AddProductsToStrategyParams) (*AddProduc
} }
type GetStrategiesByProductIdsParams struct { type GetStrategiesByProductIdsParams struct {
// List of product identifiers. The maximum number is 50
ProductId []int64 `json:"product_id"` ProductId []int64 `json:"product_id"`
} }
type GetStrategiesByProductIdsResponse struct { type GetStrategiesByProductIdsResponse struct {
core.CommonResponse core.CommonResponse
// Method result
Result GetStrategiesByProductIdsResult `json:"result"` Result GetStrategiesByProductIdsResult `json:"result"`
} }
type GetStrategiesByProductIdsResult struct { type GetStrategiesByProductIdsResult struct {
// Product information
ProductsInfo []GetStrategiesByProductIdsResultProductInfo `json:"products_info"` ProductsInfo []GetStrategiesByProductIdsResultProductInfo `json:"products_info"`
} }
type GetStrategiesByProductIdsResultProductInfo struct { type GetStrategiesByProductIdsResultProductInfo struct {
// Product identifier
ProductId int64 `json:"product_id"` ProductId int64 `json:"product_id"`
// Strategy identifier to which the product is bounded
StrategyId string `json:"strategy_id"` StrategyId string `json:"strategy_id"`
} }
@@ -263,16 +314,19 @@ func (c Strategies) GetByProductIds(params *GetStrategiesByProductIdsParams) (*G
} }
type ListProductsInStrategyParams struct { type ListProductsInStrategyParams struct {
// Strategy identifier
StrategyId string `json:"strategy_id"` StrategyId string `json:"strategy_id"`
} }
type ListProductsInStrategyResponse struct { type ListProductsInStrategyResponse struct {
core.CommonResponse core.CommonResponse
// Method result
Result ListProductsInStrategyResult `json:"result"` Result ListProductsInStrategyResult `json:"result"`
} }
type ListProductsInStrategyResult struct { type ListProductsInStrategyResult struct {
// Product identifier
ProductId []string `json:"product_id"` ProductId []string `json:"product_id"`
} }
@@ -291,26 +345,34 @@ func (c Strategies) ListProducts(params *ListProductsInStrategyParams) (*ListPro
} }
type GetCompetitorPriceParams struct { type GetCompetitorPriceParams struct {
// Product identifier
ProductId int64 `json:"product_id"` ProductId int64 `json:"product_id"`
} }
type GetCompetitorPriceResponse struct { type GetCompetitorPriceResponse struct {
core.CommonResponse core.CommonResponse
// Method result
Result GetCompetitorPriceResult `json:"result"` Result GetCompetitorPriceResult `json:"result"`
} }
type GetCompetitorPriceResult struct { type GetCompetitorPriceResult struct {
// Product identifier
StrategyId string `json:"strategy_id"` StrategyId string `json:"strategy_id"`
// true if the product is in the pricing strategy
IsEnabled bool `json:"is_enabled"` IsEnabled bool `json:"is_enabled"`
// Price of product in the strategy
StrategyProductPrice int32 `json:"strategy_product_price"` StrategyProductPrice int32 `json:"strategy_product_price"`
// Price setting date
PriceDownloadedAt string `json:"price_downloaded_at"` PriceDownloadedAt string `json:"price_downloaded_at"`
// Competitor identifier
StrategyCompetitorId int64 `json:"strategy_competitor_id"` StrategyCompetitorId int64 `json:"strategy_competitor_id"`
// Link to a competitor's product
StrategyCompetitorProductURL string `json:"strategy_competitor_product_url"` StrategyCompetitorProductURL string `json:"strategy_competitor_product_url"`
} }
@@ -329,16 +391,19 @@ func (c Strategies) GetCompetitorPrice(params *GetCompetitorPriceParams) (*GetCo
} }
type RemoveProductsFromStrategyParams struct { type RemoveProductsFromStrategyParams struct {
// List of product identifiers. The maximum number is 50
ProductId []int64 `json:"product_id"` ProductId []int64 `json:"product_id"`
} }
type RemoveProductsFromStrategyResponse struct { type RemoveProductsFromStrategyResponse struct {
core.CommonResponse core.CommonResponse
// Method result
Result RemoveProductsFromStrategyResult `json:"result"` Result RemoveProductsFromStrategyResult `json:"result"`
} }
type RemoveProductsFromStrategyResult struct { type RemoveProductsFromStrategyResult struct {
// Number of products with errors
FailedProductCount int32 `json:"failed_product_count"` FailedProductCount int32 `json:"failed_product_count"`
} }
@@ -357,8 +422,10 @@ func (c Strategies) RemoveProducts(params *RemoveProductsFromStrategyParams) (*R
} }
type ChangeStrategyStatusParams struct { type ChangeStrategyStatusParams struct {
// Strategy status
Enabled bool `json:"enabled"` Enabled bool `json:"enabled"`
// Product identifier
StrategyId string `json:"strategy_id"` StrategyId string `json:"strategy_id"`
} }
@@ -381,6 +448,7 @@ func (c Strategies) ChangeStatus(params *ChangeStrategyStatusParams) (*ChangeStr
} }
type RemoveStrategyParams struct { type RemoveStrategyParams struct {
// Strategy identifier
StrategyId string `json:"strategy_id"` StrategyId string `json:"strategy_id"`
} }