Skip to content

Order Fulfillment API (1.0.2)

API for creating/managing supplements orders within the Juniper Health platform.

Authentication

This API uses OAuth 2.0 Client Credentials flow. To obtain an access token:

Token Endpoints:

  • Sandbox: https://auth.fulfillment.sandbox.juniperhealth.com/oauth2/token
  • Production: https://auth.fulfillment.juniperhealth.com/oauth2/token

Request:

POST /oauth2/token
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET

Response:

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expires_in": 3600,
  "token_type": "Bearer"
}

Include the token in API requests using the Authorization header:

Authorization: Bearer YOUR_ACCESS_TOKEN
Download OpenAPI description
Overview
Juniper Health Engineering Team
Languages
Servers
Sandbox API Server for testing
https://api.fulfillment.sandbox.juniperhealth.com
Production API Server
https://api.fulfillment.juniperhealth.com

Orders

Create, retrieve, and manage customer orders

Operations

Protocols

Create and manage reusable order protocols/templates

Operations

Request

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.

Security
oauth2ClientCredentials
Bodyapplication/jsonrequired
customerobjectrequired

Customer information for the protocol

customer.​sourceIdstringrequired

Unique customer identifier in your system

Example: "1234567890"
customer.​firstNamestringrequired

Customer's first name

Example: "John"
customer.​lastNamestringrequired

Customer's last name

Example: "Doe"
customer.​emailstring(email)

Customer's email address

Example: "john.doe@example.com"
customer.​phonestring

Customer's phone number

Example: "1234567890"
customer.​addressobject(Address)required

Physical address information

customer.​address.​line1string<= 100 charactersrequired

Primary address line

Example: "437 Lytton"
customer.​address.​line2string<= 100 characters

Secondary address line (optional)

Example: "Suite 100"
customer.​address.​citystring<= 50 charactersrequired

City name

Example: "Palo Alto"
customer.​address.​statestring= 2 charactersrequired

State or province code

Example: "CA"
customer.​address.​zipCodestring^\d{5}$required

Postal/ZIP code (5 digits)

Example: "94301"
daysSupplyintegerrequired

Number of days the protocol is intended to supply

Enum306090
lineItemsArray of objectsnon-emptyrequired

Products included in the protocol

lineItems[].​productIdintegerrequired

Unique identifier of the product

Example: 77123129891
lineItems[].​quantityinteger>= 1required

Quantity of the product

Example: 2
lineItems[].​packDescriptionstring

Description of the product packaging

Example: "Whole Body Wellness"
lineItems[].​administrationobject(Administration)

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.

shippingMethodstringrequired

Shipping method for the protocol

Enum"STANDARD""EXPRESS""OVERNIGHT"
Example: "STANDARD"
orderTypestringrequired

Order type

Enum"ONE_TIME""SUBSCRIPTION"
Example: "SUBSCRIPTION"
curl -i -X POST \
  https://api.fulfillment.sandbox.juniperhealth.com/protocols \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "customer": {
      "sourceId": "1234567890",
      "firstName": "John",
      "lastName": "Doe",
      "email": "john.doe@example.com",
      "phone": "1234567890",
      "address": {
        "line1": "437 Lytton",
        "line2": "Suite 100",
        "city": "Palo Alto",
        "state": "CA",
        "zipCode": "94301"
      }
    },
    "daysSupply": 30,
    "lineItems": [
      {
        "productId": 77123129891,
        "quantity": 2,
        "packDescription": "Whole Body Wellness",
        "administration": {
          "morning": 1,
          "afternoon": 0,
          "evening": 1,
          "sleep": 0
        }
      }
    ],
    "shippingMethod": "STANDARD",
    "orderType": "SUBSCRIPTION"
  }'

Responses

Protocol successfully created

Bodyapplication/json
idstring

Unique protocol identifier

Example: "2vSGym0bH8qVEwCIGlyFoRgJq1A"
customerobject(Customer)

Customer information

daysSupplyinteger

Number of days the protocol is intended to supply

Enum306090
Example: 30
orderTypestring

Order type (one-time or subscription)

Enum"ONE_TIME""SUBSCRIPTION"
Example: "SUBSCRIPTION"
shippingMethodstring

Selected shipping method

Enum"STANDARD""EXPRESS""OVERNIGHT"
Example: "STANDARD"
discountstring

Discount percentage applied

Example: "10%"
lineItemsArray of objects

Products included in the protocol

subtotalPricestring

Protocol subtotal amount

Example: "30.00"
totalDiscountstring

Total discount amount

Example: "3.00"
totalFeesstring

Total handling fees for external products

Example: "5.00"
totalVolumeDiscountstring

Additional volume discount

Example: "0.00"
totalShippingstring

Shipping cost

Example: "9.99"
totalPricestring

Total protocol amount

Example: "41.99"
createdAtstring(date-time)

Protocol creation timestamp

Example: "2023-10-01T12:00:00Z"
updatedAtstring(date-time)

Protocol last update timestamp

Example: "2023-10-01T12:00:00Z"
Response
application/json
{ "id": "2vSGym0bH8qVEwCIGlyFoRgJq1A", "customer": { "sourceId": "1234567890", "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "phone": "1234567890", "address": {} }, "daysSupply": 30, "orderType": "SUBSCRIPTION", "shippingMethod": "STANDARD", "discount": "10%", "lineItems": [ {} ], "subtotalPrice": "30.00", "totalDiscount": "3.00", "totalFees": "5.00", "totalVolumeDiscount": "0.00", "totalShipping": "9.99", "totalPrice": "41.99", "createdAt": "2023-10-01T12:00:00Z", "updatedAt": "2023-10-01T12:00:00Z" }

Request

Retrieve a paginated list of protocols with optional search

Security
oauth2ClientCredentials
Query
limitinteger[ 1 .. 100 ]

Maximum number of results per page

Default 10
cursorstring

Pagination cursor for retrieving next/previous page

directionstring

Direction for pagination (next or previous)

Enum"next""previous"
searchstring

Search protocols by customer name

Example: search=John Doe
curl -i -X GET \
  'https://api.fulfillment.sandbox.juniperhealth.com/protocols?limit=10&cursor=string&direction=next&search=John+Doe' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Successfully retrieved protocols

Bodyapplication/json
protocolsArray of objects(Protocol)
cursorstring(Cursor)

Pagination cursor for retrieving next/previous page

Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Response
application/json
{ "protocols": [ {} ], "cursor": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." }

Request

Retrieve detailed information for a specific protocol

Security
oauth2ClientCredentials
Path
protocolIdstringrequired
Example: 2vTgd30JFgnwLrgb383PcV9Rken
curl -i -X GET \
  https://api.fulfillment.sandbox.juniperhealth.com/protocols/2vTgd30JFgnwLrgb383PcV9Rken \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Successfully retrieved protocol details

Bodyapplication/json
idstring

Unique protocol identifier

Example: "2vSGym0bH8qVEwCIGlyFoRgJq1A"
customerobject(Customer)

Customer information

daysSupplyinteger

Number of days the protocol is intended to supply

Enum306090
Example: 30
orderTypestring

Order type (one-time or subscription)

Enum"ONE_TIME""SUBSCRIPTION"
Example: "SUBSCRIPTION"
shippingMethodstring

Selected shipping method

Enum"STANDARD""EXPRESS""OVERNIGHT"
Example: "STANDARD"
discountstring

Discount percentage applied

Example: "10%"
lineItemsArray of objects

Products included in the protocol

subtotalPricestring

Protocol subtotal amount

Example: "30.00"
totalDiscountstring

Total discount amount

Example: "3.00"
totalFeesstring

Total handling fees for external products

Example: "5.00"
totalVolumeDiscountstring

Additional volume discount

Example: "0.00"
totalShippingstring

Shipping cost

Example: "9.99"
totalPricestring

Total protocol amount

Example: "41.99"
createdAtstring(date-time)

Protocol creation timestamp

Example: "2023-10-01T12:00:00Z"
updatedAtstring(date-time)

Protocol last update timestamp

Example: "2023-10-01T12:00:00Z"
Response
application/json
{ "id": "2vSGym0bH8qVEwCIGlyFoRgJq1A", "customer": { "sourceId": "1234567890", "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "phone": "1234567890", "address": {} }, "daysSupply": 30, "orderType": "SUBSCRIPTION", "shippingMethod": "STANDARD", "discount": "10%", "lineItems": [ {} ], "subtotalPrice": "30.00", "totalDiscount": "3.00", "totalFees": "5.00", "totalVolumeDiscount": "0.00", "totalShipping": "9.99", "totalPrice": "41.99", "createdAt": "2023-10-01T12:00:00Z", "updatedAt": "2023-10-01T12:00:00Z" }

Request

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

Security
oauth2ClientCredentials
Path
protocolIdstringrequired
Example: 2vTgd30JFgnwLrgb383PcV9Rken
Bodyapplication/jsonrequired
customerobjectrequired

Customer information for the protocol

customer.​sourceIdstringrequired

Unique customer identifier in your system

Example: "1234567890"
customer.​firstNamestringrequired

Customer's first name

Example: "John"
customer.​lastNamestringrequired

Customer's last name

Example: "Doe"
customer.​emailstring(email)

Customer's email address

Example: "john.doe@example.com"
customer.​phonestring

Customer's phone number

Example: "1234567890"
customer.​addressobject(Address)required

Physical address information

customer.​address.​line1string<= 100 charactersrequired

Primary address line

Example: "437 Lytton"
customer.​address.​line2string<= 100 characters

Secondary address line (optional)

Example: "Suite 100"
customer.​address.​citystring<= 50 charactersrequired

City name

Example: "Palo Alto"
customer.​address.​statestring= 2 charactersrequired

State or province code

Example: "CA"
customer.​address.​zipCodestring^\d{5}$required

Postal/ZIP code (5 digits)

Example: "94301"
daysSupplyintegerrequired

Number of days the protocol is intended to supply

Enum306090
lineItemsArray of objectsnon-emptyrequired

Products included in the protocol

lineItems[].​productIdintegerrequired

Unique identifier of the product

Example: 77123129891
lineItems[].​quantityinteger>= 1required

Quantity of the product

Example: 2
lineItems[].​packDescriptionstring

Description of the product packaging

Example: "Whole Body Wellness"
lineItems[].​administrationobject(Administration)

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.

shippingMethodstringrequired

Shipping method for the protocol

Enum"STANDARD""EXPRESS""OVERNIGHT"
Example: "STANDARD"
orderTypestringrequired

Order type

Enum"ONE_TIME""SUBSCRIPTION"
Example: "SUBSCRIPTION"
curl -i -X PUT \
  https://api.fulfillment.sandbox.juniperhealth.com/protocols/2vTgd30JFgnwLrgb383PcV9Rken \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "customer": {
      "sourceId": "1234567890",
      "firstName": "John",
      "lastName": "Doe",
      "email": "john.doe@example.com",
      "phone": "1234567890",
      "address": {
        "line1": "437 Lytton",
        "line2": "Suite 100",
        "city": "Palo Alto",
        "state": "CA",
        "zipCode": "94301"
      }
    },
    "daysSupply": 30,
    "lineItems": [
      {
        "productId": 77123129891,
        "quantity": 2,
        "packDescription": "Whole Body Wellness",
        "administration": {
          "morning": 1,
          "afternoon": 0,
          "evening": 1,
          "sleep": 0
        }
      }
    ],
    "shippingMethod": "STANDARD",
    "orderType": "SUBSCRIPTION"
  }'

Responses

Protocol successfully updated

Bodyapplication/json
idstring

Unique protocol identifier

Example: "2vSGym0bH8qVEwCIGlyFoRgJq1A"
customerobject(Customer)

Customer information

daysSupplyinteger

Number of days the protocol is intended to supply

Enum306090
Example: 30
orderTypestring

Order type (one-time or subscription)

Enum"ONE_TIME""SUBSCRIPTION"
Example: "SUBSCRIPTION"
shippingMethodstring

Selected shipping method

Enum"STANDARD""EXPRESS""OVERNIGHT"
Example: "STANDARD"
discountstring

Discount percentage applied

Example: "10%"
lineItemsArray of objects

Products included in the protocol

subtotalPricestring

Protocol subtotal amount

Example: "30.00"
totalDiscountstring

Total discount amount

Example: "3.00"
totalFeesstring

Total handling fees for external products

Example: "5.00"
totalVolumeDiscountstring

Additional volume discount

Example: "0.00"
totalShippingstring

Shipping cost

Example: "9.99"
totalPricestring

Total protocol amount

Example: "41.99"
createdAtstring(date-time)

Protocol creation timestamp

Example: "2023-10-01T12:00:00Z"
updatedAtstring(date-time)

Protocol last update timestamp

Example: "2023-10-01T12:00:00Z"
Response
application/json
{ "id": "2vSGym0bH8qVEwCIGlyFoRgJq1A", "customer": { "sourceId": "1234567890", "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "phone": "1234567890", "address": {} }, "daysSupply": 30, "orderType": "SUBSCRIPTION", "shippingMethod": "STANDARD", "discount": "10%", "lineItems": [ {} ], "subtotalPrice": "30.00", "totalDiscount": "3.00", "totalFees": "5.00", "totalVolumeDiscount": "0.00", "totalShipping": "9.99", "totalPrice": "41.99", "createdAt": "2023-10-01T12:00:00Z", "updatedAt": "2023-10-01T12:00:00Z" }

Request

Delete an existing protocol

Security
oauth2ClientCredentials
Path
protocolIdstringrequired
Example: 2vTgd30JFgnwLrgb383PcV9Rken
curl -i -X DELETE \
  https://api.fulfillment.sandbox.juniperhealth.com/protocols/2vTgd30JFgnwLrgb383PcV9Rken \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Protocol successfully deleted

Bodyapplication/json
protocolIdstring

ID of the deleted protocol

Example: "2vTgd30JFgnwLrgb383PcV9Rken"
messagestring
Example: "Protocol deleted successfully"
Response
application/json
{ "protocolId": "2vTgd30JFgnwLrgb383PcV9Rken", "message": "Protocol deleted successfully" }

Products

Access product catalog and inventory details

Operations

Shipping

Retrieve available shipping methods

Operations

Partner Settings

Manage partner account settings and branding

Operations