CData Python Connector for Stripe

Build 24.0.9060

CreditNotes

Creates, updates, and queries a credit note to adjust an invoice's amount after the invoice is finalized.

Table Specific Information

Select

The connector uses the Stripe API to filter the results by the following columns and operators:

  • Id supports the following operator: =.
  • CustomerId supports the following operator: =.
  • InvoiceId supports the following operator: =.
  • AccountId supports the following operator: =.

The rest of the filter is executed client-side within the connector.

You can select from the CreditNotes table with the following queries:

SELECT * FROM CreditNotes WHERE Id = 'cn_1Pkjsdb';
SELECT * FROM CreditNotes WHERE CustomerId = 'cus_N8rO0qc7j1SJJ9';
SELECT * FROM CreditNotes WHERE InvoiceId = 'in_23341xds';

Insert

To create a new credit note, InvoiceId and (Amount or Lines or ShippingCost) are required:

INSERT INTO CreditNotes (InvoiceId, Amount, Reason, OutOfBandAmount) VALUES ('in_23341xds', 1, 'duplicate', 1);
INSERT INTO CreditNotes (InvoiceId, lines) VALUES ('in_23341xds','{"type":"invoice_line_item","invoice_line_item": "il_123341xds","amount": 1}');

Update

To modify a credit note, specify the credit note Id:

UPDATE CreditNotes SET Memo = 'new_memo' WHERE id='cn_1Pkjsdb';

Columns

Name Type ReadOnly References Description
Id [KEY] String True

The Id of the credit note.

Amount Integer False

The integer amount in cents representing the total amount of the credit note, including tax.

AmountShipping Integer True

The sum of all the shipping amounts.

Created Datetime True

The time at which the object was created. Measured in seconds since the Unix epoch.

Currency String True

A three-letter ISO currency code, in lowercase.

CustomerId String True

The Id of customer.

CustomerBalanceTransaction String True

The customer balance transaction related to this credit note.

DiscountAmounts String True

The aggregate amounts calculated per discount for all line items.

EffectiveAt Datetime False

The date when this credit note goes into effect. This is the same as created unless overwritten.

InvoiceId String False

The Id of invoice.

Lines String False

Line items that make up the credit note.

Livemode Boolean True

true if the object is in live mode andfalse if in test mode.

Memo String False

Customer-facing text that appears on the credit note PDF.

Metadata String False

The set of key/value pairs that you can attach to a value list object.

Number String True

A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice.

OutOfBandAmount Integer False

Amount that was credited outside of Stripe.

Pdf String True

The link to download the PDF of the credit note.

Reason String False

The reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory.

The allowed values are duplicate, fraudulent, order_change, product_unsatisfactory.

Refund String False

The refund related to this credit note.

ShippingCost String False

The details of the cost of shipping

Status String True

The status of this credit note, one of issued or void.

Subtotal Integer True

The integer amount in cents representing the amount of the credit note, excluding exclusive tax and invoice level discounts.

SubtotalExcludingTax Integer True

The integer amount in cents representing the amount of the credit note, excluding all tax and invoice level discounts.

TaxAmounts String True

The aggregate amounts calculated per tax rate for all line items.

Total Integer True

The integer amount in cents representing the total amount of the credit note, including tax and all discount.

TotalExcludingTax Integer True

The integer amount in cents representing the total amount of the credit note, excluding tax, but including discounts.

Type String True

The type of this credit note, either pre_payment or post_payment.

VoidedAt Datetime True

The time at which the credit note was voided.

Pseudo-Columns

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.

Name Type Description
CreditAmount Integer

The integer amount in cents representing the amount to credit the customer’s balance, which will be automatically applied to their next invoice.

RefundAmount Integer

The integer amount in cents representing the amount to refund. If set, a refund will be created for the charge associated with the invoice.

AccountId String

The Id of the connected account to get credit notes for.

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9060