Create, retrieve, and manage customer orders
- Cancel an Order
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_TOKENOrder details to be created in the system
Customer information for the order
Physical address information
Secondary address line (optional)
Products included in the order
Description of the product packaging (required for pack items, optional for external items like powders)
Shipping method for the order
- Sandbox API Server for testinghttps://api.fulfillment.sandbox.juniperhealth.com/orders
- Production API Serverhttps://api.fulfillment.juniperhealth.com/orders
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://api.fulfillment.sandbox.juniperhealth.com/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"
}'Order successfully created
Order type (one-time or subscription)
Current status of the order
Total for handling fees on external products. Each external item has a $5 handling fee.
Additional discount as for purchasing a days supply over the specified volume discount limits.
{ "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" }
- Sandbox API Server for testinghttps://api.fulfillment.sandbox.juniperhealth.com/orders
- Production API Serverhttps://api.fulfillment.juniperhealth.com/orders
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://api.fulfillment.sandbox.juniperhealth.com/orders?limit=10&cursor=string&direction=next&status=NEW&search=John+Doe' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'{ "orders": [ { … } ], "cursor": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." }
- Sandbox API Server for testinghttps://api.fulfillment.sandbox.juniperhealth.com/orders/{orderId}
- Production API Serverhttps://api.fulfillment.juniperhealth.com/orders/{orderId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
https://api.fulfillment.sandbox.juniperhealth.com/orders/2vSGym0bH8qVEwCIGlyFoRgJq1A \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'Successfully retrieved order details
Order type (one-time or subscription)
Current status of the order
Total for handling fees on external products. Each external item has a $5 handling fee.
Additional discount as for purchasing a days supply over the specified volume discount limits.
{ "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" }
- Sandbox API Server for testinghttps://api.fulfillment.sandbox.juniperhealth.com/orders/{orderId}/cancel
- Production API Serverhttps://api.fulfillment.juniperhealth.com/orders/{orderId}/cancel
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://api.fulfillment.sandbox.juniperhealth.com/orders/2vTgd30JFgnwLrgb383PcV9Rken/cancel \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'{ "orderId": "2vTYQiGzufR4cn1cloW97DtSOYF", "status": "CANCELLED" }