github.com/stripe/stripe-go/v76@v76.25.0/taxid.go (about) 1 // 2 // 3 // File generated from our OpenAPI spec 4 // 5 // 6 7 package stripe 8 9 import "encoding/json" 10 11 // Type of owner referenced. 12 type TaxIDOwnerType string 13 14 // List of values that TaxIDOwnerType can take 15 const ( 16 TaxIDOwnerTypeAccount TaxIDOwnerType = "account" 17 TaxIDOwnerTypeApplication TaxIDOwnerType = "application" 18 TaxIDOwnerTypeCustomer TaxIDOwnerType = "customer" 19 TaxIDOwnerTypeSelf TaxIDOwnerType = "self" 20 ) 21 22 // Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` 23 type TaxIDType string 24 25 // List of values that TaxIDType can take 26 const ( 27 TaxIDTypeADNRT TaxIDType = "ad_nrt" 28 TaxIDTypeAETRN TaxIDType = "ae_trn" 29 TaxIDTypeARCUIT TaxIDType = "ar_cuit" 30 TaxIDTypeAUABN TaxIDType = "au_abn" 31 TaxIDTypeAUARN TaxIDType = "au_arn" 32 TaxIDTypeBGUIC TaxIDType = "bg_uic" 33 TaxIDTypeBOTIN TaxIDType = "bo_tin" 34 TaxIDTypeBRCNPJ TaxIDType = "br_cnpj" 35 TaxIDTypeBRCPF TaxIDType = "br_cpf" 36 TaxIDTypeCABN TaxIDType = "ca_bn" 37 TaxIDTypeCAGSTHST TaxIDType = "ca_gst_hst" 38 TaxIDTypeCAPSTBC TaxIDType = "ca_pst_bc" 39 TaxIDTypeCAPSTMB TaxIDType = "ca_pst_mb" 40 TaxIDTypeCAPSTSK TaxIDType = "ca_pst_sk" 41 TaxIDTypeCAQST TaxIDType = "ca_qst" 42 TaxIDTypeCHVAT TaxIDType = "ch_vat" 43 TaxIDTypeCLTIN TaxIDType = "cl_tin" 44 TaxIDTypeCNTIN TaxIDType = "cn_tin" 45 TaxIDTypeCONIT TaxIDType = "co_nit" 46 TaxIDTypeCRTIN TaxIDType = "cr_tin" 47 TaxIDTypeDORCN TaxIDType = "do_rcn" 48 TaxIDTypeECRUC TaxIDType = "ec_ruc" 49 TaxIDTypeEGTIN TaxIDType = "eg_tin" 50 TaxIDTypeESCIF TaxIDType = "es_cif" 51 TaxIDTypeEUOSSVAT TaxIDType = "eu_oss_vat" 52 TaxIDTypeEUVAT TaxIDType = "eu_vat" 53 TaxIDTypeGBVAT TaxIDType = "gb_vat" 54 TaxIDTypeGEVAT TaxIDType = "ge_vat" 55 TaxIDTypeHKBR TaxIDType = "hk_br" 56 TaxIDTypeHUTIN TaxIDType = "hu_tin" 57 TaxIDTypeIDNPWP TaxIDType = "id_npwp" 58 TaxIDTypeILVAT TaxIDType = "il_vat" 59 TaxIDTypeINGST TaxIDType = "in_gst" 60 TaxIDTypeISVAT TaxIDType = "is_vat" 61 TaxIDTypeJPCN TaxIDType = "jp_cn" 62 TaxIDTypeJPRN TaxIDType = "jp_rn" 63 TaxIDTypeJPTRN TaxIDType = "jp_trn" 64 TaxIDTypeKEPIN TaxIDType = "ke_pin" 65 TaxIDTypeKRBRN TaxIDType = "kr_brn" 66 TaxIDTypeLIUID TaxIDType = "li_uid" 67 TaxIDTypeMXRFC TaxIDType = "mx_rfc" 68 TaxIDTypeMYFRP TaxIDType = "my_frp" 69 TaxIDTypeMYITN TaxIDType = "my_itn" 70 TaxIDTypeMYSST TaxIDType = "my_sst" 71 TaxIDTypeNOVAT TaxIDType = "no_vat" 72 TaxIDTypeNOVOEC TaxIDType = "no_voec" 73 TaxIDTypeNZGST TaxIDType = "nz_gst" 74 TaxIDTypePERUC TaxIDType = "pe_ruc" 75 TaxIDTypePHTIN TaxIDType = "ph_tin" 76 TaxIDTypeROTIN TaxIDType = "ro_tin" 77 TaxIDTypeRSPIB TaxIDType = "rs_pib" 78 TaxIDTypeRUINN TaxIDType = "ru_inn" 79 TaxIDTypeRUKPP TaxIDType = "ru_kpp" 80 TaxIDTypeSAVAT TaxIDType = "sa_vat" 81 TaxIDTypeSGGST TaxIDType = "sg_gst" 82 TaxIDTypeSGUEN TaxIDType = "sg_uen" 83 TaxIDTypeSITIN TaxIDType = "si_tin" 84 TaxIDTypeSVNIT TaxIDType = "sv_nit" 85 TaxIDTypeTHVAT TaxIDType = "th_vat" 86 TaxIDTypeTRTIN TaxIDType = "tr_tin" 87 TaxIDTypeTWVAT TaxIDType = "tw_vat" 88 TaxIDTypeUAVAT TaxIDType = "ua_vat" 89 TaxIDTypeUnknown TaxIDType = "unknown" 90 TaxIDTypeUSEIN TaxIDType = "us_ein" 91 TaxIDTypeUYRUC TaxIDType = "uy_ruc" 92 TaxIDTypeVERIF TaxIDType = "ve_rif" 93 TaxIDTypeVNTIN TaxIDType = "vn_tin" 94 TaxIDTypeZAVAT TaxIDType = "za_vat" 95 ) 96 97 // Verification status, one of `pending`, `verified`, `unverified`, or `unavailable`. 98 type TaxIDVerificationStatus string 99 100 // List of values that TaxIDVerificationStatus can take 101 const ( 102 TaxIDVerificationStatusPending TaxIDVerificationStatus = "pending" 103 TaxIDVerificationStatusUnavailable TaxIDVerificationStatus = "unavailable" 104 TaxIDVerificationStatusUnverified TaxIDVerificationStatus = "unverified" 105 TaxIDVerificationStatusVerified TaxIDVerificationStatus = "verified" 106 ) 107 108 // Deletes an existing tax_id object. 109 type TaxIDParams struct { 110 Params `form:"*"` 111 Customer *string `form:"-"` // Included in URL 112 // Specifies which fields in the response should be expanded. 113 Expand []*string `form:"expand"` 114 // Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` 115 Type *string `form:"type"` 116 // Value of the tax ID. 117 Value *string `form:"value"` 118 } 119 120 // AddExpand appends a new field to expand. 121 func (p *TaxIDParams) AddExpand(f string) { 122 p.Expand = append(p.Expand, &f) 123 } 124 125 // Returns a list of tax IDs for a customer. 126 type TaxIDListParams struct { 127 ListParams `form:"*"` 128 Customer *string `form:"-"` // Included in URL 129 // Specifies which fields in the response should be expanded. 130 Expand []*string `form:"expand"` 131 } 132 133 // AddExpand appends a new field to expand. 134 func (p *TaxIDListParams) AddExpand(f string) { 135 p.Expand = append(p.Expand, &f) 136 } 137 138 // The account or customer the tax ID belongs to. 139 type TaxIDOwner struct { 140 // The account being referenced when `type` is `account`. 141 Account *Account `json:"account"` 142 // The Connect Application being referenced when `type` is `application`. 143 Application *Application `json:"application"` 144 // The customer being referenced when `type` is `customer`. 145 Customer *Customer `json:"customer"` 146 // Type of owner referenced. 147 Type TaxIDOwnerType `json:"type"` 148 } 149 150 // Tax ID verification information. 151 type TaxIDVerification struct { 152 // Verification status, one of `pending`, `verified`, `unverified`, or `unavailable`. 153 Status TaxIDVerificationStatus `json:"status"` 154 // Verified address. 155 VerifiedAddress string `json:"verified_address"` 156 // Verified name. 157 VerifiedName string `json:"verified_name"` 158 } 159 160 // You can add one or multiple tax IDs to a [customer](https://stripe.com/docs/api/customers) or account. 161 // Customer and account tax IDs get displayed on related invoices and credit notes. 162 // 163 // Related guides: [Customer tax identification numbers](https://stripe.com/docs/billing/taxes/tax-ids), [Account tax IDs](https://stripe.com/docs/invoicing/connect#account-tax-ids) 164 type TaxID struct { 165 APIResource 166 // Two-letter ISO code representing the country of the tax ID. 167 Country string `json:"country"` 168 // Time at which the object was created. Measured in seconds since the Unix epoch. 169 Created int64 `json:"created"` 170 // ID of the customer. 171 Customer *Customer `json:"customer"` 172 Deleted bool `json:"deleted"` 173 // Unique identifier for the object. 174 ID string `json:"id"` 175 // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 176 Livemode bool `json:"livemode"` 177 // String representing the object's type. Objects of the same type share the same value. 178 Object string `json:"object"` 179 // The account or customer the tax ID belongs to. 180 Owner *TaxIDOwner `json:"owner"` 181 // Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` 182 Type TaxIDType `json:"type"` 183 // Value of the tax ID. 184 Value string `json:"value"` 185 // Tax ID verification information. 186 Verification *TaxIDVerification `json:"verification"` 187 } 188 189 // TaxIDList is a list of TaxIds as retrieved from a list endpoint. 190 type TaxIDList struct { 191 APIResource 192 ListMeta 193 Data []*TaxID `json:"data"` 194 } 195 196 // UnmarshalJSON handles deserialization of a TaxID. 197 // This custom unmarshaling is needed because the resulting 198 // property may be an id or the full struct if it was expanded. 199 func (t *TaxID) UnmarshalJSON(data []byte) error { 200 if id, ok := ParseID(data); ok { 201 t.ID = id 202 return nil 203 } 204 205 type taxID TaxID 206 var v taxID 207 if err := json.Unmarshal(data, &v); err != nil { 208 return err 209 } 210 211 *t = TaxID(v) 212 return nil 213 }