# House Account Transactions

A Debit Transaction represents the customer paying part of the amount he owes, a Credit Transaction represents the customer adding more to his debts. A Credit Transaction is identified by a -ve amount, while a Debit Transaction is identified by a +ve amount.

# The House Account Transaction Object

# Sample

{
  "id": "8cd1956b",
  "amount": -180.5,
  "old_balance": 180.5,
  "new_balance": 0,
  "notes": "",
  "user": {
    "id": "8f7aafee"
  },
  "customer": {
    "id": "8f7bf6f9"
  },
  "order": {
    "id": "8fc5dacf"
  },
  "created_at": "2019-02-11 07:28:29",
  "updated_at": "2019-02-11 07:28:29"
}

# Attributes

Field Type Rule Description
id string Unique identifier for the house account transaction
amount double sortable The amount of the house account transaction
old_balance double The old balance of the house account transaction
new_balance double The new balance of the house account transaction
user object includable The User who created the house account transaction
customer object includable The Customer attached to the house account transaction
order object includable The Order attached to the house account transaction
created_at string sortable Time YYYY-MM-DD HH-MM-SS in UTC at which the house account transaction was created
updated_at string sortable Time YYYY-MM-DD HH-MM-SS in UTC at which the house account transaction was created

# List House Account Transactions

GET /house_account_transactions

# Scope

customers.accounts.read

# Filters

  • customer_id
  • user_id
  • order_id
  • updated_after

# Response

{
  "data": [
    {
      "id": "8cd1956b",
      "amount": -180.5,
      "old_balance": 180.5,
      "new_balance": 0,
      "notes": "",
      "user": {
        "id": "8f7aafee"
      },
      "customer": {
        "id": "8f7bf6f9"
      },
      "order": {
        "id": "8fc5dacf"
      },
      "created_at": "2019-02-11 07:28:29",
      "updated_at": "2019-02-11 07:28:29"
    }
  ]
}

# Get House Account Transaction

GET /house_account_transactions/{houseAccountTransactionId}

# Scope

customers.accounts.read

# Response

{
  "data": {
    "id": "8cd1956b",
    "amount": -180.5,
    "old_balance": 180.5,
    "new_balance": 0,
    "notes": "",
    "user": {
      "id": "8f7aafee"
    },
    "customer": {
      "id": "8f7bf6f9"
    },
    "order": {
      "id": "8fc5dacf"
    },
    "created_at": "2019-02-11 07:28:29",
    "updated_at": "2019-02-11 07:28:29"
  }
}

# Create House Account Transaction

POST /house_account_transactions

# Scope

customers.accounts.write

# Request

{
    "amount": -180,
    "customer_id": "8cd1956b",
    "user_id": "8cd1956b",
    "order_id": "8cd1956b"
}

# Response

{
  "data": {
    "id": "8cd1956b",
    "amount": -180.5,
    "old_balance": 180.5,
    "new_balance": 0,
    "notes": "",
    "user": {
      "id": "8f7aafee"
    },
    "customer": {
      "id": "8f7bf6f9"
    },
    "order": {
      "id": "8fc5dacf"
    },
    "created_at": "2019-02-11 07:28:29",
    "updated_at": "2019-02-11 07:28:29"
  }
}
Last Updated: 13/9/2023, 12:19:11 AM