Class: Stripe::TaxId
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::TaxId
- Extended by:
- APIOperations::Create, APIOperations::List
- Includes:
- APIOperations::Delete
- Defined in:
- lib/stripe/resources/tax_id.rb
Overview
You can add one or multiple tax IDs to a [customer](stripe.com/docs/api/customers) or account. Customer and account tax IDs get displayed on related invoices and credit notes.
Related guides: [Customer tax identification numbers](stripe.com/docs/billing/taxes/tax-ids), [Account tax IDs](stripe.com/docs/invoicing/connect#account-tax-ids)
Defined Under Namespace
Classes: Owner, Verification
Constant Summary collapse
- OBJECT_NAME =
"tax_id"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#country ⇒ Object
readonly
Two-letter ISO code representing the country of the tax ID.
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#customer ⇒ Object
readonly
ID of the customer.
-
#deleted ⇒ Object
readonly
Always true for a deleted object.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#livemode ⇒ Object
readonly
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#owner ⇒ Object
readonly
The account or customer the tax ID belongs to.
-
#type ⇒ Object
readonly
Type of the tax ID, one of ‘ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`.
-
#value ⇒ Object
readonly
Value of the tax ID.
-
#verification ⇒ Object
readonly
Tax ID verification information.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.create(params = {}, opts = {}) ⇒ Object
Creates a new account or customer tax_id object.
-
.delete(id, params = {}, opts = {}) ⇒ Object
Deletes an existing account or customer tax_id object.
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
-
.list(params = {}, opts = {}) ⇒ Object
Returns a list of tax IDs.
- .object_name ⇒ Object
Instance Method Summary collapse
-
#delete(params = {}, opts = {}) ⇒ Object
Deletes an existing account or customer tax_id object.
Methods included from APIOperations::Create
Methods included from APIOperations::List
Methods included from APIOperations::Delete
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#country ⇒ Object (readonly)
Two-letter ISO code representing the country of the tax ID.
55 56 57 |
# File 'lib/stripe/resources/tax_id.rb', line 55 def country @country end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
57 58 59 |
# File 'lib/stripe/resources/tax_id.rb', line 57 def created @created end |
#customer ⇒ Object (readonly)
ID of the customer.
59 60 61 |
# File 'lib/stripe/resources/tax_id.rb', line 59 def customer @customer end |
#deleted ⇒ Object (readonly)
Always true for a deleted object
75 76 77 |
# File 'lib/stripe/resources/tax_id.rb', line 75 def deleted @deleted end |
#id ⇒ Object (readonly)
Unique identifier for the object.
61 62 63 |
# File 'lib/stripe/resources/tax_id.rb', line 61 def id @id end |
#livemode ⇒ Object (readonly)
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
63 64 65 |
# File 'lib/stripe/resources/tax_id.rb', line 63 def livemode @livemode end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
65 66 67 |
# File 'lib/stripe/resources/tax_id.rb', line 65 def object @object end |
#owner ⇒ Object (readonly)
The account or customer the tax ID belongs to.
67 68 69 |
# File 'lib/stripe/resources/tax_id.rb', line 67 def owner @owner end |
#type ⇒ Object (readonly)
Type of the tax ID, one of ‘ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`. Note that some legacy tax IDs have type `unknown`
69 70 71 |
# File 'lib/stripe/resources/tax_id.rb', line 69 def type @type end |
#value ⇒ Object (readonly)
Value of the tax ID.
71 72 73 |
# File 'lib/stripe/resources/tax_id.rb', line 71 def value @value end |
#verification ⇒ Object (readonly)
Tax ID verification information.
73 74 75 |
# File 'lib/stripe/resources/tax_id.rb', line 73 def verification @verification end |
Class Method Details
.create(params = {}, opts = {}) ⇒ Object
Creates a new account or customer tax_id object.
78 79 80 |
# File 'lib/stripe/resources/tax_id.rb', line 78 def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/tax_ids", params: params, opts: opts) end |
.delete(id, params = {}, opts = {}) ⇒ Object
Deletes an existing account or customer tax_id object.
83 84 85 86 87 88 89 90 |
# File 'lib/stripe/resources/tax_id.rb', line 83 def self.delete(id, params = {}, opts = {}) request_stripe_object( method: :delete, path: format("/v1/tax_ids/%<id>s", { id: CGI.escape(id) }), params: params, opts: opts ) end |
.field_remappings ⇒ Object
111 112 113 |
# File 'lib/stripe/resources/tax_id.rb', line 111 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
107 108 109 |
# File 'lib/stripe/resources/tax_id.rb', line 107 def self.inner_class_types @inner_class_types = { owner: Owner, verification: Verification } end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of tax IDs.
103 104 105 |
# File 'lib/stripe/resources/tax_id.rb', line 103 def self.list(params = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/tax_ids", params: params, opts: opts) end |
.object_name ⇒ Object
15 16 17 |
# File 'lib/stripe/resources/tax_id.rb', line 15 def self.object_name "tax_id" end |
Instance Method Details
#delete(params = {}, opts = {}) ⇒ Object
Deletes an existing account or customer tax_id object.
93 94 95 96 97 98 99 100 |
# File 'lib/stripe/resources/tax_id.rb', line 93 def delete(params = {}, opts = {}) request_stripe_object( method: :delete, path: format("/v1/tax_ids/%<id>s", { id: CGI.escape(self["id"]) }), params: params, opts: opts ) end |