Skip to main content

What You Can Do with the HORISEN Code App API

The HORISEN Code App API lets you manage and distribute codes programmatically — discount codes, vouchers, or one-time offers — and deliver them dynamically as part of Business Messenger campaigns and automated messaging flows.

With the API, you can:

  • Look up Code App accounts, and fully manage code lists (create, update, delete).
  • Add or bulk-import codes into a list, retrieve them on demand, and remove them when no longer needed.
  • Publish existing codes to receivers dynamically, on demand.
  • Integrate code delivery with Business Messenger campaigns, so codes can be inserted into messages without manual preparation.

Typical Use Cases

  • Promotional campaigns with unique or reusable discount codes.
  • Voucher and coupon delivery triggered at send-time.
  • One-time code distribution for controlled or limited offers.
  • Campaign personalization using dynamically inserted codes.

Authentication

The Code App API is secured with OAuth 2.0, using the Authorization Code flow. Your application redirects the user to the authorization endpoint, and exchanges the returned code for an access token, which is then sent with every API call.

Quick Examples

Create a Code List

curl -X POST "https://api{separator}{platform_domain}/code/v1/accounts/ACCOUNT_UUID/lists" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Summer Sale Codes",
"status": "active",
"codesUnique": "yes",
"publicationOrder": "sequential",
"canPublishFrom": "2025-06-01T00:00:00Z",
"canPublishUntil": "2025-06-30T23:59:59Z",
"maxPublications": 1000
}'

Import Codes in Bulk

curl -X POST "https://api{separator}{platform_domain}/code/v1/accounts/ACCOUNT_UUID/lists/LIST_UUID/imports" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '[
{"code": "SUMMER10"},
{"code": "SUMMER20"},
{"code": "SUMMER30"}
]'

Publish Codes to Receivers

curl -X POST "https://api{separator}{platform_domain}/code/v1/accounts/ACCOUNT_UUID/lists/LIST_UUID/publications" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '[
{"receiverId": "+41790000000"},
{"receiverId": "+41790000001"}
]'

The response returns the code assigned to each receiver:

[
{"code": "SUMMER10", "receiverId": "+41790000000"},
{"code": "SUMMER20", "receiverId": "+41790000001"}
]

Typical Integrations

Business Messenger Campaigns

Publish codes for a campaign's recipients, then use each returned code as a template variable in a Campaign API message, so every recipient gets a unique or reusable code without manual preparation.

Inventory Monitoring

Use the list and code retrieval endpoints to track how many codes are still active versus published, and get notified before a list runs low.

Technical Characteristics

  • REST HTTP API with JSON payloads
  • OAuth 2.0 Authorization Code flow
  • Full CRUD for code lists; add, retrieve, and delete for individual codes
  • Bulk code import and on-demand publication to receivers