Creating a checkout using API returns 404 error.

BlocksoftwareBlocksoftware Posts: 3Member
I used an example from the API Reference "Creating an Order" where I try to create a checkout.
This is the first step for the Order creation.
As stated at the top is should be possible to create a checkout with empty data (array()).
I tried both with en empty array and with the example array.
On both cases i get an 404 error.


When i log on in the backend of the Lightspeed Webshop and select a customer.
And in the customer screen select Create Quote I get the message "Unknown error".

Furthermore if i select a customer a list of Queotes is shown with a clickable number.
Clickin on the Quote number I am forwarded to a page with the message:
  "Huh?!, 404 PAGE NOT FOUND"

Is it possible to let me know what is causing these error messages when working with quotes?

Example empty array:
$test = $client->checkouts->create(array());

Example from API Reference page "Create a Quote":
$test = $client->checkouts->create([
    "mode"        => "guest",
  "customer" => [
     "firstname" => "John",
 "lastname"  => "Doe",
 "email"     => "[email protected]",
],
  'billing_address' => [
    "name"        => "John Doe",
    "address1"    => "1401 Coconut drove",
    "address2"    => "Apartment",
    "zipcode"     => 33130,
    "city"        => "Miami",
    "country"     => "us",
    "sameaddress" => true
],
  "shipping_address" => [
    "name"     => "John",
    "company"  => "Lightspeedhq",
    "address1" => "Keizersgracht",
    "number"   => 313,
    "zipcode"  => "1016 EE",
    "city"     => "Amsterdam",
    "country"  => "nl"
],
    "terms"    => 1,
    "notifications" => false
]
);

4 comments

  • BlocksoftwareBlocksoftware Posts: 3Member
    API example returns:
    PHP Fatal error:  Uncaught WebshopappApiException: Unknown error: 404 in .../composer/vendor/seoshop/seoshop-php/src/WebshopappApiClient.php:828
    Stack trace:
    #0 .../composer/vendor/seoshop/seoshop-php/src/WebshopappApiClient.php(802): WebshopappApiClient->handleResponseError(404, NULL)
    #1 .../composer/vendor/seoshop/seoshop-php/src/WebshopappApiClient.php(852): WebshopappApiClient->sendRequest('checkouts', 'post', Array)
    #2 .../composer/vendor/seoshop/seoshop-php/src/WebshopappApiClient.php(1983): WebshopappApiClient->create('checkouts', Array)
    #3 .../test4.php(12): WebshopappApiResourceCheckouts->create(Array)
    #4 {main}
      thrown in .../composer/vendor/seoshop/seoshop-php/src/WebshopappApiClient.php on line 828

  • Alex LugoAlex Lugo Posts: 96Administrator, Lightspeed Staff moderator
    edited August 2018
    Hello @Blocksoftware,

    I'm creating a ticket with our eCom support to investigate what is causing the errors with quotes.

    For the API, would it be okay if I try to make some checkouts for testing? I was unable to reproduce the incident in my test account.
    Post edited by Michael Carey on
    Alex Lugo
    API Support Specialist
    Lightspeed HQ
  • BlocksoftwareBlocksoftware Posts: 3Member
    Hi Alex,

    Thanks for your response.
    It's okay to create a quote.
  • Alex LugoAlex Lugo Posts: 96Administrator, Lightspeed Staff moderator
    Hi @Blocksoftware,

    I'm investigating with our Dev team. It may be related to the issue with the quotes but I'm not sure. I will update you as soon as I get more information.
    Alex Lugo
    API Support Specialist
    Lightspeed HQ
Sign In or Register to comment.