Campaigns .: Claim Legacy

API Reference / v15

Claim a Legacy Loyalty Campaign

This endpoint claims a legacy loyalty campaign via legacy_id in the body. The :campaign_id in the URL does not actually indicate which campaign will be targeted as might be expected. Instead, this endpoint will search for a legacy loyalty campaign associated with the app that is associated with the request.

To claim a legacy loyalty campaign, you must have a user access token with the manage_user_campaigns permission.

Request Endpoint

POST /v15/loyalties/legacy/:campaign_id/claims

Authorization Required – User Token in Header

Authorization: token user="123456-abcdef123..."

Request Body

{
  "legacy_loyalty": {
    "legacy_id": "1234123412341234",
  }
}

Request Parameters

Param Type Required Description
legacy_id String Yes The unique identifier of the legacy loyalty card

cURL Example

curl https://sandbox.thelevelup.com/v15/loyalties/legacy/6/claims \
  -H Accept:application/json \
  -H Content-Type:application/json \
  -H 'Authorization:token user="123456-abcdef123..."' \
  -d '{
    "legacy_loyalty": {
      "legacy_id": "1234123412341234"
    }
  }'

Example Responses

HTTP/1.1 200 OK

{
  "claim" : {
    "campaign_id" : 6,
    "code": "3620KLQCPE",
    "id": 24,
    "value_amount" : 100,
    "value_remaining_amount" : 100,
    "progress_adjustments": [
      {
        "adjustment_amount": 3
      },
      {
        "adjustment_amount": 11
      }
    ]
  }
}

Response Parameters

Param Type Description
campaign_id Integer The ID of the legacy loyalty campaign.
id Integer The ID of the legacy loyalty’s claim.
code String The legacy loyalty’s cohort code.
value_amount Integer The original value of the claim.
value_remaining_amount Integer The remaining value of the claim.
progress_adjustments[] Array Object representing legacy loyalty’s progress adjustments.
progress_adjustments
[adjustment_amount]
Integer The amount adjusted for each progress adjustment.

Errors

HTTP/1.1 404 Not found - Code not valid

[{
    "error": {
        "message": "Sorry, we couldn't find your loyalty information in our records. Please try an alternate card number or email address.",
        "object": "claim",
        "property": "base"
    }
}]

HTTP/1.1 422 Unprocessable Entity - Code already claimed

[{
    "error": {
        "message": "Sorry, the value associated with this loyalty card or email address has already been migrated.",
        "object": "claim",
        "property": "base"
    }
}]