BigCommerce
Integrations
Apps
App extensions
Postman collection

App Extensions Postman Collection

One way to get started or refine requests is to use the BigCommerce App Extensions Postman collection, which contains the core mutations and queries. To work with the Postman collection, you need to supply the following:

  • The sandbox store's store_hash.
  • The sandbox store's access_token is available in your app's database as soon as you successfully install the app. You can also add a console log to get it from the terminal after the app completes the auth callback.

Importing the collection

The following code block is an exported Postman collection of App Extensions mutations and queries. To copy the collection, hover over the upper right corner of the code block.

For instructions on importing collections into Postman, see their article on Importing and Exporting Data (Postman) (opens in a new tab).

App Extensions Postman collection
{
	"info": {
		"_postman_id": "e4f08356-fc98-4b78-8ccd-edb6e88ab7b2",
		"name": "BigCommerce App Extensions",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "18111578"
	},
	"item": [
		{
			"name": "get a store's app extensions",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "graphql",
					"graphql": {
						"query": "query {\n    store {\n        appExtensions {\n            edges {\n                node {\n                    id\n                    url\n                    context\n                    model\n                }\n            }\n        }\n    }\n}",
						"variables": ""
					}
				},
				"url": {
					"raw": "https://api.bigcommerce.com/stores/{{store_hash}}/graphql",
					"protocol": "https",
					"host": [
						"api",
						"bigcommerce",
						"com"
					],
					"path": [
						"stores",
						"{{store_hash}}",
						"graphql"
					]
				}
			},
			"response": []
		},
		{
			"name": "create an app extension",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "graphql",
					"graphql": {
						"query": "mutation AppExtension($input: CreateAppExtensionInput!) {\n  appExtension {\n    createAppExtension(input: $input) {\n      appExtension {\n        id\n        context\n        label {\n          defaultValue\n          locales {\n            value\n            localeCode\n          }\n        }\n        model\n        url\n      }\n    }\n  }\n}",
						"variables": "{\n  \"input\": {\n    \"context\": \"PANEL\",\n    \"model\": \"CUSTOMERS\",\n    \"url\": \"/customers/${id}\",\n    \"label\": {\n      \"defaultValue\": \"Link Text\",\n      \"locales\": [\n        {\n          \"value\": \"Link Text\",\n          \"localeCode\": \"en-US\"\n        },\n        {\n          \"value\": \"Texto del enlace\",\n          \"localeCode\": \"es-MX\"\n        },\n        {\n          \"value\": \"Texte du lien\",\n          \"localeCode\": \"fr-FR\"\n        }\n      ]\n    }\n  }\n}"
					}
				},
				"url": {
					"raw": "https://api.bigcommerce.com/stores/{{store_hash}}/graphql",
					"protocol": "https",
					"host": [
						"api",
						"bigcommerce",
						"com"
					],
					"path": [
						"stores",
						"{{store_hash}}",
						"graphql"
					]
				}
			},
			"response": []
		},
		{
			"name": "update an app extension",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "graphql",
					"graphql": {
						"query": "mutation AppExtension($input: UpdateAppExtensionInput!) {\n  appExtension {\n    updateAppExtension(input: $input) {\n      appExtension {\n        id\n        url\n      }\n    }\n  }\n}",
						"variables": "{\n    \"input\": {\n        \"id\": \"bc/store/appExtension/5\",\n        \"data\": {\n            \"url\": \"/customers/profile/${id}\"\n        }   \n    }\n}"
					}
				},
				"url": {
					"raw": "https://api.bigcommerce.com/stores/{{store_hash}}/graphql",
					"protocol": "https",
					"host": [
						"api",
						"bigcommerce",
						"com"
					],
					"path": [
						"stores",
						"{{store_hash}}",
						"graphql"
					]
				}
			},
			"response": []
		},
		{
			"name": "delete an app extension",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "graphql",
					"graphql": {
						"query": "mutation AppExtension($input: DeleteAppExtensionInput!) {\n  appExtension {\n    deleteAppExtension(input: $input) {\n        deletedAppExtensionId\n    }\n  }\n}",
						"variables": "{\n    \"input\": {\n        \"id\": \"bc/store/appExtension/5\" \n    }\n}"
					}
				},
				"url": {
					"raw": "https://api.bigcommerce.com/stores/{{store_hash}}/graphql",
					"protocol": "https",
					"host": [
						"api",
						"bigcommerce",
						"com"
					],
					"path": [
						"stores",
						"{{store_hash}}",
						"graphql"
					]
				}
			},
			"response": []
		}
	],
	"auth": {
		"type": "apikey",
		"apikey": [
			{
				"key": "value",
				"value": "{{access_token}}",
				"type": "string"
			},
			{
				"key": "key",
				"value": "X-Auth-Token",
				"type": "string"
			}
		]
	},
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "access_token",
			"value": "",
			"type": "string"
		},
		{
			"key": "store_hash",
			"value": "",
			"type": "string"
		}
	]
}

Resources

Did you find what you were looking for?