LedgerBee Developer
  • Getting started
  • Conventions
  • Products
  • API Reference
Information
Accounts
    List accountsget
API Key
    Get current API keyget
Company
    Get company detailsget
Customers
    List customersgetCreate a customerpostGet a single customergetUpdate a customerpatchList a customer's contactsgetList a customer's departmentsgetList customer groupsget
Dimensions
    List all dimensionsgetCreate a new dimension categorypostGet a single dimension by IDgetUpdate a dimension categoryputDelete a dimension categorydeleteCreate a new dimension valuepostUpdate a dimension valueputDelete a dimension valuedelete
Document Templates
    List document templatesget
Journal Categories
    List journal categoriesget
Journal Entries
    Create multiple journal entries in batch (DEPRECATED — migrate to v2)postList journal entriesgetCreate a single journal entry (DEPRECATED — use POST /api/v2/journal-entries)postGet a single journal entrygetUpdate a journal entry — correct the reference and/or set your external system idpatchGet attachments for a journal entrygetReverse posted journal entries in batchpostReverse a posted journal entrypost
MCP
    LedgerBee Developer MCP Serverpost
Meters
    List meter subscriptions by IDgetReport usagepostList meter subscriptions by nameget
Product Groups
    List product groupsgetCreate a product grouppostGet a product groupgetDelete a product groupdeleteUpdate a product grouppatch
Product Prices
    Create a product pricepostGet a product pricegetDelete a product pricedeleteUpdate a product pricepatchActivate a product pricepostArchive a product pricepostDisable a product pricepostSet a price as the product defaultpost
Products
    List productsgetCreate a productpostGet a productgetDelete a productdeleteUpdate a productpatch
Projects
    List all projectsgetIdempotent project upsertputCreate a projectpostGet a projectgetUpdate a projectputGet project profitgetAdd a subprojectpostUpdate a subprojectputDelete a subprojectdelete
Subscriptions
    List customer subscriptionsgetAssign a subscription to a customerpostGet a customer subscription by its stable idgetUpdate a customer subscriptionpatchList a subscription’s pending scheduled changesgetCancel a single pending scheduled changedeleteCancel a customer subscriptionpostList subscription plansgetArchive a subscription planpost
VAT Codes
    List VAT codesget
Webhook Endpoints
    List webhook endpointsgetCreate a webhook endpointpostRetrieve a webhook endpointgetUpdate a webhook endpointputDelete a webhook endpointdeleteRoll the signing secretpostSend a test eventpost
Portal SSO
    Published RP signing keys (JWKS) for a tenant's private_key_jwt SSOgetMint a customer-portal SSO handoff referencepostProvision a customer + grant portal access (partner JIT provisioning)postRevoke (force-refresh) a user's customer-portal sessionspost
Credit Notes
    List credit notesgetCreate a credit notepostGet a credit note by IDgetGet the delivery status of a credit notegetDownload the credit note PDFgetSend a credit note to the customerpost
Payment Methods
    List saved payment methods for a customergetApply a payment method to all active subscriptions for a customerpostCancel a saved card on the payment providerdeleteUnassign a payment method from a customerdeleteGenerate a link for the customer to save a card for future paymentspostSet a saved payment method as the customer defaultput
Draft Journal Entries
    Create multiple draft journal entries in batchpostList draft journal entriesgetCreate a draft journal entrypostGet a single draft journal entrygetDelete a draft journal entrydeleteBook a draft journal entrypost
Invoices
    List invoicesgetCreate a draft invoicepostGet an invoice by IDgetGet the delivery status of an invoicegetDownload the invoice PDFgetSend an invoice to the customerpost
Order Confirmations
    List order confirmationsgetCreate a draft order confirmationpostGet an order confirmation by idgetUpdate a draft order confirmationpatchConvert an order confirmation into an invoicepostDownload an order confirmation as PDFgetSend an order confirmationpost
Portal Plans
    List the full plan cataloguegetGet one plan by idgetResolve the gated pricing catalogue for an identified buyer (partner display)post
Quotes
    List quotesgetCreate a draft quotepostGet a quote by idgetUpdate a draft quotepatchConvert a quotepostDownload a quote as PDFgetSend a quotepost
Vendors
    List vendorsgetCreate a vendorpostList vendor contactsgetList vendor departmentsgetList vendor groupsget
Draft Journal Entries (v2)
    Create draft journal entries in batch (v2)postList draft journal entries (v2)getCreate a draft journal entry (v2)postGet a single draft journal entry (v2)getDelete a draft journal entry (v2)deleteUpdate a draft journal entry (v2)patchBook a draft journal entry (v2)post
Journal Entries (v2)
    Create a journal entry (v2)postCreate journal entries in batch (v2)post
Schemas
LedgerBee Public API
LedgerBee Public API

Payment Methods

Download schema

List saved payment methods for a customer

GET
https://api.ledgerbee.com/api
/v1/customers/{customerId}/payment-methods
x-api-key (header)
or
OAuth 2.0

Retrieves the payment methods saved on a customer (e.g. cards stored via a card-save link). Pass ?provider= to narrow to a single payment provider.

Required Scope

  • payment-methods-read

List saved payment methods for a customer › path Parameters

customerId
​string · required

The customer ID

List saved payment methods for a customer › query Parameters

provider
​string · enum

Filter by payment provider

Enum values:
ONPAY
STRIPE

List saved payment methods for a customer › Responses

200

List of payment methods

​PaymentMethodResponse[]
PaymentMethodResponse
id
​string · required

Unique identifier of the payment method

Example: 019D1234-ABCD-7000-8000-123456789ABC
customerId
​string · required

Customer ID this payment method belongs to

Example: 019CBD16-4BFF-766B-BAD7-2F7C36DC3377
provider
​string · enum · required

Payment provider

Enum values:
ONPAY
STRIPE
Example: ONPAY
label
​string · required

Human-readable label for the payment method

Example: Dankort •••• 1234
isDefault
​boolean · required

Whether this is the default payment method for the customer

Example: false
status
​string · enum · required

Current status of the payment method

Enum values:
ACTIVE
EXPIRED
CANCELLED
Example: ACTIVE
createdAt
​string · required

When the payment method was created

Example: 2026-03-25T10:30:00.000Z
cardMask
​string

Masked card number

Example: 457199XXXXXX1234
cardType
​string

Card type as reported by the provider

Example: dankort
expiryMonth
​number

Card expiry month

Example: 12
expiryYear
​number

Card expiry year

Example: 2029
GET/v1/customers/{customerId}/payment-methods
curl https://api.ledgerbee.com/api/v1/customers/:customerId/payment-methods \ --header 'x-api-key: <api-key>'
Example Responses
[ { "id": "019D1234-ABCD-7000-8000-123456789ABC", "customerId": "019CBD16-4BFF-766B-BAD7-2F7C36DC3377", "provider": "ONPAY", "label": "Dankort •••• 1234", "cardMask": "457199XXXXXX1234", "cardType": "dankort", "expiryMonth": 12, "expiryYear": 2029, "isDefault": false, "status": "ACTIVE", "createdAt": "2026-03-25T10:30:00.000Z" } ]
json
application/json

Apply a payment method to all active subscriptions for a customer

POST
https://api.ledgerbee.com/api
/v1/customers/{customerId}/payment-methods/{paymentMethodId}/apply-to-subscriptions
x-api-key (header)
or
OAuth 2.0

Assigns the specified payment method to all active, trial, and scheduled subscriptions. Overwrites existing card assignments. Excludes PARENT_PAYS subscriptions.

Apply a payment method to all active subscriptions for a customer › path Parameters

customerId
​string · required

The customer ID

paymentMethodId
​string · required

The payment method ID to apply

Apply a payment method to all active subscriptions for a customer › Request Body

ApplyPaymentMethodToSubscriptionsDto
enableAutomaticBilling
​boolean · required

Whether to enable automatic billing on the subscriptions

Apply a payment method to all active subscriptions for a customer › Responses

200

Card applied to subscriptions

No data returned
POST/v1/customers/{customerId}/payment-methods/{paymentMethodId}/apply-to-subscriptions
curl https://api.ledgerbee.com/api/v1/customers/:customerId/payment-methods/:paymentMethodId/apply-to-subscriptions \ --request POST \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data '{ "enableAutomaticBilling": true }'
Example Request Body
{ "enableAutomaticBilling": true }
json
Example Responses
No example specified for this content type

Cancel a saved card on the payment provider

DELETE
https://api.ledgerbee.com/api
/v1/customers/{customerId}/payment-methods/{paymentMethodId}/cancel
x-api-key (header)
or
OAuth 2.0

Cancels the card subscription on OnPay and marks it as cancelled. This cannot be undone.

Cancel a saved card on the payment provider › path Parameters

customerId
​string · required

The customer ID

paymentMethodId
​string · required

The payment method ID to cancel

Cancel a saved card on the payment provider › Responses

200

Card cancelled

No data returned
DELETE/v1/customers/{customerId}/payment-methods/{paymentMethodId}/cancel
curl https://api.ledgerbee.com/api/v1/customers/:customerId/payment-methods/:paymentMethodId/cancel \ --request DELETE \ --header 'x-api-key: <api-key>'
Example Responses
No example specified for this content type

Unassign a payment method from a customer

DELETE
https://api.ledgerbee.com/api
/v1/customers/{customerId}/payment-methods/{paymentMethodId}/unassign
x-api-key (header)
or
OAuth 2.0

Removes the link between the customer and the card. The card stays active on the provider and can be reassigned to another customer.

Unassign a payment method from a customer › path Parameters

customerId
​string · required

The customer ID

paymentMethodId
​string · required

The payment method ID to unassign

Unassign a payment method from a customer › Responses

200

Payment method unassigned

No data returned
DELETE/v1/customers/{customerId}/payment-methods/{paymentMethodId}/unassign
curl https://api.ledgerbee.com/api/v1/customers/:customerId/payment-methods/:paymentMethodId/unassign \ --request DELETE \ --header 'x-api-key: <api-key>'
Example Responses
No example specified for this content type

Generate a link for the customer to save a card for future payments

POST
https://api.ledgerbee.com/api
/v1/customers/{customerId}/payment-methods/card-save-link
x-api-key (header)
or
OAuth 2.0

Creates a payment window URL where the customer can enter their card details. The card is saved as a subscription for future charges. Send this URL to your customer.

Generate a link for the customer to save a card for future payments › path Parameters

customerId
​string · required

The customer ID

Generate a link for the customer to save a card for future payments › Request Body

CreateCardSaveLinkRequest
provider
​string · enum · required

Payment provider to use for saving the card

Enum values:
ONPAY
STRIPE
Example: ONPAY

Generate a link for the customer to save a card for future payments › Responses

Payment link created

PaymentLinkResponse
url
​string · required

URL to the payment provider window. Send this to your customer.

Example: https://onpay.io/window/v3/ce8490fa-282e-11f1-a569-11b5d69909e2?k=FFtXYUNXxkh
expiresAt
​string · required

When the payment link expires

Example: 2026-03-25T11:30:00.000Z
POST/v1/customers/{customerId}/payment-methods/card-save-link
curl https://api.ledgerbee.com/api/v1/customers/:customerId/payment-methods/card-save-link \ --request POST \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data '{ "provider": "ONPAY" }'
Example Request Body
{ "provider": "ONPAY" }
json
Example Responses
{ "url": "https://onpay.io/window/v3/ce8490fa-282e-11f1-a569-11b5d69909e2?k=FFtXYUNXxkh", "expiresAt": "2026-03-25T11:30:00.000Z" }
json
application/json

Set a saved payment method as the customer default

PUT
https://api.ledgerbee.com/api
/v1/customers/{customerId}/payment-methods/default/{paymentMethodId}
x-api-key (header)
or
OAuth 2.0

Marks this card as the default for the customer. The default card is pre-selected when assigning new subscriptions — it does not retroactively change existing subscriptions. Use the apply-to-subscriptions endpoint to update existing subscriptions.

Set a saved payment method as the customer default › path Parameters

customerId
​string · required

The customer ID

paymentMethodId
​string · required

The payment method ID to set as default

Set a saved payment method as the customer default › Responses

200

Default updated

No data returned
PUT/v1/customers/{customerId}/payment-methods/default/{paymentMethodId}
curl https://api.ledgerbee.com/api/v1/customers/:customerId/payment-methods/default/:paymentMethodId \ --request PUT \ --header 'x-api-key: <api-key>'
Example Responses
No example specified for this content type

Credit NotesDraft Journal Entries