Coupons API

for owner, author, student, guest, and affiliate

GET /api/v1/coupons/bulk_create_coupons.csv

Parameters

Name Description
id coupon id
is_primary primary coupon?
code :text
currency :string(255)
discount_amount :integer
discount_in_months :integer
discount_percent :float
duration_kind forever, once, or repeating
expiration_date :date
is_published :boolean
name :text
number_available :integer
number_of_uses :integer
site_wide site_wide boolean
number number integer
product_id product_id integer

Request

Headers

Accept: application/json
X-Api-Token: x_X7f-yejxsP6_j5gB_R8Pfui5-iYpsEQQ
X-Api-Email: user-73@example.com

Route

GET /api/v1/coupons/bulk_create_coupons.csv?id=13&code=FOO&discount_percent=0.2&duration_kind=forever&expiration_date=2019-11-30&product_id=15

Query Parameters

id: 13
code: FOO
discount_percent: 0.2
duration_kind: forever
expiration_date: 2019-11-30
product_id: 15

cURL

curl "http://localhost:3000/api/v1/coupons/bulk_create_coupons.csv?id=13&code=FOO&discount_percent=0.2&duration_kind=forever&expiration_date=2019-11-30&product_id=15" -X GET \
	-H "Accept: application/json" \
	-H "X-Api-Token: x_X7f-yejxsP6_j5gB_R8Pfui5-iYpsEQQ" \
	-H "X-Api-Email: user-73@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

Content-Type: application/json; charset=utf-8
Content-Length: 46

Status

401 Unauthorized

Body

{
  "errors": "You are not authorized to do that"
}

Request

Headers

Accept: application/json
X-Api-Token: x_X7f-yejxsP6_j5gB_R8Pfui5-iYpsEQQ
X-Api-Email: user-73@example.com

Route

GET /api/v1/coupons/bulk_create_coupons.csv?id=13&code=FOO&discount_percent=0.2&duration_kind=forever&expiration_date=2019-11-30&product_id=15

Query Parameters

id: 13
code: FOO
discount_percent: 0.2
duration_kind: forever
expiration_date: 2019-11-30
product_id: 15

cURL

curl "http://localhost:3000/api/v1/coupons/bulk_create_coupons.csv?id=13&code=FOO&discount_percent=0.2&duration_kind=forever&expiration_date=2019-11-30&product_id=15" -X GET \
	-H "Accept: application/json" \
	-H "X-Api-Token: x_X7f-yejxsP6_j5gB_R8Pfui5-iYpsEQQ" \
	-H "X-Api-Email: user-73@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

Content-Type: application/json; charset=utf-8
Content-Length: 46

Status

401 Unauthorized

Body

{
  "errors": "You are not authorized to do that"
}

Request

Headers

Accept: application/json
X-Api-Token: x_X7f-yejxsP6_j5gB_R8Pfui5-iYpsEQQ
X-Api-Email: user-73@example.com

Route

GET /api/v1/coupons/bulk_create_coupons.csv?id=13&code=FOO&discount_percent=0.2&duration_kind=forever&expiration_date=2019-11-30&product_id=15

Query Parameters

id: 13
code: FOO
discount_percent: 0.2
duration_kind: forever
expiration_date: 2019-11-30
product_id: 15

cURL

curl "http://localhost:3000/api/v1/coupons/bulk_create_coupons.csv?id=13&code=FOO&discount_percent=0.2&duration_kind=forever&expiration_date=2019-11-30&product_id=15" -X GET \
	-H "Accept: application/json" \
	-H "X-Api-Token: x_X7f-yejxsP6_j5gB_R8Pfui5-iYpsEQQ" \
	-H "X-Api-Email: user-73@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

Content-Type: application/json; charset=utf-8
Content-Length: 46

Status

401 Unauthorized

Body

{
  "errors": "You are not authorized to do that"
}

Request

Headers

Accept: application/json
X-Api-Token: x_X7f-yejxsP6_j5gB_R8Pfui5-iYpsEQQ
X-Api-Email: user-73@example.com

Route

GET /api/v1/coupons/bulk_create_coupons.csv?id=13&code=FOO&discount_percent=0.2&duration_kind=forever&expiration_date=2019-11-30&product_id=15

Query Parameters

id: 13
code: FOO
discount_percent: 0.2
duration_kind: forever
expiration_date: 2019-11-30
product_id: 15

cURL

curl "http://localhost:3000/api/v1/coupons/bulk_create_coupons.csv?id=13&code=FOO&discount_percent=0.2&duration_kind=forever&expiration_date=2019-11-30&product_id=15" -X GET \
	-H "Accept: application/json" \
	-H "X-Api-Token: x_X7f-yejxsP6_j5gB_R8Pfui5-iYpsEQQ" \
	-H "X-Api-Email: user-73@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

Content-Type: application/json; charset=utf-8
Content-Length: 27

Status

401 Unauthorized

Body

{
  "error": "Failed to Login"
}

Request

Headers

Accept: application/json
X-Api-Token: x_X7f-yejxsP6_j5gB_R8Pfui5-iYpsEQQ
X-Api-Email: user-73@example.com

Route

GET /api/v1/coupons/bulk_create_coupons.csv?id=13&code=FOO&discount_percent=0.2&duration_kind=forever&expiration_date=2019-11-30&product_id=15

Query Parameters

id: 13
code: FOO
discount_percent: 0.2
duration_kind: forever
expiration_date: 2019-11-30
product_id: 15

cURL

curl "http://localhost:3000/api/v1/coupons/bulk_create_coupons.csv?id=13&code=FOO&discount_percent=0.2&duration_kind=forever&expiration_date=2019-11-30&product_id=15" -X GET \
	-H "Accept: application/json" \
	-H "X-Api-Token: x_X7f-yejxsP6_j5gB_R8Pfui5-iYpsEQQ" \
	-H "X-Api-Email: user-73@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

Content-Type: application/json; charset=utf-8
Content-Length: 46

Status

401 Unauthorized

Body

{
  "errors": "You are not authorized to do that"
}