Campaigns .: Claim Legacy

API Reference / v15

Claim a Legacy Loyalty Campaign

This endpoint claims a legacy loyalty campaign via ID. 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
  }
}

Response Parameters

Param Type Description
campaign_id Integer The ID of the legacy loyalty campaign.
id Integer The ID of the legacy loyalty claim.
code String The legacy loyalty cohort code.
value_amount Integer The value of the claim.
value_remaining_amount Integer The remaining value of the campaign.

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"
    }
}]