class Stripe::CreditNotesApi

Defined in:

stripe/api/credit_notes_api.cr

Constant Summary

GET_CREDIT_NOTES_CREDIT_NOTE_LINES_MAX_LENGTH_FOR_CREDIT_NOTE = 5000
GET_CREDIT_NOTES_CREDIT_NOTE_LINES_MAX_LENGTH_FOR_ENDING_BEFORE = 5000
GET_CREDIT_NOTES_CREDIT_NOTE_LINES_MAX_LENGTH_FOR_STARTING_AFTER = 5000
GET_CREDIT_NOTES_ID_MAX_LENGTH_FOR_ID = 5000
GET_CREDIT_NOTES_MAX_LENGTH_FOR_CUSTOMER = 5000
GET_CREDIT_NOTES_MAX_LENGTH_FOR_ENDING_BEFORE = 5000
GET_CREDIT_NOTES_MAX_LENGTH_FOR_INVOICE = 5000
GET_CREDIT_NOTES_MAX_LENGTH_FOR_STARTING_AFTER = 5000
GET_CREDIT_NOTES_PREVIEW_LINES_MAX_LENGTH_FOR_ENDING_BEFORE = 5000
GET_CREDIT_NOTES_PREVIEW_LINES_MAX_LENGTH_FOR_INVOICE = 5000
GET_CREDIT_NOTES_PREVIEW_LINES_MAX_LENGTH_FOR_MEMO = 5000
GET_CREDIT_NOTES_PREVIEW_LINES_MAX_LENGTH_FOR_STARTING_AFTER = 5000
GET_CREDIT_NOTES_PREVIEW_LINES_VALID_VALUES_FOR_EMAIL_TYPE = String.static_array("credit_note", "none")
GET_CREDIT_NOTES_PREVIEW_LINES_VALID_VALUES_FOR_REASON = String.static_array("duplicate", "fraudulent", "order_change", "product_unsatisfactory")
GET_CREDIT_NOTES_PREVIEW_MAX_LENGTH_FOR_INVOICE = 5000
GET_CREDIT_NOTES_PREVIEW_MAX_LENGTH_FOR_MEMO = 5000
GET_CREDIT_NOTES_PREVIEW_VALID_VALUES_FOR_EMAIL_TYPE = String.static_array("credit_note", "none")
GET_CREDIT_NOTES_PREVIEW_VALID_VALUES_FOR_REASON = String.static_array("duplicate", "fraudulent", "order_change", "product_unsatisfactory")
POST_CREDIT_NOTES_ID_MAX_LENGTH_FOR_ID = 5000
POST_CREDIT_NOTES_ID_MAX_LENGTH_FOR_MEMO = 5000
POST_CREDIT_NOTES_ID_VOID_MAX_LENGTH_FOR_ID = 5000
POST_CREDIT_NOTES_MAX_LENGTH_FOR_INVOICE = 5000
POST_CREDIT_NOTES_MAX_LENGTH_FOR_MEMO = 5000
POST_CREDIT_NOTES_VALID_VALUES_FOR_EMAIL_TYPE = String.static_array("credit_note", "none")
POST_CREDIT_NOTES_VALID_VALUES_FOR_REASON = String.static_array("duplicate", "fraudulent", "order_change", "product_unsatisfactory")

Constructors

Instance Method Summary

Constructor Detail

def self.new(api_client : Stripe::ApiClient = ApiClient.default) #

[View source]

Instance Method Detail

def api_client : ApiClient #

[View source]
def api_client=(api_client : ApiClient) #

[View source]
def build_api_request_for_get_credit_notes(*, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, customer : String | Nil = nil, invoice : String | Nil = nil, created : Stripe::GetAccountsCreatedParameter | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_get_credit_notes_credit_note_lines(*, credit_note : String | Nil = nil, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_get_credit_notes_id(*, id : String | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_get_credit_notes_preview(*, invoice : String | Nil = nil, refund : String | Nil = nil, lines : Array(Array(CreditNoteLineItemParams)) | Nil = nil, reason : String | Nil = nil, metadata : Hash(String, Hash(String, String)) | Nil = nil, expand : Array(Array(String)) | Nil = nil, memo : String | Nil = nil, effective_at : Int64 | Nil = nil, out_of_band_amount : Int64 | Nil = nil, credit_amount : Int64 | Nil = nil, refund_amount : Int64 | Nil = nil, amount : Int64 | Nil = nil, email_type : String | Nil = nil, shipping_cost : Stripe::CreditNoteShippingCost | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_get_credit_notes_preview_lines(*, invoice : String | Nil = nil, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, refund : String | Nil = nil, lines : Array(Array(CreditNoteLineItemParams)) | Nil = nil, reason : String | Nil = nil, metadata : Hash(String, Hash(String, String)) | Nil = nil, expand : Array(Array(String)) | Nil = nil, memo : String | Nil = nil, effective_at : Int64 | Nil = nil, out_of_band_amount : Int64 | Nil = nil, credit_amount : Int64 | Nil = nil, refund_amount : Int64 | Nil = nil, amount : Int64 | Nil = nil, email_type : String | Nil = nil, shipping_cost : Stripe::CreditNoteShippingCost | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_post_credit_notes(*, invoice : String | Nil = nil, amount : Int64 | Nil = nil, credit_amount : Int64 | Nil = nil, effective_at : Int64 | Nil = nil, email_type : String | Nil = nil, expand : Array(String) | Nil = nil, lines : Array(Stripe::CreditNoteLineItemParams) | Nil = nil, memo : String | Nil = nil, metadata : Hash(String, String) | Nil = nil, out_of_band_amount : Int64 | Nil = nil, reason : String | Nil = nil, refund : String | Nil = nil, refund_amount : Int64 | Nil = nil, shipping_cost : Stripe::CreditNoteShippingCost | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_post_credit_notes_id(*, id : String | Nil = nil, expand : Array(String) | Nil = nil, memo : String | Nil = nil, metadata : Hash(String, String) | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def build_api_request_for_post_credit_notes_id_void(*, id : String | Nil = nil, expand : Array(String) | Nil = nil) : Crest::Request #

@return Crest::Request


[View source]
def client_side_validation?(*args, **options) #

[View source]
def client_side_validation?(*args, **options, &) #

[View source]
def debugging?(*args, **options) #

[View source]
def debugging?(*args, **options, &) #

[View source]
def get_credit_notes(*, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, customer : String | Nil = nil, invoice : String | Nil = nil, created : Stripe::GetAccountsCreatedParameter | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Stripe::CreditNotesList #

Returns a list of credit notes.

@optional @param ending_before [String?] A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param customer [String?] Only return credit notes for the customer specified by this customer ID. @optional @param invoice [String?] Only return credit notes for the invoice specified by this invoice ID. @optional @param created [Stripe::GetAccountsCreatedParameter?] Only return credit notes that were created during the given date interval. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return [Stripe::CreditNotesList]

[View source]
def get_credit_notes(*, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, customer : String | Nil = nil, invoice : String | Nil = nil, created : Stripe::GetAccountsCreatedParameter | Nil = nil, expand : Array(Array(String)) | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Returns a list of credit notes.</p> @optional @param ending_before [String?] A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param customer [String?] Only return credit notes for the customer specified by this customer ID. @optional @param invoice [String?] Only return credit notes for the invoice specified by this invoice ID. @optional @param created [Stripe::GetAccountsCreatedParameter?] Only return credit notes that were created during the given date interval. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return nil


[View source]
def get_credit_notes_credit_note_lines(*, credit_note : String | Nil = nil, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Stripe::CreditNoteLinesList #

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.

@required @param credit_note [String?] @optional @param ending_before [String?] A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return [Stripe::CreditNoteLinesList]

[View source]
def get_credit_notes_credit_note_lines(*, credit_note : String | Nil = nil, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, expand : Array(Array(String)) | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>When retrieving a credit note, you’ll get a <strong>lines</strong> property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.</p> @required @param credit_note [String?] @optional @param ending_before [String?] A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return nil


[View source]
def get_credit_notes_credit_note_lines_with_http_info(*, credit_note : String | Nil = nil, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Tuple(Stripe::CreditNoteLinesList, Int32, Hash(String, Array(String) | String)) #

<p>When retrieving a credit note, you’ll get a <strong>lines</strong> property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.</p> @required @param credit_note [String?] @optional @param ending_before [String?] A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return [Tuple(Stripe::CreditNoteLinesList, Integer, Hash)] Stripe::CreditNoteLinesList, response status code and response headers


[View source]
def get_credit_notes_id(*, id : String | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Stripe::CreditNote #

Retrieves the credit note object with the given identifier.

@required @param id [String?] @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return [Stripe::CreditNote]

[View source]
def get_credit_notes_id(*, id : String | Nil = nil, expand : Array(Array(String)) | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Retrieves the credit note object with the given identifier.</p> @required @param id [String?] @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return nil


[View source]
def get_credit_notes_id_with_http_info(*, id : String | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Tuple(Stripe::CreditNote, Int32, Hash(String, Array(String) | String)) #

<p>Retrieves the credit note object with the given identifier.</p> @required @param id [String?] @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return [Tuple(Stripe::CreditNote, Integer, Hash)] Stripe::CreditNote, response status code and response headers


[View source]
def get_credit_notes_preview(*, invoice : String | Nil = nil, refund : String | Nil = nil, lines : Array(Array(CreditNoteLineItemParams)) | Nil = nil, reason : String | Nil = nil, metadata : Hash(String, Hash(String, String)) | Nil = nil, expand : Array(Array(String)) | Nil = nil, memo : String | Nil = nil, effective_at : Int64 | Nil = nil, out_of_band_amount : Int64 | Nil = nil, credit_amount : Int64 | Nil = nil, refund_amount : Int64 | Nil = nil, amount : Int64 | Nil = nil, email_type : String | Nil = nil, shipping_cost : Stripe::CreditNoteShippingCost | Nil = nil) : Stripe::CreditNote #

Get a preview of a credit note without creating it.

@required @param invoice [String?] ID of the invoice. @optional @param refund [String?] ID of an existing refund to link this credit note to. @optional @param lines [Array(Array(CreditNoteLineItemParams))?] Line items that make up the credit note. @optional @param reason [String?] Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` @optional @param metadata [Hash(String, Hash(String, String))?] Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param memo [String?] The credit note's memo appears on the credit note PDF. @optional @param effective_at [Int32?] The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. @optional @param out_of_band_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. @optional @param credit_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. @optional @param refund_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. @optional @param amount [Int32?] The integer amount in cents (or local equivalent) representing the total amount of the credit note. @optional @param email_type [String?] Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. @optional @param shipping_cost [Stripe::CreditNoteShippingCost?] When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. @return [Stripe::CreditNote]

[View source]
def get_credit_notes_preview(*, invoice : String | Nil = nil, refund : String | Nil = nil, lines : Array(Array(CreditNoteLineItemParams)) | Nil = nil, reason : String | Nil = nil, metadata : Hash(String, Hash(String, String)) | Nil = nil, expand : Array(Array(String)) | Nil = nil, memo : String | Nil = nil, effective_at : Int64 | Nil = nil, out_of_band_amount : Int64 | Nil = nil, credit_amount : Int64 | Nil = nil, refund_amount : Int64 | Nil = nil, amount : Int64 | Nil = nil, email_type : String | Nil = nil, shipping_cost : Stripe::CreditNoteShippingCost | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Get a preview of a credit note without creating it.</p> @required @param invoice [String?] ID of the invoice. @optional @param refund [String?] ID of an existing refund to link this credit note to. @optional @param lines [Array(Array(CreditNoteLineItemParams))?] Line items that make up the credit note. @optional @param reason [String?] Reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory @optional @param metadata [Hash(String, Hash(String, String))?] Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param memo [String?] The credit note's memo appears on the credit note PDF. @optional @param effective_at [Int32?] The date when this credit note is in effect. Same as created unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. @optional @param out_of_band_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. @optional @param credit_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. @optional @param refund_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. @optional @param amount [Int32?] The integer amount in cents (or local equivalent) representing the total amount of the credit note. @optional @param email_type [String?] Type of email to send to the customer, one of credit_note or none and the default is credit_note. @optional @param shipping_cost [Stripe::CreditNoteShippingCost?] When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. @return nil


[View source]
def get_credit_notes_preview_lines(*, invoice : String | Nil = nil, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, refund : String | Nil = nil, lines : Array(Array(CreditNoteLineItemParams)) | Nil = nil, reason : String | Nil = nil, metadata : Hash(String, Hash(String, String)) | Nil = nil, expand : Array(Array(String)) | Nil = nil, memo : String | Nil = nil, effective_at : Int64 | Nil = nil, out_of_band_amount : Int64 | Nil = nil, credit_amount : Int64 | Nil = nil, refund_amount : Int64 | Nil = nil, amount : Int64 | Nil = nil, email_type : String | Nil = nil, shipping_cost : Stripe::CreditNoteShippingCost | Nil = nil) : Stripe::CreditNoteLinesList #

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.

@required @param invoice [String?] ID of the invoice. @optional @param ending_before [String?] A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param refund [String?] ID of an existing refund to link this credit note to. @optional @param lines [Array(Array(CreditNoteLineItemParams))?] Line items that make up the credit note. @optional @param reason [String?] Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` @optional @param metadata [Hash(String, Hash(String, String))?] Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param memo [String?] The credit note's memo appears on the credit note PDF. @optional @param effective_at [Int32?] The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. @optional @param out_of_band_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. @optional @param credit_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. @optional @param refund_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. @optional @param amount [Int32?] The integer amount in cents (or local equivalent) representing the total amount of the credit note. @optional @param email_type [String?] Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. @optional @param shipping_cost [Stripe::CreditNoteShippingCost?] When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. @return [Stripe::CreditNoteLinesList]

[View source]
def get_credit_notes_preview_lines(*, invoice : String | Nil = nil, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, refund : String | Nil = nil, lines : Array(Array(CreditNoteLineItemParams)) | Nil = nil, reason : String | Nil = nil, metadata : Hash(String, Hash(String, String)) | Nil = nil, expand : Array(Array(String)) | Nil = nil, memo : String | Nil = nil, effective_at : Int64 | Nil = nil, out_of_band_amount : Int64 | Nil = nil, credit_amount : Int64 | Nil = nil, refund_amount : Int64 | Nil = nil, amount : Int64 | Nil = nil, email_type : String | Nil = nil, shipping_cost : Stripe::CreditNoteShippingCost | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>When retrieving a credit note preview, you’ll get a <strong>lines</strong> property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.</p> @required @param invoice [String?] ID of the invoice. @optional @param ending_before [String?] A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param refund [String?] ID of an existing refund to link this credit note to. @optional @param lines [Array(Array(CreditNoteLineItemParams))?] Line items that make up the credit note. @optional @param reason [String?] Reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory @optional @param metadata [Hash(String, Hash(String, String))?] Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param memo [String?] The credit note's memo appears on the credit note PDF. @optional @param effective_at [Int32?] The date when this credit note is in effect. Same as created unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. @optional @param out_of_band_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. @optional @param credit_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. @optional @param refund_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. @optional @param amount [Int32?] The integer amount in cents (or local equivalent) representing the total amount of the credit note. @optional @param email_type [String?] Type of email to send to the customer, one of credit_note or none and the default is credit_note. @optional @param shipping_cost [Stripe::CreditNoteShippingCost?] When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. @return nil


[View source]
def get_credit_notes_preview_lines_with_http_info(*, invoice : String | Nil = nil, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, refund : String | Nil = nil, lines : Array(Array(CreditNoteLineItemParams)) | Nil = nil, reason : String | Nil = nil, metadata : Hash(String, Hash(String, String)) | Nil = nil, expand : Array(Array(String)) | Nil = nil, memo : String | Nil = nil, effective_at : Int64 | Nil = nil, out_of_band_amount : Int64 | Nil = nil, credit_amount : Int64 | Nil = nil, refund_amount : Int64 | Nil = nil, amount : Int64 | Nil = nil, email_type : String | Nil = nil, shipping_cost : Stripe::CreditNoteShippingCost | Nil = nil) : Tuple(Stripe::CreditNoteLinesList, Int32, Hash(String, Array(String) | String)) #

<p>When retrieving a credit note preview, you’ll get a <strong>lines</strong> property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.</p> @required @param invoice [String?] ID of the invoice. @optional @param ending_before [String?] A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param refund [String?] ID of an existing refund to link this credit note to. @optional @param lines [Array(Array(CreditNoteLineItemParams))?] Line items that make up the credit note. @optional @param reason [String?] Reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory @optional @param metadata [Hash(String, Hash(String, String))?] Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param memo [String?] The credit note's memo appears on the credit note PDF. @optional @param effective_at [Int32?] The date when this credit note is in effect. Same as created unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. @optional @param out_of_band_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. @optional @param credit_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. @optional @param refund_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. @optional @param amount [Int32?] The integer amount in cents (or local equivalent) representing the total amount of the credit note. @optional @param email_type [String?] Type of email to send to the customer, one of credit_note or none and the default is credit_note. @optional @param shipping_cost [Stripe::CreditNoteShippingCost?] When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. @return [Tuple(Stripe::CreditNoteLinesList, Integer, Hash)] Stripe::CreditNoteLinesList, response status code and response headers


[View source]
def get_credit_notes_preview_with_http_info(*, invoice : String | Nil = nil, refund : String | Nil = nil, lines : Array(Array(CreditNoteLineItemParams)) | Nil = nil, reason : String | Nil = nil, metadata : Hash(String, Hash(String, String)) | Nil = nil, expand : Array(Array(String)) | Nil = nil, memo : String | Nil = nil, effective_at : Int64 | Nil = nil, out_of_band_amount : Int64 | Nil = nil, credit_amount : Int64 | Nil = nil, refund_amount : Int64 | Nil = nil, amount : Int64 | Nil = nil, email_type : String | Nil = nil, shipping_cost : Stripe::CreditNoteShippingCost | Nil = nil) : Tuple(Stripe::CreditNote, Int32, Hash(String, Array(String) | String)) #

<p>Get a preview of a credit note without creating it.</p> @required @param invoice [String?] ID of the invoice. @optional @param refund [String?] ID of an existing refund to link this credit note to. @optional @param lines [Array(Array(CreditNoteLineItemParams))?] Line items that make up the credit note. @optional @param reason [String?] Reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory @optional @param metadata [Hash(String, Hash(String, String))?] Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @optional @param memo [String?] The credit note's memo appears on the credit note PDF. @optional @param effective_at [Int32?] The date when this credit note is in effect. Same as created unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. @optional @param out_of_band_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. @optional @param credit_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. @optional @param refund_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. @optional @param amount [Int32?] The integer amount in cents (or local equivalent) representing the total amount of the credit note. @optional @param email_type [String?] Type of email to send to the customer, one of credit_note or none and the default is credit_note. @optional @param shipping_cost [Stripe::CreditNoteShippingCost?] When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. @return [Tuple(Stripe::CreditNote, Integer, Hash)] Stripe::CreditNote, response status code and response headers


[View source]
def get_credit_notes_with_http_info(*, ending_before : String | Nil = nil, starting_after : String | Nil = nil, limit : Int64 | Nil = nil, customer : String | Nil = nil, invoice : String | Nil = nil, created : Stripe::GetAccountsCreatedParameter | Nil = nil, expand : Array(Array(String)) | Nil = nil) : Tuple(Stripe::CreditNotesList, Int32, Hash(String, Array(String) | String)) #

<p>Returns a list of credit notes.</p> @optional @param ending_before [String?] A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list. @optional @param starting_after [String?] A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list. @optional @param limit [Int32?] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. @optional @param customer [String?] Only return credit notes for the customer specified by this customer ID. @optional @param invoice [String?] Only return credit notes for the invoice specified by this invoice ID. @optional @param created [Stripe::GetAccountsCreatedParameter?] Only return credit notes that were created during the given date interval. @optional @param expand [Array(Array(String))?] Specifies which fields in the response should be expanded. @return [Tuple(Stripe::CreditNotesList, Integer, Hash)] Stripe::CreditNotesList, response status code and response headers


[View source]
def post_credit_notes(*, invoice : String | Nil = nil, amount : Int64 | Nil = nil, credit_amount : Int64 | Nil = nil, effective_at : Int64 | Nil = nil, email_type : String | Nil = nil, expand : Array(String) | Nil = nil, lines : Array(Stripe::CreditNoteLineItemParams) | Nil = nil, memo : String | Nil = nil, metadata : Hash(String, String) | Nil = nil, out_of_band_amount : Int64 | Nil = nil, reason : String | Nil = nil, refund : String | Nil = nil, refund_amount : Int64 | Nil = nil, shipping_cost : Stripe::CreditNoteShippingCost | Nil = nil) : Stripe::CreditNote #

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.

@required @param invoice [String?] ID of the invoice. @optional @param amount [Int32?] The integer amount in cents (or local equivalent) representing the total amount of the credit note. @optional @param credit_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. @optional @param effective_at [Int32?] The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. @optional @param email_type [String?] Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param lines [Array(Stripe::CreditNoteLineItemParams)?] Line items that make up the credit note. @optional @param memo [String?] The credit note's memo appears on the credit note PDF. @optional @param metadata [Hash(String, String)?] @optional @param out_of_band_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. @optional @param reason [String?] Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` @optional @param refund [String?] ID of an existing refund to link this credit note to. @optional @param refund_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. @optional @param shipping_cost [Stripe::CreditNoteShippingCost?] @return [Stripe::CreditNote]

[View source]
def post_credit_notes(*, invoice : String | Nil = nil, amount : Int64 | Nil = nil, credit_amount : Int64 | Nil = nil, effective_at : Int64 | Nil = nil, email_type : String | Nil = nil, expand : Array(String) | Nil = nil, lines : Array(Stripe::CreditNoteLineItemParams) | Nil = nil, memo : String | Nil = nil, metadata : Hash(String, String) | Nil = nil, out_of_band_amount : Int64 | Nil = nil, reason : String | Nil = nil, refund : String | Nil = nil, refund_amount : Int64 | Nil = nil, shipping_cost : Stripe::CreditNoteShippingCost | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Issue a credit note to adjust the amount of a finalized invoice. For a <code>status=open</code> invoice, a credit note reduces its <code>amount_due</code>. For a <code>status=paid</code> invoice, a credit note does not affect its <code>amount_due</code>. Instead, it can result in any combination of the following:</p> <ul> <li>Refund: create a new refund (using <code>refund_amount</code>) or link an existing refund (using <code>refund</code>).</li> <li>Customer balance credit: credit the customer’s balance (using <code>credit_amount</code>) which will be automatically applied to their next invoice when it’s finalized.</li> <li>Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using <code>out_of_band_amount</code>).</li> </ul> <p>For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.</p> <p>You may issue multiple credit notes for an invoice. Each credit note will increment the invoice’s <code>pre_payment_credit_notes_amount</code> or <code>post_payment_credit_notes_amount</code> depending on its <code>status</code> at the time of credit note creation.</p> @required @param invoice [String?] ID of the invoice. @optional @param amount [Int32?] The integer amount in cents (or local equivalent) representing the total amount of the credit note. @optional @param credit_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. @optional @param effective_at [Int32?] The date when this credit note is in effect. Same as created unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. @optional @param email_type [String?] Type of email to send to the customer, one of credit_note or none and the default is credit_note. @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param lines [Array(Stripe::CreditNoteLineItemParams)?] Line items that make up the credit note. @optional @param memo [String?] The credit note's memo appears on the credit note PDF. @optional @param metadata [Hash(String, String)?] @optional @param out_of_band_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. @optional @param reason [String?] Reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory @optional @param refund [String?] ID of an existing refund to link this credit note to. @optional @param refund_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. @optional @param shipping_cost [Stripe::CreditNoteShippingCost?] @return nil


[View source]
def post_credit_notes_id(*, id : String | Nil = nil, expand : Array(String) | Nil = nil, memo : String | Nil = nil, metadata : Hash(String, String) | Nil = nil) : Stripe::CreditNote #

Updates an existing credit note.

@required @param id [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param memo [String?] Credit note memo. @optional @param metadata [Hash(String, String)?] @return [Stripe::CreditNote]

[View source]
def post_credit_notes_id(*, id : String | Nil = nil, expand : Array(String) | Nil = nil, memo : String | Nil = nil, metadata : Hash(String, String) | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Updates an existing credit note.</p> @required @param id [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param memo [String?] Credit note memo. @optional @param metadata [Hash(String, String)?] @return nil


[View source]
def post_credit_notes_id_void(*, id : String | Nil = nil, expand : Array(String) | Nil = nil) : Stripe::CreditNote #

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

@required @param id [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return [Stripe::CreditNote]

[View source]
def post_credit_notes_id_void(*, id : String | Nil = nil, expand : Array(String) | Nil = nil, &block : Crest::Response -> ) : Nil #

<p>Marks a credit note as void. Learn more about <a href=&quot;/docs/billing/invoices/credit-notes#voiding&quot;>voiding credit notes</a>.</p> @required @param id [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return nil


[View source]
def post_credit_notes_id_void_with_http_info(*, id : String | Nil = nil, expand : Array(String) | Nil = nil) : Tuple(Stripe::CreditNote, Int32, Hash(String, Array(String) | String)) #

<p>Marks a credit note as void. Learn more about <a href=&quot;/docs/billing/invoices/credit-notes#voiding&quot;>voiding credit notes</a>.</p> @required @param id [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @return [Tuple(Stripe::CreditNote, Integer, Hash)] Stripe::CreditNote, response status code and response headers


[View source]
def post_credit_notes_id_with_http_info(*, id : String | Nil = nil, expand : Array(String) | Nil = nil, memo : String | Nil = nil, metadata : Hash(String, String) | Nil = nil) : Tuple(Stripe::CreditNote, Int32, Hash(String, Array(String) | String)) #

<p>Updates an existing credit note.</p> @required @param id [String?] @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param memo [String?] Credit note memo. @optional @param metadata [Hash(String, String)?] @return [Tuple(Stripe::CreditNote, Integer, Hash)] Stripe::CreditNote, response status code and response headers


[View source]
def post_credit_notes_with_http_info(*, invoice : String | Nil = nil, amount : Int64 | Nil = nil, credit_amount : Int64 | Nil = nil, effective_at : Int64 | Nil = nil, email_type : String | Nil = nil, expand : Array(String) | Nil = nil, lines : Array(Stripe::CreditNoteLineItemParams) | Nil = nil, memo : String | Nil = nil, metadata : Hash(String, String) | Nil = nil, out_of_band_amount : Int64 | Nil = nil, reason : String | Nil = nil, refund : String | Nil = nil, refund_amount : Int64 | Nil = nil, shipping_cost : Stripe::CreditNoteShippingCost | Nil = nil) : Tuple(Stripe::CreditNote, Int32, Hash(String, Array(String) | String)) #

<p>Issue a credit note to adjust the amount of a finalized invoice. For a <code>status=open</code> invoice, a credit note reduces its <code>amount_due</code>. For a <code>status=paid</code> invoice, a credit note does not affect its <code>amount_due</code>. Instead, it can result in any combination of the following:</p> <ul> <li>Refund: create a new refund (using <code>refund_amount</code>) or link an existing refund (using <code>refund</code>).</li> <li>Customer balance credit: credit the customer’s balance (using <code>credit_amount</code>) which will be automatically applied to their next invoice when it’s finalized.</li> <li>Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using <code>out_of_band_amount</code>).</li> </ul> <p>For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.</p> <p>You may issue multiple credit notes for an invoice. Each credit note will increment the invoice’s <code>pre_payment_credit_notes_amount</code> or <code>post_payment_credit_notes_amount</code> depending on its <code>status</code> at the time of credit note creation.</p> @required @param invoice [String?] ID of the invoice. @optional @param amount [Int32?] The integer amount in cents (or local equivalent) representing the total amount of the credit note. @optional @param credit_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. @optional @param effective_at [Int32?] The date when this credit note is in effect. Same as created unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. @optional @param email_type [String?] Type of email to send to the customer, one of credit_note or none and the default is credit_note. @optional @param expand [Array(String)?] Specifies which fields in the response should be expanded. @optional @param lines [Array(Stripe::CreditNoteLineItemParams)?] Line items that make up the credit note. @optional @param memo [String?] The credit note's memo appears on the credit note PDF. @optional @param metadata [Hash(String, String)?] @optional @param out_of_band_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. @optional @param reason [String?] Reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory @optional @param refund [String?] ID of an existing refund to link this credit note to. @optional @param refund_amount [Int32?] The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. @optional @param shipping_cost [Stripe::CreditNoteShippingCost?] @return [Tuple(Stripe::CreditNote, Integer, Hash)] Stripe::CreditNote, response status code and response headers


[View source]