Added a method for getting a barcode from the /v2/posting/fbs/act/get-barcode response in text format

This commit is contained in:
diPhantxm
2023-07-12 19:10:32 +03:00
committed by Kirill
parent 2ca20d9b12
commit 1958dfb94e
2 changed files with 79 additions and 0 deletions

View File

@@ -2678,3 +2678,30 @@ func (c FBS) BarcodeFromProductShipment(params *BarcodeFromProductShipmentParams
return resp, nil
}
type BarcodeValueFromProductShipmentParams struct {
// Freight identifier
Id int64 `json:"id"`
}
type BarcodeValueFromProductShipmentResponse struct {
core.CommonResponse
// Barcode in text format
Result string `json:"result"`
}
// Use this method to get the barcode from the /v2/posting/fbs/act/get-barcode response in text format.
func (c FBS) BarcodeValueFromProductShipment(params *BarcodeValueFromProductShipmentParams) (*BarcodeValueFromProductShipmentResponse, error) {
url := "/v2/posting/fbs/act/get-barcode/text"
resp := &BarcodeValueFromProductShipmentResponse{}
response, err := c.client.Request(http.MethodPost, url, params, resp, nil)
if err != nil {
return nil, err
}
response.CopyCommonResponse(&resp.CommonResponse)
return resp, nil
}