---
title: CREATE Order
slug: create-order
icon: 🟩
createdAt: 2022-03-23T01:57:46.000Z
---

**Important notes**:

- In order to allow for patients to pay with saved credit cards and/or Payment Plans, we need to be able to tie to a patient. &#x20;
- There are 2 ways of accomplishing this:
  - Provide the `patientId` which is the iCorePay internal Patient ULID
  - Provide your Patient ID (\``externalPatientId`\`) AND Patient Date of birth \``customerDOB`\`)
    - `externalPmsPatientId` - This is the PMS's patient identifier
    - `externalPatientId` - This is your identifier for the patient (can be the same as the PMS's patient identifer)
    - `customerDOB` - In `YYYY-MM-DD` format.
    - `savePatient`  - Set to true to save patient info as a FeatherPay patient
    - If `externalPatientId` exists, but is not in our DB from PMS, it will throw an error.&#x20;

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://test-api.featherpay.io/v1/stores/{storeId}/orders",
  "name": "Create Order",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "c0f7bjPcqHaJiKYiBqEF0",
        "code": "{\n   \"id\": \"01FDTFXZZ25GXZFWZZZYS1TJGT\", //Need Order ID\n   \"deleted\": false,\n   \"orderType\": \"quote\",\n   \"posOrderId\": \"Invoice Reference Id via API\",\n   \"storeId\": \"01E8F3ZZDJ186BZFZEN3V8Z44W\",\n   \"orderKey\": \"162HGY4R5H9RFBHMR1VZ2ZHW30\", //Need Order Key\n   \"status\": \"Incomplete\",\n   \"totalAuthorized\": 0,\n   \"totalCanceled\": 0,\n   \"totalInvoiced\": 20000,\n   \"totalPaid\": 0,\n   \"totalRefunded\": 0,\n   \"totalDue\": 20000,\n   \"patientId\": \"01F79XZZZZC2WKBZJ3XQ7Z1R64\", //FeatherPay Internal Patient Identifier\n   \"customerEmail\": \"test@gogreenfeather.com\",\n   \"customerFirstName\": \"TERRENCE\",\n   \"customerLastName\": \"CLARKE\",\n   \"onBehalfOf\": \"jane.doe@merchant.com\",\n   \"currencyCode\": \"usd\",\n   \"multipay\": false,\n   \"enablePaymentPlanForPatient\": true, \n   \"shippingAddress\": {\n     \"id\": \"01FDTEZVW6QSC9ZDXBSC02EFY7\",\n     \"orderId\": \"01FDTFXZZ25GXZFWZZZYS1TJGT\",\n     \"firstName\": \"TERRENCE\",\n     \"lastName\": \"CLARKE\",\n     \"line1\": \"6110 WILMER RD\",\n     \"city\": \"CINCINNATI\",\n     \"stateProvince\": \"OH\",\n     \"postcode\": \"45247-5934\",\n     \"countryCode\": \"US\",\n     \"email\": \"test@gogreenfeather.com\",\n     \"telephone\": \"(513) 385-5591\",\n     \"sameAsBilling\": false,\n     \"shipping\": true,\n     \"billing\": false\n   },\n   \"billingAddress\": {\n     \"id\": \"01FDTFDSTKFFZHZW6TJ7A882ZA\",\n     \"orderId\": \"01FDTFXZZ25GXZFWZZZYS1TJGT\",\n     \"firstName\": \"TERRENCE\",\n     \"lastName\": \"CLARKE\",\n     \"line1\": \"6110 WILMER RD\",\n     \"city\": \"CINCINNATI\",\n     \"stateProvince\": \"OH\",\n     \"postcode\": \"45247-5934\",\n     \"countryCode\": \"US\",\n     \"email\": \"test@gogreenfeather.com\",\n     \"telephone\": \"(513) 385-5591\",\n     \"sameAsBilling\": false,\n     \"shipping\": false,\n     \"billing\": true\n   },\n   \"orderItems\": [\n     {\n       \"id\": \"01FDTBFXWZ3K1VXSFZJDZ45JF5\",\n       \"orderId\": \"01FDTFXZZ25GXZFWZZZYS1TJGT\",\n       \"quantity\": 1,\n       \"unitPrice\": 10000,\n       \"name\": \"Dental procedure\",\n       \"sku\": \"34587549834\",\n       \"hidden\": true,\n       \"friendlyName\": \"Dental Fee\",\n       \"bundleId\": \"1\",\n       \"externalPmsId\":\"10002347\",\n       \"pmsId\": \"23\"\n     },\n     {\n       \"id\": \"01FDTEDXHPWFJNDBZQS8W743A4\",\n       \"orderId\": \"01FDTFXZZ25GXZFWZZZYS1TJGT\",\n       \"quantity\": 1,\n       \"unitPrice\": 10000,\n       \"name\": \"cavityFilling\",\n       \"sku\": \"CavityFillingSKU1\",\n       \"hidden\": false,\n       \"friendlyName\": \"Cavity Filling\",\n       \"externalPmsId\":\"10002348\",\n       \"pmsId\": \"24\"\n     }\n   ],\n   \"invoiceType\": \"Payment\"\n }\n",
        "language": "200",
        "customLabel": ""
      },
      {
        "id": "i--B0CW-nFoCrWXX5weSz",
        "code": "{\n  \"subErrors\": [],\n  \"status\": \"invalid_external_patient\",\n  \"message\": \"Cannot find patient with external ID of abc123 and DOB 1959-10-22\"\n}\t",
        "language": "400",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "c0f7bjPcqHaJiKYiBqEF0"
  },
  "examples": {
    "languages": [
      {
        "id": "TsJH4BARuElrAzdNuPV8E",
        "code": "curl -X POST \\\n  --url 'https://test-api.featherpay.io/api/v1/stores/:storeId/orders' \\\n  --header 'content-type: application/json;charset=UTF-8' \\\n  --header 'accept: application/json' \\\n  --header 'X-Api-Key: {Secret API Key}' \\\n  --header 'X-Store-Id: {Store ULID}' \\\n  --data '{\n      \"posOrderId\": \"Invoice Reference Id via API\", //Your reference id for this invoice\n      \"storeId\": {Store ULID}, //Store ID we give you with keys for a given store\n      \"totalInvoiced\": 20000, // $200.00.  \n      \"patientId\": \"01F79XZZZZC2WKBZJ3XQ7Z1R64\", // Optional. FeatherPay Patient Identifier\n      \"externalPatientId\": \"abc123\", // Optional. PMS Patient Identifier\n      \"savePatient\": false, // Set to true to save patient info using externalPatientId.  FeatherPay will reply with the patientId to be used in future transactions\n      \"customerDOB\": \"1959-10-22\", // Required IF using externalPatientId. In format of `YYYY-MM-DD`\n      \"customerEmail\": \"test@featherpay.io\",\n      \"customerFirstName\": \"TERRENCE\",\n      \"customerLastName\": \"CLARKE\",\n      \"onBehalfOf\": \"jane.doe@merchant.com\", //Identifier of merchant generating invoice. User readable format recommended, eg name or email\n      \"enablePaymentPlanForPatient\": true, // Optional.  Default to store level if not specified\n      \"shippingAddress\": { // Optional\n        \"firstName\": \"TERRENCE\",\n        \"lastName\": \"CLARKE\",\n        \"line1\": \"6110 WILMER RD\",\n        \"city\": \"CINCINNATI\",\n        \"stateProvince\": \"OH\",\n        \"postcode\": \"45247-5934\",\n        \"countryCode\": \"US\",\n        \"email\": \"test@gogreenfeather.com\",\n        \"telephone\": \"(513) 385-5591\",\n        \"sameAsBilling\": false\n      },\n      \"billingAddress\": {\n        \"firstName\": \"TERRENCE\",\n        \"lastName\": \"CLARKE\",\n        \"line1\": \"6110 WILMER RD\",\n        \"city\": \"CINCINNATI\",\n        \"stateProvince\": \"OH\",\n        \"postcode\": \"45247-5934\",\n        \"countryCode\": \"US\",\n        \"email\": \"test@gogreenfeather.com\",\n        \"telephone\": \"(513) 385-5591\"\n      },\n      \"orderItems\": [\n        {\n          \"quantity\": 1,\n          \"unitPrice\": 10000, //$100.00\n          \"name\": \"Dental procedure\",\n          \"sku\": \"D2740\", //  Code or unique identifier for product/service/procedure \n          \"hidden\": false, // Optional. If true, this will not be displayed to the patient.\n          \"friendlyName\": \"Dental Fee\", //Optional.  If this field exists, it will be the display we show the customer at payment time.\n          \"bundleId\": \"1\", //Optional.  If this field exists, it will group all items with the same bundle id together.  Otherwise, the item will be treated as an individual line item\n          \"externalPmsId\":\"10002347\", //Optional.  This is s a 3rd Party's identifer for a procedure\n          \"pmsId\": \"23\" //Optional. This is the PMS (OpenDental, EagleSoft, etc) identifier for a procedure\n        },\n        {\n          \"quantity\": 1,\n          \"unitPrice\": 10000,\n          \"name\": \"cavityFilling\",\n          \"sku\": \"CavityFillingSKU1\",\n          \"hidden\": false, \n          \"friendlyName\": \"Cavity Filling\",\n          \"externalPmsId\":\"10002348\",\n          \"pmsId\": \"24\"\n      \n        }\n      ],\n      \"invoiceType\": \"{TextValue}\" // Payment, Statement, or Unset used to trigger default payment reminders\n}'",
        "language": "json",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "TsJH4BARuElrAzdNuPV8E"
  },
  "description": "From your backend code, create the order with your store id and private key.",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::



