LLSR API - Gift Card API Specification and Examples

Note that the methods in this API require authentication to use them. Visit the Authentication API for more information.

Root Nodes

/giftCard                            Scanning API root node
/giftCard/[cardNumber]/balance       Query gift card balance
/giftCard/[cardNumber]/member        Query member ID associated with gift card
/giftCard/[cardNumber]/registration  Register an unregistered gift card
/giftCard/[cardNumber]/token         Generate a temporary authentication token for requests
/giftCard/[cardNumber]/topup         Top up gift card balance

/giftCard/[cardNumber]/balance

Reading

The current balance of a given gift card or season pass can be read from the balance node. The following example shows how the /giftCard/[cardNumber]/balance endpoint is used to achieve this:

GET /giftCard/H4E62548/balance HTTP/1.1
Host: api.skilouise.com

In this example, a query on the balance endpoint might generate the following JSON-encoded result:

{
  "balance":0
}

If the card number being queried does not exist then the following JSON-encoded result might be generated:

{
  "error":{
    "message":"Card number invalid"
  }
}

Publishing

Unavailable.

Updating

Unavailable.

Deleting

Unavailable.

/giftCard/[cardNumber]/member

Reading

The member ID associated with a given gift card or season pass can be read from the member node. The following example shows how the /giftCard/[cardNumber]/member endpoint is used to achieve this:

GET /giftCard/H4E62548/member HTTP/1.1
Host: api.skilouise.com

In this example, a query on the member endpoint might generate the following JSON-encoded result:

{
  "memberID":123456
}

If the card number being queried is not associated with a member profile, a null memberID is returned:

{
  "memberID":null
}

If the card number being queried does not existi, or is not associated with a member profile, then the following JSON-encoded result might be generated:

{
  "error":{
    "message":"Gift card info could not be retrieved"
  }
}

Publishing

Unavailable.

Updating

Unavailable.

Deleting

Unavailable.

/giftCard/[cardNumber]/registration

Reading

Note: This function requires a valid token to be passed in through the request header X-LLSR-GC-TOKEN. See the /giftCard/[cardNumber]/token endpoint for details on generating this token value.
If no authenticaton token is provided to this endpoint, only a boolen value representing the existence of a registration for the given gift card is returned.

The registration details of a given gift card can be queried using the registration node. The following examples shows how the /giftCard/[cardNumber]/registration endpoint is used to achieve this:

GET /giftCard/3030000000000000/registration HTTP/1.1
Host: api.skilouise.com

If the given gift card is registered, but is not associated with a member profile, then the following is an example of the JSON-encoded result that may be generated:

{
  "registered":"true",
  "hasLinkedMember":"false",
  "user":{
    "firstName":"John",
    "lastName":"Doe",
    "passPhrase":"[email protected]"
  }
}

If a valid authentication token is not provided, the result will only include the registered and hasLinkedMember parameters; i.e.:

{
  "registered":"true"
  "hasLinkedMember":"false",
}

If the given gift card is unregistered, but is associated with a member profile, then the following JSON-encoded result is generated:

{
  "registered":"false"
  "hasLinkedMember":"true",
}

Publishing

A given gift card can be registered from the registration node. The following example shows how the /giftCard/[cardNumber]/registration endpoint is used to achieve this:

POST /giftCard/3030000000000000/registration HTTP/1.1
Host: api.skilouise.com

[email protected]&passPhrase=itsasecret

Parameters:

  • firstName
    • The given name of the cardholder of the given gift card.
  • lastName
    • The surname of the cardholder of the given gift card.
  • email
    • The email address of the cardholder of the given gift card. This email address is verified using domain and SMTP validation.
  • passPhrase
    • The new passphrase for the given gift card. This passphrase is required to authenticate all requests to any other endpoint in the Gift Card API.

In this example, the gift card 3030000000000000 is registered to John Doe <[email protected]> with the passphrase 'itsasecret'.

If successful, the following JSON-encoded result is generated:

{
  "success":"true"
}

If the email address provided does fails validation, the following JSON-encoded result might be generated:

{
  "error":{
    "message":"Invalid email address"
  }
}

If the passphrase provided does not meet the minimum complexity requirements, the following JSON-encoded result might be generated:

{
  "error":{
    "message":"Password does not meet complexity requirements"
  }
}

If the card number requested for registration has already been registered, then the following JSON-encoded result might be generated:

{
  "error":{
    "message":"Card already registered"
  }
}

If the card number requested for registration does not exist then the following JSON-encoded result might be generated:

{
  "error":{
    "message":"Card number invalid"
  }
}

Updating

Unavailable.

Deleting

Unavailable.

/giftCard/[cardNumber]/token

Reading

Unavailable.

Publishing

A new authentication token can be generated from the token node. The following example shows how the /giftCard/[cardNumber]/token endpoint is used to achieve this:

POST /giftCard/H4E62548/token HTTP/1.1
Host: api.skilouise.com

passPhrase=itsasecret

Parameters:

  • passPhrase
  • The passphrase used to authenticate the user associated with the specified gift card.

In this example, a new authentication token is generated for the pass "H4E62548".

If successful, the following JSON-encoded result is generated:

{
  "token":"12345678-9012-3456-7890-123456789012"
  "expiry":2020-01-01T09:00:00-06:00"
}

This token can be used to make requests to the /giftCard/[cardNumber]/topup endpoint on or before the specified expiry date.

If the card number requested for the topup does not exist then the following JSON-encoded result might be generated:

{
  "error":{
    "message":"Card number invalid"
  }
}

If the passphrase provided does not match the passphrase on file, the following JSON-encoded result might be generated:

{
  "error":{
    "message":"Incorrect passphrase"
  }
}

Updating

Unavailable.

Deleting

Unavailable.

/giftCard/[cardNumber]/topup

Reading

Unavailable.

Publishing

Note: This function requires a valid token to be passed in through the request header X-LLSR-GC-TOKEN. See the /giftCard/[cardNumber]/token endpoint for details on generating this token value.

The current balance of a given gift card or season pass can be increased from the topup node. The following example shows how the /giftCard/[cardNumber]/topup endpoint is used to achieve this:

POST /giftCard/H4E62548/topup HTTP/1.1
Host: api.skilouise.com

amount=1.99&transNumber=123456789

Parameters:

  • amount
    • Amount in dollars and cents to increment the balance of the specified gift card or season pass.
  • transNumber
    • The transNumber identifying the approved payment card transaction to match the topup amount. The transaction must have been successful charge, must be for the same amount as the topup being requested, and must have been processed recently (as defined by internal API timeout parameters). For details on how to process a payment transaction, see the Payment API documentation.

In this example, the pass "H4E62548" is topped up with $1.99 of gift card credit.

If the card number requested for the topup does not exist then the following JSON-encoded result might be generated:

{
  "error":{
    "message":"Card number invalid"
  }
}

If the transNumber provided for the topup does not meet the requirements stated above under "Parameters", the following JSON-encoded result might be generated:

{
  "error":{
    "message":"Payment reference number invalid"
  }
}

Updating

Unavailable.

Deleting

Unavailable.

HTTP Status Codes

The Scanning API uses the following standard HTTP status codes:

200: OK
400: Bad Request
401: Unauthorized
503: Service Unavailable