curl --request GET \
--url https://api-sandbox.appcharge.com/components/v1/product/{externalId} \
--header 'x-publisher-token: <api-key>'import requests
url = "https://api-sandbox.appcharge.com/components/v1/product/{externalId}"
headers = {"x-publisher-token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-publisher-token': '<api-key>'}};
fetch('https://api-sandbox.appcharge.com/components/v1/product/{externalId}', 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-sandbox.appcharge.com/components/v1/product/{externalId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-publisher-token: <api-key>"
],
]);
$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-sandbox.appcharge.com/components/v1/product/{externalId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-publisher-token", "<api-key>")
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-sandbox.appcharge.com/components/v1/product/{externalId}")
.header("x-publisher-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.appcharge.com/components/v1/product/{externalId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-publisher-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "507f1f77bcf86cd799439015",
"name": "Gold Coins Pack",
"displayName": "Gold Coins",
"publisherProductId": "gold_coins_100",
"type": "Quantity",
"description": "A pack of 100 gold coins.",
"prefix": "Get",
"suffix": "coins",
"textFontColorHex": "#f5c518",
"productImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5",
"productPrefixImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5",
"productImageExternalUrl": "https://images.pexels.com/photos/35406321/pexels-photo-35406321.jpeg"
}Get Product
Retrieves the details of a specific product.
curl --request GET \
--url https://api-sandbox.appcharge.com/components/v1/product/{externalId} \
--header 'x-publisher-token: <api-key>'import requests
url = "https://api-sandbox.appcharge.com/components/v1/product/{externalId}"
headers = {"x-publisher-token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-publisher-token': '<api-key>'}};
fetch('https://api-sandbox.appcharge.com/components/v1/product/{externalId}', 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-sandbox.appcharge.com/components/v1/product/{externalId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-publisher-token: <api-key>"
],
]);
$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-sandbox.appcharge.com/components/v1/product/{externalId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-publisher-token", "<api-key>")
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-sandbox.appcharge.com/components/v1/product/{externalId}")
.header("x-publisher-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.appcharge.com/components/v1/product/{externalId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-publisher-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "507f1f77bcf86cd799439015",
"name": "Gold Coins Pack",
"displayName": "Gold Coins",
"publisherProductId": "gold_coins_100",
"type": "Quantity",
"description": "A pack of 100 gold coins.",
"prefix": "Get",
"suffix": "coins",
"textFontColorHex": "#f5c518",
"productImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5",
"productPrefixImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5",
"productImageExternalUrl": "https://images.pexels.com/photos/35406321/pexels-photo-35406321.jpeg"
}Authorizations
Publisher token, as displayed in the Publisher Dashboard.
Path Parameters
External ID that you defined.
"gold_coins_pack"
Response
Product details retrieved successfully.
Product ID.
"507f1f77bcf86cd799439015"
Product name.
"Gold Coins Pack"
Product display name.
"Gold Coins"
Product ID that you defined.
"gold_coins_100"
Product unit type.
Quantity, Time "Quantity"
Product description.
"A pack of 100 gold coins."
Product prefix text.
"Get"
Product suffix text.
"coins"
Product text font color in hex format.
^#[0-9a-fA-F]{6}$"#f5c518"
Product image URL. For uploaded files, this is the Appcharge-hosted CDN URL. For external image URLs, this is the original image URL served from the provided URL.
"https://media.appcharge.com/media/69133d595af23405d8e843a5"
Product prefix image URL. For uploaded files, this is the Appcharge-hosted CDN URL. For external image URLs, this is the original image URL served from the provided URL.
"https://media.appcharge.com/media/69133d595af23405d8e843a5"
Original product image URL when the product uses an external image URL. This URL is used as provided to serve the image.
"https://images.pexels.com/photos/35406321/pexels-photo-35406321.jpeg"
Was this page helpful?
