# Create a New Protocol Create a reusable order protocol/template with customer information, product line items, and shipping details. Protocols can be used to quickly generate orders with pre-configured settings. Endpoint: POST /protocols Version: 1.0.2 Security: oauth2ClientCredentials ## Request fields (application/json): - `customer` (object, required) Customer information for the protocol - `customer.sourceId` (string, required) Unique customer identifier in your system Example: "1234567890" - `customer.firstName` (string, required) Customer's first name Example: "John" - `customer.lastName` (string, required) Customer's last name Example: "Doe" - `customer.email` (string) Customer's email address Example: "john.doe@example.com" - `customer.phone` (string) Customer's phone number Example: "1234567890" - `customer.address` (object, required) Physical address information - `customer.address.line1` (string, required) Primary address line Example: "437 Lytton" - `customer.address.line2` (string) Secondary address line (optional) Example: "Suite 100" - `customer.address.city` (string, required) City name Example: "Palo Alto" - `customer.address.state` (string, required) State or province code Example: "CA" - `customer.address.zipCode` (string, required) Postal/ZIP code (5 digits) Example: "94301" - `daysSupply` (integer, required) Number of days the protocol is intended to supply Enum: 30, 60, 90 - `lineItems` (array, required) Products included in the protocol - `lineItems.productId` (integer, required) Unique identifier of the product Example: 77123129891 - `lineItems.quantity` (integer, required) Quantity of the product Example: 2 - `lineItems.packDescription` (string) Description of the product packaging Example: "Whole Body Wellness" - `lineItems.administration` (object) Dosage schedule information specifying how many pills to take at each time of day. Note: The sum of morning + afternoon + evening + sleep must equal the line item quantity. - `lineItems.administration.morning` (integer, required) Morning dosage quantity Example: 1 - `lineItems.administration.afternoon` (integer, required) Afternoon dosage quantity - `lineItems.administration.evening` (integer, required) Evening dosage quantity Example: 1 - `lineItems.administration.sleep` (integer, required) Bedtime dosage quantity - `shippingMethod` (string, required) Shipping method for the protocol Enum: "STANDARD", "EXPRESS", "OVERNIGHT" - `orderType` (string, required) Order type Enum: "ONE_TIME", "SUBSCRIPTION" ## Response 201 fields (application/json): - `id` (string) Unique protocol identifier Example: "2vSGym0bH8qVEwCIGlyFoRgJq1A" - `customer` (object) Customer information - `customer.sourceId` (string, required) Unique customer identifier in the partner system Example: "1234567890" - `customer.firstName` (string, required) Customer's first name Example: "John" - `customer.lastName` (string, required) Customer's last name Example: "Doe" - `customer.email` (string) Customer's email address Example: "john.doe@example.com" - `customer.phone` (string) Customer's phone number Example: "1234567890" - `customer.address` (object, required) Physical address information - `customer.address.line1` (string, required) Primary address line Example: "437 Lytton" - `customer.address.line2` (string) Secondary address line (optional) Example: "Suite 100" - `customer.address.city` (string, required) City name Example: "Palo Alto" - `customer.address.state` (string, required) State or province code Example: "CA" - `customer.address.zipCode` (string, required) Postal/ZIP code (5 digits) Example: "94301" - `daysSupply` (integer) Number of days the protocol is intended to supply Enum: 30, 60, 90 - `orderType` (string) Order type (one-time or subscription) Enum: "ONE_TIME", "SUBSCRIPTION" - `shippingMethod` (string) Selected shipping method Enum: "STANDARD", "EXPRESS", "OVERNIGHT" - `discount` (string) Discount percentage applied Example: "10%" - `lineItems` (array) Products included in the protocol - `lineItems.productId` (integer) Unique identifier of the product Example: 77123129891 - `lineItems.name` (string) Product name Example: "Elite EPA" - `lineItems.quantity` (integer) Quantity of the product Example: 2 - `lineItems.packDescription` (string) Description of the product packaging Example: "Whole Body Wellness" - `lineItems.price` (string) Per pill price of product Example: "0.37" - `lineItems.discountedPrice` (string) Per pill price with partner discount applied Example: "0.33" - `lineItems.totalPrice` (string) Total price for this line item Example: "29.70" - `lineItems.external` (boolean) Whether this is an external product - `lineItems.imageUrl` (string) URL to the product image Example: "https://example.com/images/elite-epa.jpg" - `lineItems.administration` (object) Dosage schedule information specifying how many pills to take at each time of day. Note: The sum of morning + afternoon + evening + sleep must equal the line item quantity. - `lineItems.administration.morning` (integer, required) Morning dosage quantity Example: 1 - `lineItems.administration.afternoon` (integer, required) Afternoon dosage quantity - `lineItems.administration.evening` (integer, required) Evening dosage quantity Example: 1 - `lineItems.administration.sleep` (integer, required) Bedtime dosage quantity - `subtotalPrice` (string) Protocol subtotal amount Example: "30.00" - `totalDiscount` (string) Total discount amount Example: "3.00" - `totalFees` (string) Total handling fees for external products Example: "5.00" - `totalVolumeDiscount` (string) Additional volume discount Example: "0.00" - `totalShipping` (string) Shipping cost Example: "9.99" - `totalPrice` (string) Total protocol amount Example: "41.99" - `createdAt` (string) Protocol creation timestamp Example: "2023-10-01T12:00:00Z" - `updatedAt` (string) Protocol last update timestamp Example: "2023-10-01T12:00:00Z" ## Response 400 fields (application/json): - `detail` (string, required) Detailed error message explaining the bad request Example: "Invalid request parameters" ## Response 422 fields (application/json): - `detail` (array) List of specific validation errors - `detail.loc` (array, required) Location of the error in the request body - `detail.type` (string, required) Type of validation error Enum: "missing", "invalid", "type_error"