Get Collection
curl --request GET \
--url https://api.launchmystore.io/api/v1/collections/{id}.json \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.launchmystore.io/api/v1/collections/{id}.json"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.launchmystore.io/api/v1/collections/{id}.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.launchmystore.io/api/v1/collections/{id}.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.launchmystore.io/api/v1/collections/{id}.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.launchmystore.io/api/v1/collections/{id}.json")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/collections/{id}.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"collection": {
"id": 123,
"title": "<string>",
"handle": "<string>",
"body_html": "<string>",
"description": "<string>",
"published_at": "<string>",
"published_scope": "<string>",
"sort_order": "<string>",
"template_suffix": "<string>",
"image": {},
"products_count": 123,
"collection_type": "<string>",
"seo": {},
"updated_at": "<string>"
}
}Collections
Get Collection
Retrieve a single collection by ID
GET
/
api
/
v1
/
collections
/
{id}
.json
Get Collection
curl --request GET \
--url https://api.launchmystore.io/api/v1/collections/{id}.json \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.launchmystore.io/api/v1/collections/{id}.json"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.launchmystore.io/api/v1/collections/{id}.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.launchmystore.io/api/v1/collections/{id}.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.launchmystore.io/api/v1/collections/{id}.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.launchmystore.io/api/v1/collections/{id}.json")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/collections/{id}.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"collection": {
"id": 123,
"title": "<string>",
"handle": "<string>",
"body_html": "<string>",
"description": "<string>",
"published_at": "<string>",
"published_scope": "<string>",
"sort_order": "<string>",
"template_suffix": "<string>",
"image": {},
"products_count": 123,
"collection_type": "<string>",
"seo": {},
"updated_at": "<string>"
}
}Get Collection
Returns a single collection by its ID, in the standard commerce shape.Request
curl -X GET "https://api.launchmystore.io/api/v1/collections/col_abc123.json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
const response = await fetch('https://api.launchmystore.io/api/v1/collections/col_abc123.json', {
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}
});
Path Parameters
Response
Returns a bare object with the collection under thecollection
key.
Collection object
Show Collection Object
Show Collection Object
Numeric collection ID. The collection’s UUID is accepted too wherever a
collection id is taken.
Example Response
{
"collection": {
"id": 339550,
"title": "Summer Collection",
"handle": "summer-collection",
"body_html": "<p>Our latest summer styles featuring lightweight fabrics and vibrant colors.</p>",
"description": "<p>Our latest summer styles featuring lightweight fabrics and vibrant colors.</p>",
"published_at": "2024-03-01T10:00:00Z",
"published_scope": "web",
"sort_order": "manual",
"template_suffix": null,
"collection_type": "custom",
"image": {
"alt": "Summer Collection",
"width": 1200,
"height": 600,
"src": "https://cdn.launchmystore.io/images/summer-banner.jpg"
},
"products_count": 24,
"seo": {
"title": "Summer Collection",
"description": "Shop our summer collection",
"image": "https://cdn.launchmystore.io/images/summer-banner.jpg"
},
"url": "/collections/summer-collection",
"updated_at": "2024-03-15T14:30:00Z"
}
}
Errors
Failures return a standard{ errors } body with the appropriate HTTP
status:
{
"errors": {
"base": ["Collection not found"]
}
}
| Status | Description |
|---|---|
401 | Invalid or missing access token |
403 | App doesn’t have the read_products scope |
404 | Collection with the specified ID does not exist |