# Create Campaign

## How this example works

OpenLoyalty allows you to create various types of campaigns to engage and reward your customers. You can set up point-based campaigns, referral campaigns, or even time-based promotions.

{% hint style="warning" %}
Creating campaigns is a complex process, but using the admin panel can simplify it.
{% endhint %}

In this example, we will create a campaign that rewards a member with 100 points for each transaction.

***

## Try yourself <a href="#to-try-it-yourself" id="to-try-it-yourself"></a>

* Input the previous saved [token](https://help.openloyalty.io/technical-guide/getting-started-guide/authentication) and [storeCode](https://help.openloyalty.io/technical-guide/member-registartion-configuration#to-try-it-yourself) in the request header
* Create a campaign\
  Endpoint: `POST /api/{storeCode}/campaign`

  ```
  {
      "campaign": {
          "type": "direct",
          "trigger": "transaction",
          "translations": {
              "en": {
                  "name": "Get 100 points for any transaction",
                  "description": ""
              }
          },
          "activity": {
              "startsAt": "2024-01-01 00:00+00:00",
              "endsAt": null
          },
          "rules": [
              {
                  "effects": [
                      {
                          "effect": "give_points",
                          "pointsRule": "100",
                          "walletCode": "default"
                      }
                  ]
              }
          ],
          "labels": [],
          "limits": {},
          "active": true
      }
  }
  ```

***

## Endpoints used

{% openapi src="<https://content.gitbook.com/content/gIv2CyIIYf7vRfuhMKQ6/blobs/2xnMWXnOETp8Vxl2YZoi/openapi-5.61.0%20(1).json>" path="/api/{storeCode}/campaign" method="post" %}
[openapi-5.61.0 (1).json](https://content.gitbook.com/content/gIv2CyIIYf7vRfuhMKQ6/blobs/2xnMWXnOETp8Vxl2YZoi/openapi-5.61.0%20\(1\).json)
{% endopenapi %}

***

## More resources

For a detailed overview and description of the campaign creation and management, please refer to these series of articles:

{% content-ref url="<https://app.gitbook.com/s/cNVX03KZzmrGwJihLiEx/main-features/campaigns>" %}
[Campaigns](https://app.gitbook.com/s/cNVX03KZzmrGwJihLiEx/main-features/campaigns)
{% endcontent-ref %}
