Create, retrieve, and manage customer orders
- Get Protocol Details
Order Fulfillment API (1.0.2)
API for creating/managing supplements orders within the Juniper Health platform.
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_SECRETResponse:
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 3600,
"token_type": "Bearer"
}Include the token in API requests using the Authorization header:
Authorization: Bearer YOUR_ACCESS_TOKENRequest
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.
Customer information for the protocol
Physical address information
Secondary address line (optional)
Products included in the protocol
Description of the product packaging
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.
Shipping method for the protocol
- Sandbox API Server for testinghttps://api.fulfillment.sandbox.juniperhealth.com/v1/protocols
- Production API Serverhttps://api.fulfillment.juniperhealth.com/v1/protocols
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://api.fulfillment.sandbox.juniperhealth.com/v1/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"
}'Protocol successfully created
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.
Order type (one-time or subscription). Nullable: protocols created via flows where the order type is decided at checkout time return null here.
Selected shipping method. Nullable: protocols created via flows where shipping is decided on the subscription return null here.
Protocol subtotal amount. Nullable: pricing is computed at checkout time for protocols created via modern flows.
{ "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" }
- Sandbox API Server for testinghttps://api.fulfillment.sandbox.juniperhealth.com/v1/protocols
- Production API Serverhttps://api.fulfillment.juniperhealth.com/v1/protocols
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://api.fulfillment.sandbox.juniperhealth.com/v1/protocols?limit=10&cursor=string&direction=next&search=John+Doe' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'{ "protocols": [ { … } ], "cursor": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." }
- Sandbox API Server for testinghttps://api.fulfillment.sandbox.juniperhealth.com/v1/protocols/{protocolId}
- Production API Serverhttps://api.fulfillment.juniperhealth.com/v1/protocols/{protocolId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
https://api.fulfillment.sandbox.juniperhealth.com/v1/protocols/2vTgd30JFgnwLrgb383PcV9Rken \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'Successfully retrieved protocol details
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.
Order type (one-time or subscription). Nullable: protocols created via flows where the order type is decided at checkout time return null here.
Selected shipping method. Nullable: protocols created via flows where shipping is decided on the subscription return null here.
Protocol subtotal amount. Nullable: pricing is computed at checkout time for protocols created via modern flows.
{ "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" }
Customer information for the protocol
Physical address information
Secondary address line (optional)
Products included in the protocol
Description of the product packaging
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.
Shipping method for the protocol
- Sandbox API Server for testinghttps://api.fulfillment.sandbox.juniperhealth.com/v1/protocols/{protocolId}
- Production API Serverhttps://api.fulfillment.juniperhealth.com/v1/protocols/{protocolId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
https://api.fulfillment.sandbox.juniperhealth.com/v1/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"
}'Protocol successfully updated
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.
Order type (one-time or subscription). Nullable: protocols created via flows where the order type is decided at checkout time return null here.
Selected shipping method. Nullable: protocols created via flows where shipping is decided on the subscription return null here.
Protocol subtotal amount. Nullable: pricing is computed at checkout time for protocols created via modern flows.
{ "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" }
- Sandbox API Server for testinghttps://api.fulfillment.sandbox.juniperhealth.com/v1/protocols/{protocolId}
- Production API Serverhttps://api.fulfillment.juniperhealth.com/v1/protocols/{protocolId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
https://api.fulfillment.sandbox.juniperhealth.com/v1/protocols/2vTgd30JFgnwLrgb383PcV9Rken \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'{ "protocolId": "2vTgd30JFgnwLrgb383PcV9Rken", "message": "Protocol deleted successfully" }