Webshop Promotions
This set of APIs allows for the creation and activation of promotion codes associated with a specific promotion and organization. The APIs support various actions, including creating non-activated codes, generating and activating unique codes with expiration and redemption details, and activating pre-existing codes. Each endpoint requires specific user details, a promotion reference, and organization identifiers, with optional location data.
Activate a webshop promotions code
This API endpoint activates an unused promotion code for a specified promotion and organization. The API requires the code, user details, a promotion reference, and an organization identifier. It optionally includes a location ID, which can be null if not applicable.
This API requires a Device Token. These tokens are generated in the dashboard by navigating to "Scanners" and clicking the key icon.
Required headers
- Name
Authorization
- Type
- string
- Description
The token itself as a bearer token.
Request body
- Name
code
- Type
- string
- Description
The code id of the promotion
- Name
firstname
- Type
- string
- Description
The firstname of the user
- Name
lastname
- Type
- string
- Description
The lastname of the user
- Name
email
- Type
- string
- Description
The email of the user
- Name
promotion_reference
- Type
- string
- Description
The promotion reference of the promotion
- Name
organization_identifier
- Type
- string
- Description
The organization identifier of the organization
- Name
location_id
- Type
- integer
- Description
If a valid location_id is linked with promotions, it will be used. If location_id is not available, this field can be skipped, and a default location_id will be set according to the environment configuration.
Request
curl -X POST https://api.walletapp.co/webshop-promotions/webshopcode
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"
-d '{
"code":"<code>",
"firstname":"<firstname>",
"lastname":"<lastname>",
"email":"<email>",
"promotion_reference":"<reference>",
"organization_identifier":"<identifier>",
"location_id":"<location_id>",
}'
Response
{
"success": true,
"message": "Promotion code activated successfully",
}
Create and activated promotion code
This API endpoint creates and activates a promotion code for a specified promotion and organization. The API requires user details, a promotion identifier, organization identifier and location ID. Upon success, it returns a unique, activated promotion code with an expiration date and a URL for redemption.
This API requires a Device Token. These tokens are generated in the dashboard by navigating to "Scanners" and clicking the key icon.
Note
The product title will be included in the response only if product_id is present and valid in the payload.
Required headers
- Name
Authorization
- Type
- string
- Description
The token itself as a bearer token.
Request body
- Name
firstname
- Type
- string|Required
- Description
The firstname of the user
- Name
lastname
- Type
- string|Required
- Description
The lastname of the user
- Name
email
- Type
- string|Required
- Description
The email of the user
- Name
promotion_identifier
- Type
- string|Required
- Description
The promotion identifier of the promotion
- Name
organization_identifier
- Type
- string|Required
- Description
The organization identifier of the organization
- Name
off_peak_sale
- Type
- boolean|Required
- Description
The off peak sale of the product
- Name
product_id
- Type
- integer|Optional
- Description
The product id of the product
- Name
location_id
- Type
- integer|Optional
- Description
The location id of the location
Request
curl -X POST https://api.walletapp.co/webshop-promotions/requestActivatePromotionCode
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"
-d '{
"firstname":"<firstname>",
"lastname":"<lastname>",
"email":"<email>",
"promotion_identifier":"<promotion_identifier>",
"organization_identifier":"<organization_identifier>",
"off_peak_sale":"<off_peak_sale>",
"location_id":"<location_id>",
"product_id":"<product_id>",
}'
Response
{
"success": true,
"message": "Promotion code created and activated successfully",
"result": [
{
"code": "activate promotion code",
"expiration_date": "expiration date",
"url": "promotion UI redirect url"
"product_title": "product name"
}
]
}
Create non activated promotion code
This API endpoint is designed to create non-activated promotion codes linked to a specific promotion and organization. Users can specify the number of codes, a reference to the promotion, and the organization ID.
Required headers
- Name
Authorization
- Type
- string
- Description
The token itself as a bearer token.
Request body
- Name
codes
- Type
- string
- Description
Enter numbers of codes we want to generate
- Name
promotion_reference
- Type
- string
- Description
The promotion reference of the promotion
- Name
organization_id
- Type
- integer
- Description
The organization id of the organization
Request
curl -X POST https://api.walletapp.co/webshop-promotions/createNonActivatedCodes
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"
-d '{
"codes":"<code>",
"promotion_reference":"<reference>",
"organization_id":"<organization_id>",
}'
Response
{
"success": true,
"message": "Promotion codes created successfully",
"codes": [
{
"code": "promotion code"
},
]
}