API Reference
Products

Products

Products represent in-app purchase or subscription items from Apple App Store, Google Play, or Stripe. They map store-specific product IDs to your project and can carry entitlement information used by campaigns and audience targeting.

All product endpoints require a private API key (Authorization: Bearer sk_...).


Create a Product

POST /v1/projects/:id/products

Request Body

FieldTypeRequiredDescription
namestringYesDisplay name for the product
storestringYesStore type: apple, google, or stripe
storeProductIdstringYesThe product identifier in the store (e.g., com.app.monthly_pro)
basePlanIdstringNoGoogle Play base plan ID (only relevant for google store)
offerIdsstring[]NoArray of promotional offer IDs
entitlementsstring[]NoArray of entitlement keys this product grants (e.g., ["pro", "analytics"])
displayPricestringNoHuman-readable price string (e.g., "$9.99")
displayPeriodstringNoHuman-readable billing period (e.g., "monthly", "annual")

Example

curl -X POST https://agentwallie.com/api/v1/projects/PROJECT_ID/products \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk_your_private_key" \
  -d '{
    "name": "Pro Monthly",
    "store": "apple",
    "storeProductId": "com.myapp.pro_monthly",
    "entitlements": ["pro", "analytics"],
    "displayPrice": "$9.99",
    "displayPeriod": "monthly"
  }'

Response 201 Created

{
  "id": "prod_abc123",
  "name": "Pro Monthly",
  "store": "apple",
  "storeProductId": "com.myapp.pro_monthly",
  "basePlanId": null,
  "offerIds": "[\"summer_sale\"]",
  "entitlements": "[\"pro\",\"analytics\"]",
  "displayPrice": "$9.99",
  "displayPeriod": "monthly",
  "projectId": "PROJECT_ID",
  "createdAt": "2025-01-15T10:00:00.000Z",
  "updatedAt": "2025-01-15T10:00:00.000Z"
}
⚠️

offerIds and entitlements are stored as JSON-encoded strings. When reading products, parse these fields from their string representation.


List Products

GET /v1/projects/:id/products

Returns all products for the project.

Example

curl https://agentwallie.com/api/v1/projects/PROJECT_ID/products \
  -H "Authorization: Bearer sk_your_private_key"

Response 200 OK

[
  {
    "id": "prod_abc123",
    "name": "Pro Monthly",
    "store": "apple",
    "storeProductId": "com.myapp.pro_monthly",
    "basePlanId": null,
    "offerIds": null,
    "entitlements": "[\"pro\"]",
    "displayPrice": "$9.99",
    "displayPeriod": "monthly",
    "projectId": "PROJECT_ID",
    "createdAt": "2025-01-15T10:00:00.000Z",
    "updatedAt": "2025-01-15T10:00:00.000Z"
  },
  {
    "id": "prod_def456",
    "name": "Pro Annual",
    "store": "google",
    "storeProductId": "pro_annual",
    "basePlanId": "annual-base",
    "offerIds": null,
    "entitlements": "[\"pro\"]",
    "displayPrice": "$79.99",
    "displayPeriod": "annual",
    "projectId": "PROJECT_ID",
    "createdAt": "2025-01-15T10:05:00.000Z",
    "updatedAt": "2025-01-15T10:05:00.000Z"
  }
]

Update a Product

PUT /v1/projects/:id/products/:pid

All fields are optional. Only provided fields are updated.

Request Body

FieldTypeDescription
namestringNew display name
storestringapple, google, or stripe
storeProductIdstringNew store product identifier
basePlanIdstringGoogle Play base plan ID
offerIdsstring[]Replacement offer IDs
entitlementsstring[]Replacement entitlement keys
displayPricestringUpdated price string
displayPeriodstringUpdated period string

Example

curl -X PUT https://agentwallie.com/api/v1/projects/PROJECT_ID/products/prod_abc123 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk_your_private_key" \
  -d '{
    "displayPrice": "$7.99",
    "entitlements": ["pro", "analytics", "export"]
  }'

Response 200 OK

Returns the updated product object.


Delete a Product

DELETE /v1/projects/:id/products/:pid

Example

curl -X DELETE https://agentwallie.com/api/v1/projects/PROJECT_ID/products/prod_abc123 \
  -H "Authorization: Bearer sk_your_private_key"

Response 204 No Content

No response body.


Store Types

StoreDescriptionNotes
appleApple App StoreUses storeProductId as the App Store product identifier
googleGoogle PlaySupports basePlanId for subscription base plans and offerIds for promotional offers
stripeStripeUses storeProductId as the Stripe Price or Product ID