Documentation / API / Operations on Coupons

GET, COUNT, CREATE, UPDATE and DELETE operations available on coupons.

Coupons Operations

GET

URL

POST https://your-secured-store-url:443/api/v1/coupons/get

Filters

Filter Type
id Array of GUID
startdate_min DateTime
startdate_max DateTime
enddate_min DateTime
enddate_max DateTime
code Array of String (max 255 chars)
type Array of String (Predefined values)
name Array of String (max 255 chars)
discountamount_min Decimal (max 8 digits and 2 decimals)
discountamount_max Decimal (max 8 digits and 2 decimals)
minimumpurchase_min Decimal (max 8 digits and 2 decimals)
minimumpurchase_max Decimal (max 8 digits and 2 decimals)
limittotal_min Integer (max 11 digits)
limittotal_max Integer (max 11 digits)
limitcustomer_min Integer (max 11 digits)
limitcustomer_max Integer (max 11 digits)
createdon_min DateTime
createdon_max DateTime

Request

Retrieve all the items (max 1000)

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        }
    }

Retrieve specific items by ID

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        },
        'filters' : {
            'id' : ['00000000-0000-0000-0000-000000000000', '12345678-1234-1234-1234-123456781234']
        }
    }

Most complete request (just to give you the format of each parameter)

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        },
        'filters' : {
            'id' : ['00000000-0000-0000-0000-000000000000', '12345678-1234-1234-1234-123456781234'],
		    'startdate_min' : '2015-01-01',
		    'startdate_max' : '2017-01-01',
		    'enddate_min' : '2017-10-23',
		    'enddate_max' : '2019-10-23',
		    'code' : ['example-a','example-b'],
		    'type' : ['AMOUNT_ORDER','FREE_SHIPPING'],
		    'name' : ['example a','example b'],
		    'discountamount_min' : '1.25',
		    'discountamount_max' : '99999999.99',
		    'minimumpurchase_min' : '0',
		    'minimumpurchase_max' : '10000',
		    'limittotal_min' : '0',
		    'limittotal_max' : '1000',
		    'limitcustomer_min' : '0',
		    'limitcustomer_max' : '10',
		    'createdon_min' : '2000-01-01',
		    'createdon_max' : '2042-01-01'
	    },
        'pagination' : {
            'pageNumber' : '1',
            'pageSize' : '1000'
        }
    }

Response

If no error occured, you will receive a response like this one (object type: Coupon). Please refer to error messages to learn more about the possible error responses.

[
   {
      "id": "00000000-0000-0000-0000-000000000000",
      "startdate": "2015-10-08 00:00:00",
      "enddate": "2015-10-23 00:00:00",
      "code": "example-a",
      "type": "AMOUNT_ORDER",
      "name": "example a",
      "discountamount": "99999999.99",
      "minimumpurchase": "0.00",
      "limittotal": "0",
      "limitcustomer": "0",
      "author": "Mr Example",
      "createdon": "2015-10-14 10:36:02"
   },
   {
      "id": "12345678-1234-1234-1234-123456781234",
      "startdate": "2015-11-30 00:00:00",
      "enddate": "2015-12-28 00:00:00",
      "code": "example-b",
      "type": "FREE_SHIPPING",
      "name": "example b",
      "discountamount": "4.00",
      "minimumpurchase": "1.00",
      "limittotal": "10",
      "limitcustomer": "1",
      "author": "Mr Example",
      "createdon": "2015-10-24 16:26:13"
   }
]

COUNT

URL

POST https://your-secured-store-url:443/api/v1/coupons/count

Filters

Filter Type
id Array of GUID
startdate_min DateTime
startdate_max DateTime
enddate_min DateTime
enddate_max DateTime
code Array of String (max 255 chars)
type Array of String (Predefined values)
name Array of String (max 255 chars)
discountamount_min Decimal (max 8 digits and 2 decimals)
discountamount_max Decimal (max 8 digits and 2 decimals)
minimumpurchase_min Decimal (max 8 digits and 2 decimals)
minimumpurchase_max Decimal (max 8 digits and 2 decimals)
limittotal_min Integer (max 11 digits)
limittotal_max Integer (max 11 digits)
limitcustomer_min Integer (max 11 digits)
limitcustomer_max Integer (max 11 digits)
createdon_min DateTime
createdon_max DateTime

Request

Count the items

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        }
    }

Count specific items by type

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        },
        'filters' : {
            'type' : ['AMOUNT_ORDER']
        }
    }

Most complete request (just to give you the format of each parameter)

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        },
        'filters' : {
            'id' : ['00000000-0000-0000-0000-000000000000', '12345678-1234-1234-1234-123456781234'],
		    'startdate_min' : '2015-01-01',
		    'startdate_max' : '2017-01-01',
		    'enddate_min' : '2017-10-23',
		    'enddate_max' : '2019-10-23',
		    'code' : ['example-a','example-b'],
		    'type' : ['AMOUNT_ORDER','FREE_SHIPPING'],
		    'name' : ['example a','example b'],
		    'discountamount_min' : '1.25',
		    'discountamount_max' : '99999999.99',
		    'minimumpurchase_min' : '0',
		    'minimumpurchase_max' : '10000',
		    'limittotal_min' : '0',
		    'limittotal_max' : '1000',
		    'limitcustomer_min' : '0',
		    'limitcustomer_max' : '10',
		    'createdon_min' : '2000-01-01',
		    'createdon_max' : '2042-01-01'
	    }
    }

Response

If no error occured, you will receive a response like this one. Please refer to error messages to learn more about the possible error responses.

{
   "count": "2"
}

CREATE

URL

POST https://your-secured-store-url:443/api/v1/coupons/create

Data properties

Mandatory
Property Type
startdate DateTime
enddate DateTime
code String (max 255 chars)
type String (Predefined values)
name String (max 255 chars)
discountamount Decimal (max 8 digits and 2 decimals)
minimumpurchase Decimal (max 8 digits and 2 decimals)
limittotal Integer (max 11 digits)
limitcustomer Integer (max 11 digits)

Request

Most complete request

{
    'authentication' : {
        'apiKey' : 'jjns7519v1v3ns6xU162'
    },
    'data' : [{
			'startdate' : '2016-01-01',
			'enddate' : '2017-01-01',
			'code' : 'example-c',
			'type' : 'FREE_SHIPPING',
			'name' : 'example c',
			'discountamount' : '5.25',
			'minimumpurchase' : '10',
			'limittotal' : '0',
			'limitcustomer' : '1'
		}]
}

Response

If no error occured, you will receive a response like this one. Please refer to error messages to learn more about the possible error responses.

[
   {
      "id": "d4d25dfd-45a1-4418-88ee-6751d74f5f8f",
      "startdate": "2016-01-01 00:00:00",
      "enddate": "2017-01-01 00:00:00",
      "code": "example-c",
      "type": "FREE_SHIPPING",
      "name": "example c",
      "discountamount": "5,25",
      "minimumpurchase": "10,00",
      "limittotal": "0",
      "limitcustomer": "1",
      "author": "",
      "createdon": "2016-09-11 15:34:50"
   }
]

UPDATE

URL

POST https://your-secured-store-url:443/api/v1/coupons/update

Data properties

Mandatory
Property Type
id GUID
startdate DateTime
enddate DateTime
code String (max 255 chars)
type String (Predefined values)
name String (max 255 chars)
discountamount Decimal (max 8 digits and 2 decimals)
minimumpurchase Decimal (max 8 digits and 2 decimals)
limittotal Integer (max 11 digits)
limitcustomer Integer (max 11 digits)

Request

Most complete request

{
    'authentication' : {
        'apiKey' : 'jjns7519v1v3ns6xU162'
    },
	'data' : [
		{
			'id' : 'd4d25dfd-45a1-4418-88ee-6751d74f5f8f',
			'startdate' : '2016-01-01',
			'enddate' : '2017-01-01',
			'code' : 'example-c',
			'type' : 'FREE_SHIPPING',
			'name' : 'example c',
			'discountamount' : '5.25',
			'minimumpurchase' : '10',
			'limittotal' : '0',
			'limitcustomer' : '1'
		}]
}

Response

If no error occured, you will receive a response like this one. Please refer to error messages to learn more about the possible error responses.

[
   {
      "id": "d4d25dfd-45a1-4418-88ee-6751d74f5f8f",
      "startdate": "2016-01-01 00:00:00",
      "enddate": "2017-01-01 00:00:00",
      "code": "example-c",
      "type": "FREE_SHIPPING",
      "name": "example c",
      "discountamount": "5,25",
      "minimumpurchase": "10,00",
      "limittotal": "0",
      "limitcustomer": "1",
      "author": "",
      "createdon": "2016-09-11 15:34:50"
   }
]

DELETE

URL

POST https://your-secured-store-url:443/api/v1/coupons/delete

Filters

Filter Type
id GUID

Request

Normal request

{
    'authentication' : {
        'apiKey' : 'jjns7519v1v3ns6xU162'
    },
    'filter' : [{
        'id': ['d4d25dfd-45a1-4418-88ee-6751d74f5f8f']
    }]
}

Response

If no error occured, you will receive a response like this one. Please refer to error messages to learn more about the possible error responses.

{
   "success": "true"
}