Bundles

The Bundles endpoints allow you to retrieve, create, update, and delete information about Bundles in a database.


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://api.lightfunnels.com/graphql
query BundlesQuery($first: Int, $after: String, $query: String!){
	priceBundles(query: "order_by:id order_dir:desc", after: "WzVE4OTA5LDEe/4OTA5XQ==", first: 10){
		edges{
			node{
				id
				label
				created_at
				items {
					id
					discount_value
					quantity
					discount_type
					label
				}
			}
			cursor
		}
		pageInfo{
			endCursor
			hasNextPage
		}
	}
}

Response

{
		"data": {
			"edges": [
				{
					"node": {
						"created_at": "a few seconds ago",
						"id": "pb_phvLG7yxd4_V3ga-XliGl",
						"label": "Bundle test",
						"items": [
							{
								"id": "off_UMDqtpjaSAng-vMLuKr8K",
								"discount_value": 0,
								"quantity": 1,
								"discount_type": "item",
								"label": "Buy 1 item only"
							}
						],
						"cursor": "WzVE4OTA5LDEe/4OTA5XQ==",
						"__typename": "PriceBundle"
					}
				}
			],
			"pageInfo": {
				"endCursor": "WzE5OTY4LDE5OTY4XQ==",
				"hasNextPage": false
			}
		}
	}

Create a PriceBundle

This query allows you to add a new PriceBundle.

Arguments

Fields

Request

POST
https://api.lightfunnels.com/graphql
mutation mutationName($node: InputPriceBundle!) {
	createPriceBundle(node: $node){
		# PriceBundle type fields
	}
}

Response

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

Retrieve a Bundle

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

Arguments

  • Name
    id
    Type
    ID!
    Description

    The PriceBundle id.

Fields

Request

POST
https://api.lightfunnels.com/graphql
	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://api.lightfunnels.com/graphql
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://api.lightfunnels.com/graphql
	mutation deleteBundlesMutation($items: [ID!]!){
		deleteBundles(items: $items){
			# [ID] type fields
		}
	}

Response

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