Skip to main content
GET
/
products
/
{id}
/
prices
Retrieve a products's prices
curl --request GET \
  --url https://pay.chargily.net/test/api/v2/products/{id}/prices \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://pay.chargily.net/test/api/v2/products/{id}/prices"

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/{id}/prices', 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/{id}/prices",
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/{id}/prices"

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/{id}/prices")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://pay.chargily.net/test/api/v2/products/{id}/prices")

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": "01hkfeqh157vnbtv7xrrcgchpr",
      "entity": "price",
      "amount": 5000,
      "currency": "dzd",
      "metadata": {
        "brand": "apple"
      },
      "created_at": 1704547042,
      "updated_at": 1704547042,
      "product_id": "01hkfdv9grv7eyyzxrzqz72596"
    },
    {
      "id": "01hkfekvqyc5tnhw7pyg5yw2vs",
      "entity": "price",
      "amount": 5000,
      "currency": "dzd",
      "metadata": {
        "color": "red"
      },
      "created_at": 1704546922,
      "updated_at": 1704546922,
      "product_id": "01hkfdv9grv7eyyzxrzqz72596"
    }
  ],
  "first_page_url": "http://pay.chargily.local/test/api/v2/products/01hkfdv9grv7eyyzxrzqz72596/prices?page=1",
  "last_page": 1,
  "last_page_url": 1,
  "next_page_url": null,
  "path": "http://pay.chargily.local/test/api/v2/products/01hkfdv9grv7eyyzxrzqz72596/prices",
  "per_page": 10,
  "prev_page_url": null,
  "total": 2
}

Path parameters

id
string
The ID of the product.

Query parameters

per_page
integer
A numeric value indicating the quantity of prices 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 all the prices of the product, limited to a maximum of per_page value.
{
  "livemode": false,
  "current_page": 1,
  "data": [
    {
      "id": "01hkfeqh157vnbtv7xrrcgchpr",
      "entity": "price",
      "amount": 5000,
      "currency": "dzd",
      "metadata": {
        "brand": "apple"
      },
      "created_at": 1704547042,
      "updated_at": 1704547042,
      "product_id": "01hkfdv9grv7eyyzxrzqz72596"
    },
    {
      "id": "01hkfekvqyc5tnhw7pyg5yw2vs",
      "entity": "price",
      "amount": 5000,
      "currency": "dzd",
      "metadata": {
        "color": "red"
      },
      "created_at": 1704546922,
      "updated_at": 1704546922,
      "product_id": "01hkfdv9grv7eyyzxrzqz72596"
    }
  ],
  "first_page_url": "http://pay.chargily.local/test/api/v2/products/01hkfdv9grv7eyyzxrzqz72596/prices?page=1",
  "last_page": 1,
  "last_page_url": 1,
  "next_page_url": null,
  "path": "http://pay.chargily.local/test/api/v2/products/01hkfdv9grv7eyyzxrzqz72596/prices",
  "per_page": 10,
  "prev_page_url": null,
  "total": 2
}