# Update Protocol

Update an existing protocol with new customer, product, or shipping information

Endpoint: PUT /protocols/{protocolId}
Version: 1.0.2
Security: oauth2ClientCredentials

## Path parameters:

  - `protocolId` (string, required)
    Example: "2vTgd30JFgnwLrgb383PcV9Rken"

## 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,null)
    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,null)
    Dosage schedule information specifying how many pills to take at each time of day.

Null for external products (powders, liquids, standalone items outside the pill pack). For pack products, 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 200 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,null)
    Customer's email address
    Example: "john.doe@example.com"

  - `customer.phone` (string,null)
    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,null)
    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,null)
    Number of days the protocol is intended to supply. Nullable: protocols created via flows where days-supply lives on the subscription (not the protocol) return null here.
    Example: 30

  - `orderType` (string,null)
    Order type (one-time or subscription). Nullable: protocols created via flows where the order type is decided at checkout time return null here.
    Enum: "ONE_TIME", "SUBSCRIPTION"

  - `shippingMethod` (string,null)
    Selected shipping method. Nullable: protocols created via flows where shipping is decided on the subscription return null here.
    Enum: "STANDARD", "EXPRESS", "OVERNIGHT"

  - `discount` (string,null)
    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,null)
    URL to the product image
    Example: "https://example.com/images/elite-epa.jpg"

  - `lineItems.administration` (object,null)
    Dosage schedule information specifying how many pills to take at each time of day.

Null for external products (powders, liquids, standalone items outside the pill pack). For pack products, 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,null)
    Protocol subtotal amount. Nullable: pricing is computed at checkout time for protocols created via modern flows.
    Example: "30.00"

  - `totalDiscount` (string,null)
    Total discount amount
    Example: "3.00"

  - `totalFees` (string,null)
    Total handling fees for external products
    Example: "5.00"

  - `totalVolumeDiscount` (string,null)
    Additional volume discount
    Example: "0.00"

  - `totalShipping` (string,null)
    Shipping cost
    Example: "9.99"

  - `totalPrice` (string,null)
    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 404 fields (application/json):

  - `detail` (string, required)
    Detailed error message explaining the resource not found
    Example: "The requested resource could not be found"

## 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"


