---
agentTools:
  projectIndex: https://docs.mthmr.com/llms.txt
---

# Add Transactions History

This endpoint enables the addition of one or multiple transaction records to the system. It is ideal for adding a large number of transactions at once, saving time and effort. It will return an event ID which can be used to receive the transactions' cashback record via webhook.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "MTHMR CASHBACK API",
    "version": "0.1.0"
  },
  "servers": [
    {
      "url": "https://bank-api.mthmr.com"
    }
  ],
  "paths": {
    "/transactions-history": {
      "post": {
        "tags": [
          "Transaction"
        ],
        "summary": "Add Transactions History",
        "description": "This endpoint enables the addition of one or multiple transaction records to the system. It is ideal for adding a large number of transactions at once, saving time and effort. It will return an event ID which can be used to receive the transactions' cashback record via webhook.",
        "operationId": "add_transactions_history_transactions_history_post",
        "parameters": [
          {
            "name": "Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "The authentication token for accessing the API.",
              "required": true,
              "title": "Token"
            },
            "description": "The authentication token for accessing the API.",
            "example": "<YOUR_TOKEN>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TransBase"
                },
                "title": "Transactiond"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "Location": {
        "properties": {
          "country": {
            "type": "string",
            "title": "Country",
            "description": "The country where the customer resides.",
            "example": "Saudi Arabia"
          },
          "city": {
            "type": "string",
            "title": "City",
            "description": "The city where the customer resides.",
            "example": "Riyadh"
          }
        },
        "type": "object",
        "required": [
          "country",
          "city"
        ],
        "title": "Location"
      },
      "Merchant": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "The unique identifier of the merchant.",
            "example": "b65cca2a-6809-11ee-8c99-0242ac120002"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "The name of the merchant.",
            "example": "MTHMR"
          },
          "category_code": {
            "type": "string",
            "title": "Category Code",
            "description": "The category code of the merchant",
            "example": "b65cca2a-6809-11ee-8c99-0242ac120002"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "category_code"
        ],
        "title": "Merchant"
      },
      "TransBase": {
        "properties": {
          "transaction_id": {
            "type": "string",
            "title": "Transaction Id",
            "description": "The unique identifier for the transaction.",
            "example": "b65cca2a-6809-11ee-8c99-0242ac120002"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "A brief description or note about the transaction.",
            "example": "This is a brief note about the transaction."
          },
          "customer_id": {
            "type": "string",
            "title": "Customer Id",
            "description": "The unique identifier for the customer associated with the transaction.",
            "example": "a8de52aa-49e7-4e5c-bb66-1c82ac1d"
          },
          "date": {
            "type": "string",
            "format": "date-time",
            "title": "Date",
            "description": "The date and time when the transaction was made.",
            "example": "2024-04-17T13:45:00Z"
          },
          "amount": {
            "type": "number",
            "title": "Amount",
            "description": "The monetary value of the transaction.",
            "example": "150.23"
          },
          "merchant": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Merchant"
              }
            ],
            "description": "An object containing details about the merchant where the transaction occurred."
          },
          "location": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Location"
              }
            ],
            "description": "An object containing details about the customer's location."
          }
        },
        "type": "object",
        "required": [
          "transaction_id",
          "customer_id",
          "date",
          "amount",
          "merchant"
        ],
        "title": "TransBase"
      },
      "TransactionResponse": {
        "properties": {
          "event_id": {
            "type": "string",
            "title": "Event Id",
            "description": "Token to be used in your webhooks"
          }
        },
        "type": "object",
        "required": [
          "event_id"
        ],
        "title": "TransactionResponse"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  },
  "tags": [
    {
      "name": "Transaction",
      "description": "Transaction"
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 102,
      "1": 215,
      "2": 14,
      "3": 198,
      "4": 95,
      "5": 13,
      "6": 67,
      "7": 0,
      "8": 54,
      "9": 49,
      "10": 13,
      "11": 95
    }
  }
}
```