Get Transactions - Fabric

Get Transactions

cURL

curl --request GET
--url https://vanilla-dev02-loyalty.fabric.zone/api/v2/earn/get-transaction
--header 'Authorization: Bearer '

Python

import requests

url = "https://vanilla-dev02-loyalty.fabric.zone/api/v2/earn/get-transaction"

headers = {"Authorization": "Bearer "}

response = requests.get(url, headers=headers)

print(response.text)

JavaScript (Fetch)

const options = {method: 'GET', headers: {Authorization: 'Bearer '}};

fetch('https://vanilla-dev02-loyalty.fabric.zone/api/v2/earn/get-transaction', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));

PHP

"https://vanilla-dev02-loyalty.fabric.zone/api/v2/earn/get-transaction", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ?>

Go

package main

import ( "fmt" "net/http" "io" )

func main() {

url := "https://vanilla-dev02-loyalty.fabric.zone/api/v2/earn/get-transaction"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer ")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close() body, _ := io.ReadAll(res.Body)

fmt.Println(string(body)) }

Java (Unirest)

HttpResponse response = Unirest.get("https://vanilla-dev02-loyalty.fabric.zone/api/v2/earn/get-transaction") .header("Authorization", "Bearer ") .asString();

Ruby

require 'uri' require 'net/http'

url = URI("https://vanilla-dev02-loyalty.fabric.zone/api/v2/earn/get-transaction")

http = Net::HTTP.new(url.host, url.port) http.use_ssl = true

request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer '

response = http.request(request) puts response.read_body

Response Codes

Example Response (Success)

{
  "status": 200,
  "message": "",
  "errors": {},
  "data": [
    {
      "profileId": "67460e74-02e3-11e8-b443-00163e990bdb",
      "transactionExternalReference": "LOYALTY-8675309",
      "transactionEntityReference": "Liberty_center_store",
      "transactionCode": "62660e74-02e3-11e8-b443-00163e990abc",
      "transactionTypeExternalReference": "PURCHASE",
      "transactionType": "EARN",
      "transactionActivityType": "BASE_POINTS_EARNED",
      "transactionDateTime": "2020-03-20T14:28:23.382748",
      "totalAmountPaid": 180,
      "totalTax": 20,
      "discounts": [
        {
          "id": 101,
          "value": 20,
          "type": "tier"
        }
      ],
      "discountValue": 20,
      "transactionNetAmount": 160,
      "points": 160,
      "currentPointsBalance": 360,
      "basePoints": 260,
      "bonusPoints": 100,
      "promotionalPoints": 0,
      "transactionItems": [
        {
          "grossAmount": 200,
          "totalAmountPaid": 200,
          "taxAmount": 20,
          "netAmount": 180,
          "itemPrice": 90,
          "itemQuantity": 2,
          "SKU": "1123455",
          "lineNumber": 0,
          "itemName": "demo item",
          "UOM": "unit",
          "discounts": [
            {
              "id": 2345,
              "value": 0,
              "type": "promotion",
              "description": "Black Friday discount"
            }
          ],
          "couponCodes": [
            "H4B-1000"
          ]
        }
      ],
      "activityTimestamp": "2020-02-08 09:30:26",
      "transactionNumber": "LOYALTY-8675309",
      "reasonCode": "9393",
      "reasonDescription": "earning item",
      "deviceId": "D10626",
      "issueAuditUser": "Joe",
      "cancelAuditUser": "John",
      "rewards": [
        {
          "reward_id": 111,
          "core_rule_id": 2,
          "reward_portion": 10
        }
      ]
    }
  ]
}

Example Response (Error)

{
  "message": "Error message string",
  "errors": {
    "ExceptionString": [
      "Invalid Field"
    ]
  },
  "data": null,
  "status": 400
}

{ "detail": "Authentication Failed" }

Authorizations

Query Parameters