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-analysis

Rest 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 

ParameterTypeDescriptionRequired or Optional
filenameStringThe file that contains the image of the receipt.Required
membershipnumberStringThe 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 

ParameterTypeDescription
confidenceStatusStringThe receipt analysis status based on the confidence value defined in the app. Possible values are Success, Failure, or Partial.
isEligibleBooleanIndicates 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.
lineItemStringThe details of the receipt line item.
lineItemPriceStringThe total price of the receipt line item.
memberShipNumberStringThe unique identifier of the member.
priceCurrencyThe unit price of the receipt line item.
productNameStringThe name of the product purchased.
quantityIntegerThe quantity of the product purchased.
receiptDatedateTimeThe date when the receipt is generated.
receiptNumberStringThe receipt number.
receiptSFDCIdReferenceThe unique ID of the receipt.
storeAddressStringThe store address.
storeNameStringThe store name.

See Also