Buy buttons
Summary of buy button endpoints
- GET /admin/api/buy_buttons - list all available buy buttons for the current site.
- GET /admin/api/buy_buttons/1 - get data for a single buy button.
- PUT /admin/api/buy_buttons/1 - update attributes of a buy button.
List all available buy buttons for the current site
GET /admin/api/buy_buttons
Example response:
Status: 200 OK
[
{
"id": 1,
"created_at": "2014-01-14T09:25:22.000Z",
"updated_at": "2014-01-14T09:26:17.000Z",
"url": "http://helloworld.voog.co/admin/api/buy_buttons/1",
"content": {
"id": 1,
"name": "body",
"created_at": "2014-01-14T09:25:22.000Z",
"updated_at": "2014-01-14T09:25:22.000Z",
"position": 1,
"url": "http://helloworld.voog.co/admin/api/pages/1/contents/1"
},
"parent": {
"id": 2,
"title": "Products",
"created_at": "2014-01-14T09:22:49.000Z",
"updated_at": "2014-01-14T09:22:54.000Z",
"type": "page",
"url": "http://helloworld.voog.co/admin/api/pages/1"
},
"product": {
"id": 1,
"name": "Sample product",
"sku": "0001",
"price": 166.67,
"status": "live",
"uses_variants": false,
"in_stock": true,
"created_at": "2016-12-10T15:59:23.000Z",
"updated_at": "2016-12-10T15:59:23.000Z"
}
}, {
"id": 2,
"created_at": "2014-01-14T11:43:42.000Z",
"updated_at": "2014-01-14T11:44:07.000Z",
"url": "http://helloworld.voog.co/admin/api/buy_buttons/2",
"content": {
"id": 2,
"name": "body",
"created_at": "2014-01-14T11:43:42.000Z",
"updated_at": "2014-01-14T11:43:42.000Z",
"position": 2,
"url": "http://helloworld.voog.co/admin/api/pages/3/contents/2"
},
"parent": {
"id": 3,
"title": "Product #1",
"created_at": "2014-01-14T11:43:37.000Z",
"updated_at": "2014-01-14T11:43:37.000Z",
"type": "page",
"url": "http://helloworld.voog.co/admin/api/pages/3"
},
"product": {
"id": 1,
"name": "Sample product",
"sku": "0001",
"price": 166.67,
"status": "live",
"uses_variants": false,
"in_stock": true,
"created_at": "2016-12-10T15:59:23.000Z",
"updated_at": "2016-12-10T15:59:23.000Z"
}
}
]
Parameters
per_page
- elements per response (default:50
; maximum:250
).page
- requested page (default:1
).
Filter attributes
Read more about filters.
- Object
buy_button
attributes:id
,product_id
,settings
,created_at
,updated_at
. - Object
content
attributes:id
,parent_id
,parent_type
,language_id
,content_id
,content_type
,page_id
,page_type
,name
,position
,created_at
,updated_at
.
Get data for a single buy button
GET /admin/api/buy_buttons/1
Example request:
GET http://helloworld.voog.co/admin/api/buy_buttons/2
Example response:
Status: 200 OK
{
"id": 1,
"created_at": "2014-01-14T09:25:22.000Z",
"updated_at": "2014-01-14T09:26:17.000Z",
"url": "http://helloworld.voog.co/admin/api/buy_buttons/1",
"content": {
"id": 1,
"name": "body",
"created_at": "2014-01-14T09:25:22.000Z",
"updated_at": "2014-01-14T09:25:22.000Z",
"position": 1,
"url": "http://helloworld.voog.co/admin/api/pages/1/contents/1"
},
"parent": {
"id": 2,
"title": "Products",
"created_at": "2014-01-14T09:22:49.000Z",
"updated_at": "2014-01-14T09:22:54.000Z",
"type": "page",
"url": "http://helloworld.voog.co/admin/api/pages/1"
},
"product": {
"id": 1,
"name": "Sample product",
"sku": "0001",
"price": 166.67,
"status": "live",
"uses_variants": false,
"in_stock": true,
"created_at": "2016-12-10T15:59:23.000Z",
"updated_at": "2016-12-10T15:59:23.000Z"
}
}
Update attributes of a buy button
PUT /admin/api/buy_buttons/1
Example request:
PUT http://helloworld.voog.co/admin/api/buy_buttons/2
Example data:
{
"product_id": 2,
}
Example response:
Status: 200 OK
p
Status: 200 OK
{
"id": 1,
"created_at": "2014-01-14T09:25:22.000Z",
"updated_at": "2014-01-14T09:26:17.000Z",
"url": "http://helloworld.voog.co/admin/api/buy_buttons/1",
"content": {
"id": 1,
"name": "body",
"created_at": "2014-01-14T09:25:22.000Z",
"updated_at": "2014-01-14T09:25:22.000Z",
"position": 1,
"url": "http://helloworld.voog.co/admin/api/pages/1/contents/1"
},
"parent": {
"id": 2,
"title": "Products",
"created_at": "2014-01-14T09:22:49.000Z",
"updated_at": "2014-01-14T09:22:54.000Z",
"type": "page",
"url": "http://helloworld.voog.co/admin/api/pages/1"
},
"product": {
"id": 2,
"name": "Sample product #2",
"sku": "0002",
"price": 166.67,
"status": "live",
"uses_variants": false,
"in_stock": true,
"created_at": "2016-12-10T15:59:23.000Z",
"updated_at": "2016-12-10T15:59:23.000Z"
}
}
Parameters
Required parameters:
body
- new content for the object.