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/v1
Production API Server
https://api.fulfillment.juniperhealth.com/v1

Create, retrieve, and manage customer orders

Operations

Request

Submit a new customer order with product line items and shipping details

Security
oauth2ClientCredentials
Bodyapplication/jsonrequired

Order details to be created in the system

customerobjectrequired

Customer information for the order

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 or null<= 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 order is intended to supply

Enum306090
lineItemsArray of objectsnon-emptyrequired

Products included in the order

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 (required for pack items, optional for external items like powders)

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

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.

shippingMethodstringrequired

Shipping method for the order

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

Type of order (this is currently only used for inventory forecasting by Juniper)

Enum"ONE_TIME""SUBSCRIPTION"
Example: "ONE_TIME"
curl -i -X POST \
  https://api.fulfillment.sandbox.juniperhealth.com/v1/orders \
  -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": "ONE_TIME"
  }'

Responses

Order successfully created

Bodyapplication/json
idstring

Unique order identifier

Example: "2vSGym0bH8qVEwCIGlyFoRgJq1A"
discountstring

Discount percentage applied to the order

Example: "10%"
daysSupplyinteger

Number of days the order is intended to supply

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

Current status of the order

Enum"NEW""PROCESSING""DISPENSING""FILLED""FULFILLED""AWAITING_SHIPMENT""SHIPPED""DELIVERED""CANCELLED"
Example: "NEW"
fulfillmentInfoobject or null

Details about the order fulfillment process. The object itself is null until the order has shipped, and individual fields are null until the carrier provides them.

lineItemsArray of objects

Products included in the order

customerobject(Customer)

Customer information

subtotalPricestring

Order subtotal amount

Example: "30.00"
totalDiscountstring

Total discount amount applied to the order

Example: "27.00"
totalFeesstring

Total for handling fees on external products. Each external item has a $5 handling fee.

Example: "5.00"
totalShippingstring

Shipping cost

Example: "9.99"
totalVolumeDiscountstring

Additional discount as for purchasing a days supply over the specified volume discount limits.

Example: "12.10"
totalPricestring

Total order amount (subtotal + shipping)

Example: "36.99"
createdAtstring(date-time)

Order creation timestamp

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

Order last update timestamp

Example: "2023-10-01T12:00:00Z"
Response
application/json
{ "id": "2vSGym0bH8qVEwCIGlyFoRgJq1A", "discount": "10%", "daysSupply": 30, "orderType": "SUBSCRIPTION", "shippingMethod": "STANDARD", "status": "NEW", "fulfillmentInfo": { "carrier": "UPS", "trackingNumber": "1Z9999999999999999", "trackingStatus": "InTransit", "trackingUrl": "https://www.ups.com/track?tracknum=1Z9999999999999999", "checkpoints": [] }, "lineItems": [ {} ], "customer": { "sourceId": "1234567890", "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "phone": "1234567890", "address": {} }, "subtotalPrice": "30.00", "totalDiscount": "27.00", "totalFees": "5.00", "totalShipping": "9.99", "totalVolumeDiscount": "12.10", "totalPrice": "36.99", "createdAt": "2023-10-01T12:00:00Z", "updatedAt": "2023-10-01T12:00:00Z" }

Request

Retrieve a list of orders with optional filtering

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

Filter orders by status

Enum"NEW""PROCESSING""DISPENSING""FILLED""FULFILLED""AWAITING_SHIPMENT""SHIPPED""DELIVERED""CANCELLED"
searchstring

Fuzzy search orders by customer name

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

Responses

Successfully retrieved orders

Bodyapplication/json
ordersArray of objects(Order)
cursorstring or null(Cursor)

Pagination cursor for retrieving next/previous page. Null when there are no more pages in the requested direction.

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

Request

Get detailed information for a specific order

Security
oauth2ClientCredentials
Path
orderIdstringrequired
Example: 2vSGym0bH8qVEwCIGlyFoRgJq1A
curl -i -X GET \
  https://api.fulfillment.sandbox.juniperhealth.com/v1/orders/2vSGym0bH8qVEwCIGlyFoRgJq1A \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Successfully retrieved order details

Bodyapplication/json
idstring

Unique order identifier

Example: "2vSGym0bH8qVEwCIGlyFoRgJq1A"
discountstring

Discount percentage applied to the order

Example: "10%"
daysSupplyinteger

Number of days the order is intended to supply

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

Current status of the order

Enum"NEW""PROCESSING""DISPENSING""FILLED""FULFILLED""AWAITING_SHIPMENT""SHIPPED""DELIVERED""CANCELLED"
Example: "NEW"
fulfillmentInfoobject or null

Details about the order fulfillment process. The object itself is null until the order has shipped, and individual fields are null until the carrier provides them.

lineItemsArray of objects

Products included in the order

customerobject(Customer)

Customer information

subtotalPricestring

Order subtotal amount

Example: "30.00"
totalDiscountstring

Total discount amount applied to the order

Example: "27.00"
totalFeesstring

Total for handling fees on external products. Each external item has a $5 handling fee.

Example: "5.00"
totalShippingstring

Shipping cost

Example: "9.99"
totalVolumeDiscountstring

Additional discount as for purchasing a days supply over the specified volume discount limits.

Example: "12.10"
totalPricestring

Total order amount (subtotal + shipping)

Example: "36.99"
createdAtstring(date-time)

Order creation timestamp

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

Order last update timestamp

Example: "2023-10-01T12:00:00Z"
Response
application/json
{ "id": "2vSGym0bH8qVEwCIGlyFoRgJq1A", "discount": "10%", "daysSupply": 30, "orderType": "SUBSCRIPTION", "shippingMethod": "STANDARD", "status": "NEW", "fulfillmentInfo": { "carrier": "UPS", "trackingNumber": "1Z9999999999999999", "trackingStatus": "InTransit", "trackingUrl": "https://www.ups.com/track?tracknum=1Z9999999999999999", "checkpoints": [] }, "lineItems": [ {} ], "customer": { "sourceId": "1234567890", "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "phone": "1234567890", "address": {} }, "subtotalPrice": "30.00", "totalDiscount": "27.00", "totalFees": "5.00", "totalShipping": "9.99", "totalVolumeDiscount": "12.10", "totalPrice": "36.99", "createdAt": "2023-10-01T12:00:00Z", "updatedAt": "2023-10-01T12:00:00Z" }

Request

Cancel an order that has not yet entered processing. Orders can only be cancelled while in NEW status.

Security
oauth2ClientCredentials
Path
orderIdstringrequired
Example: 2vTgd30JFgnwLrgb383PcV9Rken
curl -i -X POST \
  https://api.fulfillment.sandbox.juniperhealth.com/v1/orders/2vTgd30JFgnwLrgb383PcV9Rken/cancel \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Order successfully cancelled

Bodyapplication/json
orderIdstring

ID of the cancelled order

Example: "2vTYQiGzufR4cn1cloW97DtSOYF"
statusstring

Order status

Example: "CANCELLED"
Response
application/json
{ "orderId": "2vTYQiGzufR4cn1cloW97DtSOYF", "status": "CANCELLED" }

Create and manage reusable order protocols/templates

Operations

Access product catalog and inventory details

Operations

Retrieve available shipping methods

Operations

Manage partner account settings and branding

Operations