#Place an order with a specified period
["Front-end api interface document"](#)
Create an order interface and add a new interface parameter **orderPeriod**
This parameter is data in Json format, the format is as follows:
```json
{
"unit": 1,
"duration": 1,
"dateStart": "2020-05-05 11:47:19",
"times": 6,
"autoPay": false
}
```
The specific description of the 3 parameters is as follows:
1. unit, this represents the period unit, currently supports: 0 days, 1 month, 2 years
2. duration, this represents the interval, such as the json above, which means once a month
3. dateStart is the first deduction time. Use this time as the starting point to create orders periodically.
4. Times is the total number of subscriptions. Subscription will automatically stop after the number is reached.
5. autoPay Whether to automatically deduct payment from the balance after the next order is generated, true / false
# Add order list/details return field
The order list interface and order details interface will return the following fields:
**type field**
1. 0 represents an ordinary order;
2. 1 represents periodic order;
3. 2 means scanning the QR code to place an order;
**unit**
0 days 1 month 2 years
**duration**
cycle
**dateStart**
First deduction time
**dateStartNext**
Next deduction time
**pid**
Explain that the current order is a sub-order created by the periodic order pid (the system will automatically create sub-orders in each period)
**periodStatus**
Status 0 invalid 1 valid
**nextOrderId**
The ID of the last sub-order of the current cycle order
**nextOrderStatus**
Order status for next service
# When to automatically generate orders
According to the service time specified in the order, the system will automatically generate an order when the next cycle arrives;
If autoPay = true is specified, the order will be automatically paid with the user's balance;