Skip to main content
GET
/
customers
/
external_customer_id
/
{external_customer_id}
/
credits
/
ledger
Fetch customer credits ledger by external ID
curl --request GET \  --url https://api.withorb.com/v1/customers/external_customer_id/{external_customer_id}/credits/ledger \  --header 'Authorization: Bearer <token>'
{  "data": [  {  "metadata": {},  "id": "<string>",  "ledger_sequence_number": 123,  "entry_status": "committed",  "customer": {  "id": "<string>",  "external_customer_id": "<string>"  },  "starting_balance": 123,  "ending_balance": 123,  "amount": 123,  "currency": "<string>",  "created_at": "2023-11-07T05:31:56Z",  "description": "<string>",  "credit_block": {  "id": "<string>",  "expiry_date": "2023-11-07T05:31:56Z",  "per_unit_cost_basis": "<string>",  "filters": [  {  "field": "<any>",  "operator": "<any>",  "values": "<any>"  }  ]  },  "entry_type": "increment",  "created_invoices": [  {  "metadata": {},  "voided_at": "2023-11-07T05:31:56Z",  "paid_at": "2023-11-07T05:31:56Z",  "issued_at": "2023-11-07T05:31:56Z",  "scheduled_issue_at": "2023-11-07T05:31:56Z",  "auto_collection": {  "next_attempt_at": "2023-11-07T05:31:56Z",  "previously_attempted_at": "2023-11-07T05:31:56Z",  "enabled": true,  "num_attempts": 123  },  "issue_failed_at": "2023-11-07T05:31:56Z",  "sync_failed_at": "2023-11-07T05:31:56Z",  "payment_failed_at": "2023-11-07T05:31:56Z",  "payment_started_at": "2023-11-07T05:31:56Z",  "amount_due": "8.00",  "created_at": "2022-05-01T07:01:31+00:00",  "currency": "USD",  "customer": {  "id": "<string>",  "external_customer_id": "<string>"  },  "due_date": "2022-05-30T07:00:00+00:00",  "id": "<string>",  "invoice_pdf": "https://assets.withorb.com/invoice/rUHdhmg45vY45DX/qEAeuYePaphGMdFb",  "invoice_number": "JYEFHK-00001",  "subscription": {  "id": "VDGsT23osdLb84KD"  },  "total": "8.00",  "customer_balance_transactions": [  {  "id": "cgZa3SXcsPTVyC4Y",  "created_at": "2022-05-01T07:01:31+00:00",  "starting_balance": "33.00",  "ending_balance": "22.00",  "amount": "11.00",  "action": "applied_to_invoice",  "description": "An optional description",  "invoice": {  "id": "gXcsPTVyC4YZa3Sc"  },  "type": "increment",  "credit_note": {  "id": "<string>"  }  }  ],  "status": "issued",  "invoice_source": "subscription",  "shipping_address": {  "line1": "<string>",  "line2": "<string>",  "city": "<string>",  "state": "<string>",  "postal_code": "<string>",  "country": "<string>"  },  "billing_address": {  "line1": "<string>",  "line2": "<string>",  "city": "<string>",  "state": "<string>",  "postal_code": "<string>",  "country": "<string>"  },  "hosted_invoice_url": "<string>",  "will_auto_issue": true,  "eligible_to_issue_at": "2023-11-07T05:31:56Z",  "customer_tax_id": {  "country": "AD",  "type": "ad_nrt",  "value": "<string>"  },  "memo": "<string>",  "credit_notes": [  {  "id": "<string>",  "credit_note_number": "<string>",  "reason": "<string>",  "total": "<string>",  "voided_at": "2022-05-01T07:01:31+00:00",  "type": "<string>",  "memo": "<string>"  }  ],  "payment_attempts": [  {  "id": "<string>",  "payment_provider": "stripe",  "payment_provider_id": "<string>",  "amount": "<string>",  "succeeded": true,  "created_at": "2023-11-07T05:31:56Z",  "receipt_pdf": "https://assets.withorb.com/receipt/rUHdhmg45vY45DX/qEAeuYePaphGMdFb"  }  ],  "discount": "<any>",  "discounts": [  {  "discount_type": "percentage",  "applies_to_price_ids": [  "h74gfhdjvn7ujokd",  "7hfgtgjnbvc3ujkl"  ],  "filters": [  "<any>"  ],  "reason": "<string>",  "percentage_discount": 0.15  }  ],  "minimum": {  "minimum_amount": "<string>",  "filters": [  {  "field": "<any>",  "operator": "<any>",  "values": "<any>"  }  ],  "applies_to_price_ids": [  "<string>"  ]  },  "minimum_amount": "<string>",  "maximum": {  "maximum_amount": "<string>",  "filters": [  {  "field": "<any>",  "operator": "<any>",  "values": "<any>"  }  ],  "applies_to_price_ids": [  "<string>"  ]  },  "maximum_amount": "<string>",  "line_items": [  {  "amount": "7.00",  "discount": {},  "end_date": "2022-02-01T08:00:00+00:00",  "grouping": "<string>",  "minimum": {  "minimum_amount": "<any>",  "filters": "<any>",  "applies_to_price_ids": "<any>"  },  "minimum_amount": "<string>",  "maximum": {  "maximum_amount": "<any>",  "filters": "<any>",  "applies_to_price_ids": "<any>"  },  "maximum_amount": "<string>",  "adjustments": [  {}  ],  "name": "Fixed Fee",  "quantity": 1,  "start_date": "2022-02-01T08:00:00+00:00",  "subtotal": "9.00",  "adjusted_subtotal": "5.00",  "credits_applied": "6.00",  "partially_invoiced_amount": "4.00",  "sub_line_items": [  {}  ],  "tax_amounts": [  {  "tax_rate_description": "<string>",  "tax_rate_percentage": "<any>",  "amount": "<string>"  }  ],  "id": "<string>",  "price": {  "model_type": "unit",  "unit_config": {},  "metadata": {},  "id": "<string>",  "name": "<string>",  "external_price_id": "<any>",  "replaces_price_id": "<any>",  "price_type": "usage_price",  "created_at": "2023-11-07T05:31:56Z",  "cadence": "one_time",  "billing_mode": "in_advance",  "billing_cycle_configuration": {},  "invoicing_cycle_configuration": "<any>",  "billable_metric": "<any>",  "dimensional_price_configuration": "<any>",  "fixed_price_quantity": "<any>",  "plan_phase_order": "<any>",  "currency": "<string>",  "conversion_rate": "<any>",  "conversion_rate_config": "<any>",  "item": {},  "credit_allocation": "<any>",  "composite_price_filters": "<any>",  "discount": "<any>",  "minimum": "<any>",  "minimum_amount": "<any>",  "maximum": "<any>",  "maximum_amount": "<any>"  },  "usage_customer_ids": [  "<string>"  ],  "filter": "<string>"  }  ],  "subtotal": "8.00",  "invoice_date": "2022-05-01T07:00:00+00:00"  }  ]  }  ],  "pagination_metadata": {  "has_more": true,  "next_cursor": "<string>"  } }

Authorizations

Authorization
string
header
required

API Keys can be issued in the Orb's web application.

Path Parameters

external_customer_id
string | null
required

Query Parameters

limit
integer
default:20

The number of items to fetch. Defaults to 20.

Required range: 1 <= x <= 100
cursor
string | null

Cursor for pagination. This can be populated by the next_cursor value returned from the initial request.

currency
string | null

The ledger currency or custom pricing unit to use.

minimum_amount
string | null
entry_type
enum<string> | null
Available options:
increment,
decrement,
expiration_change,
credit_block_expiry,
void,
void_initiated,
amendment
entry_status
enum<string> | null
Available options:
committed,
pending
created_at[gte]
string<date-time> | null
created_at[gt]
string<date-time> | null
created_at[lt]
string<date-time> | null
created_at[lte]
string<date-time> | null

Response

OK

data
Data · array
required
  • IncrementLedgerEntry
  • DecrementLedgerEntry
  • ExpirationChangeLedgerEntry
  • CreditBlockExpiryLedgerEntry
  • VoidLedgerEntry
  • VoidInitiatedLedgerEntry
  • AmendmentLedgerEntry
pagination_metadata
object
required