Skip to content

Latest commit

 

History

History
229 lines (154 loc) · 5.8 KB

File metadata and controls

229 lines (154 loc) · 5.8 KB

list

List all credit notes

Returns a list of credit notes.

API Endpoint: GET /v1/credit_notes

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.credit_note.list()

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.credit_note.list()

preview

Preview a credit note

Get a preview of a credit note without creating it.

API Endpoint: GET /v1/credit_notes/preview

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.credit_note.preview(invoice="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.credit_note.preview(invoice="string")

preview_lines

Retrieve a credit note preview's line items

When retrieving a credit note preview, you’ll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.

API Endpoint: GET /v1/credit_notes/preview/lines

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.credit_note.preview_lines(invoice="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.credit_note.preview_lines(invoice="string")

lines

Retrieve a credit note's line items

When retrieving a credit note, you’ll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.

API Endpoint: GET /v1/credit_notes/{credit_note}/lines

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.credit_note.lines(credit_note="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.credit_note.lines(credit_note="string")

get

Retrieve a credit note

Retrieves the credit note object with the given identifier.

API Endpoint: GET /v1/credit_notes/{id}

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.credit_note.get(id="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.credit_note.get(id="string")

create

Create a credit note

Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result in any combination of the following:

  • Refund: create a new refund (using refund_amount) or link an existing refund (using refund).
  • Customer balance credit: credit the customer’s balance (using credit_amount) which will be automatically applied to their next invoice when it’s finalized.
  • Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount).

For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.

You may issue multiple credit notes for an invoice. Each credit note will increment the invoice’s pre_payment_credit_notes_amount or post_payment_credit_notes_amount depending on its status at the time of credit note creation.

API Endpoint: POST /v1/credit_notes

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.credit_note.create(invoice="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.credit_note.create(invoice="string")

update

Update a credit note

Updates an existing credit note.

API Endpoint: POST /v1/credit_notes/{id}

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.credit_note.update(id="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.credit_note.update(id="string")

void

Void a credit note

Marks a credit note as void. Learn more about voiding credit notes.

API Endpoint: POST /v1/credit_notes/{id}/void

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.credit_note.void(id="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.credit_note.void(id="string")