If you are looking for Overview, Connection Info or other modules, please click here: CP Extender

This article describes the available Gift Card methods. 

Loyalty

    /Earn

    /BalanceCheck

    /Authorize


To complete authorized transactions, please refer to CP Extender: Authorize  



Controller: Loyalty

Method: Loyalty/Earn

Security: Bearer

Type: POST

URL: https://{{BaseUrl}}:{{Port}}/Loyalty/Earn

 

Request Body:

{
	"CustomerNumber":"2059378440",
	"Points":100,
	"Reason":"Facebook Share",
	"Reference":"123456789"
}
Loyalty Point Earnings can be issued for any earning event type.

 

Response: HTTP Status 204

Errors:


400 Bad Request

401 Not Authorized

404 CustomerNumber Not Found

500 Internal Server Error


Method: Loyalty/BalanceCheck

Parameters: {{id}}

Security: Bearer

Type: GET

URL: https://{{BaseUrl}}:{{Port}}/Loyalty/{{id}}/BalanceCheck

Optional Request Body:

{
    "startDate": "01/01/2019 10:15:00.000",
    "endDate": "07/03/2020 22:15:00.000"
}


startDate will default to -1 year if not provided

endDate will default to now if not provided

* All dates use UTC


Response: HTTP Status 200

Response Body:

{
    "Loyalty": {
        "CustomerNumber": "CPOL-123185",
        "ProgramName": "Loyalty program 1",
        "EarningDescription": "Return Listing of CP Earning Rule Descriptions",
        "RedemptionDescription": "Return Listing of CP Redemption Rule Descriptions",
        "Status": "active",
        "PointBalance": 1504,
        "OpenAuthorizations": 1000,
        "PendingPointsEarned": 0,
        "AvailablePointBalance": 504,
        "History": [
            {
                "Activity": "Historical Summary",
                "Date": "11/29/2015",
                "PointAmount": 1404
            },
            {
                "Date": "07/02/2020",
                "PointAmount": 100,
                "Document": "123456789",
                "Reason": "Facebook Share"
            },
            {
                "Activity": "Pending Charge",
                "Date": "07/02/2020",
                "PointAmount": 1000,
                "Location": "Web Order",
                "Document": "WB-101-10444"
            }
        ]
    }
}

Errors:


401 Not Authorized

404 Id not found

500 Internal Server Error


Method: Loyalty/Authorize

Security: Bearer

Type: POST

URL: https://{{BaseUrl}}:{{Port}}/Loyalty/Authorize


Request Body:

{
   "Type":"loyalty",
   "Ref":"CPOL-123185",
   "SaleId":"WB-101-10444",
   "RequestedPoints":1000
}

 

Response: HTTP Status 200

Response Body:

{
    "RequestId": "0cb3fb5b-6b65-4d52-860e-33297f97fa2e",
    "Type": "loyalty",
    "AuthorizedAmount": 10.00,
    "AuthorizedPoints": 1000,
    "AuthCode": "GDA17E1614ABBA6596E5B3BA3781B339B"
}

Errors:


400 Required: Type, Ref, SaleId, and (RequestedAmount or RequestedPoints)

400 Type is not valid

400 No Balance Remaining

400 Not enrolled in Loyalty

401 Not Authorized

500 Internal Server Error