API Reference
Resources
List all fixed price promotions
How to fetch a collection of fixed price promotions via API
To fetch a collection of fixed price promotions, send a GET request to the /api/fixed_price_promotions endpoint.

Request

GET https://yourdomain.commercelayer.io/api/fixed_price_promotions

Example

Request
Response
The following request fetches a collection of fixed price promotions:
1
curl -g -X GET \
2
'https://yourdomain.commercelayer.io/api/fixed_price_promotions/' \
3
-H 'Accept: application/vnd.api+json' \
4
-H 'Authorization: Bearer your-access-token'
Copied!
On success, the API responds with a 200 OK status code, returning a paginated collection of resource objects:
1
{
2
"data": [
3
{
4
"id": "xYZkjABcde",
5
"type": "fixed_price_promotions",
6
"links": {
7
"self": "https://yourdomain.commercelayer.io/api/fixed_price_promotions/xYZkjABcde"
8
},
9
"attributes": {
10
"name": "Personal promotion",
11
"starts_at": "2018-01-01T12:00:00.000Z",
12
"expires_at": "2018-01-02T12:00:00.000Z",
13
"total_usage_limit": 5,
14
"total_usage_count": 2,
15
"active": true,
16
"created_at": "2018-01-01T12:00:00.000Z",
17
"updated_at": "2018-01-01T12:00:00.000Z",
18
"reference": "ANY-EXTERNAL-REFEFERNCE",
19
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
20
"metadata": {
21
"foo": "bar"
22
},
23
"fixed_amount_cents": 1000,
24
"fixed_amount_float": 10.0,
25
"formatted_fixed_amount": "€10,00"
26
},
27
"relationships": {
28
"market": {
29
"links": {
30
"self": "https://yourdomain.commercelayer.io/api/fixed_price_promotions/xYZkjABcde/relationships/market",
31
"related": "https://yourdomain.commercelayer.io/api/fixed_price_promotions/xYZkjABcde/market"
32
}
33
},
34
"promotion_rules": {
35
"links": {
36
"self": "https://yourdomain.commercelayer.io/api/fixed_price_promotions/xYZkjABcde/relationships/promotion_rules",
37
"related": "https://yourdomain.commercelayer.io/api/fixed_price_promotions/xYZkjABcde/promotion_rules"
38
}
39
},
40
"order_amount_promotion_rule": {
41
"links": {
42
"self": "https://yourdomain.commercelayer.io/api/fixed_price_promotions/xYZkjABcde/relationships/order_amount_promotion_rule",
43
"related": "https://yourdomain.commercelayer.io/api/fixed_price_promotions/xYZkjABcde/order_amount_promotion_rule"
44
}
45
},
46
"sku_list_promotion_rule": {
47
"links": {
48
"self": "https://yourdomain.commercelayer.io/api/fixed_price_promotions/xYZkjABcde/relationships/sku_list_promotion_rule",
49
"related": "https://yourdomain.commercelayer.io/api/fixed_price_promotions/xYZkjABcde/sku_list_promotion_rule"
50
}
51
},
52
"coupon_codes_promotion_rule": {
53
"links": {
54
"self": "https://yourdomain.commercelayer.io/api/fixed_price_promotions/xYZkjABcde/relationships/coupon_codes_promotion_rule",
55
"related": "https://yourdomain.commercelayer.io/api/fixed_price_promotions/xYZkjABcde/coupon_codes_promotion_rule"
56
}
57
},
58
"attachments": {
59
"links": {
60
"self": "https://yourdomain.commercelayer.io/api/fixed_price_promotions/xYZkjABcde/relationships/attachments",
61
"related": "https://yourdomain.commercelayer.io/api/fixed_price_promotions/xYZkjABcde/attachments"
62
}
63
},
64
"sku_list": {
65
"links": {
66
"self": "https://yourdomain.commercelayer.io/api/fixed_price_promotions/xYZkjABcde/relationships/sku_list",
67
"related": "https://yourdomain.commercelayer.io/api/fixed_price_promotions/xYZkjABcde/sku_list"
68
}
69
},
70
"skus": {
71
"links": {
72
"self": "https://yourdomain.commercelayer.io/api/fixed_price_promotions/xYZkjABcde/relationships/skus",
73
"related": "https://yourdomain.commercelayer.io/api/fixed_price_promotions/xYZkjABcde/skus"
74
}
75
}
76
},
77
"meta": {
78
"mode": "test"
79
}
80
},
81
{
82
"other": "... 9 fixed_price_promotions (first page)"
83
}
84
],
85
"meta": {
86
"record_count": 140,
87
"page_count": 14
88
},
89
"links": {
90
"first": "https://yourdomain.commercelayer.io/api/fixed_price_promotions?page[number]=1&page[size]=10",
91
"next": "https://yourdomain.commercelayer.io/api/fixed_price_promotions?page[number]=2&page[size]=10",
92
"last": "https://yourdomain.commercelayer.io/api/fixed_price_promotions?page[number]=14&page[size]=10"
93
}
94
}
Copied!

Sortable attributes

The list of fixed price promotions can be sorted by the following attributes:
  • name
  • starts_at
  • expires_at
  • id
  • created_at
  • updated_at
  • reference
  • reference_origin
  • fixed_amount_cents
Last modified 2mo ago