{"id":19000606,"date":"2026-08-23T12:08:09","date_gmt":"2026-08-23T12:08:09","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/custom-order-number-not-applied-to-api-and-programmatically-created-orders\/"},"modified":"2026-08-23T12:08:09","modified_gmt":"2026-08-23T12:08:09","slug":"custom-order-number-not-applied-to-api-and-programmatically-created-orders","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/custom-order-number-not-applied-to-api-and-programmatically-created-orders\/","title":{"rendered":"Custom Order Number Not Applied to API and Programmatically Created Orders"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello Support Team,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I am using the <strong>Custom Order Numbers for WooCommerce<\/strong> plugin. I recently updated the plugin from <strong>version 1.13.0 to version 2.0.0 on June 24, 2026<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since the update, I have encountered an issue with orders created programmatically.Issue<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When an order is created using any programmatic method, such as:<\/p>\n\n\n\n<ul>\n<li>WooCommerce REST API<\/li>\n\n\n\n<li><code>wc_create_order()<\/code><\/li>\n\n\n\n<li>Other programmatic order creation methods<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">the <strong>custom order number is not being applied correctly<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instead, the <strong>WordPress\/WooCommerce post ID is used as the order number<\/strong> in:<\/p>\n\n\n\n<ul>\n<li>WooCommerce Admin<\/li>\n\n\n\n<li>Order emails<\/li>\n\n\n\n<li>Other places where the order number is displayed<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For example, orders created manually through the WooCommerce interface work as expected, but orders created programmatically continue to use the original WordPress Post ID instead of the configured custom order number.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Testing Performed<\/strong>: To investigate the issue, I reverted the plugin back to <strong>version 1.13.0<\/strong>, and the problem does not occur there. I have also tested the newer plugin releases after version 1.13.0, including the latest version available as of today, and I consistently experience the same issue.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Therefore, I currently need to keep using <strong>version 1.13.0<\/strong> as a workaround.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><strong>Expected Behavior<\/strong>:<\/em> Orders created through the REST API or programmatically using functions such as <code>wc_create_order()<\/code> should receive and display the configured custom order number in the same way as manually created orders.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><strong>Actual Behavior<\/strong>:<\/em> Programmatically created orders use the WordPress\/WooCommerce Post ID instead of the configured custom order number, particularly in the WooCommerce Admin and email notifications.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Could you please investigate whether there was a change in the newer versions that affects programmatic order creation or the hook\/filter used to generate custom order numbers?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I would appreciate a fix or a recommended workaround that allows us to use the latest version of the plugin while retaining custom order numbers for programmatically created orders.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"template":"","class_list":["post-19000606","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19000606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19000606\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19000606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}