question

nexibit avatar image
nexibit asked Dan answered

Get Order Number

I am creating an Order using the following code. When i print the order receipt, it is not displaying the Order Number in the title. I have enabled order number in the settings. What do i need to do to generate the title with the auto generated Order Number ?

Order currOrder = new Order();
currOrder.setState("open");
CurrentOrder = orderConnector.createOrder(currOrder);
Orders
2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

What is an order number? Do you mean the order ID, the 13-digit base-32 Clover ID?

0 Likes 0 ·
nexibit avatar image nexibit commented ·
No, Its not the 13 digit order id. Its the order number that shows at the top of the receipt and starts at 001 and autoincrements.
0 Likes 0 ·

1 Answer

Dan avatar image
Dan answered
The order number uses the order title field, and is set automatically if the merchant is using automatic order numbering and the state of the order is null and the order title is null.

This all applies to using the clover-android-sdk on a device.

It looks like the state that you are setting when the order is being created is going to be ignored.
When the order has a null state and title and updateOrder is called, the state will be determined automatically and an automatic order number will be assigned.
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community