sales_order table - increment_id doesn't match entity_id

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
2
down vote

favorite












I'm unsure whether they should match or not, I haven't been able to find a definitive answer yet.



The start of sales_order table looks fine:



enter image description here



But suddenly the increment_id column stopped matching the entity_id column:



enter image description here



The invoice IDs still match, sales_invoice table:



enter image description here



But maybe that's because we only have 103 invoices, whereas we have 270 orders. The IDs in the order table started to get out of sync at order 173.



Any help is greatly appreciated. We have multiple third party integrations, some of them use entity_id and some increment_id, so it gets very confusing.










share|improve this question



























    up vote
    2
    down vote

    favorite












    I'm unsure whether they should match or not, I haven't been able to find a definitive answer yet.



    The start of sales_order table looks fine:



    enter image description here



    But suddenly the increment_id column stopped matching the entity_id column:



    enter image description here



    The invoice IDs still match, sales_invoice table:



    enter image description here



    But maybe that's because we only have 103 invoices, whereas we have 270 orders. The IDs in the order table started to get out of sync at order 173.



    Any help is greatly appreciated. We have multiple third party integrations, some of them use entity_id and some increment_id, so it gets very confusing.










    share|improve this question























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I'm unsure whether they should match or not, I haven't been able to find a definitive answer yet.



      The start of sales_order table looks fine:



      enter image description here



      But suddenly the increment_id column stopped matching the entity_id column:



      enter image description here



      The invoice IDs still match, sales_invoice table:



      enter image description here



      But maybe that's because we only have 103 invoices, whereas we have 270 orders. The IDs in the order table started to get out of sync at order 173.



      Any help is greatly appreciated. We have multiple third party integrations, some of them use entity_id and some increment_id, so it gets very confusing.










      share|improve this question













      I'm unsure whether they should match or not, I haven't been able to find a definitive answer yet.



      The start of sales_order table looks fine:



      enter image description here



      But suddenly the increment_id column stopped matching the entity_id column:



      enter image description here



      The invoice IDs still match, sales_invoice table:



      enter image description here



      But maybe that's because we only have 103 invoices, whereas we have 270 orders. The IDs in the order table started to get out of sync at order 173.



      Any help is greatly appreciated. We have multiple third party integrations, some of them use entity_id and some increment_id, so it gets very confusing.







      magento2






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 4 hours ago









      VirtusB

      388




      388




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          increment_id and entity_id are two different elements at magento2.



          entity_id is the primary key of the table which auto increment.



          Where increment_id an unique identifier of an order which using build on some logic.



          Like



          Prefix
          Suffix
          Step
          Start-value
          Pad-length


          That it logic is build at Magento_SalesSequence module. Please check more detail at https://www.classyllama.com/blog/m2-incrementid






          share|improve this answer






















          • Thanks, Amit. So if an API uses entity_id that is bad, correct? They should switch to increment_id? Do you know if entity_id should match increment_id?
            – VirtusB
            3 hours ago










          • use of entity_id is not bad. But use entity_id and increment is totally depends on your business logic.If you want to get order data using increment id,then just create own api
            – Amit Bera♦
            3 hours ago

















          up vote
          0
          down vote













          Good day, your EntityID doesnt have to match your OrderID.



          Your Ordernumbers are out of sync because of the quotation system behind magento. For every order a customer wants to make a quote gets created in your database and potentually reserving an ordernumber. Thats why the ordernumbers jump ( Invoice numbers wont jump ).



          You can check that yourself on that MySql table:



          quote


          I hope i could help you with that :)






          share|improve this answer




















          • Hi. In quote I have 474 rows, and only entity_id. It increases by 1 for each quote. So there's about double the amount of quotes than orders. Currently the entity_id is four numbers behind increment_id in the sales_order table.
            – VirtusB
            3 hours ago










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f245877%2fsales-order-table-increment-id-doesnt-match-entity-id%23new-answer', 'question_page');

          );

          Post as a guest






























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          4
          down vote



          accepted










          increment_id and entity_id are two different elements at magento2.



          entity_id is the primary key of the table which auto increment.



          Where increment_id an unique identifier of an order which using build on some logic.



          Like



          Prefix
          Suffix
          Step
          Start-value
          Pad-length


          That it logic is build at Magento_SalesSequence module. Please check more detail at https://www.classyllama.com/blog/m2-incrementid






          share|improve this answer






















          • Thanks, Amit. So if an API uses entity_id that is bad, correct? They should switch to increment_id? Do you know if entity_id should match increment_id?
            – VirtusB
            3 hours ago










          • use of entity_id is not bad. But use entity_id and increment is totally depends on your business logic.If you want to get order data using increment id,then just create own api
            – Amit Bera♦
            3 hours ago














          up vote
          4
          down vote



          accepted










          increment_id and entity_id are two different elements at magento2.



          entity_id is the primary key of the table which auto increment.



          Where increment_id an unique identifier of an order which using build on some logic.



          Like



          Prefix
          Suffix
          Step
          Start-value
          Pad-length


          That it logic is build at Magento_SalesSequence module. Please check more detail at https://www.classyllama.com/blog/m2-incrementid






          share|improve this answer






















          • Thanks, Amit. So if an API uses entity_id that is bad, correct? They should switch to increment_id? Do you know if entity_id should match increment_id?
            – VirtusB
            3 hours ago










          • use of entity_id is not bad. But use entity_id and increment is totally depends on your business logic.If you want to get order data using increment id,then just create own api
            – Amit Bera♦
            3 hours ago












          up vote
          4
          down vote



          accepted







          up vote
          4
          down vote



          accepted






          increment_id and entity_id are two different elements at magento2.



          entity_id is the primary key of the table which auto increment.



          Where increment_id an unique identifier of an order which using build on some logic.



          Like



          Prefix
          Suffix
          Step
          Start-value
          Pad-length


          That it logic is build at Magento_SalesSequence module. Please check more detail at https://www.classyllama.com/blog/m2-incrementid






          share|improve this answer














          increment_id and entity_id are two different elements at magento2.



          entity_id is the primary key of the table which auto increment.



          Where increment_id an unique identifier of an order which using build on some logic.



          Like



          Prefix
          Suffix
          Step
          Start-value
          Pad-length


          That it logic is build at Magento_SalesSequence module. Please check more detail at https://www.classyllama.com/blog/m2-incrementid







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 3 hours ago

























          answered 3 hours ago









          Amit Bera♦

          55k1367160




          55k1367160











          • Thanks, Amit. So if an API uses entity_id that is bad, correct? They should switch to increment_id? Do you know if entity_id should match increment_id?
            – VirtusB
            3 hours ago










          • use of entity_id is not bad. But use entity_id and increment is totally depends on your business logic.If you want to get order data using increment id,then just create own api
            – Amit Bera♦
            3 hours ago
















          • Thanks, Amit. So if an API uses entity_id that is bad, correct? They should switch to increment_id? Do you know if entity_id should match increment_id?
            – VirtusB
            3 hours ago










          • use of entity_id is not bad. But use entity_id and increment is totally depends on your business logic.If you want to get order data using increment id,then just create own api
            – Amit Bera♦
            3 hours ago















          Thanks, Amit. So if an API uses entity_id that is bad, correct? They should switch to increment_id? Do you know if entity_id should match increment_id?
          – VirtusB
          3 hours ago




          Thanks, Amit. So if an API uses entity_id that is bad, correct? They should switch to increment_id? Do you know if entity_id should match increment_id?
          – VirtusB
          3 hours ago












          use of entity_id is not bad. But use entity_id and increment is totally depends on your business logic.If you want to get order data using increment id,then just create own api
          – Amit Bera♦
          3 hours ago




          use of entity_id is not bad. But use entity_id and increment is totally depends on your business logic.If you want to get order data using increment id,then just create own api
          – Amit Bera♦
          3 hours ago












          up vote
          0
          down vote













          Good day, your EntityID doesnt have to match your OrderID.



          Your Ordernumbers are out of sync because of the quotation system behind magento. For every order a customer wants to make a quote gets created in your database and potentually reserving an ordernumber. Thats why the ordernumbers jump ( Invoice numbers wont jump ).



          You can check that yourself on that MySql table:



          quote


          I hope i could help you with that :)






          share|improve this answer




















          • Hi. In quote I have 474 rows, and only entity_id. It increases by 1 for each quote. So there's about double the amount of quotes than orders. Currently the entity_id is four numbers behind increment_id in the sales_order table.
            – VirtusB
            3 hours ago














          up vote
          0
          down vote













          Good day, your EntityID doesnt have to match your OrderID.



          Your Ordernumbers are out of sync because of the quotation system behind magento. For every order a customer wants to make a quote gets created in your database and potentually reserving an ordernumber. Thats why the ordernumbers jump ( Invoice numbers wont jump ).



          You can check that yourself on that MySql table:



          quote


          I hope i could help you with that :)






          share|improve this answer




















          • Hi. In quote I have 474 rows, and only entity_id. It increases by 1 for each quote. So there's about double the amount of quotes than orders. Currently the entity_id is four numbers behind increment_id in the sales_order table.
            – VirtusB
            3 hours ago












          up vote
          0
          down vote










          up vote
          0
          down vote









          Good day, your EntityID doesnt have to match your OrderID.



          Your Ordernumbers are out of sync because of the quotation system behind magento. For every order a customer wants to make a quote gets created in your database and potentually reserving an ordernumber. Thats why the ordernumbers jump ( Invoice numbers wont jump ).



          You can check that yourself on that MySql table:



          quote


          I hope i could help you with that :)






          share|improve this answer












          Good day, your EntityID doesnt have to match your OrderID.



          Your Ordernumbers are out of sync because of the quotation system behind magento. For every order a customer wants to make a quote gets created in your database and potentually reserving an ordernumber. Thats why the ordernumbers jump ( Invoice numbers wont jump ).



          You can check that yourself on that MySql table:



          quote


          I hope i could help you with that :)







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 4 hours ago









          Marcel H.

          306320




          306320











          • Hi. In quote I have 474 rows, and only entity_id. It increases by 1 for each quote. So there's about double the amount of quotes than orders. Currently the entity_id is four numbers behind increment_id in the sales_order table.
            – VirtusB
            3 hours ago
















          • Hi. In quote I have 474 rows, and only entity_id. It increases by 1 for each quote. So there's about double the amount of quotes than orders. Currently the entity_id is four numbers behind increment_id in the sales_order table.
            – VirtusB
            3 hours ago















          Hi. In quote I have 474 rows, and only entity_id. It increases by 1 for each quote. So there's about double the amount of quotes than orders. Currently the entity_id is four numbers behind increment_id in the sales_order table.
          – VirtusB
          3 hours ago




          Hi. In quote I have 474 rows, and only entity_id. It increases by 1 for each quote. So there's about double the amount of quotes than orders. Currently the entity_id is four numbers behind increment_id in the sales_order table.
          – VirtusB
          3 hours ago

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f245877%2fsales-order-table-increment-id-doesnt-match-entity-id%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What does second last employer means? [closed]

          List of Gilmore Girls characters

          One-line joke