Create Application Charge

The Create Application Charge API is used to create a charge for an application within Shoplazza. This API is essential for developers implementing billing functionalities for their apps, ensuring that the charges match the pricing defined in the APP package settings.

This API is especially useful for:

  1. Enabling app developers to implement billing workflows.
  2. Redirecting users to a specified URL after payment.
  3. Testing payment flows with test charges.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Body Parameters

ParameterTypeRequiredDescriptionExample
application_charge.namestringYesThe name of recurring application charge."Test Charge"
application_charge.pricestringYesThe amount of the charge. Must match the app package setting amount."10.00"
application_charge.return_urlstringYesRedirect URL after payment."https://example.com/redirect"
application_charge.testbooleanNoWhether it is a test charge. Defaults to false.false

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Success Response

FieldTypeDescriptionExample
idstringUnique identifier for the application charge."372212374289312759"
application_idstringID of the associated application."kmbYzm_WldIg1Z1yY1XtVk63teakZ"
namestringThe name of recurring application charge."Test Charge"
pricestringThe price of the charge."10.00"
return_urlstringURL to redirect after payment."https://example.com/redirect"
confirm_urlstringURL to confirm the charge."https://test-shoplazza.stg.myshoplaza.com/confirm_charge"
statusstringCurrent status of the charge."pending"
testbooleanIndicates if this is a test charge.false
created_atstringTimestamp when the charge was created."2024-04-23T02:39:05Z"
updated_atstringTimestamp when the charge was last updated."2024-04-23T02:39:05Z"

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 application_charge.name field is either missing or an empty string in the request payload."Name is required"
return_url field is missing, malformed, or not a valid URL."ReturnUrl must be a valid URL"
The price field in your request might not match the pricing specified in your app’s package settings on Shoplazza."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!