# Transactions

Endpoint for transactions

## Get Transactions

 - [GET /transactions/customerId/{customerId}](https://dev.triggloyalty.com/openapi/transactions/gettransactions.md): Returns all transactions for a member.

## Create transaction

 - [POST /transactions](https://dev.triggloyalty.com/openapi/transactions/addtransactions.md): Endpoint used for inserting transactions into OIP. 

It is recommended to send in a list/batch of transactions instead of sending multiple single transactions.
The maximum recommended items per batch is around 400 transactions/items.

{% admonition type="info" name="Returns" %}
To make a transaction be processed as a return, you have to do the following:
  * Set the transactionType field on item level to 'RETURN'
  * Set the quantity value to a negative value.

{% /admonition %}

  Example of transaction flagged as a return:
  
  {
  "ReceiptRequests": [
    {
      "Header": {
        "StoreId": "001",
        "ReceiptId": "9999258836",
        "TimeStamp": "2023-10-13T14:50:05",
        "ConsumerId": "9ae37ad3-8a55-4bb5-81fd-b08f00b684ed",
        "GrossAmount": 1817.8,
        "Vat": 363.56
      },
      "Items": [
        {
          "ReceiptId": "Id of receipt",
          "LineNo": 1,
          "Quantity": -1,
          "ProductId": "VR1722775",
          "ProductName": "MINI CHRISTMAS TREE WITH LED LIGHTS",
          "GrossAmount": 1817.8,
          "Vat": 363.56,
          "NetAmount": 1454.24,
          "TransactionType": "RETURN"
        }
      ]
    }
  ]
}

