Skip to main content
POST
/
api
/
billing
/
coworkerledgerentries
Create CoworkerLedgerEntry
curl --request POST \
  --url https://spaces.nexudus.com/api/billing/coworkerledgerentries \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "BusinessId": 123,
  "CoworkerId": 123,
  "Description": "<string>",
  "Code": "<string>",
  "Debit": 123,
  "Credit": 123,
  "Balance": 123
}
'
{
  "Status": 123,
  "Message": "<string>",
  "Value": "<any>",
  "WasSuccessful": true,
  "Errors": [
    {
      "AttemptedValue": "<any>",
      "Message": "<string>",
      "PropertyName": "<string>"
    }
  ]
}
A CoworkerLedgerEntry is an individual financial transaction line in a customer’s ledger. Ledger entries record debits, credits, and the running balance between a location and a customer. Each entry can be linked to a CoworkerInvoice and carries a PaymentGatewayName that identifies which payment provider processed the transaction. The ledger balance reflects the net financial position between the location and the customer:
  • A positive balance means the customer owes money (unpaid invoices).
  • A negative balance means the customer has credited payments that will be applied to future invoices.
  • A balance of 0 means the account is settled with no outstanding invoices or credits.

Authentication

This endpoint requires OAuth2 authentication. Include a valid bearer token in the Authorization header. The authenticated user must be a full unrestricted administrator or have the CoworkerLedgerEntry-Create role.

Enums

ValueName
1PayPalStandard
2PaypalStandardSubscription
3GoCardless
4Stripe
5AuthorizeNetDirect
6UsaEPay
7AuthorizeNetSubscription
8Adyen
9MultiGateway
11Manual
12Forte
13PayPalAdaptive
14GoCardlessPro
15CreditCard
16EPay
17Braintree
18MidTrans
19EziDebit
20LiqPay
21RazorPay
22SquareCash
23SquareCreditCard
24StripeACH
25StripeDirectDebit
26IZettleCreditCard
27PeachPayments
28Klarna
29StripeTerminal
30PayPalStandardRest
401HostedPaymentPage1
402HostedPaymentPage2
403HostedPaymentPage3
500Xero
501Quickbooks
989ManualDirectDebit
990BadDebt
991CreditCardManual1
992CreditCardManual2
993CreditCardManual3
994Credit
995Gift
996Bank
997Cash
998Check
999Other

Request Body

Required Fields

BusinessId
integer
required
Business Id.
CoworkerId
integer
required
Coworker Id.
Description
string
required
Description.
Code
string
required
Ledger entry code.
Debit
number
required
Debit amount.
Credit
number
required
Credit amount.
Balance
number
required
Balance.

Optional Fields

CoworkerInvoiceId
integer
Coworker Invoice Id.
PaymentGatewayName
integer
Payment gateway name. See ePaymentProvider? enum above.
PaymentMethodNumber
string
Payment method number.
TransactionDate
string
Transaction date.
Billed
boolean
Whether this entry has been billed.
TransactionDateLocal
string
Transaction date in the location’s local time.
ConnectedTransactionGuid
string
Connected transaction GUID.

Code Examples

curl -X POST \
  "https://spaces.nexudus.com/api/billing/coworkerledgerentries" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "BusinessId": 0,
    "CoworkerId": 0,
    "Description": "",
    "Code": "",
    "Debit": 0,
    "Credit": 0,
    "Balance": 0
}'

Response

200

Status
integer
HTTP status code. 200 on success.
Message
string
A human-readable message confirming the creation.
Value
object
Contains the Id of the newly created record.
WasSuccessful
boolean
true if the coworkerledgerentry was created successfully.
Errors
array
null on success.
Example Response
{
  "Status": 200,
  "Message": "CoworkerLedgerEntry was successfully created.",
  "Value": {
    "Id": 87654321
  },
  "OpenInDialog": false,
  "OpenInWindow": false,
  "RedirectURL": null,
  "JavaScript": null,
  "UpdatedOn": "2025-01-15T10:30:00Z",
  "UpdatedBy": "admin@example.com",
  "Errors": null,
  "WasSuccessful": true
}

400

Message
string
A summary of the validation error(s), in the format PropertyName: error message.
Value
any
null on validation failure.
Errors
object[]
Array of validation errors.
WasSuccessful
boolean
false when the request fails validation.
Example Response
{
  "Message": "Description: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "Description"
    }
  ],
  "WasSuccessful": false
}