Expense Analysis
Stores the product and information from a receipt submitted for review by a member. To
get the receipt information, access the LoyaltyProgramMember object reference.
Resource
1services/apexrest/expense-analysisRest Method Type
POST
Signature
1curl --location --request POST 'https://yourInstance.salesforce.com/services/apexrest/expense-analysis/?filename=8925687d-7489-7ecb-5307-19d4d33bc650.jpeg&membershipnumber=124345696' \
2--header 'Authorization: Bearer 00DB000000FX0aR!ARQAQCyXQGgMcxjFvjs1hnPCDJEZyPavtzxM26XvjDU.gr56iTgkGp_EQCZ0yyi1QZzILDqO1my3KpJqhKAOc56o4jqx6CxU' \
3--header 'Cookie: BrowserId=MZ4W4WebEe6bX0_gtfh0Tw; CookieConsentPolicy=0:1; LSKey-c$CookieConsentPolicy=0:1'Request Parameters
| Parameter | Type | Description | Required or Optional |
|---|---|---|---|
| filename | String | The file that contains the image of the receipt. | Required |
| membershipnumber | String | The unique identifier of the member. | Required |
Sample Output
1{
2 "storeName" : "alpine nutrition",
3 "storeAddress" : "625 Market Street,\n6th floor,\nSan Francisco,\nCA, 94105",
4 "receiptSFDCId" : "a0PHp00000tstqeMAA",
5 "receiptNumber" : "#0529-0002",
6 "receiptDate" : "2020-01-10",
7 "memberShipNumber" : "124345696",
8 "lineItem" : [ {
9 "quantity" : "5",
10 "productName" : "Alpine-Bran Cereal",
11 "price" : "$7.99",
12 "lineItemPrice" : "$39.95",
13 "isEligible" : false
14 }, {
15 "quantity" : "2",
16 "productName" : "Alpine-Oat Cereal",
17 "price" : "$7.99",
18 "lineItemPrice" : "$15.98",
19 "isEligible" : false
20 } ],
21 "confidenceStatus" : "Partial"
22}Output Parameters
| Parameter | Type | Description |
|---|---|---|
| confidenceStatus | String | The receipt analysis status based on the confidence value defined in the
app. Possible values are:
|
| isEligible | Boolean | Indicates whether the item is eligible for accrual of loyalty points ((true)) or not ((false)).
This value is displayed only if the admin has opted to display ineligible items in the receipt. |
| lineItem | String | The details of the receipt line item. |
| lineItemPrice | String | The total price of the receipt line item. |
| memberShipNumber | String | The unique identifier of the member. |
| price | Currency | The unit price of the receipt line item. |
| productName | String | The name of the product purchased. |
| quantity | Integer | The quantity of the product purchased. |
| receiptDate | dateTime | The date when the receipt is generated. |
| receiptNumber | String | The receipt number. |
| receiptSFDCId | Reference | The unique ID of the receipt. |
| storeAddress | String | The store address. |
| storeName | String | The store name. |