Bundles

These endpoints allow you to retrieve, create, update, and delete Bundle(s).


List all Bundles

This query allows you to retrieve a paginated list of all your Bundles. By default, a maximum of 25 Bundles are shown per page.

Arguments

  • Name
    query
    Type
    String!
    Description

    Supported filter parameters: order_by order_dir

  • Name
    after
    Type
    String
    Description

    Returns the elements that come after the specified cursor.

  • Name
    first
    Type
    String
    Description

    Returns up to the first n elements from the list.

Fields

Request

POST
https://services.lightfunnels.com/api/v2
query BundlesQuery($first: Int, $after: String, $query: String!){
	priceBundles(query: $query, after: $after, first: $first){
		edges{
			node{
				label
				items {
					label
				}
			}
			cursor
		}
		pageInfo{
			endCursor
			hasNextPage
		}
	}
}

Response

	{
		"data": {
			"priceBundles": {
				"edges": [
					{
							"node": {
									"label": "Test Bundles",
									"items": [
										{
											"label": "Buy 1 item only"
										}
									]
							},
							"cursor": "WyJwYl9WODdGVG4yTTNhYWs5eWg4bVRmR18iLCJwYl9WODdGVG4yTTNhYWs5eWg4bVRmR18iXQ=="
					},
					{
							"node": {
									"label": "Bundle test",
									"items": [
										{
											"label": "Test Bundle"
										}
									]
							},
							"cursor": "WyJwYl9zRVNCYnN3SzQxZWZ4UkpvMHVOZFYiLCJwYl9zRVNCYnN3SzQxZWZ4UkpvMHVOZFYiXQ=="
					},
				],
				"pageInfo": {
					"endCursor": "WyJwYl9GUjFwbzlnWE92ZHd5d1o5SkYtQ3IiLCJwYl9GUjFwbzlnWE92ZHd5d1o5SkYtQ3IiXQ==",
					"hasNextPage": false
				}
			}
		}
	}		

Create a PriceBundle

This query allows you to add a new PriceBundle.

Arguments

Fields

Request

POST
https://services.lightfunnels.com/api/v2
mutation mutationName($node: InputPriceBundle!) {
	createPriceBundle(node: $node){
		id 
		label
		items {
			label
			quantity
			discount_value
			discount_type
		}
	}
}

Response

{
		"node" : {
			"label": "Bundle test",
			"items": {
					"label": "Test",
					"quantity": 1,
					"discount_value": 10,
					"discount_type" : "percentage"
			}
		}
	}

Retrieve a Bundle

This query allows you to retrieve a PriceBundle by providing its id.

Arguments

  • Name
    id
    Type
    ID!
    Description

    Bundle id.

Fields

Request

POST
https://services.lightfunnels.com/api/v2
	query BundleQuery($id: ID!){
		node(id: $id){
			... on PriceBundle{
				# PriceBundle type fields
			}
		}
	}

Response

	{
		"data": {
			"node": {
				"created_at": "a few seconds ago",
				"id": "pb_phvLG7yxd4_V3ga-XliGl",
				"label": "Bundle test"
				...
			}
		}
	}

Update a PriceBundle

This query allows you to perform an update on a PriceBundle.

Arguments

Fields

Request

Post
https://services.lightfunnels.com/api/v2
mutation updateBundleMutation($node: InputUpdatePriceBundle!, $id: ID!){
		updatePriceBundle(node: $node, id: $id){
			# PriceBundle type fields
		}
	}

Response

{
		"data": {
			"PriceBundle": {
				"created_at": "a few seconds ago",
				"id": "pb_phvLG7yxd4_V3ga-XliGl",
				"label": "Bundle test"
				...
			}
		}
	}

Delete a PriceBundle

This query allows you to delete Bundles.

Arguments

  • Name
    items
    Type
    [ID!]!
    Description

    The PriceBundle ids.

Fields

  • Name
    [ID]
    Description

    List of PriceBundle ids.

Request

POST
https://services.lightfunnels.com/api/v2
	mutation deleteBundlesMutation($items: [ID!]!){
		deletePriceBundles(items: $items){
			# [ID] type fields
		}
	}

Response

{
	"data": {
		"deletePriceBundles": [
			"UHJvZHVjdDoxNTUxMQ==",
			"UHJvZHVjdFKWATUxMQ=="
		]
	}
}