Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I create a product? How do I search for a product? #77

Open
Lollichkeit opened this issue Nov 1, 2023 · 0 comments
Open

How do I create a product? How do I search for a product? #77

Lollichkeit opened this issue Nov 1, 2023 · 0 comments

Comments

@Lollichkeit
Copy link

My problem has been closed, but my problem is still there:

My problem:
My goal is:
Reading out whether the product is available and if not, then creating it, but I already have an error while creating it.

My code:

...
$product = new Product;
$title = new TranslatableText;
$title->text = 'Test';
$title->languageCode = 'de';

$product->title 		= $title;
$product->sku		= 'test';
$product->soldAmount	=  99.99;

print_r($product);

$test = $client->createProduct($product);
print_r($test);
...

My Error:
Fatal error:
Uncaught GuzzleHttp\Exception\ClientException:
Client error: POST https://app.billbee.io/api/v1/products resulted in a 400 Bad Request response: {"Message":"Die Anforderung ist ungültig.","ModelState":{"model.Title.text":["Cannot deserialize the current JSON objec (truncated...) in .../vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113 Stack trace: #0 .../vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response)) #1 .../vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Response)) #2
.../vendor/guzzlehttp/promises/src/Promise.php(153):
GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL) #3
.../ap in .../vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 113

My addendum:

Thanks again for your help. I am working on the problem again and I keep getting the error 500 Internal Server Error.
Can you help me please?

Uncaught GuzzleHttp\Exception\ServerException: Server error: 'POST https://app.billbee.io/api/v1/products' resulted in a '500 Internal Server Error' response:

#75

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant