Skip to content

Products

briansemify edited this page Oct 24, 2025 · 7 revisions

Products / Service Plan Attachment

Attach service plans (products) to accounts or campaigns.

All endpoints require Authorization with Bearer JWT token.

Available Product Plans

Product Name Product ID
SEO Grow 3012
SEO Leap 3022
SEO Soar 3032

Available Endpoints

Get Service Plans for Campaign and Account

  • Endpoint: GET /api/v1/products/plans/campaigns/{campaign_id}/accounts/{account_id}
  • Description: Returns available service plans for a given campaign and account
  • Parameters:
    • campaign_id (integer): Numeric ID of the campaign to retrieve service plans for
    • account_id (integer): Numeric ID of the account to retrieve service plans for

Create and Attach Service Plan

  • Endpoint: POST /api/v1/products/plans/campaigns
  • Description: Attaches a product plan to an account
  • Required Fields:
    • account_id (integer): Account ID to attach the service plan to
    • campaign_id (integer): Campaign ID to attach the service plan to
    • service_plan_id (integer): Service plan ID (e.g., 3012, 3022, 3032)

Example Requests

Get Available Service Plans

curl -H "Authorization: Bearer $TOKEN" \
     -H "Content-Type: application/json" \
     "https://developers.semify.com/api/v1/products/plans/campaigns/26939/accounts/1"

Attach Service Plan to Campaign

curl -X POST \
     -H "Authorization: Bearer $TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
       "account_id": 12345,
       "campaign_id": 54321,
       "service_plan_id": 3012
     }' \
     "https://developers.semify.com/api/v1/products/plans/campaigns"

Sample Responses

Get Service Plans Response

{
  "data": [
    {
      "service_plan_id": 3012,
      "plan_name": "SEO Grow",
      "description": "Basic SEO service plan",
      "price": 299.00,
      "billing_interval": "monthly"
    },
    {
      "service_plan_id": 3022,
      "plan_name": "SEO Leap", 
      "description": "Advanced SEO service plan",
      "price": 499.00,
      "billing_interval": "monthly"
    }
  ],
  "messages": ["Service plan retrieval success"],
  "error": false,
  "pagination": {
    "totalPages": 1,
    "maxRows": 0,
    "offset": 0,
    "page": 1,
    "totalRecords": 3
  }
}

Attach Service Plan Response

{
  "data": {
    "account_id": 12345,
    "campaign_id": 54321,
    "service_plan_id": 3012
  },
  "error": false,
  "pagination": {
    "totalPages": 1,
    "maxRows": 0,
    "offset": 0,
    "page": 1,
    "totalRecords": 1
  },
  "messages": [
    "Successful plan attachment"
  ]
}

Typical Workflow

  1. Retrieve available service plans: GET /api/v1/products/plans/campaigns/{campaign_id}/accounts/{account_id}
  2. Attach service plan to campaign: POST /api/v1/products/plans/campaigns
  3. Confirm service plan is active on campaign

Important Notes

  • Service Plan Validation: Validate product availability for your reseller account before attachment
  • Campaign Association: Service plans are attached to specific campaigns within accounts
  • Billing Integration: Service plans include billing intervals and pricing information
  • Error Handling: Check response messages for attachment success or failure

Recommendations

  • Validate product availability for your reseller account
  • Record billing identifiers in attributes or external_* fields for reconciliation
  • Implement proper error handling for service plan attachment operations
  • Store service plan IDs for future reference and management

Clone this wiki locally