billbeeio/billbee-php-sdk

createOrder not working

Closed this issue · 9 comments

Example:

use BillbeeDe\BillbeeAPI\Client;
use BillbeeDe\BillbeeAPI\Model\Order;
use BillbeeDe\BillbeeAPI\Model\OrderItem;
use BillbeeDe\BillbeeAPI\Model\SoldProduct;

$user = '';
$apiPassword = '';
$apiKey = '';

$client = new Client($user, $apiPassword, $apiKey);
$client->setLogger(new \BillbeeDe\BillbeeAPI\Logger\DiagnosticsLogger(__DIR__.'/log.txt'));

$order = new Order();
$order->orderNumber = '4711';
$order->createdAt = new DateTime();
$order->acceptLossOfReturnRight = false;

$item = new OrderItem();
$item->quantity = 1;
$item->product = new SoldProduct();
$item->product->id = "Artikel Id in deinem System";
$item->product->sku = "Eine SKU";
// ...

$order->orderItems = [$item];

$shopId = null;
$client->orders()->createOrder($order, $shopId);

Log:

[2022-08-15 11:03:34.973] DEBUG:     Message: Execute request to https://api.billbee.io/api/v1/orders?shopId=; Context: {"method":"POST","body":{}}
[2022-08-15 11:03:35.360] ERROR:     Message: Error during request; Context: {"GuzzleHttp\\Exception\\RequestExceptionrequest":{},"GuzzleHttp\\Exception\\RequestExceptionresponse":{},"GuzzleHttp\\Exception\\RequestExceptionhandlerContext":[],"*message":"Client error: `POST https://api.billbee.io/api/v1/orders?shopId=` resulted in a `400 Bad Request` response:\n{\"Message\":\"Die Anforderung ist ungültig.\",\"ModelState\":{\"orderData.createdAt\":[\"Unexpected character encountered while (truncated...)\n","Exceptionstring":"","*code":400,"*file":"C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\vendor\\guzzlehttp\\guzzle\\src\\Exception\\RequestException.php","*line":113,"Exceptiontrace":[{"file":"C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\vendor\\guzzlehttp\\guzzle\\src\\Middleware.php","line":65,"function":"create","class":"GuzzleHttp\\Exception\\RequestException","type":"::","args":[{},{}]},{"file":"C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\vendor\\guzzlehttp\\promises\\src\\Promise.php","line":204,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":[{}]},{"file":"C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\vendor\\guzzlehttp\\promises\\src\\Promise.php","line":153,"function":"callHandler","class":"GuzzleHttp\\Promise\\Promise","type":"::","args":[1,{},null]},{"file":"C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\vendor\\guzzlehttp\\promises\\src\\TaskQueue.php","line":48,"function":"GuzzleHttp\\Promise\\{closure}","class":"GuzzleHttp\\Promise\\Promise","type":"::","args":[]},{"file":"C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\vendor\\guzzlehttp\\promises\\src\\Promise.php","line":248,"function":"run","class":"GuzzleHttp\\Promise\\TaskQueue","type":"->","args":[true]},{"file":"C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\vendor\\guzzlehttp\\promises\\src\\Promise.php","line":224,"function":"invokeWaitFn","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\vendor\\guzzlehttp\\promises\\src\\Promise.php","line":269,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\vendor\\guzzlehttp\\promises\\src\\Promise.php","line":226,"function":"invokeWaitList","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\vendor\\guzzlehttp\\promises\\src\\Promise.php","line":62,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\src\\Client.php","line":441,"function":"wait","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\src\\Client.php","line":346,"function":"internalRequest","class":"BillbeeDe\\BillbeeAPI\\Client","type":"->","args":["BillbeeDe\\BillbeeAPI\\Response\\BaseResponse",{}]},{"file":"C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\src\\Endpoint\\OrdersEndpoint.php","line":265,"function":"post","class":"BillbeeDe\\BillbeeAPI\\Client","type":"->","args":["orders?shopId=","{\n    \"id\": null,\n    \"parentOrderId\": null,\n    \"externalId\": null,\n    \"shipping\": null,\n    \"acceptLossOfReturnRight\": false,\n    \"orderNumber\": \"4711\",\n    \"state\": 1,\n    \"vatMode\": 0,\n    \"createdAt\": [],\n    \"shippedAt\": null,\n    \"confirmedAt\": null,\n    \"payedAt\": null,\n    \"sellerComment\": null,\n    \"comments\": null,\n    \"invoiceNumberPrefix\": null,\n    \"invoiceNumberPostfix\": null,\n    \"invoiceNumber\": null,\n    \"invoiceDate\": null,\n    \"invoiceAddress\": null,\n    \"shippingAddress\": null,\n    \"paymentMethod\": null,\n    \"shippingCost\": null,\n    \"totalCost\": null,\n    \"adjustmentCost\": null,\n    \"adjustmentReason\": null,\n    \"orderItems\": [\n        {\n            \"billbeeId\": null,\n            \"transactionId\": null,\n            \"product\": {\n                \"id\": \"Artikel Id in deinem System\",\n                \"billbeeId\": null,\n                \"title\": null,\n                \"weight\": null,\n                \"sku\": \"Eine SKU\",\n                \"isDigital\": null,\n                \"ean\": null,\n                \"taric\": null,\n                \"countryOfOrigin\": null\n            },\n            \"quantity\": 1,\n            \"totalPrice\": null,\n            \"unrebatedTotalPrice\": null,\n            \"taxAmount\": null,\n            \"taxIndex\": null,\n            \"discount\": null,\n            \"attributes\": null,\n            \"getPriceFromArticleIfAny\": false,\n            \"isCoupon\": false,\n            \"shippingProfileId\": null,\n            \"dontAdjustStock\": null,\n            \"serialNumber\": null\n        }\n    ],\n    \"currency\": null,\n    \"isCanceled\": false,\n    \"restfulPath\": null,\n    \"seller\": null,\n    \"buyer\": null,\n    \"updatedAt\": null,\n    \"taxRate1\": null,\n    \"taxRate2\": null,\n    \"vatId\": null,\n    \"tags\": null,\n    \"shipWeightKg\": null,\n    \"languageCode\": null,\n    \"paidAmount\": null,\n    \"shippingProfileId\": null,\n    \"shippingProfileName\": null,\n    \"shippingProviderId\": null,\n    \"shippingProviderProductId\": null,\n    \"shippingProviderName\": null,\n    \"shippingProviderProductName\": null,\n    \"paymentInstruction\": null,\n    \"isCancellationFor\": null,\n    \"paymentTransactionId\": null,\n    \"deliverySourceCountryCode\": null,\n    \"customInvoiceNote\": null,\n    \"customerNumber\": null,\n    \"distributionCenter\": null,\n    \"customer\": null,\n    \"payments\": null\n}","BillbeeDe\\BillbeeAPI\\Response\\BaseResponse"]},{"file":"C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\bin\\program.php","line":33,"function":"createOrder","class":"BillbeeDe\\BillbeeAPI\\Endpoint\\OrdersEndpoint","type":"->","args":[{"id":null,"parentOrderId":null,"externalId":null,"shipping":null,"acceptLossOfReturnRight":false,"orderNumber":"4711","state":1,"vatMode":0,"createdAt":{"date":"2022-08-15 11:03:34.966896","timezone_type":3,"timezone":"UTC"},"shippedAt":null,"confirmedAt":null,"payedAt":null,"sellerComment":null,"comments":null,"invoiceNumberPrefix":null,"invoiceNumberPostfix":null,"invoiceNumber":null,"invoiceDate":null,"invoiceAddress":null,"shippingAddress":null,"paymentMethod":null,"shippingCost":null,"totalCost":null,"adjustmentCost":null,"adjustmentReason":null,"orderItems":[{"billbeeId":null,"transactionId":null,"product":{"id":"Artikel Id in deinem System","billbeeId":null,"title":null,"weight":null,"sku":"Eine SKU","isDigital":null,"ean":null,"taric":null,"countryOfOrigin":null},"quantity":1,"totalPrice":null,"unrebatedTotalPrice":null,"taxAmount":null,"taxIndex":null,"discount":null,"attributes":null,"getPriceFromArticleIfAny":false,"isCoupon":false,"shippingProfileId":null,"dontAdjustStock":null,"serialNumber":null}],"currency":null,"isCanceled":false,"restfulPath":null,"seller":null,"buyer":null,"updatedAt":null,"taxRate1":null,"taxRate2":null,"vatId":null,"tags":null,"shipWeightKg":null,"languageCode":null,"paidAmount":null,"shippingProfileId":null,"shippingProfileName":null,"shippingProviderId":null,"shippingProviderProductId":null,"shippingProviderName":null,"shippingProviderProductName":null,"paymentInstruction":null,"isCancellationFor":null,"paymentTransactionId":null,"deliverySourceCountryCode":null,"customInvoiceNote":null,"customerNumber":null,"distributionCenter":null,"customer":null,"payments":null},null]}],"Exceptionprevious":null,"xdebug_message":"\nGuzzleHttp\\Exception\\ClientException: Client error: `POST https://api.billbee.io/api/v1/orders?shopId=` resulted in a `400 Bad Request` response:\n{\"Message\":\"Die Anforderung ist ungültig.\",\"ModelState\":{\"orderData.createdAt\":[\"Unexpected character encountered while (truncated...)\n in C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\vendor\\guzzlehttp\\guzzle\\src\\Exception\\RequestException.php on line 113\n\nCall Stack:\n    0.0005     398880   1. {main}() C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\bin\\program.php:0\n    0.0563    2342088   2. BillbeeDe\\BillbeeAPI\\Endpoint\\OrdersEndpoint->createOrder($order = class BillbeeDe\\BillbeeAPI\\Model\\Order { public $id = NULL; public $parentOrderId = NULL; public $externalId = NULL; public $shipping = NULL; public $acceptLossOfReturnRight = FALSE; public $orderNumber = '4711'; public $state = 1; public $vatMode = 0; public $createdAt = class DateTime { public $date = '2022-08-15 11:03:34.966896'; public $timezone_type = 3; public $timezone = 'UTC' }; public $shippedAt = NULL; public $confirmedAt = NULL; public $payedAt = NULL; public $sellerComment = NULL; public $comments = NULL; public $invoiceNumberPrefix = NULL; public $invoiceNumberPostfix = NULL; public $invoiceNumber = NULL; public $invoiceDate = NULL; public $invoiceAddress = NULL; public $shippingAddress = NULL; public $paymentMethod = NULL; public $shippingCost = NULL; public $totalCost = NULL; public $adjustmentCost = NULL; public $adjustmentReason = NULL; public $orderItems = [0 => class BillbeeDe\\BillbeeAPI\\Model\\OrderItem { ... }]; public $currency = NULL; public $isCanceled = FALSE; public $restfulPath = NULL; public $seller = NULL; public $buyer = NULL; public $updatedAt = NULL; public $taxRate1 = NULL; public $taxRate2 = NULL; public $vatId = NULL; public $tags = NULL; public $shipWeightKg = NULL; public $languageCode = NULL; public $paidAmount = NULL; public $shippingProfileId = NULL; public $shippingProfileName = NULL; public $shippingProviderId = NULL; public $shippingProviderProductId = NULL; public $shippingProviderName = NULL; public $shippingProviderProductName = NULL; public $paymentInstruction = NULL; public $isCancellationFor = NULL; public $paymentTransactionId = NULL; public $deliverySourceCountryCode = NULL; public $customInvoiceNote = NULL; public $customerNumber = NULL; public $distributionCenter = NULL; public $customer = NULL; public $payments = NULL }, $shopId = NULL) C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\bin\\program.php:33\n    0.0565    2350248   3. BillbeeDe\\BillbeeAPI\\Client->post($node = 'orders?shopId=', $data = '{\\n    \"id\": null,\\n    \"parentOrderId\": null,\\n    \"externalId\": null,\\n    \"shipping\": null,\\n    \"acceptLossOfReturnRight\": false,\\n    \"orderNumber\": \"4711\",\\n    \"state\": 1,\\n    \"vatMode\": 0,\\n    \"createdAt\": [],\\n    \"shippedAt\": null,\\n    \"confirmedAt\": null,\\n    \"payedAt\": null,\\n    \"sellerComment\": null,\\n    \"comments\": null,\\n    \"invoiceNumberPrefix\": null,\\n    \"invoiceNumberPostfix\": null,\\n    \"invoiceNumber\": null,\\n    \"invoiceDate\": null,\\n    \"invoiceAddress\": null,\\n    \"shippingAdd', $responseClass = 'BillbeeDe\\\\BillbeeAPI\\\\Response\\\\BaseResponse') C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\src\\Endpoint\\OrdersEndpoint.php:265\n    0.0565    2350944   4. BillbeeDe\\BillbeeAPI\\Client->internalRequest($responseClass = 'BillbeeDe\\\\BillbeeAPI\\\\Response\\\\BaseResponse', $requestFactory = class Closure { public $static = ['data' => '{\\n    \"id\": null,\\n    \"parentOrderId\": null,\\n    \"externalId\": null,\\n    \"shipping\": null,\\n    \"acceptLossOfReturnRight\": false,\\n    \"orderNumber\": \"4711\",\\n    \"state\": 1,\\n    \"vatMode\": 0,\\n    \"createdAt\": [],\\n    \"shippedAt\": null,\\n    \"confirmedAt\": null,\\n    \"payedAt\": null,\\n    \"sellerComment\": null,\\n    \"comments\": null,\\n    \"invoiceNumberPrefix\": null,\\n    \"invoiceNumberPostfix\": null,\\n    \"invoiceNumber\": null,\\n    \"invoiceDate\": null,\\n    \"invoiceAddress\": null,\\n    \"shippingAdd', 'node' => 'orders?shopId=']; public $this = class BillbeeDe\\BillbeeAPI\\Client { protected $endpoint = 'https://api.billbee.io/api/v1/'; protected $jom = class MintWare\\DMM\\ObjectMapper { ... }; private $useBatching = FALSE; protected $requestPool = [...]; private $logRequests = FALSE; private $productsEndpoint = class BillbeeDe\\BillbeeAPI\\Endpoint\\ProductsEndpoint { ... }; private $provisioningEndpoint = class BillbeeDe\\BillbeeAPI\\Endpoint\\ProvisioningEndpoint { ... }; private $eventsEndpoint = class BillbeeDe\\BillbeeAPI\\Endpoint\\EventsEndpoint { ... }; private $ordersEndpoint = class BillbeeDe\\BillbeeAPI\\Endpoint\\OrdersEndpoint { ... }; private $invoicesEndpoint = class BillbeeDe\\BillbeeAPI\\Endpoint\\InvoiceEndpoint { ... }; private $shipmentsEndpoint = class BillbeeDe\\BillbeeAPI\\Endpoint\\ShipmentsEndpoint { ... }; private $customFieldsEndpoint = class BillbeeDe\\BillbeeAPI\\Endpoint\\ProductCustomFieldsEndpoint { ... }; private $webHooksEndpoint = class BillbeeDe\\BillbeeAPI\\Endpoint\\WebHooksEndpoint { ... }; private $customersEndpoint = class BillbeeDe\\BillbeeAPI\\Endpoint\\CustomersEndpoint { ... }; private $cloudStoragesEndpoint = class BillbeeDe\\BillbeeAPI\\Endpoint\\CloudStorageEndpoint { ... }; private $layoutsEndpoint = class BillbeeDe\\BillbeeAPI\\Endpoint\\LayoutsEndpoint { ... }; private $searchEndpoint = class BillbeeDe\\BillbeeAPI\\Endpoint\\SearchEndpoint { ... }; private $client = class BillbeeDe\\BillbeeAPI\\CustomClient { ... }; protected $logger = class BillbeeDe\\BillbeeAPI\\Logger\\DiagnosticsLogger { ... } } }, $ignorePool = ???) C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\src\\Client.php:346\n    0.4453    2739024   5. GuzzleHttp\\Promise\\Promise->wait($unwrap = ???) C:\\Users\\jfinkler\\Desktop\\billbee-php-sdk\\src\\Client.php:441\n"}

Error:

PHP Fatal error:  Uncaught GuzzleHttp\Exception\ClientException: Client error: `POST https://api.billbee.io/api/v1/orders?shopId=` resulted in a `400 Bad Request` response:
{"Message":"Die Anforderung ist ungültig.","ModelState":{"orderData.createdAt":["Unexpected character encountered while (truncated...)
 in C:\Users\jfinkler\Desktop\billbee-php-sdk\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php:113
Stack trace:
#0 C:\Users\jfinkler\Desktop\billbee-php-sdk\vendor\guzzlehttp\guzzle\src\Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 C:\Users\jfinkler\Desktop\billbee-php-sdk\vendor\guzzlehttp\promises\src\Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 C:\Users\jfinkler\Desktop\billbee-php-sdk\vendor\guzzlehttp\promises\src\Promise.php(153): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL)
#3 C:\Users\jfinkler\Desktop\billbee-php-sdk\vendor\gu in C:\Users\jfinkler\Desktop\billbee-php-sdk\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line 113

Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: `POST https://api.billbee.io/api/v1/orders?shopId=` resulted in a `400 Bad Request` response:
{"Message":"Die Anforderung ist ungültig.","ModelState":{"orderData.createdAt":["Unexpected character encountered while (truncated...)
 in C:\Users\jfinkler\Desktop\billbee-php-sdk\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line 113

GuzzleHttp\Exception\ClientException: Client error: `POST https://api.billbee.io/api/v1/orders?shopId=` resulted in a `400 Bad Request` response:
{"Message":"Die Anforderung ist ungültig.","ModelState":{"orderData.createdAt":["Unexpected character encountered while (truncated...)
 in C:\Users\jfinkler\Desktop\billbee-php-sdk\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line 113

Call Stack:
    0.0005     398880   1. {main}() C:\Users\jfinkler\Desktop\billbee-php-sdk\bin\program.php:0
    0.0563    2342088   2. BillbeeDe\BillbeeAPI\Endpoint\OrdersEndpoint->createOrder($order = class BillbeeDe\BillbeeAPI\Model\Order { public $id = NULL; public $parentOrderId = NULL; public $externalId = NULL; public $shipping = NULL; public $acceptLossOfReturnRight = FALSE; public $orderNumber = '4711'; public $state = 1; public $vatMode = 0; public $createdAt = class DateTime { public $date = '2022-08-15 11:03:34.966896'; public $timezone_type = 3; public $timezone = 'UTC' }; public $shippedAt = NULL; public $confirmedAt = NULL; public $payedAt = NULL; public $sellerComment = NULL; public $comments = NULL; public $invoiceNumberPrefix = NULL; public $invoiceNumberPostfix = NULL; public $invoiceNumber = NULL; public $invoiceDate = NULL; public $invoiceAddress = NULL; public $shippingAddress = NULL; public $paymentMethod = NULL; public $shippingCost = NULL; public $totalCost = NULL; public $adjustmentCost = NULL; public $adjustmentReason = NULL; public $orderItems = [0 => class BillbeeDe\BillbeeAPI\Model\OrderItem { ... }]; public $currency = NULL; public $isCanceled = FALSE; public $restfulPath = NULL; public $seller = NULL; public $buyer = NULL; public $updatedAt = NULL; public $taxRate1 = NULL; public $taxRate2 = NULL; public $vatId = NULL; public $tags = NULL; public $shipWeightKg = NULL; public $languageCode = NULL; public $paidAmount = NULL; public $shippingProfileId = NULL; public $shippingProfileName = NULL; public $shippingProviderId = NULL; public $shippingProviderProductId = NULL; public $shippingProviderName = NULL; public $shippingProviderProductName = NULL; public $paymentInstruction = NULL; public $isCancellationFor = NULL; public $paymentTransactionId = NULL; public $deliverySourceCountryCode = NULL; public $customInvoiceNote = NULL; public $customerNumber = NULL; public $distributionCenter = NULL; public $customer = NULL; public $payments = NULL }, $shopId = NULL) C:\Users\jfinkler\Desktop\billbee-php-sdk\bin\program.php:33
    0.0565    2350248   3. BillbeeDe\BillbeeAPI\Client->post($node = 'orders?shopId=', $data = '{\n    "id": null,\n    "parentOrderId": null,\n    "externalId": null,\n    "shipping": null,\n    "acceptLossOfReturnRight": false,\n    "orderNumber": "4711",\n    "state": 1,\n    "vatMode": 0,\n    "createdAt": [],\n    "shippedAt": null,\n    "confirmedAt": null,\n    "payedAt": null,\n    "sellerComment": null,\n    "comments": null,\n    "invoiceNumberPrefix": null,\n    "invoiceNumberPostfix": null,\n    "invoiceNumber": null,\n    "invoiceDate": null,\n    "invoiceAddress": null,\n    "shippingAdd', $responseClass = 'BillbeeDe\\BillbeeAPI\\Response\\BaseResponse') C:\Users\jfinkler\Desktop\billbee-php-sdk\src\Endpoint\OrdersEndpoint.php:265
    0.0565    2350944   4. BillbeeDe\BillbeeAPI\Client->internalRequest($responseClass = 'BillbeeDe\\BillbeeAPI\\Response\\BaseResponse', $requestFactory = class Closure { public $static = ['data' => '{\n    "id": null,\n    "parentOrderId": null,\n    "externalId": null,\n    "shipping": null,\n    "acceptLossOfReturnRight": false,\n    "orderNumber": "4711",\n    "state": 1,\n    "vatMode": 0,\n    "createdAt": [],\n    "shippedAt": null,\n    "confirmedAt": null,\n    "payedAt": null,\n    "sellerComment": null,\n    "comments": null,\n    "invoiceNumberPrefix": null,\n    "invoiceNumberPostfix": null,\n    "invoiceNumber": null,\n    "invoiceDate": null,\n    "invoiceAddress": null,\n    "shippingAdd', 'node' => 'orders?shopId=']; public $this = class BillbeeDe\BillbeeAPI\Client { protected $endpoint = 'https://api.billbee.io/api/v1/'; protected $jom = class MintWare\DMM\ObjectMapper { ... }; private $useBatching = FALSE; protected $requestPool = [...]; private $logRequests = FALSE; private $productsEndpoint = class BillbeeDe\BillbeeAPI\Endpoint\ProductsEndpoint { ... }; private $provisioningEndpoint = class BillbeeDe\BillbeeAPI\Endpoint\ProvisioningEndpoint { ... }; private $eventsEndpoint = class BillbeeDe\BillbeeAPI\Endpoint\EventsEndpoint { ... }; private $ordersEndpoint = class BillbeeDe\BillbeeAPI\Endpoint\OrdersEndpoint { ... }; private $invoicesEndpoint = class BillbeeDe\BillbeeAPI\Endpoint\InvoiceEndpoint { ... }; private $shipmentsEndpoint = class BillbeeDe\BillbeeAPI\Endpoint\ShipmentsEndpoint { ... }; private $customFieldsEndpoint = class BillbeeDe\BillbeeAPI\Endpoint\ProductCustomFieldsEndpoint { ... }; private $webHooksEndpoint = class BillbeeDe\BillbeeAPI\Endpoint\WebHooksEndpoint { ... }; private $customersEndpoint = class BillbeeDe\BillbeeAPI\Endpoint\CustomersEndpoint { ... }; private $cloudStoragesEndpoint = class BillbeeDe\BillbeeAPI\Endpoint\CloudStorageEndpoint { ... }; private $layoutsEndpoint = class BillbeeDe\BillbeeAPI\Endpoint\LayoutsEndpoint { ... }; private $searchEndpoint = class BillbeeDe\BillbeeAPI\Endpoint\SearchEndpoint { ... }; private $client = class BillbeeDe\BillbeeAPI\CustomClient { ... }; protected $logger = class BillbeeDe\BillbeeAPI\Logger\DiagnosticsLogger { ... } } }, $ignorePool = ???) C:\Users\jfinkler\Desktop\billbee-php-sdk\src\Client.php:346


Process finished with exit code 255

Update 2022-08-16 10:45:
Migration done, adding some tests for serializing.

Models:

  • Search
    • CustomerResult
    • OrderResult
    • ProductResult
  • Address
  • BillOfMaterialProduct
  • Category
  • CloudStorage
  • Comment
  • CreateCustomerRequest
  • Customer
  • CustomerAddress
  • CustomerMetaData
  • CustomFieldDefinition
  • DeliveryNoteDocument
  • Dimensions
  • Event
  • Image
  • Invoice
  • InvoiceDocument
  • InvoicePosition
  • Layout
  • MessageForCustomer
  • Order
  • OrderItem
  • OrderItemAttribute
  • PartnerOrder
  • Payment
  • Product
  • ProductCustomField
  • Seller
  • Shipment
  • ShipmentWithLabel
  • ShippingProduct
  • ShippingProvider
  • SoldProduct
  • Source
  • Stock
  • StockCode
  • TermsInfo
  • TranslatableText
  • WebHook
  • WebHookFilter

Branch: https://github.com/billbeeio/billbee-php-sdk/tree/63-migrate-to-jms-serializer


Response

  • Model
    • ShipmentWithLabelResult
  • BaseResponse
  • CreateDeliveryNoteResponse
  • CreateInvoiceResponse
  • GetCategoriesResponse
  • GetCloudStoragesResponse
  • GetCustomerAddressesResponse
  • GetCustomerAddressResponse
  • GetCustomerResponse
  • GetCustomersResponse
  • GetCustomFieldDefinitionResponse
  • GetCustomFieldDefinitionsResponse
  • GetEventsResponse
  • GetInvoicesResponse
  • GetLayoutsResponse
  • GetOrderByPartnerResponse
  • GetOrderResponse
  • GetOrdersResponse
  • GetPatchableFieldsResponse
  • GetProductResponse
  • GetProductsResponse
  • GetShippingProvidersResponse
  • GetTermsInfoResponse
  • SearchDataResponse
  • ShipWithLabelResponse
  • UpdateStockResponse

I'm working on a fix. I'll replace the data-model-mapper dependency with the jms/serializer

Fixed in v2.2.0-RC1

$shopId = null;
$client->orders()->createOrder($order, $shopId);

Why is $shopId = null;
Calling the following line the code runs into an error.

Using your code example, I can't get an order in the system.
I added this to add an client to the order.

$order->user = new OrderUser();
$order->user->id = "id";

How can I enable a debug-mode?
I get no errors, but no order is saved.

What fields must be filled to create an order?

How do you activate the logging?

This line in the example above:

$client->setLogger(new \BillbeeDe\BillbeeAPI\Logger\DiagnosticsLogger(__DIR__.'/log.txt'));

Another question:
How to get to these values

$product->stocks[0];

I tried this
$product->stocks[0]->stockId;
$product->stocks[0]['stockId'];

$product->stocks[0]->getName();