Shopify Cash on Delivery Fee API Endpoints
Complete reference documentation for all available ACOD Cash on Delivery Fee Management API endpoints. All endpoints are accessible via HTTPS and require authentication for Shopify integration.
Base URL
All API endpoints are relative to: https://api.acod.app/v1
Fee Calculation
Calculate COD Fee
POST /calculate-feeCalculate the COD fee for a given cart and customer location.
Request Parameters
cart_total(required) - Total cart value in store currencycurrency(required) - Store currency code (INR, USD, etc.)shipping_address(required) - Customer's shipping address informationshipping_method(optional) - Selected shipping methoditems(optional) - Cart items for product-specific rules
Response
{
"cod_fee": {
"amount": 50,
"currency": "INR",
"type": "flat"
},
"rule_applied": {
"id": "rule_123",
"name": "Standard COD Fee"
},
"is_cod_available": true
}Get Fee Rules
GET /fee-rulesRetrieve all COD fee rules for the store.
Query Parameters
status(optional) - Filter rules by status (active, inactive)type(optional) - Filter rules by type (flat, percentage, mixed)
Create Fee Rule
POST /fee-rulesCreate a new COD fee rule.
Request Body
{
"name": "High Value Order Fee",
"description": "1% fee for orders over ₹10,000",
"conditions": {
"cart_value": {
"min": 10000
}
},
"fee": {
"type": "percentage",
"percentage": 1
},
"status": "active"
}Update Fee Rule
PUT /fee-rules/:idUpdate an existing COD fee rule.
Delete Fee Rule
DELETE /fee-rules/:idDelete a COD fee rule.
Location Management
Get Location Groups
GET /location-groupsRetrieve all location groups for COD fee rules.
Create Location Group
POST /location-groupsCreate a new location group for targeted COD fees.
Request Body
{
"name": "Remote Areas",
"locations": [
{
"type": "state",
"value": "Jammu & Kashmir"
},
{
"type": "postal_code_range",
"start": "190001",
"end": "192301"
}
],
"description": "Remote areas with higher delivery costs"
}Analytics
Get COD Order Statistics
GET /analytics/cod-ordersRetrieve statistics about COD orders.
Query Parameters
start_date(optional) - Start date for the report (default: 30 days ago)end_date(optional) - End date for the report (default: today)group_by(optional) - Group results by (day, week, month)
Rate Limiting
API calls are limited to 500 requests per minute per API key. For higher limits, please upgrade to a premium plan.
Next Steps
- Learn about API Authentication
- Understand Error Handling
- Check out Advanced Fee Conditions
