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 or account. Customer and account tax IDs get displayed on related invoices and credit notes.
Related guides: Customer tax identification numbers, 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.
-
#customer_account ⇒ Object
readonly
ID of the Account representing the customer.
-
#deleted ⇒ Object
readonly
Always true for a deleted object.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#livemode ⇒ Object
readonly
If the object exists in live mode, the value is
true. -
#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,fo_vat,gb_vat,ge_vat,gi_tin,gn_nif,hk_br,hr_oib,hu_tin,id_npwp,il_vat,in_gst,is_vat,it_cf,jp_cn,jp_rn,jp_trn,ke_pin,kg_tin,kh_tin,kr_brn,kz_bin,la_tin,li_uid,li_vat,lk_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,pl_nip,py_ruc,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, orzw_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?, field_encodings, #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.
57 58 59 |
# File 'lib/stripe/resources/tax_id.rb', line 57 def country @country end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
59 60 61 |
# File 'lib/stripe/resources/tax_id.rb', line 59 def created @created end |
#customer ⇒ Object (readonly)
ID of the customer.
61 62 63 |
# File 'lib/stripe/resources/tax_id.rb', line 61 def customer @customer end |
#customer_account ⇒ Object (readonly)
ID of the Account representing the customer.
63 64 65 |
# File 'lib/stripe/resources/tax_id.rb', line 63 def customer_account @customer_account end |
#deleted ⇒ Object (readonly)
Always true for a deleted object
65 66 67 |
# File 'lib/stripe/resources/tax_id.rb', line 65 def deleted @deleted end |
#id ⇒ Object (readonly)
Unique identifier for the object.
67 68 69 |
# File 'lib/stripe/resources/tax_id.rb', line 67 def id @id end |
#livemode ⇒ Object (readonly)
If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
69 70 71 |
# File 'lib/stripe/resources/tax_id.rb', line 69 def livemode @livemode end |
#object ⇒ Object (readonly)
String representing the object's type. Objects of the same type share the same value.
71 72 73 |
# File 'lib/stripe/resources/tax_id.rb', line 71 def object @object end |
#owner ⇒ Object (readonly)
The account or customer the tax ID belongs to.
73 74 75 |
# File 'lib/stripe/resources/tax_id.rb', line 73 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, fo_vat, gb_vat, ge_vat, gi_tin, gn_nif, hk_br, hr_oib, hu_tin, id_npwp, il_vat, in_gst, is_vat, it_cf, jp_cn, jp_rn, jp_trn, ke_pin, kg_tin, kh_tin, kr_brn, kz_bin, la_tin, li_uid, li_vat, lk_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, pl_nip, py_ruc, 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
75 76 77 |
# File 'lib/stripe/resources/tax_id.rb', line 75 def type @type end |
#value ⇒ Object (readonly)
Value of the tax ID.
77 78 79 |
# File 'lib/stripe/resources/tax_id.rb', line 77 def value @value end |
#verification ⇒ Object (readonly)
Tax ID verification information.
79 80 81 |
# File 'lib/stripe/resources/tax_id.rb', line 79 def verification @verification end |
Class Method Details
.create(params = {}, opts = {}) ⇒ Object
Creates a new account or customer tax_id object.
82 83 84 |
# File 'lib/stripe/resources/tax_id.rb', line 82 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.
87 88 89 90 91 92 93 94 |
# File 'lib/stripe/resources/tax_id.rb', line 87 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
115 116 117 |
# File 'lib/stripe/resources/tax_id.rb', line 115 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
111 112 113 |
# File 'lib/stripe/resources/tax_id.rb', line 111 def self.inner_class_types @inner_class_types = { owner: Owner, verification: Verification } end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of tax IDs.
107 108 109 |
# File 'lib/stripe/resources/tax_id.rb', line 107 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.
97 98 99 100 101 102 103 104 |
# File 'lib/stripe/resources/tax_id.rb', line 97 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 |