API Details
Technical specification for the CashMyCell Order Completion API endpoint.
Endpoint Information
Base URL
https://api.cashmycell.comPath
/api/v1/public/order-completeMethod
GETFull URL Example
https://api.cashmycell.com/api/v1/public/order-complete?status=COMPLETED&order_value=1499&cmc_id=abc123xyz&ts=1704067200000Request Parameters
All parameters are passed as query parameters in the URL.
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
status | String | Yes | Order status indicator | COMPLETED |
order_value | String/Number | Yes | Total order amount in applicable currency | 1499 |
cmc_id | String | Yes | Click identifier provided by CashMyCell | abc123xyz789 |
ts | Number | Yes | Timestamp in milliseconds (Unix time) | 1704067200000 |
Parameter Details
status
- Value:
COMPLETED - Purpose: Indicates successful order completion
- Note: Only completed orders should trigger this endpoint
order_value
- Format: Numeric string or number
- Example:
"1499"or1499 - Currency: Use the order value in your system's currency (no currency conversion)
- Decimal: Can include decimals (e.g.,
"14.99")
cmc_id
- Source: Retrieved from cookie set by Script 1
- Format: URL-safe string
- Importance: Required to match conversion with CashMyCell click
- Encoding: Use
encodeURIComponent()for safe transmission
ts (Timestamp)
- Format: Unix timestamp in milliseconds
- Generation: Use
Date.now()in JavaScript - Purpose: Server-side timing validation
- Example:
1704067200000(January 2, 2024, 12:00 PM UTC)
Request Example
JavaScript/Fetch API
const cmcId = 'abc123xyz789';
const orderValue = '1499';
const timestamp = Date.now();
const url = `https://api.cashmycell.com/api/v1/public/order-complete?` +
`status=COMPLETED&` +
`order_value=${encodeURIComponent(orderValue)}&` +
`cmc_id=${encodeURIComponent(cmcId)}&` +
`ts=${timestamp}`;
// Using Image beacon (recommended)
const img = new Image();
img.src = url;
// Or using Fetch
fetch(url)
.then(response => console.log('Tracked'))
.catch(error => console.error('Tracking error:', error));cURL
curl "https://api.cashmycell.com/api/v1/public/order-complete?status=COMPLETED&order_value=1499&cmc_id=abc123xyz789&ts=1704067200000"Python Requests
import requests
import time
cmc_id = 'abc123xyz789'
order_value = '1499'
timestamp = int(time.time() * 1000)
url = 'https://api.cashmycell.com/api/v1/public/order-complete'
params = {
'status': 'COMPLETED',
'order_value': order_value,
'cmc_id': cmc_id,
'ts': timestamp
}
response = requests.get(url, params=params)
print(response.status_code)Response
Success Response (2xx)
The API returns a successful response regardless of parameter values. The response may be:
- 204 No Content (typical)
- 200 OK with minimal body
- Image response (when using tracking pixel)
No specific response body is guaranteed, as this is designed as a fire-and-forget tracking endpoint.
Response Format
// Minimal response (may vary)
HTTP/1.1 200 OK
Content-Type: image/gif
Content-Length: 43
GIF89a...Expected Behavior
- Request is asynchronously processed
- Response received immediately
- Data recorded on CashMyCell servers
- No correlation ID returned
Important Implementation Details
Encoding
Always URL-encode parameters that may contain special characters:
// Correct
encodeURIComponent('$1,499.99') // %241%2C499.99
// Wrong (will fail)
'$1,499.99' // Contains special charactersTracking Pixel Method (Recommended)
Using an Image beacon is preferred as it:
- Works cross-domain without CORS issues
- Fires asynchronously without blocking
- Minimal performance impact
- Proven reliable tracking method
const img = new Image();
img.src = trackingUrl;
// No need to wait for responseCORS Considerations
If using Fetch API, be aware of CORS headers. The tracking pixel method avoids CORS issues entirely.
Timestamp Requirements
- Must be current: Timestamp should be within reasonable window (±5 minutes recommended)
- Milliseconds: Use milliseconds, not seconds
- Server sync: Ensure client clock is reasonably synchronized
Verification Steps
Step 1: Test the URL
Visit the URL in your browser:
https://api.cashmycell.com/api/v1/public/order-complete?status=COMPLETED&order_value=100&cmc_id=test123&ts=1704067200000You should receive a response (may be invisible image).
Step 2: Check Network Tab
In browser DevTools:
- Open Network tab
- Place order on your website
- Look for request to
api.cashmycell.com/api/v1/public/order-complete - Verify response status is
200or204
Step 3: Verify Conversion
In CashMyCell dashboard, check if conversion appears within a few minutes.
Error Handling
Missing Parameters
If parameters are missing, the request may be:
- Silently ignored
- Rejected with 400 error
- Logged for debugging
Best practice: Always include all required parameters.
Invalid cmc_id
- Conversion won't match to CashMyCell click
- No error response (silent fail)
- Check cookie exists before sending
Duplicate Requests
If you send the same request twice:
- First: Recorded normally
- Second: May be deduplicated or recorded separately
- Best practice: Add guard to prevent duplicate Script 2 execution
Rate Limiting
The /api/v1/public/order-complete endpoint is designed to handle high volume:
- No strict rate limits per user
- Fair use policies apply
- Excessive requests may be throttled
Reasonable usage (one request per successful order) is always safe.
Migration from Old API
If you're upgrading from a previous tracking method:
- Keep old and new tracking in parallel (2-3 weeks)
- Monitor conversion data consistency
- Verify CashMyCell team can see conversions
- Remove old tracking when confident
Frequently Asked Questions
Can I send multiple orders in one request?
No. One request per order only. Send separate requests for each conversion.
What happens if cmc_id is invalid?
The request will still succeed (200/204), but conversion won't be attributed to any click. Always verify the cookie exists.
Is the endpoint available offline?
No, internet connectivity is required to reach the endpoint. If offline, the request will fail silently (no UI impact).
Can I batch requests?
No. Send one request per conversion. Batching is not supported.
How long does data take to appear?
Conversions typically appear in CashMyCell dashboard within 1-2 minutes.
Support
For technical support or integration questions:
- See Integration Guide
- Contact Support
- Email: tech@cashmycell.com