Skip to content

Latest commit

 

History

History
308 lines (189 loc) · 7.43 KB

billing-document-api.md

File metadata and controls

308 lines (189 loc) · 7.43 KB

Billing Document API

Billing Documents represent invoices, credit memos and debit memos.

Invoices are statements of amounts owed by a customer, and are either generated one-off, or generated periodically from a subscription. They contain invoice items, and proration adjustments that may be caused by changes to a subscription.

If your invoice is configured to be charged automatically, Zuora automatically finalizes your invoice and attempts payment otherwise Zuora will email the invoice to your customer and await payment.

Any customer credit on the account may be applied before determining the amount due for the invoice (i.e., the amount that will be charged).

Class Name

BillingDocumentAPI

Methods

Create Billing Document

BillingDocument billingDocument = zuoraClient.billingDocuments().create(params);

Parameters

Parameter Type Tags Description
params BillingDocumentCreateRequest Required A billing document create request.

Response Type

BillingDocument

Example

BillingDocument billingDocument = zuoraClient.billingDocuments().create(params);

Get Billing Document

BillingDocument billingDocument = zuoraClient.billingDocuments().get({id});

Parameters

Parameter Type Tags Description
id String Required The unique identifier for the billing document.

Response Type

BillingDocument

Example

BillingDocument billingDocument = zuoraClient.billingDocuments().get({id});

Update Billing Document

BillingDocument billingDocument = zuoraClient.billingDocuments().update();

Parameters

Parameter Type Tags Description

Response Type

BillingDocument

Example

BillingDocument billingDocument = zuoraClient.billingDocuments().get({id});
billingDocument.setDocumentDate({date})
billingDocument.update();

Stream Billing Documents

Stream<BillingDocument> billingDocuments = zuoraClient.billingDocuments().stream();

Parameters

Parameter Type Description

Response Type

Stream<BillingDocument>

Example

Stream<BillingDocument> billingDocuments = zuoraClient.billingDocuments().stream();

Get Billing Documents By Account

BillingDocument billingDocument = zuoraClient.billingDocuments().findByAccount({accountId});

Parameters

Parameter Type Tags Description
accountId String Required The unique identifier of an account.

Response Type

List<BillingDocument>

Example

List<BillingDocument> billingDocuments = zuoraClient.billingDocuments().findByAccount({accountId});

Post Invoice

BillingDocument invoice = zuoraClient.billingDocuments().post({invoiceId});

Parameters

Parameter Type Tags Description
id String Required The unique identifier for the invoice billing document.

Response Type

BillingDocument

Example

BillingDocument invoice = zuoraClient.billingDocuments().post({invoiceId});

Post Credit Memo

BillingDocument creditMemo = zuoraClient.billingDocuments().post({creditMemoId});

Parameters

Parameter Type Tags Description
id String Required The unique identifier for the credit memo billing document.

Response Type

BillingDocument

Example

BillingDocument creditMemo = zuoraClient.billingDocuments().post({creditMemoId});

Post Debit Memo

BillingDocument debitMemo = zuoraClient.billingDocuments().post({debitMemoId});

Parameters

Parameter Type Tags Description
id String Required The unique identifier for the debit memo billing document.

Response Type

BillingDocument

Example

BillingDocument debitMemo = zuoraClient.billingDocuments().post({debitMemoId});

Write Off Invoice

String creditMemoId = zuoraClient.billingDocuments().writeOff({id}, {writeOffRequest});

Parameters

Parameter Type Tags Description
id String Required The unique identifier of an invoice billing document.
invoiceWriteOffRequest InvoiceWriteOffRequest Required Invoice write off request.

Response Type

String

Example

InvoiceWriteOffRequest invoiceWriteOffRequest = InvoiceWriteOffRequest.builder()
        .reasonCode("7368")
        .build();

String creditMemoId = zuoraClient.billingDocuments().writeOff(invoiceId, invoiceWriteOffRequest);

Apply Credit Memo

BillingDocument creditMemo = zuoraClient.billingDocuments().apply({creditMemoId}, applicationCreateRequest);

Parameters

Parameter Type Tags Description
id String Required The unique identifier of a credit memo billing document.
applicationCreateRequest ApplicationCreateRequest Required Credit memo application request.

Response Type

BillingDocument

Example

ApplicationCreateRequest applicationCreateRequest = ApplicationCreateRequest.builder()
        .effectiveDate("2022-01-01")
        .build();
BillingDocument creditMemo = zuoraClient.billingDocuments().apply({creditMemoId}, applicationCreateRequest);

Pay Billing Document

Payment payment = zuoraClient.billingDocuments().pay(key, paymentCreateRequest);

Parameters

Parameter Type Tags Description
key String Required The document number of a billing document.
paymentCreateRequest PaymentCreateRequest Required Payment for invoice or debit memo.

Response Type

Payment

Example

PaymentCreateRequest paymentCreateRequest = PaymentCreateRequest.builder()
        .amount(10.0d)
        .account("account_id8")
        .authorisationCode("7368")
        .currency("USD")
        .external(true)
        .build();

Payment payment = zuoraClient.billingDocuments().pay(number, paymentCreateRequest);