API Reference
The AppActor REST API. Base URL: https://api.appactor.com
Authenticationโ
- Public keys (
pk_*): client SDK endpoints - Secret keys (
sk_*): admin/server-to-server endpoints
Use one of:
Authorization: Bearer <key>
or
X-API-Key: <key>
Response Formatโ
Most endpoints return this envelope:
// Success
{ "data": { "...": "..." }, "requestId": "req_abc123" }
// Error
{ "error": { "code": "ERROR_CODE", "message": "..." }, "requestId": "req_abc123" }
Exception: POST /v1/payment/receipts/apple returns the SDK receipt-status contract (ok, retryable_error, permanent_error) instead of the generic envelope.
Client SDK Endpoints (pk_* key)โ
Identityโ
POST /v1/payment/identifyโ
Create or retrieve a user identity and return customer snapshot.
{
"appUserId": "user_123",
"platform": "ios",
"appVersion": "2.1.0",
"sdkVersion": "1.0.0",
"deviceLocale": "en_US",
"deviceModel": "iPhone15,2",
"osVersion": "17.0"
}
POST /v1/payment/loginโ
Switch from current user to a new user.
{
"currentAppUserId": "appactor-anon-abc",
"newAppUserId": "user_123"
}
POST /v1/payment/logoutโ
Logout current user.
{
"appUserId": "user_123"
}
Offeringsโ
GET /v1/payment/offeringsโ
Fetch server-driven offerings. Supports ETag / If-None-Match.
Customer Infoโ
GET /v1/customers/:appUserIdโ
Fetch customer entitlements/subscriptions for the given app user ID. Supports ETag / If-None-Match.
Receiptsโ
POST /v1/payment/receipts/appleโ
Submit Apple StoreKit 2 signed transaction (signedTransactionInfo) for validation.
{
"appUserId": "user_123",
"bundleId": "com.myapp.app",
"signedTransactionInfo": "<JWS string>",
"environment": "production"
}
Response status contract:
| Status | Meaning | SDK behavior |
|---|---|---|
ok | Receipt validated | Finish transaction |
retryable_error | Temporary/transient failure | Keep queued and retry |
permanent_error | Invalid/revoked/malformed receipt | Finish and discard |
POST /v1/payment/restoreโ
Restore purchases by submitting transactions/purchases.
{
"appUserId": "user_123",
"store": "apple",
"transactions": [
{
"transactionId": "12345",
"jwsRepresentation": "<JWS string>"
}
]
}
Remote Configโ
GET /v1/remote-configโ
Resolve active config values for the authenticated app context.
Query parameters:
| Parameter | Required | Description |
|---|---|---|
app_user_id | No | User ID for entitlement-based targeting |
app_version | No | App version for version targeting |
country | No | ISO 3166-1 alpha-2 country code |
Experimentsโ
POST /v1/experiments/:experimentKey/assignmentsโ
Assign (or return sticky assignment for) a user in an experiment.
Query parameters:
| Parameter | Required | Description |
|---|---|---|
app_user_id | Yes | User ID (max 256 chars) |
app_version | No | App version for targeting |
country | No | ISO 3166-1 alpha-2 country code |
Apple Search Adsโ
POST /v1/asa/attributionโ
Submit ASA attribution token payload.
POST /v1/asa/purchase-eventโ
Submit ASA purchase event payload.
Server-Side Endpoints (sk_* key)โ
User Managementโ
GET /v1/api/users/:idโ
Get user details.
DELETE /v1/api/users/:idโ
Soft-delete a user.
PUT /v1/api/users/:id/attributesโ
Patch/replace user attributes.
{
"attributes": {
"plan": "enterprise",
"seats": 50,
"trial": false
}
}
Entitlement Managementโ
POST /v1/api/users/:id/entitlements/:entitlementId/grantโ
Grant entitlement directly (promotional/manual).
{
"duration": "P30D"
}
Or:
{
"endTimeMs": 1706745600000
}
POST /v1/api/users/:id/entitlements/:entitlementId/revokeโ
Revoke manually granted entitlement.
ASA Identity Syncโ
POST /v1/asa/update-user-idโ
Server-to-server ASA identity update endpoint (requires secret key).
Webhook Endpointsโ
POST /v1/webhooks/apple/:tokenโ
Inbound Apple App Store Server Notifications V2.
POST /v1/webhooks/google/:appIdโ
Inbound Google Play Pub/Sub notifications.
Error Codesโ
| Code | HTTP Status | Description |
|---|---|---|
VALIDATION_ERROR | 400 | Invalid request payload/params |
UNAUTHORIZED | 401 | Invalid/missing API key |
NOT_FOUND | 404 | Resource not found |
CONFLICT | 409 | Conflict (e.g., identity collision) |
RATE_LIMIT_EXCEEDED | 429 | Request throttled |
INTERNAL | 500 | Internal server error |
Health Checkโ
GET /healthโ
Service health endpoint (no authentication required).
{
"status": "ok",
"timestamp": "2025-01-15T12:00:00Z"
}
Next Stepsโ
- API Authentication โ Key types and security model
- Webhooks โ Subscription event integration