Skip to Content
Docs
API referenceManagement API

Billing ledger

POST
/billing/customers/{customer_id}/account-credit/refund

billing.ledger.v1.LedgerService/RefundAccountCredit (36-credits-ledger.md, API Surface; Account credit; 38-payments-and-tax.md, Refunds). Pays refundable account credit back to the provider payment it came from, never more than what is left of that payment, as refunds with reason account_credit_refund and no credit note (billing-svc docs/questions.md, P96). Credit added by hand, an invoice's surplus or an external overpayment can only be spent. More than the balance is balance_would_be_negative; more than the refundable part (the balances read's refundable) is refund_exceeds_payment.

Authorization

BearerAuth
headerAuthorization<token>

Access token as "Bearer "

Path Parameters

customer_id*string

The Customer id

Header Parameters

X-Idempotency-Key?string

Idempotency key

Response Body

The credit_refunded LedgerEntry object

application/json
  1. response
Example Request
curl -X POST 'https://api.us.pontive.com/v1/billing/customers/string/account-credit/refund'
Example Response
{}
GET
/billing/customers/{customer_id}/balances

billing.ledger.v1.LedgerService/ListBalances (36-credits-ledger.md, API Surface).

Authorization

BearerAuth
headerAuthorization<token>

Access token as "Bearer "

Path Parameters

customer_id*string

id

Query Parameters

unit?string

unit

at?string

RFC 3339 time

page?integer

Page number, from 1

limit?integer

Items per page, 1 to 100, default 25

Response Body

A list of Balance objects with pagination

application/json
  1. response
data?array<>
object?string
pagination?

Pagination is the page answered (api-route-review D9).

Example Request
curl -X GET 'https://api.us.pontive.com/v1/billing/customers/string/balances'
Example Response
{  "data": [    {      "id": "string",      "object": "string"    }  ],  "object": "string",  "pagination": {    "limit": 0,    "page": 0,    "total": 0,    "total_pages": 0  }}
POST
/billing/customers/{customer_id}/ledger-adjustments

billing.ledger.v1.LedgerService/CreateLedgerAdjustment (36-credits-ledger.md, API Surface).

Authorization

BearerAuth
headerAuthorization<token>

Access token as "Bearer "

Path Parameters

customer_id*string

id

Header Parameters

X-Idempotency-Key?string

Idempotency key

Response Body

A LedgerEntry object

application/json
  1. response
id?string

ID is its prefixed id.

object?string

Object names the kind: customer, invoice, contract, …

Example Request
curl -X POST 'https://api.us.pontive.com/v1/billing/customers/string/ledger-adjustments'
Example Response
{  "id": "string",  "object": "string"}
POST
/billing/customers/{customer_id}/top-ups

billing.ledger.v1.LedgerService/CreateTopUp (36-credits-ledger.md, API Surface).

Authorization

BearerAuth
headerAuthorization<token>

Access token as "Bearer "

Path Parameters

customer_id*string

id

Header Parameters

X-Idempotency-Key?string

Idempotency key

Response Body

The CreateTopUpResponse fields

application/json
  1. response
Example Request
curl -X POST 'https://api.us.pontive.com/v1/billing/customers/string/top-ups'
Example Response
{}
GET
/billing/customers/{customer_id}/wallets/{unit}

billing.ledger.v1.LedgerService/GetWallet (36-credits-ledger.md, API Surface).

Authorization

BearerAuth
headerAuthorization<token>

Access token as "Bearer "

Path Parameters

customer_id*string

id

unit*string

unit

Response Body

A Wallet object

application/json
  1. response
id?string

ID is its prefixed id.

object?string

Object names the kind: customer, invoice, contract, …

Example Request
curl -X GET 'https://api.us.pontive.com/v1/billing/customers/string/wallets/string'
Example Response
{  "id": "string",  "object": "string"}
PUT
/billing/customers/{customer_id}/wallets/{unit}

billing.ledger.v1.LedgerService/UpdateWalletSettings (36-credits-ledger.md, API Surface).

Authorization

BearerAuth
headerAuthorization<token>

Access token as "Bearer "

Path Parameters

customer_id*string

id

unit*string

unit

Header Parameters

X-Idempotency-Key?string

Idempotency key

Response Body

A WalletSettings object

application/json
  1. response
id?string

ID is its prefixed id.

object?string

Object names the kind: customer, invoice, contract, …

Example Request
curl -X PUT 'https://api.us.pontive.com/v1/billing/customers/string/wallets/string'
Example Response
{  "id": "string",  "object": "string"}
GET
/billing/ledger-entries

billing.ledger.v1.LedgerService/ListLedgerEntries (36-credits-ledger.md, API Surface).

Authorization

BearerAuth
headerAuthorization<token>

Access token as "Bearer "

Query Parameters

limit?integer

Items per page, 1 to 100, default 25

after?string

Cursor: a next_cursor, to continue forward

before?string

Cursor: a next_cursor, to read the page just before it

customer_id?string

A cust_ id

grant_id?string

A grant id

account?string

account

type?string

type

invoice_id?string

A binv_ id

from?string

RFC 3339 time

to?string

RFC 3339 time

Response Body

A list of LedgerEntry objects, walked by cursor (api-route-review D41)

application/json
  1. response
data?array<>
next_cursor?string
object?string
Example Request
curl -X GET 'https://api.us.pontive.com/v1/billing/ledger-entries'
Example Response
{  "data": [    {      "id": "string",      "object": "string"    }  ],  "next_cursor": "string",  "object": "string"}