Create new rental order via API

You can easily create new orders via TWICE Commerce Admin API

Written by
Karri Hiekkanen
Published on
Dec 20, 2024
Updated on
Dec 20, 2024

You can create new rental orders through API.

API call

Use POST to https://api.twicecommerce.com/admin/orders with a payload (example).

{
  "startDate": "2024-11-26T20:11:20.477Z",
  "duration": {
    "period": "days",
    "value": 1
  },
  "storeId": "PNEnzoEUhcLPGGkd3SEY",
  "customer": {
    "firstName": "John",
    "lastName": "Doe",
    "phone": "+1555555555",
    "email": "john@doe.com",
    "marketingConsent": true,
    "language": "en",
    "address": {
      "address": "123 Main St",
      "zipCode": "12345",
      "city": "New York",
      "country": "United States",
      "state": "New York"
    }
  },
  "items": [
    {
      "productId": "8cXDYcPTi3HbJjT8Z9t2",
      "variantId": "YaW1E2arTJvvjcq70ACz",
      "quantity": 1,
      "duration": {
        "period": "days",
        "value": 1
      }
    }
  ],
  "paid": true
}

The following fields are required

  • "startDate"
  • "duration"
    • "duration.period"
    • "duration.value"
  • "storeId"
  • "customer"
    • "customer.firstName"
    • "customer.lastName"
    • "customer.phone""
    • "customer.email"
    • "customer.marketingConsent"
  • "items" (array)
    • "items.productId"
    • "items.duration"
      • "items.duration.period"
      • "items.duration.value"

Check out our full full API documentation for creating an order.

On this page

Start your circular business  with TWICE