App charges

In this guide, we will look at how to handle charges for your app in Lightfunnels.


Create app charges

To create an app charge, you need to use the following GraphQL mutation:

Arguments

Fields

Request

POST
https://services.lightfunnels.com/api/v2
# Mutation
mutation createAppChargeMutation($input: createAppChargeInput!) {
	createAppCharge(input: $input) {
		createAppChargePayload type fields
	}
}

createAppChargeInput type example

{
	"input": {
		"node": {
			"price": 0,
			"return_url": "https://your-website.com",
			"name": "Plan name",
			"trial": 0,
			"plan_id": "navigate to your app billing tab and select a plan id under app plans"
		}
	}
}

createAppChargePayload type example

{
		"node": {
			"appCharge": {
				"id": "charge id",
				"price": 25.99,
				"name": "basic",
				"started_at": "2024-01-12 15:56:23"
			},
		}
	}

List all app charges

To get your app charges, you need to use the following GraphQL query:

Arguments

    appCharges query has no arguments

Fields

Request

POST
https://services.lightfunnels.com/api/v2
query {
	appCharges{
		list {
			id
			price
			name
			started_at
		}
	}
}

Response

	{
		"appCharges": {
			"id": "charge id",
			"price": 25.99,
			"name": "basic",
			"started_at": "2024-01-12 15:56:23"
		}
	}		

Get an app charge

To get an app charge, you need to use the following GraphQL query:

Arguments

  • Name
    id
    Type
    ID!
    Description

    The app charge id.

Fields

  • Label
    AppCharge
    Description

    The AppCharge query type.

Request

POST
https://services.lightfunnels.com/api/v2
query appChargeQuery($id: ID!) {
	appCharge(id: $id){
		id
		price
		name
		started_at
	}
}

Response

	{
		"appCharge": {
			"id": "charge id",
			"price": 25.99,
			"name": "basic",
			"started_at": "2024-01-12 15:56:23"
		}
	}