Defintions
For request and response defintions, vist Defintions For Create Campaign Settings
Example Request
curl --request POST \
--url https://api.taggun.io/api/validation/v1/campaign/settings/create/october-cola-24 \
--header 'accept: application/json' \
--header 'apikey: 12345678abcd1234efgh567890abcdef' \
--header 'content-type: application/json' \
--data '
{
"date": {
"start": "2024-10-01T00:00:00.000Z",
"end": "2024-10-31T23:59:59.000Z"
},
"merchantNames": {
"skip": false,
"list": [
"Walmart",
"Target"
]
},
"productLineItems": {
"skip": false,
"totalPrice": {
"min": 0,
"max": 100
},
"quantity": {
"min": 1,
"max": 100
},
"names": [
"Coca Cola",
"Sprite"
]
},
"balanceOwing": {
"skip": true,
"max": 0
},
"fraudDetection": {
"allowSimilarityCheck": true
}
}
'
Request Breakdown:
date
: Specifies the campaign period from October 1, 2024, to October 31, 2024.merchantNames
: The campaign applies to receipts from Walmart and Target.productLineItems
: Specifies validation rules for products, allowing Coca Cola and Sprite, with a price range of $0-$100 and quantity between 1 and 100.balanceOwing
: Skipped in this case, meaning that validating an empty balance is not required.fraudDetection
: Enables fraud detection, allowing for similarity checks between receipts.
Example JSON Response
{
"result": "Successfully created campaign settings",
"statusCode": 201
}
Response Breakdown:
result
: Confirms the successful creation of the campaign settings.statusCode
: The HTTP status code 201 indicates that the campaign was successfully created.
Status Codes
201
: Successful validation400
: Campaign ID already exists403
: Authentication error (invalid API key)
Key Notes
- The
campaignId
in this example is "october-cola-24". You can replace it with any unique ID for your own campaigns. - Ensure to use your actual
apikey
in place of the example key provided here. - Use this structure to define specific validation rules tailored to your campaign needs, such as participating merchants, eligible products, and fraud detection settings.