From b33620f6291dd25164c3eaee6d40c05ec10e87cf Mon Sep 17 00:00:00 2001 From: jeezft Date: Tue, 14 Oct 2025 11:37:19 +0300 Subject: [PATCH] json mashal instead of struct in body --- api/fiscal.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/fiscal.go b/api/fiscal.go index 56badb4..1b87b5a 100644 --- a/api/fiscal.go +++ b/api/fiscal.go @@ -8,10 +8,16 @@ import ( ) func (c *Client) executeRequest(ctx context.Context, request FiscalRequest, response interface{}) error { + reqJson, err := json.Marshal(request) + if err != nil { + return fmt.Errorf("failed to marshal request: %w", err) + } + fmt.Println(string(reqJson)) + resp, err := c.resty.R(). SetContext(ctx). SetHeader("Authorization", c.token). - SetBody(request). + SetBody(reqJson). Post(c.apiBaseURL + "/fiscal/execute") if err != nil {