Create Recurring Aplication Charge

The Create Recurring Application Charge API is used to create a recurring charge for an application. This API is essential for developers implementing subscription-based billing workflows for their apps, allowing businesses to manage recurring charges with specific terms and limits.

This API is especially useful for:

  1. Setting up recurring billing for application usage.
  2. Defining usage-based billing terms and limits.
  3. Managing application subscription charges with trial periods and specific conditions.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Body Parameters

ParameterTypeRequiredDescriptionExample
recurring_application_charge.namestringYesThe name of recurring application charge.test
recurring_application_charge.pricestringYesThe price of the recurring application charge. Must match the package price defined in the app.10.0
recurring_application_charge.return_urlstringYesThe URL to redirect the merchant to after completing the subscription.https://shoplazza.com
recurring_application_charge.trial_daysint32NoThe number of trial days offered for the subscription.7
recurring_application_charge.capped_amountstringNoThe limit a customer can be charged for usage-based billing. If this property is provided, the terms property must also be provided.100.0
recurring_application_charge.termsstringNoThe terms and conditions of usage-based billing charges. Required if capped_amount is provided."Monthly usage cap of $100"
recurring_application_charge.testbooleanNoWhether it is a test charge. Defaults to false.false

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Success Response

FieldTypeDescriptionExample
idstringThe unique ID of the recurring application charge.372269663945671159
application_idstringThe unique ID of the application.s1deCNxrkHePw03HD2bZ.xfwJAqe07nznt
namestringThe name of the recurring application charge.test
pricestringThe price of the recurring application charge.10.0
capped_amountstringThe limit a customer can be charged for usage based billing. If this property is provided, then you must also provide the terms property. See usage charges for more information.100.0
termsstringThe terms and conditions of usage based billing charges. Must be present in order to create usage charges, for example when the capped_amount property is provided. Presented to the merchant when they approve an app's usage charges.terms
return_urlstringThe redirect URL after payment.https://shoplazza.com
confirm_urlstringThe URL to confirm the recurring application charge.https://test-shoplazza.stg.myshoplaza.com
statusstringThe status of the recurring application charge (e.g., pending, active).pending
testbooleanWhether this is a test charge.false
trial_daysint32The trial period in days.7
trial_ends_onstringThe end date of the trial period.null
billing_onstringThe billing start date.null
cancelled_onstringThe date the charge was cancelled.null
cancel_sub_onstringThe subscription cancellation date, if applicable.null
created_atstringThe creation timestamp of the recurring application charge.2024-04-23T06:26:45Z
updated_atstringThe last updated timestamp of the recurring application charge.2024-04-23T06:26:45Z

Error Response

Error responses in the API can be represented using two different fields: errors and error. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.

FieldTypeExampleDescription
errorsArray[ "file number error"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorString "page not found"Indicates an error encountered during the process

Error Detail

Status CodeMessagePossible ReasonExample Response
400Bad RequestInvalid input format or request structure (e.g., missing required fields or incorrect data types).Bad Request
UnauthorizedThe request is missing valid authentication credentials or the credentials provided are invalid.Unauthorized
422Unprocessable EntityThe return_url field is missing in the API request body.ReturnUrl is required
The return_url field is present but contains an invalid or improperly formatted URLReturnUrl must be a valid URL
There is a mismatch between the charge type specified in the application plan configuration and the charge type being created. T“The chargetype configuration in the plan does not match with the listing, please check”

API Structure Overview

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!