# API endpoints

All endpoints are located at https://your-store.codefort.io/api/rest/*

# GET orders.json

Get all completed orders.

Example response

{
   "data":[
      {
         "id": 1663940918283628,
         "uuid": "4866f3ef-66dc-429a-b741-dda4d79782d8",
         "number": "DK1002",
         "name": "Jane Doe",
         "email": "[email protected]",
         "phone": "+4512345678",
         "voucher_code": null,
         "total": 10000,
         "total_with_currency": "100,00 DKK",
         "currency": "DKK",
         "payment_status": "Paid",
         "fulfillment_status": "Fulfilled",
         "subscription_status": null,
         "ip": "184.137.213.235",
         "created_at": "2020-06-02 10:24:09",
		"updated_at": "2020-06-02 10:24:37"
      },
      {
         "id": 1663311691930636,
		 "uuid": "b0bd87dd-ddd4-44ad-934e-0b80f00bf724",
         "number": "DK1001",
         "name": "John Doe",
         "email": "[email protected]",
         "phone": "+4512345678",
         "voucher_code": null,
         "total": 200000,
         "total_with_currency": "200,00 DKK",
         "currency": "DKK",
         "payment_status": "Paid",
         "fulfillment_status": "Fulfilled",
         "subscription_status": null,
         "ip": "a304:32bc:cfd7:05f6:aa12:a7ed:8cd1:03e9",
		"created_at": "2020-04-24 13:54:50",
		"updated_at": "2020-04-30 12:07:29"
      }
   ],
   "meta": {
      "current_page": 1,
      "first_page_url": "https: \/\/your-shop-shop.codefort.io\/admin\/api\/rest\/orders.json?query=&page=1",
      "from": 1,
      "last_page": 8,
      "last_page_url": "https: \/\/your-shop-shop.codefort.io\/admin\/api\/rest\/orders.json?query=&page=8",
      "next_page_url": "https: \/\/your-shop-shop.codefort.io\/admin\/api\/rest\/orders.json?query=&page=2",
      "path": "https: \/\/your-shop-shop.codefort.io\/admin\/api\/rest\/orders.json",
      "per_page": 25,
      "prev_page_url": null,
      "to": 9,
      "total": 180
   }
}

# GET orders/count.json

Get the number of completed orders.

Example response

{
	"data": {
		"count": 180
	}
}

# GET orders/{order:uuid}.json

Get the specified order.

Example response

{
	"data": {
		"id": 1668374855503420,
		"uuid": "4866f3ef-66dc-429a-b741-dda4d79782d8",
		"number": "DK1009",
		"account_name": "Jane Doe",
		"email": "[email protected]",
		"phone": "+4522345678",
		"voucher_code": null,
		"total": 2500,
		"outstanding": 0,
		"currency": "DKK",
		"payment_status": "paid",
		"fulfillment_status": "fulfilled",
		"ip": "209.237.66.35",
		"subscription_status": "new",
		"created_at": "2020-06-02T08:24:09.000000Z",
		"updated_at": "2020-06-02T08:24:37.000000Z",
		"recovered_at": null,
		"notified_abandoned_at": null,
		"attributes": {
			"timeslot": "10:40"
		},
		"line_items": [
			{
				"id": "59364ee0-a083-4f83-abff-6f42d43db950",
				"variant_id": "99038822-9abd-47ce-a015-0fb4241ccb8d",
				"product_id": "c1d2cd92-4787-4aa9-9277-4438615253d4",
				"title": "Some product",
				"qty": 1,
				"price": 9900
			}
		]
	}
}

# GET vouchers.json

Get all vouchers.

Example response

{
	"data": [
		{
			"id": "c4744c2f-fe18-423b-ac3d-317bc72f25e5",
			"code": "MARK40PCT",
			"referrer": null,
			"value": "40 %",
			"usage": 0,
			"revenue": 0,
			"profit": 0,
			"status": "active",
			"currency": "DKK",
			"is_unlimited": true,
			"qty": null
		},
		{
			"id": "4697cf4e-b0dd-485a-a211-f89449da7e5d",
			"code": "SUMMER20",
			"referrer": null,
			"value": "20 %",
			"usage": 0,
			"revenue": 10000,
			"profit": 2315,
			"status": "active",
			"currency": "DKK",
			"is_unlimited": true,
			"qty": null
		}
	],
	"meta": {
		"current_page": 1,
		"first_page_url": "https://your-shop.codefort.io/admin/api/rest/vouchers.json?query=&page=1",
		"from": 1,
		"last_page": 2,
		"last_page_url": "https://your-shop.codefort.io/admin/api/rest/vouchers.json?query=&page=2",
		"next_page_url": "https://your-shop.codefort.io/admin/api/rest/vouchers.json?query=&page=2",
		"path": "https://your-shop.codefort.io/admin/api/rest/vouchers.json",
		"per_page": "2",
		"prev_page_url": null,
		"to": 9,
		"total": 3
	}
}

# GET vouchers/count.json

Get the number of vouchers.

Example response

{
	"data": {
		"count": 28
	}
}

# GET vouchers/{voucher:id}.json

Get the specified voucher.

Example response

{
	"data": {
		"id": "4697cf4e-b0dd-485a-a211-f89449da7e5d",
		"code": "SUMMER20",
		"value": "20 %",
		"referrer_email": null,
		"is_unlimited": true,
		"qty": null,
		"usage": 1,
		"revenue": 10000,
		"profit": 2315,
		"status": "active",
		"created_at": "2020-06-02T08:06:09.000000Z",
		"updated_at": "2020-06-02T08:06:20.000000Z"
	}
}

# GET subscriptions.json

Get all subscriptions.

Example response

{
	"data": [
		{
			"id": 1664854828374394,
			"uuid": "7aefe39d-f94f-47cf-956b-35d437580499",
			"plan_name": "Member plan",
			"plan_amount": 9900,
			"customer_name": "Jane Doe",
			"customer_email": "[email protected]",
			"customer_address": "Jane Doe, Fakeway 1, 1000 Copenhagen, Denmark",
			"status": "trialing",
			"quantity": 1,
			"periods_count": 1,
			"current_period": "2020-04-24 11:54:50 - 2020-05-08 11:54:50",
			"start_at": "2020-04-24T11:54:50.000000Z",
			"last_failed_at": null,
			"canceled_at": null,
			"ended_at": null,
			"created_at": "2020-04-24T11:54:50.000000Z",
			"updated_at": "2020-04-30T10:07:29.000000Z"
		},
		{
			"id": 1664228219265135,
			"uuid": "e55cc05f-b6d3-439f-91ce-6d2c44c0dc3d",
			"plan_name": "Member plan",
			"plan_amount": 9900,
			"customer_name": "John Doe",
			"customer_email": "[email protected]",
			"customer_address": "John Doe, Fakeway 1, 1000 Copenhagen, Denmark",
			"status": "active",
			"quantity": 1,
			"periods_count": 7,
			"current_period": "2020-04-17 14:38:05 - 2020-04-20 14:38:05",
			"start_at": "2020-04-17T13:55:09.000000Z",
			"last_failed_at": null,
			"canceled_at": null,
			"ended_at": null,
			"created_at": "2020-04-17T13:55:09.000000Z",
			"updated_at": "2020-04-17T14:38:08.000000Z"
		}
	],
	"meta": {
		"current_page": 1,
		"first_page_url": "https://your-shop.codefort.io/admin/api/rest/subscriptions.json?query=&page=1",
		"from": 1,
		"last_page": 2,
		"last_page_url": "https://your-shop.codefort.io/admin/api/rest/subscriptions.json?query=&page=2",
		"next_page_url": "https://your-shop.codefort.io/admin/api/rest/subscriptions.json?query=&page=2",
		"path": "https://your-shop.codefort.io/admin/api/rest/subscriptions.json",
		"per_page": "2",
		"prev_page_url": null,
		"to": 9,
		"total": 3
	}
}

# GET subscriptions/count.json

Get the number of subscriptions.

Example response

{
	"data": {
		"count": 3
	}
}

# GET subscriptions/{subscription:uuid}.json

Get the specified subscription.

Example response

{
	"data": {
		"id": 1664221823461943,
		"uuid": "e8e4b92e-dd42-4106-830c-0c5dc6b3df55",
		"quantity": 1,
		"status": "unpaid",
		"periods_count": 15,
		"start_at": "2020-04-17T12:13:29.000000Z",
		"next_renewal_at": "2020-05-17T12:23:04.000000Z",
		"canceled_at": null,
		"ended_at": null,
		"last_failed_at": "2020-04-17T13:52:59.000000Z",
		"created_at": "2020-04-17T12:13:29.000000Z",
		"updated_at": "2020-04-17T13:52:59.000000Z",
		"customer": {
			"id": "227500cd-92f4-47b7-acdb-6e8d6b97ba2d",
			"name": "Jane Doe",
			"email": "[email protected]",
			"address": "Jane Doe, Fakeway 1, 1000 Copenhagen, Denmark"
		},
		"plan": {
			"id": "2d407749-d2ec-4c74-8b11-422a226d199a",
			"name": "Member plan",
			"active": true,
			"amount": 9900,
			"interval": "30 days",
			"trial_period_days": 14,
			"variant_id": "b9088f0e-c72b-424c-8410-668fb8f9be26"
		}
	}
}

# GET collections.json

Get all collections.

Example response

{
	"data": [
		{
			"id": 1668033007604759,
			"uuid": "745d9e9e-171f-4772-a5a4-240246ee1232",
			"slug": "my-collection",
			"title": "my collection",
			"count": 4
		},
		{
			"id": 1667129428257474,
			"uuid": "fc31866f-7839-414f-9e17-68e58915ff65",
			"slug": "test-collection",
			"title": "test collection",
			"count": 0
		}
	],
	"meta": {
		"current_page": 1,
		"first_page_url": "https://your-shop.codefort.io/admin/api/rest/collections.json?query=&page=1",
		"from": 1,
		"last_page": 1,
		"last_page_url": "https://your-shop.codefort.io/admin/api/rest/collections.json?query=&page=1",
		"next_page_url": "https://your-shop.codefort.io/admin/api/rest/collections.json?query=&page=1",
		"path": "https://your-shop.codefort.io/admin/api/rest/collections.json",
		"per_page": "2",
		"prev_page_url": null,
		"to": 9,
		"total": 2
	}
}

# GET collections/count.json

Get the number of collections.

Example response

{
	"data": {
		"count": 8
	}
}

# GET collections/{collection:uuid}.json

Get the specified collection.

Example response

{
	"data": {
		"id": 1668033007604759,
		"uuid": "fc31866f-7839-414f-9e17-68e58915ff65",
		"handle": "sale",
		"title": "Summer Sale",
		"body_html": null,
		"template_suffix": null,
		"meta_title": null,
		"meta_description": null,
		"published_at": "2020-06-01T16:28:37.000000Z",
		"created_at": "2020-06-01T14:28:37.000000Z",
		"updated_at": "2020-06-02T12:12:18.000000Z",
		"product_ids": [
			"54c69abc-41bd-4acd-bedc-1b6b702da797",
			"262bd5fc-1432-4c88-b899-ba940244aebb",
			"41385838-8853-4b9a-b6f5-c3a32c7ce034",
			"4a82deab-0333-4569-a632-6149b42bc6b1"
		]
	}
}

# GET customers.json

Get all customers.

Example response

{
	"data": [
		{
			"id": "8286e72c-2a08-4fb0-a0de-596a7a7f6cb5",
			"name": "John Doe",
			"email": "[email protected]",
			"phone": "+4522334455",
			"default_address": null,
			"orders_count": 0,
			"total_spent": 0
		},
		{
			"id": "6f45d5d5-2630-4617-b9fe-17a56ba8768d",
			"name": "Jane Doe",
			"email": "[email protected]",
			"phone": "+4533445566",
			"default_address": "Jane Doe, Fakeway 1, 1000 Copenhagen, Denmark",
			"orders_count": 1,
			"total_spent": 2500
		}
	],
	"meta": {
		"current_page": 1,
		"first_page_url": "https://your-shop.codefort.io/admin/api/rest/customers.json?query=&page=1",
		"from": 1,
		"last_page": 2,
		"last_page_url": "https://your-shop.codefort.io/admin/api/rest/customers.json?query=&page=2",
		"next_page_url": "https://your-shop.codefort.io/admin/api/rest/customers.json?query=&page=2",
		"path": "https://your-shop.codefort.io/admin/api/rest/customers.json",
		"per_page": "2",
		"prev_page_url": null,
		"to": 9,
		"total": 4
	}
}

# GET customers/count.json

Get the number of customers.

Example response

{
	"data": {
		"count": 4
	}
}

# GET customers/{customer:uuid}.json

Get the specified customer.

Example response

{
	"data": {
		"id": "8286e72c-2a08-4fb0-a0de-596a7a7f6cb5",
		"name": "John Doe",
		"email": "[email protected]",
		"phone": "+4522334455",
		"default_address": null,
		"orders_count": 0,
		"total_spent": 0,
		"created_at": "2020-06-04T13:43:49.000000Z",
		"updated_at": "2020-06-04T13:46:44.000000Z"
	}
}

# GET products.json

Get all products.

Example response

{
	"data": [
		{
			"id": "d7ebd728-3379-422d-a8d1-0c54dca6cbf2",
			"title": "Basic product",
			"featured_image_url": "https://files.codefort.io/your-shop/images/products/1024x1024/5igecj39d5e2i.jpg",
			"handle": "basic-product",
			"price_min": 2500,
			"price_max": 2500,
			"price_range_formatted": "25,00 DKK",
			"qty": 2500,
			"status": "active",
			"type": "Default",
			"vendor": null,
			"skus": "AB100-4",
			"created_at": "2020-07-27T12:39:40.000000Z",
			"updated_at": "2020-07-29T15:41:35.000000Z"
		},
		{
			"id": "8e75a5f7-cf06-4bf1-842c-c044a2e4b102",
			"title": "Some product",
			"featured_image_url": "https://files.codefort.io/image-not-found.jpg",
			"handle": "some-product",
			"price_min": 2000,
			"price_max": 3000,
			"price_range_formatted": "20,00 DKK - 30,00 DKK",
			"qty": null,
			"status": "active",
			"type": null,
			"vendor": null,
			"skus": "",
			"created_at": "2020-07-01T11:43:37.000000Z",
			"updated_at": "2020-07-01T11:44:09.000000Z"
		}
	],
	"meta": {
		"current_page": 1,
		"first_page_url": "https://your-shop.codefort.io/admin/api/rest/products.json?query=&page=1",
		"from": 1,
		"last_page": 12,
		"last_page_url": "https://your-shop.codefort.io/admin/api/rest/products.json?query=&page=12",
		"next_page_url": "https://your-shop.codefort.io/admin/api/rest/products.json?query=&page=2",
		"path": "https://your-shop.codefort.io/admin/api/rest/products.json",
		"per_page": "2",
		"prev_page_url": null,
		"to": 9,
		"total": 24,
		"shop": {
			"id": "be6dc752-ef46-40ea-8a27-dcf4e6dd8150",
			"handle": "your-shop",
			"name": "Your Shop"
		}
	}
}

# GET products/count.json

Get the number of products.

Example response

{
	"data": {
		"count": 24
	}
}

# GET products/{product:uuid}.json

Get the specified product.

Example response

{
	"data": {
		"id": "d7ebd728-3379-422d-a8d1-0c54dca6cbf2",
		"title": "Basic product",
		"featured_image_url": "https://files.codefort.io/your-shop/images/products/1024x1024/5igecj39d5e2i.jpg",
		"handle": "basic-product",
		"price_min": 2500,
		"price_max": 2500,
		"price_range_formatted": "25,00 DKK",
		"qty": 2500,
		"status": "active",
		"type": "Default",
		"vendor": null,
		"template_suffix": null,
		"images": [
			{
				"id": "3d26f088-5f75-4ecb-8a4c-7fb323070620",
				"position": 0,
				"width": 360,
				"height": 355,
				"aspect_ratio": 1.0140845070422535,
				"src": "https://files.codefort.io/your-shop/images/products/1024x1024/5igecj39d5e2i.jpg",
				"created_at": "2020-07-27T12:39:41.000000Z",
				"updated_at": "2020-07-29T19:17:38.000000Z",
				"variant_ids": []
			}
		],
		"variants": [
			{
				"id": "c7aa5641-4f0e-4098-821d-fe8306fdfa3d",
				"title": "Default title",
				"sku": null,
				"barcode": null,
				"location": null,
				"price": 2500,
				"default_price": 2500,
				"compare_at_price": 12500,
				"cost_price": 245,
				"weight": "350",
				"weight_unit": "grams",
				"inventory_policy": "deny",
				"inventory_management": "normal",
				"option_values": [],
				"created_at": "2020-07-27T12:39:40.000000Z",
				"updated_at": "2020-07-29T15:41:35.000000Z"
			}
		],
		"created_at": "2020-07-27T12:39:40.000000Z",
		"updated_at": "2020-07-29T15:41:35.000000Z"
	},
	"meta": {
		"shop": {
			"id": "be6dc752-ef46-40ea-8a27-dcf4e6dd8150",
			"handle": "your-shop",
			"name": "Your Shop"
		}
	}
}