> For the complete documentation index, see [llms.txt](https://docs.cubicl.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cubicl.io/api-integration/bookkeeping.md).

# Bookkeeping

Receivable and payable records, payments, and activities related to customers.

## Get bookkeeping page

> Returns bookkeeping entries, activities, and statistics for the bookkeeping page.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Bookkeeping","description":"Receivable and payable records, payments, and activities related to customers."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"BookkeepingPage":{"type":"object","properties":{"activities":{"type":"array","items":{"$ref":"#/components/schemas/BookkeepingActivity"}},"entries":{"type":"array","items":{"$ref":"#/components/schemas/BookkeepingEntry"}},"payables":{"$ref":"#/components/schemas/BookkeepingTotals"},"receivables":{"$ref":"#/components/schemas/BookkeepingTotals"}}},"BookkeepingActivity":{"type":"object","properties":{"org":{"type":"string"},"customer":{"type":"string"},"entry":{"type":"string"},"payment":{"type":"string"},"type":{"type":"string","enum":["receivable-created","payable-created","payment-received","payment-sent","payment-deleted"]},"data":{"type":"object","properties":{"entryName":{"type":"string"},"entryDueAt":{"type":"number"},"amount":{"type":"number"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"paidAmount":{"type":"number"}}},"createdBy":{"$ref":"#/components/schemas/BookkeepingUser"},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"},"updatedAt":{"$ref":"#/components/schemas/UnixTimestamp"}}},"CurrencyCode":{"type":"string","enum":["TRY","USD","EUR","GBP","AUD","CAD","CHF","CNY","HKD","NZD","SEK","KRW","SGD","NOK","MXN","INR","ZAR","RUB","BRL","JPY","TWD","DKK","PLN","THB","IDR","HUF","CZK","ILS","PHP","AED","COP","SAR","MYR","RON"]},"BookkeepingUser":{"type":"object","properties":{"_id":{"type":"string"},"email":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"language":{"type":"string"},"org":{"type":"string","nullable":true},"profile":{"type":"string"}}},"UnixTimestamp":{"type":"number","description":"Unix timestamp (seconds)"},"BookkeepingEntry":{"type":"object","properties":{"org":{"type":"string"},"customer":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"}}},"type":{"type":"string","enum":["receivable","payable"]},"amount":{"type":"number"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"name":{"type":"string"},"desc":{"type":"string","nullable":true},"paidAmount":{"type":"number"},"isPaid":{"type":"boolean"},"dueAt":{"type":"number","nullable":true},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"},"createdBy":{"$ref":"#/components/schemas/BookkeepingUser"}}},"BookkeepingTotals":{"type":"object","properties":{"total":{"type":"number"},"outstanding":{"type":"number"},"overdue":{"type":"number"},"currency":{"type":"string"}}},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}}},"responses":{"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}}}},"paths":{"/bookkeeping/page":{"get":{"tags":["Bookkeeping"],"summary":"Get bookkeeping page","operationId":"getBookkeepingPage","responses":{"200":{"description":"Activities, entries, payables, and receivables","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookkeepingPage"}}}},"403":{"$ref":"#/components/responses/Forbidden"}},"description":"Returns bookkeeping entries, activities, and statistics for the bookkeeping page."}}}}
```

## List bookkeeping entry activities

> Returns activities of the specified bookkeeping entry.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Bookkeeping","description":"Receivable and payable records, payments, and activities related to customers."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"BookkeepingActivityList":{"type":"array","items":{"$ref":"#/components/schemas/BookkeepingActivity"}},"BookkeepingActivity":{"type":"object","properties":{"org":{"type":"string"},"customer":{"type":"string"},"entry":{"type":"string"},"payment":{"type":"string"},"type":{"type":"string","enum":["receivable-created","payable-created","payment-received","payment-sent","payment-deleted"]},"data":{"type":"object","properties":{"entryName":{"type":"string"},"entryDueAt":{"type":"number"},"amount":{"type":"number"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"paidAmount":{"type":"number"}}},"createdBy":{"$ref":"#/components/schemas/BookkeepingUser"},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"},"updatedAt":{"$ref":"#/components/schemas/UnixTimestamp"}}},"CurrencyCode":{"type":"string","enum":["TRY","USD","EUR","GBP","AUD","CAD","CHF","CNY","HKD","NZD","SEK","KRW","SGD","NOK","MXN","INR","ZAR","RUB","BRL","JPY","TWD","DKK","PLN","THB","IDR","HUF","CZK","ILS","PHP","AED","COP","SAR","MYR","RON"]},"BookkeepingUser":{"type":"object","properties":{"_id":{"type":"string"},"email":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"language":{"type":"string"},"org":{"type":"string","nullable":true},"profile":{"type":"string"}}},"UnixTimestamp":{"type":"number","description":"Unix timestamp (seconds)"},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"responses":{"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}},"ValidationFailed":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}},"paths":{"/bookkeeping/activities":{"get":{"tags":["Bookkeeping"],"summary":"List bookkeeping entry activities","operationId":"listBookkeepingActivities","parameters":[{"name":"entry","in":"query","required":true,"schema":{"$ref":"#/components/schemas/ObjectId"},"description":"Bookkeeping entry ID"}],"responses":{"200":{"description":"Activity list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookkeepingActivityList"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"}},"description":"Returns activities of the specified bookkeeping entry."}}}}
```

## Create bookkeeping entry

> Adds a receivable or payable record for a customer.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Bookkeeping","description":"Receivable and payable records, payments, and activities related to customers."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"CreateBookkeepingEntryRequest":{"type":"object","required":["customer","name","currency","amount","type"],"properties":{"customer":{"type":"string","description":"Customer ID"},"name":{"type":"string","description":"Receivable or payable name"},"currency":{"allOf":[{"$ref":"#/components/schemas/CurrencyCode"}],"description":"Currency code"},"amount":{"type":"number","minimum":0,"description":"Bookkeeping amount. Must be greater than 0."},"type":{"type":"string","enum":["receivable","payable"],"description":"Entry type."},"dueAt":{"type":"number","description":"Due date (Unix seconds). Payment is expected before this date."},"paidAmount":{"type":"number","description":"Paid amount. Must be greater than 0 and less than the total."},"desc":{"type":"string","description":"Receivable or payable description"}}},"CurrencyCode":{"type":"string","enum":["TRY","USD","EUR","GBP","AUD","CAD","CHF","CNY","HKD","NZD","SEK","KRW","SGD","NOK","MXN","INR","ZAR","RUB","BRL","JPY","TWD","DKK","PLN","THB","IDR","HUF","CZK","ILS","PHP","AED","COP","SAR","MYR","RON"]},"CreateBookkeepingEntryResponse":{"type":"object","properties":{"entry":{"$ref":"#/components/schemas/BookkeepingEntry"},"entryActivity":{"$ref":"#/components/schemas/BookkeepingActivity"},"payment":{"$ref":"#/components/schemas/BookkeepingPayment"},"paymentActivity":{"$ref":"#/components/schemas/BookkeepingActivity"}}},"BookkeepingEntry":{"type":"object","properties":{"org":{"type":"string"},"customer":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"}}},"type":{"type":"string","enum":["receivable","payable"]},"amount":{"type":"number"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"name":{"type":"string"},"desc":{"type":"string","nullable":true},"paidAmount":{"type":"number"},"isPaid":{"type":"boolean"},"dueAt":{"type":"number","nullable":true},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"},"createdBy":{"$ref":"#/components/schemas/BookkeepingUser"}}},"UnixTimestamp":{"type":"number","description":"Unix timestamp (seconds)"},"BookkeepingUser":{"type":"object","properties":{"_id":{"type":"string"},"email":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"language":{"type":"string"},"org":{"type":"string","nullable":true},"profile":{"type":"string"}}},"BookkeepingActivity":{"type":"object","properties":{"org":{"type":"string"},"customer":{"type":"string"},"entry":{"type":"string"},"payment":{"type":"string"},"type":{"type":"string","enum":["receivable-created","payable-created","payment-received","payment-sent","payment-deleted"]},"data":{"type":"object","properties":{"entryName":{"type":"string"},"entryDueAt":{"type":"number"},"amount":{"type":"number"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"paidAmount":{"type":"number"}}},"createdBy":{"$ref":"#/components/schemas/BookkeepingUser"},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"},"updatedAt":{"$ref":"#/components/schemas/UnixTimestamp"}}},"BookkeepingPayment":{"type":"object","properties":{"org":{"type":"string"},"customer":{"type":"string"},"amount":{"type":"number"},"entry":{"type":"string"},"note":{"type":"string","nullable":true},"createdBy":{"type":"string"},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"}}},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}},"ErrorCode":{"type":"object","required":["code"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."}}},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"responses":{"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}}}},"paths":{"/bookkeeping/entries":{"post":{"tags":["Bookkeeping"],"summary":"Create bookkeeping entry","operationId":"createBookkeepingEntry","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBookkeepingEntryRequest"}}}},"responses":{"200":{"description":"New entry and activities","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBookkeepingEntryResponse"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}},"422":{"description":"Invalid operation","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorCode"},{"$ref":"#/components/schemas/ValidationError"}]}}}}},"description":"Adds a receivable or payable record for a customer."}}}}
```

## Update bookkeeping entry

> Updates the bookkeeping entry. \`type\`, \`name\`, and \`currency\` are required on every request, even if they do not change. If \`desc\` or \`dueAt\` is omitted, the previous value is kept; send \`null\` or an empty value to clear it. Amount cannot be changed with this endpoint.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Bookkeeping","description":"Receivable and payable records, payments, and activities related to customers."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"UpdateBookkeepingEntryRequest":{"type":"object","required":["type","name","currency"],"properties":{"type":{"type":"string","enum":["receivable","payable"],"description":"Entry type."},"name":{"type":"string","description":"Receivable or payable name"},"currency":{"allOf":[{"$ref":"#/components/schemas/CurrencyCode"}],"description":"Currency code"},"dueAt":{"type":"number","description":"Due date (Unix seconds). If omitted, the previous value is kept; send `null` to clear it."},"desc":{"type":"string","description":"Receivable or payable description. If omitted, the previous value is kept; send `null` or an empty value to clear it."}}},"CurrencyCode":{"type":"string","enum":["TRY","USD","EUR","GBP","AUD","CAD","CHF","CNY","HKD","NZD","SEK","KRW","SGD","NOK","MXN","INR","ZAR","RUB","BRL","JPY","TWD","DKK","PLN","THB","IDR","HUF","CZK","ILS","PHP","AED","COP","SAR","MYR","RON"]},"BookkeepingEntry":{"type":"object","properties":{"org":{"type":"string"},"customer":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"}}},"type":{"type":"string","enum":["receivable","payable"]},"amount":{"type":"number"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"name":{"type":"string"},"desc":{"type":"string","nullable":true},"paidAmount":{"type":"number"},"isPaid":{"type":"boolean"},"dueAt":{"type":"number","nullable":true},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"},"createdBy":{"$ref":"#/components/schemas/BookkeepingUser"}}},"UnixTimestamp":{"type":"number","description":"Unix timestamp (seconds)"},"BookkeepingUser":{"type":"object","properties":{"_id":{"type":"string"},"email":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"language":{"type":"string"},"org":{"type":"string","nullable":true},"profile":{"type":"string"}}},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}},"ErrorCode":{"type":"object","required":["code"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."}}},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"responses":{"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}}}},"paths":{"/bookkeeping/entries/{entry}":{"put":{"tags":["Bookkeeping"],"summary":"Update bookkeeping entry","operationId":"updateBookkeepingEntry","parameters":[{"name":"entry","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ObjectId"},"description":"Bookkeeping entry ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBookkeepingEntryRequest"}}}},"responses":{"200":{"description":"Updated entry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookkeepingEntry"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}},"422":{"description":"Invalid operation","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorCode"},{"$ref":"#/components/schemas/ValidationError"}]}}}}},"description":"Updates the bookkeeping entry. `type`, `name`, and `currency` are required on every request, even if they do not change. If `desc` or `dueAt` is omitted, the previous value is kept; send `null` or an empty value to clear it. Amount cannot be changed with this endpoint."}}}}
```

## Delete bookkeeping entry

> Deletes the bookkeeping entry. All related activity and payment records are deleted.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Bookkeeping","description":"Receivable and payable records, payments, and activities related to customers."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"responses":{"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}},"ValidationFailed":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}},"paths":{"/bookkeeping/entries/{entry}":{"delete":{"tags":["Bookkeeping"],"summary":"Delete bookkeeping entry","description":"Deletes the bookkeeping entry. All related activity and payment records are deleted.","operationId":"deleteBookkeepingEntry","parameters":[{"name":"entry","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ObjectId"},"description":"Bookkeeping entry ID"}],"responses":{"200":{"description":"Empty response"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}},"422":{"$ref":"#/components/responses/ValidationFailed"}}}}}}
```

## Add payment

> Adds a payment to the bookkeeping entry.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Bookkeeping","description":"Receivable and payable records, payments, and activities related to customers."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"CreateBookkeepingPaymentRequest":{"type":"object","required":["paidAmount"],"properties":{"paidAmount":{"type":"number","minimum":0,"description":"Paid amount. Minimum 0, maximum the entry amount."},"note":{"type":"string","description":"Optional note"}}},"CreateBookkeepingPaymentResponse":{"type":"object","properties":{"payment":{"$ref":"#/components/schemas/BookkeepingPayment"},"activity":{"$ref":"#/components/schemas/BookkeepingActivity"}}},"BookkeepingPayment":{"type":"object","properties":{"org":{"type":"string"},"customer":{"type":"string"},"amount":{"type":"number"},"entry":{"type":"string"},"note":{"type":"string","nullable":true},"createdBy":{"type":"string"},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"}}},"UnixTimestamp":{"type":"number","description":"Unix timestamp (seconds)"},"BookkeepingActivity":{"type":"object","properties":{"org":{"type":"string"},"customer":{"type":"string"},"entry":{"type":"string"},"payment":{"type":"string"},"type":{"type":"string","enum":["receivable-created","payable-created","payment-received","payment-sent","payment-deleted"]},"data":{"type":"object","properties":{"entryName":{"type":"string"},"entryDueAt":{"type":"number"},"amount":{"type":"number"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"paidAmount":{"type":"number"}}},"createdBy":{"$ref":"#/components/schemas/BookkeepingUser"},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"},"updatedAt":{"$ref":"#/components/schemas/UnixTimestamp"}}},"CurrencyCode":{"type":"string","enum":["TRY","USD","EUR","GBP","AUD","CAD","CHF","CNY","HKD","NZD","SEK","KRW","SGD","NOK","MXN","INR","ZAR","RUB","BRL","JPY","TWD","DKK","PLN","THB","IDR","HUF","CZK","ILS","PHP","AED","COP","SAR","MYR","RON"]},"BookkeepingUser":{"type":"object","properties":{"_id":{"type":"string"},"email":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"language":{"type":"string"},"org":{"type":"string","nullable":true},"profile":{"type":"string"}}},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}},"ErrorCode":{"type":"object","required":["code"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."}}},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"responses":{"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}}}},"paths":{"/bookkeeping/payment/{entry}":{"post":{"tags":["Bookkeeping"],"summary":"Add payment","operationId":"createBookkeepingPayment","parameters":[{"name":"entry","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ObjectId"},"description":"Bookkeeping entry ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBookkeepingPaymentRequest"}}}},"responses":{"200":{"description":"New payment and activity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBookkeepingPaymentResponse"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}},"422":{"description":"Invalid operation","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorCode"},{"$ref":"#/components/schemas/ValidationError"}]}}}}},"description":"Adds a payment to the bookkeeping entry."}}}}
```

## Delete payment

> Deletes the payment record.

```json
{"openapi":"3.0.3","info":{"title":"Cubicl API","version":"1.0.0"},"tags":[{"name":"Bookkeeping","description":"Receivable and payable records, payments, and activities related to customers."}],"servers":[{"url":"https://cubicl.io/api/v1","description":"Cubicl production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Access token from the Integrations page. Header: `Authorization: Bearer YOUR_ACCESS_TOKEN`."}},"schemas":{"ObjectId":{"type":"string","description":"MongoDB ObjectId"},"DeleteBookkeepingPaymentResponse":{"type":"object","properties":{"activity":{"$ref":"#/components/schemas/BookkeepingActivity"}}},"BookkeepingActivity":{"type":"object","properties":{"org":{"type":"string"},"customer":{"type":"string"},"entry":{"type":"string"},"payment":{"type":"string"},"type":{"type":"string","enum":["receivable-created","payable-created","payment-received","payment-sent","payment-deleted"]},"data":{"type":"object","properties":{"entryName":{"type":"string"},"entryDueAt":{"type":"number"},"amount":{"type":"number"},"currency":{"$ref":"#/components/schemas/CurrencyCode"},"paidAmount":{"type":"number"}}},"createdBy":{"$ref":"#/components/schemas/BookkeepingUser"},"createdAt":{"$ref":"#/components/schemas/UnixTimestamp"},"updatedAt":{"$ref":"#/components/schemas/UnixTimestamp"}}},"CurrencyCode":{"type":"string","enum":["TRY","USD","EUR","GBP","AUD","CAD","CHF","CNY","HKD","NZD","SEK","KRW","SGD","NOK","MXN","INR","ZAR","RUB","BRL","JPY","TWD","DKK","PLN","THB","IDR","HUF","CZK","ILS","PHP","AED","COP","SAR","MYR","RON"]},"BookkeepingUser":{"type":"object","properties":{"_id":{"type":"string"},"email":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"language":{"type":"string"},"org":{"type":"string","nullable":true},"profile":{"type":"string"}}},"UnixTimestamp":{"type":"number","description":"Unix timestamp (seconds)"},"ErrorCodeMessage":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."},"message":{"type":"string"}}},"ErrorCode":{"type":"object","required":["code"],"properties":{"code":{"type":"integer","description":"Application error code. Not an HTTP status code."}}},"ValidationError":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"responses":{"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}}}},"paths":{"/bookkeeping/payments/{payment}":{"delete":{"tags":["Bookkeeping"],"summary":"Delete payment","operationId":"deleteBookkeepingPayment","parameters":[{"name":"payment","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ObjectId"},"description":"Payment ID"}],"responses":{"200":{"description":"Bookkeeping activity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteBookkeepingPaymentResponse"}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodeMessage"}}}},"422":{"description":"Invalid operation","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ErrorCode"},{"$ref":"#/components/schemas/ValidationError"}]}}}}},"description":"Deletes the payment record."}}}}
```
