PUT
/
components
/
v1
/
product
/
{externalId}
cURL
curl --request PUT \
  --url https://api-sandbox.appcharge.com/components/v1/product/{externalId} \
  --header 'Content-Type: application/json' \
  --header 'x-publisher-token: <api-key>' \
  --data '{
  "name": "Premium Gold Coins Pack",
  "displayName": "Premium Gold Coins",
  "publisherProductId": "gold_coins_100",
  "type": "Quantity",
  "prefix": "Get",
  "suffix": "premium coins",
  "textFontColorHex": "#d4af37",
  "productImageUrl": "https://example.com/images/premium_gold_coins.png",
  "productPrefixImageUrl": "https://example.com/images/premium_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"
}

Authorizations

x-publisher-token
string
header
required

Publisher token, as displayed in the Publisher Dashboard.

Path Parameters

externalId
string
required

External ID that you defined.

Example:

"gold_coins_pack"

Body

application/json
name
string

Product name.

Example:

"Premium Gold Coins Pack"

displayName
string

Product display name.

Example:

"Premium Gold Coins"

publisherProductId
string

Product ID that you define

Example:

"gold_coins_100"

type
enum<string>

Product unit type.

Available options:
Quantity,
Time
Example:

"Quantity"

prefix
string

Product prefix text.

Example:

"Get"

suffix
string

Product suffix text.

Example:

"premium coins"

textFontColorHex
string

Product text font color in hex format.

Example:

"#d4af37"

productImageUrl
string<url>

URL to a valid, publicly accessible product image. Must be in PNG or JPEG format.

Example:

"https://example.com/images/premium_gold_coins.png"

productPrefixImageUrl
string<url>

URL to a valid, publicly accessible product prefix image. Must be in PNG or JPEG format.

Example:

"https://example.com/images/premium_gold_coin_icon.png"

Response

Product updated successfully.

id
string
required

Product ID.

Example:

"507f1f77bcf86cd799439015"

name
string
required

Product name.

Example:

"Gold Coins Pack"

displayName
string
required

Product display name.

Example:

"Gold Coins"

publisherProductId
string
required

Product ID that you defined.

Example:

"gold_coins_100"

type
enum<string>
required

Product unit type.

Available options:
Quantity,
Time
Example:

"Quantity"

textFontColorHex
string
required

Product text font color in hex format.

Example:

"#f5c518"

productImageUrl
string<url>
required

URL of poduct image stored on Appcharge CDN.

Example:

"https://cdn.appcharge.com/507f1f77bcf86cd799439015_product.png"

description
string

Product description.

Example:

"A pack of 100 gold coins."

prefix
string

Product prefix text.

Example:

"Get"

suffix
string

Product suffix text.

Example:

"coins"

productPrefixImageUrl
string<url>

URL of product prefix image stored on Appcharge CDN.

Example:

"https://cdn.appcharge.com/507f1f77bcf86cd799439015_prefix.png"

productImageExternalUrl
string<url>

Original URL of the product image if uploaded via external link.

Example:

"https://example.com/images/gold_coins.png"