Skip to main content
Version: 1.27 (Current)

Create Subscription

Audience: Citizen Developer, Pro Developer

Skill Prerequisites: APIs, Payment Gateway Integrations, Tokens

The Create Subscription action is used to create a recurring payment subscription through Authorize.Net. This powerful integration enables your application to charge customers' credit cards on a schedule you define—perfect for memberships, product subscriptions, or any recurring billing need.

It supports both Live and Test (Sandbox) modes, making it suitable for development, staging, or production environments. The action collects customer details, payment schedule, and subscription properties, then communicates securely with Authorize.Net’s API to initiate the subscription.

You can configure this action for complex scenarios, including trial periods, dynamic data via tokens, and downstream actions for webhook notifications (e.g., when a subscription is created, updated, cancelled, or expires).

Typical Use Cases

  • Creating monthly or yearly recurring billing for membership sites.
  • Automating payment collection for subscription-based services and SaaS platforms.
  • Handling introductory trial pricing and then converting to a regular payment plan.
  • Storing subscription and customer profile IDs for future API operations or record-keeping.
  • Responding to Authorize.Net webhook events (such as subscription renewal, suspension, or expiration) by executing custom logic in your app.
Action NameDescription
Run SQL QueryUse to log payments or update subscription records in your database.
Display MessageProvide feedback to users after subscription creation.
Apply TokensPopulate input fields dynamically with user data, form entries, or computed values.

Input Parameter Reference

ParameterDescriptionSupports TokensDefaultRequired
API Login IDYour Authorize.Net API Login ID.YesYes
Transaction KeyYour Authorize.Net Transaction Key.YesYes
Go LiveSwitch between Authorize.Net Sandbox (unchecked) and Production (checked).YesfalseNo
Subscription NameName of the subscription.YesNo
Subscription AmountAmount to bill each cycle. No $ sign (e.g., 8.95).YesYes
Subscription Trial AmountAmount for the trial period, if any.YesNo
Card NumberCustomer’s credit card number.YesYes
Card CCVCard security code (CVV/CCV).YesYes
Expiration MonthCredit card expiration month (e.g., 07).YesYes
Expiration YearCredit card expiration year (e.g., 2025 or 25).YesYes
First NameCustomer’s first name.YesYes
Last NameCustomer’s last name.YesYes
AddressOptional - Billing address.YesNo
CityOptional - Billing city.YesNo
StateOptional - Billing state/province.YesNo
CountryOptional - Billing country.YesNo
Postal CodeOptional - Billing postal/ZIP code.YesNo
CompanyOptional - Company name.YesNo
Interval LengthHow often to charge (e.g., every 1 month).YesYes
Interval UnitInterval type: 0 = Days, 1 = Months.Yes0Yes
Total OccurrencesTotal number of billing cycles (use 9999 for unlimited/ongoing).YesYes
Trial OccurrencesNumber of billing cycles at trial amount.YesNo
Response Result Code TokenNameToken to store the response result code from Authorize.Net.YesNo
Response Message TokenNameToken to store the response message from Authorize.Net.YesNo
Response SubscriptionId TokenNameToken to store the subscription ID from Authorize.Net.YesNo
Response Customer ProfileId TokenNameToken to store the customer profile ID.YesNo
Response Customer PaymentProfileId TokenNameToken to store the customer payment profile ID.YesNo
Response Customer Address Id TokenNameToken to store the customer address ID.YesNo
Response Ref Id TokenNameToken to store the ref ID.YesNo
Response SessionToken TokenNameToken to store the session token.YesNo
On SuccessActions to execute when the subscription is successfully created.N/ANo
On ErrorActions to execute if the subscription creation fails.N/ANo
On Subscription Payment CreatedActions to execute when notified that a subscription payment was created.N/ANo
On Subscription Payment UpdatedActions to execute when a subscription payment is updated.N/ANo
On Subscription Payment SuspendedActions to execute when a subscription payment is suspended.N/ANo
On Subscription Payment TerminatedActions to execute when a subscription payment is terminated.N/ANo
On Subscription Payment CancelledActions to execute when a subscription payment is cancelled.N/ANo
On Subscription Payment ExpiringActions to execute when a subscription payment is near expiration.N/ANo

Output Parameters Reference

ParameterDescription
Response Result Code TokenNameToken containing the Authorize.Net result code (Ok for success)
Response Message TokenNameToken containing the detailed text response or error message
Response SubscriptionId TokenNameToken containing the subscription's unique ID
Response Customer ProfileId TokenNameToken containing the created customer profile ID
Response Customer PaymentProfileId TokenNameToken containing the payment profile ID
Response Customer Address Id TokenNameToken containing the address ID
Response Ref Id TokenNameToken containing the Authorize.Net ref ID
Response SessionToken TokenNameToken containing a session token for client-side integrations

Webhook Support

You can configure Authorize.Net to send notifications (webhooks) to your site on subscription events. The endpoint for your notifications will be:

{YourSiteUrl}/DesktopModules/DnnSharp/Common/WebHandlers/AuthorizeCreateSubscriptionHandler.ashx

Assign custom actions for each event (Created, Updated, Suspended, etc.) using the relevant On Subscription... parameters.

Security

  • Always use secure (HTTPS) endpoints for API keys and credit card data transmission.
  • Never store plain text credit card info.
  • Limit access to this action to trusted users and system roles.
  • Protect and rotate your Authorize.Net credentials regularly.

Examples

1. Create a Basic Monthly Subscription

Create a $10/month membership subscription for a user, store the result in tokens, and display a message on success or error.

{
"Title": "Create Monthly Subscription",
"ActionType": "CreateSubscription",
"Parameters": {
"AuthorizeNetAPILoginID": "[Settings:AuthorizeNetAPILoginID]",
"AuthorizeNetTransactionKey": "[Settings:AuthorizeNetTransactionKey]",
"AuthorizeNetLiveMode": "false",
"AuthorizeNetAmount": "10.00",
"AuthorizeNetCardNumber": "[Form:CardNumber]",
"AuthorizeNetCCV": "[Form:CardCCV]",
"AuthorizeNetExpirationMonth": "[Form:CardExpMonth]",
"AuthorizeNetExpirationYear": "[Form:CardExpYear]",
"AuthorizeNetFirstName": "[User:FirstName]",
"AuthorizeNetLastName": "[User:LastName]",
"AuthorizeNetIntervalLength": "1",
"AuthorizeNetIntervalUnit": "1",
"TotalOccurrences": "9999",
"AuthorizeNetSubscriptionName": "Monthly Membership",
"AuthorizeNetResponseResultCodeTokenName": "ANetResultCode",
"AuthorizeNetResponseMessageTokenName": "ANetMsg",
"AuthorizeNetResponseSubscriptionIdTokenName": "ANetSubID",
"OnSuccess": [
{
"Title": "Display Message",
"ActionType": "DisplayMessage",
"Parameters": {
"Message": "Subscription was successfully created! ID: [ANetSubID]"
}
}
],
"OnError": [
{
"Title": "Display Message",
"ActionType": "DisplayMessage",
"Parameters": {
"Message": "Subscription failed: [ANetMsg]"
}
}
]
}
}

2. Create a Subscription with a Trial Period

Charge $1 for the first month, then $20/month thereafter, for a total of 13 months.

{
"Title": "Create Subscription With Trial",
"ActionType": "CreateSubscription",
"Parameters": {
"AuthorizeNetAPILoginID": "[Settings:AuthorizeNetAPILoginID]",
"AuthorizeNetTransactionKey": "[Settings:AuthorizeNetTransactionKey]",
"AuthorizeNetLiveMode": "true",
"AuthorizeNetAmount": "20.00",
"AuthorizeNetTrialAmount": "1.00",
"AuthorizeNetIntervalLength": "1",
"AuthorizeNetIntervalUnit": "1",
"TotalOccurrences": "13",
"TrialOccurrences": "1",
"AuthorizeNetCardNumber": "[Form:CardNumber]",