post
https://{shopdomain}.myshoplaza.com/openapi/2022-01/application_charges
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:
- Enabling app developers to implement billing workflows.
- Redirecting users to a specified URL after payment.
- Testing payment flows with test charges.
Request Parameters
Public Request Parameters
Body Parameters
| Field | Type | Required | Example | Description |
|---|---|---|---|---|
application_charge. |
string | Yes | "Test Charge" |
The name of recurring application charge. |
application_charge. |
string | Yes | "10.00" |
The amount of the charge. Must match the app package setting amount. |
application_charge. |
string | Yes | "https://example.com/redirect" |
Redirect URL after payment. |
application_charge. |
boolean | No | false |
Whether it is a test charge. Defaults to false. |
Response Explanation
Public Response Parameters
Success Response
| Field | Type | Description | Example |
|---|---|---|---|
id | string | Unique identifier for the application charge. | "372212374289312759" |
application_id | string | ID of the associated application. | "kmbYzm_WldIg1Z1yY1XtVk63teakZ" |
name | string | The name of recurring application charge. | "Test Charge" |
price | string | The price of the charge. | "10.00" |
return_url | string | URL to redirect after payment. | "https://example.com/redirect" |
confirm_url | string | URL to confirm the charge. | "https://test-shoplazza.stg.myshoplaza.com/confirm_charge" |
status | string | Current status of the charge. | "pending" |
test | boolean | Indicates if this is a test charge. | false |
created_at | string | Timestamp when the charge was created. | "2024-04-23T02:39:05Z" |
updated_at | string | Timestamp 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.
| Field | Type | Example | Description |
|---|---|---|---|
errors | Array | [ "file number error"] | A list of errors encountered during the request processing. |
| Field | Type | Example | Description |
|---|---|---|---|
error | String | "page not found" | Indicates an error encountered during the process |
Error Detail
| Status Code | Message | Possible Reason | Example Response |
|---|---|---|---|
| 400 | Bad Request | Invalid input format or request structure (e.g., missing required fields or incorrect data types). | Bad Request |
| Unauthorized | The request is missing valid authentication credentials or the credentials provided are invalid. | Unauthorized | |
| 422 | Unprocessable Entity | The 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" |
