Create. API

Discount Codes

Access Levels
Group: shop
Resource: discount_codes

List all discount codes

GET 	https://api.create.net/discount_codes

Response

Status: 200 OK
{ "discount_codes" :[ 
	{
		"ID" : 5890,
		"name" : "Facebook Friends Discount",
		"code" : "FBF010",
		"type" : "percent",
		"amount" : "10.00",
		"expiry" : "9999-99-99"
	}
]}

Get a discount code

GET 	https://api.create.net/discount_codes/:id

Response

Status: 200 OK
{ "discount_code" : 
	{
		"ID" : 5890,
		"name" : "Facebook Friends Discount",
		"code" : "FBF010",
		"type" : "percent",
		"amount" : "10.00",
		"expiry" : "9999-99-99"
	}
}

Create a discount code

POST 	https://api.create.net/discount_codes

Input

Param Type Required Description
name string Required The name of the discount code
code string Required The discount code
Letters and/or numbers only
type string Required The type of discount code
Options: percent, amount
amount string Required The discount amount
expiry date Required The date to expire
yyyy-mm-dd OR 9999-99-99 to never expire

Response

Status: 201 Created
Location: http://api.create.net/discount_codes/5890
{ "discount_code" : 
	{
		"ID" : 5890,
		"name" : "Facebook Friends Discount",
		"code" : "FBF010",
		"type" : "percent",
		"amount" : "10.00",
		"expiry" : "9999-99-99"
	}
}

Update a discount code

PUT 	https://api.create.net/discount_codes/:id

Input

Param Type Required Description
name string Optional The name of the discount code
code string Optional The discount code
Letters and/or numbers only
type string Optional The type of discount code
Options: percent, amount
amount string Optional The discount amount
expiry date Optional The date to expire
yyyy-mm-dd OR 9999-99-99 to never expire

Response

Status: 200 OK

Delete a discount code

DELETE 	https://api.create.net/discount_codes/:id

Response

Status: 200 OK