Promotion
For service introduction and console setup instructions, the promotion introduction documentplease refer to.
Game mini app
Even without separate server integration, grant Toss Points to users within the game mini appand expose it in the Benefits tab.
SDK function: grantPromotionRewardForGame
This function can only be called from mini apps in the game category. If executed in a non-game category, an error occurs.
Signature
Parameters
params · Required ·
{ params: { promotionCode: string; amount: number } }This is the information needed to grant points.
params.promotionCode · Required ·
stringThis is the promotion code.
params.amount · Required ·
numberThis is the amount of points to grant.
Return value
Promise<{ key: string } | { errorCode: string; message: string } | 'ERROR' | undefined>
Returns the point grant result.
{ key: string }: Point grant succeeded. key refers to the reward key.{ errorCode: string, message: string }: Point grant failed. Please check the error code.
Error code
These are the error codes that can occur while using the promotion function. Refer to the response code or message and apply appropriate exception handling logic.
40000
When called from a non-game mini app
4100
Could not find promotion information
When called with a promotion key not registered in the console
4109
The promotion is not running
When the promotion was not started in the console, or was automatically terminated because the budget was exhausted
4110
Rewards cannot be granted/reclaimed
This is a case where an internal system error occurred, Re-grant logic.
4111
Could not find reward grant history
When querying a grant history that does not exist
4112
Promotion funds are insufficient
Grant failed due to insufficient budget; increase the budget in the console or top up Biz Wallet is required
4114
Exceeded the one-time grant amount
4116
The maximum grant amount exceeded the budget
ERROR
An unknown error occurred.
undefined
The app version is lower than the minimum supported version.
Example
Non-game mini app
There are two ways to grant Toss Points to users through promotions in a non-game category mini app.
Grant without a server: Grant points simply by calling the SDK function without separate server integration.
Grant through server: Grant points by directly calling the API from the partner company's server. Use this when integrity is important, such as preventing request tampering.
Grant promotional points without a server
SDK function: grantPromotionReward
Even without separate server integration, Grant Toss Points to users within the non-game mini appand expose it in the Benefits tab.
Signature
Parameters
params · Required ·
{ params: { promotionCode: string; amount: number } }This is the information needed to grant points.
params.promotionCode · Required ·
stringThis is the promotion code.
params.amount · Required ·
numberThis is the amount of points to grant.
Return value
Promise<{ key: string } | { errorCode: string; message: string } | 'ERROR' | undefined>
Returns the point grant result.
{ key: string }: Point grant succeeded. key refers to the reward key.{ errorCode: string, message: string }: Point grant failed. Please check the error code.
Error code
These are the error codes that can occur while using the promotion function. Refer to the response code or message and apply appropriate exception handling logic.
4100
Could not find promotion information
When called with a promotion key not registered in the console
4109
The promotion is not running
When the promotion was not started in the console, or was automatically terminated because the budget was exhausted
4110
Rewards cannot be granted/reclaimed
This is a case where an internal system error occurred, Re-grant logic.
4111
Could not find reward grant history
When querying a grant history that does not exist
4112
Promotion funds are insufficient
Grant failed due to insufficient budget; increase the budget in the console or top up Biz Wallet is required
4114
Exceeded the one-time grant amount
4116
The maximum grant amount exceeded the budget
ERROR
An unknown error occurred.
undefined
The app version is lower than the minimum supported version.
Example
Grant promotional points through the server
This is a method of directly calling the API from the partner company's server to grant Toss Points to users.
Identify the promotion target users
The promotion API identifies the promotion target using one of the two methods below. Do not pass both values at the same time; choose only one.
x-toss-user-key
Toss Loginobtained with userKey value.
x-anon-key
Issue user identification keyThis is the hash value obtained with
Please choose according to your purpose.
If you have already integrated Toss Login, or want to manage it together with member information such as name and email, use Toss Login.
If you want to identify users lightly without login integration, use the user identification key issuance feature.
x-anon-keyIf you want to check in advance whether (hash) is a valid value, Check identification key use the API.
Basic information
Base URL
https://apps-in-toss-api.toss.im
Server authentication
mTLS (client certificate)
Content-Type
application/json
① Create a promotion reward grant key
Issue a key for promotion grants. You can use this key to grant rewards to users.
Content-type: application/json
Method:
POSTEndpoint:
/api-partner/v1/apps-in-toss/promotion/execute-promotion/get-key
Request headers
For the headers that identify the promotion target, use one of the two below. Do not send both headers at the same time.
x-toss-user-key
string
Choose one
Toss Loginobtained with userKey. Get user informationcan be obtained through.
Response parameters
key
String
Key value for promotion grant (base64 encoded value)
② Grant promotion rewards
with the issued key execute promotion reward grantThe amount is deducted from the promotion budget when granted, and there may be a slight delay until the actual grant.
Content-type: application/json
Method:
POSTEndpoint:
/api-partner/v1/apps-in-toss/promotion/execute-promotion
Request headers
For the headers that identify the promotion target, use one of the two below. Do not send both headers at the same time.
x-toss-user-key
string
Choose one
Toss Loginobtained with userKey. Get user informationcan be obtained through.
Request parameters
promotionCode
String
Y
Promotion code ID created in the console
key
String
Y
The KEY issued for promotion grant
amount
Integer
Y
Promotion grant amount
Response parameters
key
String
The KEY issued for promotion grant
③ Check promotion grant result
After the grant request query the promotion grant status.
Content-type: application/json
Method:
POSTEndpoint:
/api-partner/v1/apps-in-toss/promotion/execution-result
Request headers
For the headers that identify the promotion target, use one of the two below. Do not send both headers at the same time.
x-toss-user-key
string
Choose one
Toss Loginobtained with userKey. Get user informationcan be obtained through.
Request parameters
promotionCode
String
Y
Promotion code ID created in the console
key
String
Y
The KEY issued for promotion grant
Response parameters
success
String
Promotion grant result (SUCCESS / PENDING / FAILED)
Error code
These are the error codes that can occur while using the promotion API. Refer to the response code or message and apply appropriate exception handling logic.
4100
Could not find promotion information
When called with a promotion key not registered in the console
4109
The promotion is not running
When the promotion was not started in the console, or was automatically terminated because the budget was exhausted
4110
Rewards cannot be granted/reclaimed
This is a case where an internal system error occurred, Re-grant logic.
4111
Could not find reward grant history
When querying a grant history that does not exist
4112
Promotion funds are insufficient
Grant failed due to insufficient budget; increase the budget in the console or top up Biz Wallet is required
4113
This is a case where the grant/reclaim history already exists
If you attempt duplicate granting with the same Key, issue a new Key and try again.
4114
Exceeded the one-time grant amount
4116
The maximum grant amount exceeded the budget
Last updated
Was this helpful?