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 generating and activating unique codes with expiration and redemption details. Each endpoint requires specific user details, a promotion reference, and organization identifiers, with optional location data.
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/Orders
-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"
}
]
}
