Charges

The Charges API lets you create, list, update and delete Charges in a Workspace.

The Charge Object

{
  "id": "1",
  "title": "Acme - Website Redesign",
  "amount": 5000,
  "currency": "USD",
  "is_paid": false,
  "paid_at": null,
  "project_id": "1",
  "created_by": {},
  "created_at": "2021-10-28T10:47:55+00:00"
}
1
2
3
4
5
6
7
8
9
10
11

Attributes

id string

The unique identifier of the Charge.


title string

The title of the Charge.


amount int|float

The amount of the Charge. E.g. 1024.63, 157.


currency string

The currency of the Charge amount.


is_paid bool

Whether the Charge is paid or not.


paid_at datetime

The datetime of when the Charge was paid.


project_id string

The id of the Project associated with the Charge.


created_by User

The id of the User who created the Charge. See The User object


created_at datetime

The creation datetime of the Charge.




List Charges

GET /v1/charges

curl 'https://{workspace}.kitchen.co/api/v1/charges' \
 -H 'Accept: application/json' \
 -H 'Authorization: Bearer {AUTH_TOKEN}'
1
2
3

Response

{
  "data": [
    {
      "id": "1",
      "title": "Acme - Website Redesign",
      "amount": 5000,
      "currency": "USD",
      "is_paid": false,
      "paid_at": null,
      "project_id": "1",
      "created_by": {},
      "created_at": "2021-10-28T10:47:55+00:00"
    },],
  "meta": {}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19



Retrieve a Charge

GET /v1/charges/{charge_id}

curl 'https://{workspace}.kitchen.co/api/v1/charges/{charge_id}' \
 -H 'Accept: application/json' \
 -H 'Authorization: Bearer {AUTH_TOKEN}'
1
2
3

Parameters

charge_id string required

The ID of the Charge.


Response

{
  "id": "1",
  "title": "Acme - Website Redesign",
  "amount": 5000,
  "currency": "USD",
  "is_paid": false,
  "paid_at": null,
  "project_id": "1",
  "created_by": {},
  "created_at": "2021-10-28T10:47:55+00:00"
}
1
2
3
4
5
6
7
8
9
10
11



Create a Charge

POST /v1/charges

curl 'https://{workspace}.kitchen.co/api/v1/charges/' \
 -H 'Accept: application/json' \
 -H 'Authorization: Bearer {AUTH_TOKEN}' \
 -d 'project_id={project_id}' \
 -d 'title=Acme - Website Redesign' \
 -d 'amount'=5000
1
2
3
4
5
6

Parameters

project_id string required

The id of the Project that should be associated with the Charge.


title string required

The title of the Charge.


amount string required

The amount of the Charge.


Response

{
  "id": "1",
  "title": "Acme - Website Redesign",
  "amount": 5000,
  "currency": "USD",
  "is_paid": false,
  "paid_at": null,
  "project_id": "1",
  "created_by": {},
  "created_at": "2021-10-28T10:47:55+00:00"
}
1
2
3
4
5
6
7
8
9
10
11



Update a Charge

PUT /v1/charges/{charge_id}

curl 'https://{workspace}.kitchen.co/api/v1/charges/{charge_id}' \
 -H 'Accept: application/json' \
 -H 'Authorization: Bearer {AUTH_TOKEN}' \
 -d 'title=New Title' \
 -d 'amount=10000' \
 -X PUT
1
2
3
4
5
6

Parameters

charge_id string required

The id of the Charge.


Body Parameters

title string optional

The new title for the Charge.


amount int|float optional

The new amount for the Charge.


Response

{
  "id": "1",
  "title": "New Title",
  "amount": 10000,
  "currency": "USD",
  "is_paid": false,
  "paid_at": null,
  "project_id": "1",
  "created_by": {},
  "created_at": "2021-10-28T10:47:55+00:00"
}
1
2
3
4
5
6
7
8
9
10
11



Delete a Charge

DELETE /v1/charges/{charge_id}

curl 'https://{workspace}.kitchen.co/api/v1/charges/{charge_id}' \
 -H 'Accept: application/json' \
 -H 'Authorization: Bearer {AUTH_TOKEN}' \
 -X DELETE
1
2
3
4

Parameters

charge_id string required

The id of the Charge.


Response

Status 204 No Content



Mark Charge as Paid/Unpaid

PUT /v1/charges/{charge_id}

curl 'https://{workspace}.kitchen.co/api/v1/charges/{charge_id}/paid' \
 -H 'Accept: application/json' \
 -H 'Authorization: Bearer {AUTH_TOKEN}' \
 -d 'paid=1' \
 -X PUT
1
2
3
4
5

Parameters

charge_id string required


Body parameters

paid bool required

Whether the Charge should be marked as paid/unpaid. Can be 1 for paid, 0 for unpaid.


Response

{
  "id": "1",
  "title": "Acme - Website Redesign",
  "amount": 5000,
  "currency": "USD",
  "is_paid": true,
  "paid_at": null,
  "project_id": "1",
  "created_by": {},
  "created_at": "2021-10-28T10:47:55+00:00"
}
1
2
3
4
5
6
7
8
9
10
11



List Charges from a Project

GET /v1/projects/{project_id}/charges

curl 'https://{workspace}.kitchen.co/api/v1/projects/{project_id}/charges' \
 -H 'Accept: application/json' \
 -H 'Authorization: Bearer {AUTH_TOKEN}'
1
2
3

Parameters

project_id string Required

The id of the Project.


Response

{
  "data": [
    {
      "id": "1",
      "title": "Acme - Website Redesign",
      "amount": 5000,
      "currency": "USD",
      "is_paid": false,
      "paid_at": null,
      "project_id": "1",
      "created_by": {},
      "created_at": "2021-10-28T10:47:55+00:00"
    },]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16