Charges

Charges#index

Retrieves all invoice charges

GET /invoices/:invoice_id/charges

Response

Returns a 200 OK with an array of invoice charges:

[
    {
        "id": 1,
        "matter_id": null,
        "invoice_id": 1,
        "contact_id": 1,
        "firm_id": 1,
        "user_id": 2,
        "description": null,
        "amount": "100.0",
        "status": "service",
        "created_at": "2022-03-03T17:27:09.950Z",
        "updated_at": "2022-03-03T17:27:10.164Z",
        "created_by_migration": null,
        "date": "2022-03-03"
    },
    {
        "id": 2,
        "matter_id": 1,
        "invoice_id": 1,
        "contact_id": 1,
        "firm_id": 1,
        "user_id": 2,
        "description": "New description",
        "amount": "100.0",
        "status": "service",
        "created_at": "2022-01-12T15:35:32.586Z",
        "updated_at": "2022-03-03T17:47:39.669Z",
        "created_by_migration": null,
        "date": "2022-01-12"
    }
]

Charges#create

Creates a new invoice charge. Keep in mind to send charge data inside a charge root key.

POST /invoices/:invoice_id/charges

You should pass a JSON with the following parameters:

  • amount decimal, greater than or equal to 0, required

  • status 'service' or 'expense' or 'fee', required

  • date date, required

  • description string

  • matter_id integer

{
    "charge": {
        amount: 100,
        status: "service",
        date: "2021-09-22",
        description: "New description"
    }
}

Response

Returns a 201 created.

Charges#update

Updates an existing charge.

PUT /charges/:id

You should pass a JSON with the following parameters:

  • amount decimal, greater than or equal to 0

  • status 'service' or 'expense' or 'fee'

  • date date

  • description string

  • matter_id integer

{
    "charge": {
        amount: 200,
        status: "expense",
        date: "2022-01-01",
        description: "New description"
    }
}

Response:

Returns 200 OK

Charges#destroy

Destroys an existing charge

DELETE /charges/:id

Response:

Returns 200 OK

Last updated