curl -X POST \
'https://api.appcharge.com/components/v1/badge' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-publisher-token: <x-publisher-token>' \
--data '{
"name": "New Item",
"publisherBadgeId": "new_item",
"type": "emblem",
"badgeImageId": "507f1f77bcf86cd799439011"
}'
curl -X POST \
'https://api.appcharge.com/components/v1/badge' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-publisher-token: <x-publisher-token>' \
--data '{
"name": "Limited Offer",
"publisherBadgeId": "limited_offer",
"type": "emblem",
"badgeImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5"
}'
curl -X POST \
'https://api.appcharge.com/components/v1/badge' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-publisher-token: <x-publisher-token>' \
--data '{
"name": "New Item",
"publisherBadgeId": "new_item",
"type": "emblem",
"badgeImageId": "507f1f77bcf86cd799439011",
"badgeImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5"
}'
{
"id": "507f1f77bcf86cd799439020",
"name": "New Item",
"publisherBadgeId": "new_item",
"type": "emblem",
"badgeImageId": "507f1f77bcf86cd799439011",
"badgeImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5"
}
{
"id": "507f1f77bcf86cd799439021",
"name": "Limited Offer",
"publisherBadgeId": "limited_offer",
"type": "emblem",
"badgeImageId": "507f1f77bcf86cd799439022",
"badgeImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5"
}
{
"id": "507f1f77bcf86cd799439020",
"name": "New Item",
"publisherBadgeId": "new_item",
"type": "emblem",
"badgeImageId": "507f1f77bcf86cd799439011",
"badgeImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5"
}
Create Badge
Creates a badge.
curl -X POST \
'https://api.appcharge.com/components/v1/badge' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-publisher-token: <x-publisher-token>' \
--data '{
"name": "New Item",
"publisherBadgeId": "new_item",
"type": "emblem",
"badgeImageId": "507f1f77bcf86cd799439011"
}'
curl -X POST \
'https://api.appcharge.com/components/v1/badge' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-publisher-token: <x-publisher-token>' \
--data '{
"name": "Limited Offer",
"publisherBadgeId": "limited_offer",
"type": "emblem",
"badgeImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5"
}'
curl -X POST \
'https://api.appcharge.com/components/v1/badge' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-publisher-token: <x-publisher-token>' \
--data '{
"name": "New Item",
"publisherBadgeId": "new_item",
"type": "emblem",
"badgeImageId": "507f1f77bcf86cd799439011",
"badgeImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5"
}'
{
"id": "507f1f77bcf86cd799439020",
"name": "New Item",
"publisherBadgeId": "new_item",
"type": "emblem",
"badgeImageId": "507f1f77bcf86cd799439011",
"badgeImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5"
}
{
"id": "507f1f77bcf86cd799439021",
"name": "Limited Offer",
"publisherBadgeId": "limited_offer",
"type": "emblem",
"badgeImageId": "507f1f77bcf86cd799439022",
"badgeImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5"
}
{
"id": "507f1f77bcf86cd799439020",
"name": "New Item",
"publisherBadgeId": "new_item",
"type": "emblem",
"badgeImageId": "507f1f77bcf86cd799439011",
"badgeImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5"
}
curl -X POST \
'https://api.appcharge.com/components/v1/badge' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-publisher-token: <x-publisher-token>' \
--data '{
"name": "New Item",
"publisherBadgeId": "new_item",
"type": "emblem",
"badgeImageId": "507f1f77bcf86cd799439011"
}'
curl -X POST \
'https://api.appcharge.com/components/v1/badge' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-publisher-token: <x-publisher-token>' \
--data '{
"name": "Limited Offer",
"publisherBadgeId": "limited_offer",
"type": "emblem",
"badgeImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5"
}'
curl -X POST \
'https://api.appcharge.com/components/v1/badge' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-publisher-token: <x-publisher-token>' \
--data '{
"name": "New Item",
"publisherBadgeId": "new_item",
"type": "emblem",
"badgeImageId": "507f1f77bcf86cd799439011",
"badgeImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5"
}'
{
"id": "507f1f77bcf86cd799439020",
"name": "New Item",
"publisherBadgeId": "new_item",
"type": "emblem",
"badgeImageId": "507f1f77bcf86cd799439011",
"badgeImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5"
}
{
"id": "507f1f77bcf86cd799439021",
"name": "Limited Offer",
"publisherBadgeId": "limited_offer",
"type": "emblem",
"badgeImageId": "507f1f77bcf86cd799439022",
"badgeImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5"
}
{
"id": "507f1f77bcf86cd799439020",
"name": "New Item",
"publisherBadgeId": "new_item",
"type": "emblem",
"badgeImageId": "507f1f77bcf86cd799439011",
"badgeImageUrl": "https://media.appcharge.com/media/69133d595af23405d8e843a5"
}
Authorizations
Publisher token, as displayed in the Publisher Dashboard.
Body
- Emblem Badge
- Ribbon Badge
Create an emblem badge. Provide badgeImageId (asset ID), badgeImageUrl, or both to set the badge image. At least one is required on create.
Badge name.
"New Year Celebration"
Badge ID that you define.
"new_year_celebration"
Badge type.
emblem "emblem"
Asset ID of an existing badge image in the Assets Library. Must reference an asset of type badge. Reuses the existing asset without creating a duplicate. If both badgeImageId and badgeImageUrl are provided, badgeImageId takes precedence.
"507f1f77bcf86cd799439011"
Badge image URL in PNG or JPEG format. Creates a new asset from the URL when badgeImageId isn't provided. If both badgeImageId and badgeImageUrl are provided, badgeImageId takes precedence.
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. External image URLs are saved and used as-is, and Appcharge doesn't download, copy, upload, or host them. Images must remain available at the provided URLs.
We recommend uploading image files instead of using external URLs when possible.
"https://media.appcharge.com/media/69133d595af23405d8e843a5"
Response
Badge created successfully.
- Emblem Badge
- Ribbon Badge
Badge ID.
"507f1f77bcf86cd799439011"
Badge name.
"New Year Celebration"
Badge ID that you defined.
"new_year_celebration"
Badge type.
emblem "emblem"
Asset ID of the badge image. Save this value to reuse the same asset in future create or update requests. Only present for emblem badges when the image is linked to an asset.
"507f1f77bcf86cd799439011"
Badge 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. For emblem badges, returned alongside badgeImageId when the image is linked to an asset.
"https://media.appcharge.com/media/69133d595af23405d8e843a5"
Was this page helpful?
