14th Oct 2019

Meta-response

Currently, the meta object provides you:

  • All custom attribute values for all triggered campaigns and the coupon
  • The reasons why a coupon was rejected

There are currently 3 possible sub-objects that can be present in the meta-data object:

1. If there have been effects triggered by the request you will receive a campaigns object

meta: {
  campaigns: {
    "1": {
      attributes: {
        rrp: 34.95,
        Brand: "Nike",
        ProductOnSale: false
      }
    }
  }
}

The campaigns-object will contain the campaign-id and all the custom campaign attributes.

2. If there was a coupon sent within the request you will receive a coupons object.

meta: {
  coupons: {
    "XXXXX": {
      attributes: {
        rrp: 34.95,
        Brand: "Nike",
        ProductOnSale: false
      }
    }
  }
} 

The coupons-object will contain the certain coupon value and all the custom campaign attributes.

Coupon Rejection Reasons

If the transfered coupon has been rejected, you will receive a couponRejectionReason object

meta: {
  couponRejectionReason: {
    campaignId: 12, 
    couponId: 0, 
    reason: 'CouponNotFound' 
  }
} 

The couponRejectionReason-object will contain a string which can have the following text:

  • "CouponNotFound" will be returned if the transferred coupon is wrong
  • "CouponStartDateInFuture" will be returned if the transferred coupon isn't active yet
  • "CouponExpired" will be returned if the transferred coupon is expired
  • "CouponPartOfNotRunningCampaign" will be returned if the campaign the coupon belongs to, is currently not active. The campaignId field will have the id of that campaign
  • "ProfileLimitReached" will be returned if the profile-specific coupon redemption limit has been reached
  • "CouponLimitReached" will be returned if the coupon redemption limit has been reached
  • "CampaignLimitReached" will be returned if the campaign-wide coupon redemption limit has been reached
  • "CouponRecipientDoesNotMatch" will be returned if the given coupon value does not match the recipient
  • "CouponRejectedByCondition" will be returned if the coupon is valid and in an active campaign, but there were other conditions in that campaign's rules that were not met
  • "EffectCouldNotBeApplied" will be returned if one of the effects in the campaign could not be applied because a limit for that effect was reached (most common use case will be setDiscount can not be applied because a discount limit is reached)
  • "CouponValidConditionMissing" will be returned if no "coupon is valid" condition is present in the rules of the campaign that this coupon belongs to

Referral Code Rejection Reasons

If the transferred referral code has been rejected, you will receive a referralRejectionReason object

meta: {
  referralRejectionReason: {
    campaignId: 12, 
    referralId: 0, 
    reason: 'ReferralNotFound' 
  }
} 

The referralRejectionReason-object will contain a string which can have the following text:

  • "ReferralNotFound" will be returned if the transferred referral code is wrong
  • "ReferralStartDateInFuture" will be returned if the transferred referral code isn't active yet
  • "ReferralExpired" will be returned if the transferred referral code is expired
  • "ReferralPartOfNotRunningCampaign" will be returned if the campaign the referral code belongs to, is currently not active. The campaignId field will have the id of that campaign
  • "ProfileLimitReached" will be returned if the profile-specific referral code redemption limit has been reached
  • "ReferralLimitReached" will be returned if the referral code redemption limit has been reached
  • "CampaignLimitReached" will be returned if the campaign-wide coupon redemption limit has been reached
  • "ReferralRecipientDoesNotMatch" will be returned if the given referral code value does not match the recipient
  • "ReferralRejectedByCondition" will be returned if the coupon is valid and in an active campaign, but there were other conditions in that campaign's rules that were not met
  • "ReferralValidConditionMissing" will be returned if no "coupon is valid" condition is present in the rules of the campaign that this coupon belongs to
  • "ReferralRecipientIdSameAsAdvocate" will be returned if the recipient (friend) has the same id as the advocate
  • "EffectCouldNotBeApplied" will be returned if one of the effects in the campaign could not be applied because a limit for that effect was reached (most common use case will be setDiscount can not be applied because a discount limit is reached)
Still need help? Get in touch!
Last updated on 14th Oct 2019

Was this article helpful?

Thank you! You have already voted

If you’d like a member of our support team to respond to you, please send a note to support@talon.one