Products
List all products
Returns a list of all your products.
GET
/
products
List all products
curl --request GET \
--url https://pay.chargily.net/test/api/v2/products \
--header 'Authorization: Bearer <token>'import requests
url = "https://pay.chargily.net/test/api/v2/products"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://pay.chargily.net/test/api/v2/products', 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://pay.chargily.net/test/api/v2/products",
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://pay.chargily.net/test/api/v2/products"
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://pay.chargily.net/test/api/v2/products")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pay.chargily.net/test/api/v2/products")
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{
"livemode": false,
"current_page": 1,
"data": [
{
"id": "01hhyre3ng8r8m80c4m90p0zdn",
"entity": "product",
"name": "Super Product",
"description": null,
"images": [],
"metadata": [],
"created_at": 1702913052,
"updated_at": 1702913052
},
{
"id": "01hhyqvh7as945t3ra6tjn0fzx",
"entity": "product",
"name": "Awsome Product",
"description": null,
"images": [],
"metadata": [],
"created_at": 1702912443,
"updated_at": 1702912443
}
],
"first_page_url": "https://pay.chargily.net/test/api/v2/products?page=1",
"last_page": 4,
"last_page_url": "https://pay.chargily.net/test/api/v2/products?page=4",
"next_page_url": "https://pay.chargily.net/test/api/v2/products?page=2",
"path": "https://pay.chargily.net/test/api/v2/products",
"per_page": 2,
"prev_page_url": null,
"total": 7
}
Query parameters
A numeric value indicating the quantity of products to be returned with the
request, with a minimum value of 1 and a maximum value of 50.
Returns
A key-value array, containing a data property which is an array of products, limited to a maximum ofper_page value.
{
"livemode": false,
"current_page": 1,
"data": [
{
"id": "01hhyre3ng8r8m80c4m90p0zdn",
"entity": "product",
"name": "Super Product",
"description": null,
"images": [],
"metadata": [],
"created_at": 1702913052,
"updated_at": 1702913052
},
{
"id": "01hhyqvh7as945t3ra6tjn0fzx",
"entity": "product",
"name": "Awsome Product",
"description": null,
"images": [],
"metadata": [],
"created_at": 1702912443,
"updated_at": 1702912443
}
],
"first_page_url": "https://pay.chargily.net/test/api/v2/products?page=1",
"last_page": 4,
"last_page_url": "https://pay.chargily.net/test/api/v2/products?page=4",
"next_page_url": "https://pay.chargily.net/test/api/v2/products?page=2",
"path": "https://pay.chargily.net/test/api/v2/products",
"per_page": 2,
"prev_page_url": null,
"total": 7
}
Previous
Delete a productDelete a product. Product deletion is feasible only when there are no associated prices linked to it.
Next
⌘I
List all products
curl --request GET \
--url https://pay.chargily.net/test/api/v2/products \
--header 'Authorization: Bearer <token>'import requests
url = "https://pay.chargily.net/test/api/v2/products"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://pay.chargily.net/test/api/v2/products', 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://pay.chargily.net/test/api/v2/products",
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://pay.chargily.net/test/api/v2/products"
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://pay.chargily.net/test/api/v2/products")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pay.chargily.net/test/api/v2/products")
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{
"livemode": false,
"current_page": 1,
"data": [
{
"id": "01hhyre3ng8r8m80c4m90p0zdn",
"entity": "product",
"name": "Super Product",
"description": null,
"images": [],
"metadata": [],
"created_at": 1702913052,
"updated_at": 1702913052
},
{
"id": "01hhyqvh7as945t3ra6tjn0fzx",
"entity": "product",
"name": "Awsome Product",
"description": null,
"images": [],
"metadata": [],
"created_at": 1702912443,
"updated_at": 1702912443
}
],
"first_page_url": "https://pay.chargily.net/test/api/v2/products?page=1",
"last_page": 4,
"last_page_url": "https://pay.chargily.net/test/api/v2/products?page=4",
"next_page_url": "https://pay.chargily.net/test/api/v2/products?page=2",
"path": "https://pay.chargily.net/test/api/v2/products",
"per_page": 2,
"prev_page_url": null,
"total": 7
}