curl --request POST \
--url https://api-sandbox.appcharge.com/components/v1/product \
--header 'Content-Type: application/json' \
--header 'x-publisher-token: <api-key>' \
--data '{
"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://example.com/images/gold_coins.png",
"productPrefixImageUrl": "https://example.com/images/gold_coin_icon.png"
}'
{
"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://cdn.appcharge.com/507f1f77bcf86cd799439015_product.png",
"productPrefixImageUrl": "https://cdn.appcharge.com/507f1f77bcf86cd799439015_prefix.png",
"productImageExternalUrl": "https://example.com/images/gold_coins.png"
}
Creates a product.
curl --request POST \
--url https://api-sandbox.appcharge.com/components/v1/product \
--header 'Content-Type: application/json' \
--header 'x-publisher-token: <api-key>' \
--data '{
"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://example.com/images/gold_coins.png",
"productPrefixImageUrl": "https://example.com/images/gold_coin_icon.png"
}'
{
"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://cdn.appcharge.com/507f1f77bcf86cd799439015_product.png",
"productPrefixImageUrl": "https://cdn.appcharge.com/507f1f77bcf86cd799439015_prefix.png",
"productImageExternalUrl": "https://example.com/images/gold_coins.png"
}
Publisher token, as displayed in the Publisher Dashboard.
Product created successfully.
The response is of type object
.
Was this page helpful?