Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

feat(connector): [JPMorgan] extend L2/L3 data support through UCS (#14915)

Vani Guptad73a3642b2a1
diff --git a/api-reference/v1/openapi_spec_v1.json b/api-reference/v1/openapi_spec_v1.json
index 756e25bf26..2b504f1467 100644
--- a/api-reference/v1/openapi_spec_v1.json
+++ b/api-reference/v1/openapi_spec_v1.json
@@ -29625,6 +29625,12 @@
"type": "string",
"example": "123456789",
"nullable": true
+ },
+ "merchant_vat_registration_id": {
+ "type": "string",
+ "description": "The merchant's VAT registration identifier",
+ "example": "GB987654321",
+ "nullable": true
}
},
"additionalProperties": false
@@ -35790,6 +35796,20 @@
],
"nullable": true
},
+ "value_added_tax_amount": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Value added tax (VAT) amount applied to the order or transaction.",
+ "example": 54,
+ "nullable": true
+ },
+ "value_added_tax_percent": {
+ "type": "number",
+ "format": "double",
+ "description": "Value added tax (VAT) rate applied to the order or transaction.",
+ "example": 2.5,
+ "nullable": true
+ },
"duty_amount": {
"allOf": [
{
@@ -35798,6 +35818,18 @@
],
"nullable": true
},
+ "order_commodity_code": {
+ "type": "string",
+ "description": "Commodity code classifying the order as a whole, as opposed to the\nper-item codes in `order_details`.",
+ "example": "4900",
+ "nullable": true
+ },
+ "vat_invoice_reference_number": {
+ "type": "string",
+ "description": "Reference number of the value added tax (VAT) invoice for this order.",
+ "example": "9999",
+ "nullable": true
+ },
"order_date": {
"type": "string",
"format": "date-time",
@@ -36366,6 +36398,20 @@
],
"nullable": true
},
+ "value_added_tax_amount": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Value added tax (VAT) amount applied to the order or transaction.",
+ "example": 54,
+ "nullable": true
+ },
+ "value_added_tax_percent": {
+ "type": "number",
+ "format": "double",
+ "description": "Value added tax (VAT) rate applied to the order or transaction.",
+ "example": 2.5,
+ "nullable": true
+ },
"duty_amount": {
"allOf": [
{
@@ -36374,6 +36420,18 @@
],
"nullable": true
},
+ "order_commodity_code": {
+ "type": "string",
+ "description": "Commodity code classifying the order as a whole, as opposed to the\nper-item codes in `order_details`.",
+ "example": "4900",
+ "nullable": true
+ },
+ "vat_invoice_reference_number": {
+ "type": "string",
+ "description": "Reference number of the value added tax (VAT) invoice for this order.",
+ "example": "9999",
+ "nullable": true
+ },
"order_date": {
"type": "string",
"format": "date-time",
@@ -38255,6 +38313,20 @@
],
"nullable": true
},
+ "value_added_tax_amount": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Value added tax (VAT) amount applied to the order or transaction.",
+ "example": 54,
+ "nullable": true
+ },
+ "value_added_tax_percent": {
+ "type": "number",
+ "format": "double",
+ "description": "Value added tax (VAT) rate applied to the order or transaction.",
+ "example": 2.5,
+ "nullable": true
+ },
"duty_amount": {
"allOf": [
{
@@ -38263,6 +38335,18 @@
],
"nullable": true
},
+ "order_commodity_code": {
+ "type": "string",
+ "description": "Commodity code classifying the order as a whole, as opposed to the\nper-item codes in `order_details`.",
+ "example": "4900",
+ "nullable": true
+ },
+ "vat_invoice_reference_number": {
+ "type": "string",
+ "description": "Reference number of the value added tax (VAT) invoice for this order.",
+ "example": "9999",
+ "nullable": true
+ },
"order_date": {
"type": "string",
"format": "date-time",
@@ -39873,6 +39957,20 @@
],
"nullable": true
},
+ "value_added_tax_amount": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Value added tax (VAT) amount applied to the order or transaction.",
+ "example": 54,
+ "nullable": true
+ },
+ "value_added_tax_percent": {
+ "type": "number",
+ "format": "double",
+ "description": "Value added tax (VAT) rate applied to the order or transaction.",
+ "example": 2.5,
+ "nullable": true
+ },
"duty_amount": {
"allOf": [
{
@@ -39881,6 +39979,18 @@
],
"nullable": true
},
+ "order_commodity_code": {
+ "type": "string",
+ "description": "Commodity code classifying the order as a whole, as opposed to the\nper-item codes in `order_details`.",
+ "example": "4900",
+ "nullable": true
+ },
+ "vat_invoice_reference_number": {
+ "type": "string",
+ "description": "Reference number of the value added tax (VAT) invoice for this order.",
+ "example": "9999",
+ "nullable": true
+ },
"order_date": {
"type": "string",
"format": "date-time",
diff --git a/api-reference/v2/openapi_spec_v2.json b/api-reference/v2/openapi_spec_v2.json
index 0744f0a87f..0af554edb0 100644
--- a/api-reference/v2/openapi_spec_v2.json
+++ b/api-reference/v2/openapi_spec_v2.json
@@ -20272,6 +20272,12 @@
"type": "string",
"example": "123456789",
"nullable": true
+ },
+ "merchant_vat_registration_id": {
+ "type": "string",
+ "description": "The merchant's VAT registration identifier",
+ "example": "GB987654321",
+ "nullable": true
}
},
"additionalProperties": false
diff --git a/crates/api_models/src/admin.rs b/crates/api_models/src/admin.rs
index 4b07023781..cb2f4a8cec 100644
--- a/crates/api_models/src/admin.rs
+++ b/crates/api_models/src/admin.rs
@@ -824,6 +824,10 @@ pub struct MerchantDetails {
#[schema(value_type = Option<String>, example = "123456789")]
pub merchant_tax_registration_id: Option<Secret<String>>,
+
+ /// The merchant's VAT registration identifier
+ #[schema(value_type = Option<String>, example = "GB987654321")]
+ pub merchant_vat_registration_id: Option<Secret<String>>,
}
/// The credentials required for calling the network tokenization provider APIs
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs
index a0be3a35a2..eaae10ce91 100644
--- a/crates/api_models/src/payments.rs
+++ b/crates/api_models/src/payments.rs
@@ -30,7 +30,10 @@ use common_utils::{
id_type,
new_type::MaskedBankAccount,
pii::{self, Email},
- types::{AmountConvertor, MinorUnit, Percentage, SemanticVersion, StringMajorUnit, TimeRange},
+ types::{
+ AmountConvertor, MinorUnit, Percentage, ScalarPercentage, SemanticVersion, StringMajorUnit,
+ TimeRange,
+ },
};
use error_stack::ResultExt;
@@ -1619,10 +1622,31 @@ pub struct PaymentsRequest {
#[smithy(value_type = "Option<i64>")]
pub shipping_amount_tax: Option<MinorUnit>,
+ /// Value added tax (VAT) amount applied to the order or transaction.
+ #[schema(value_type = Option<i64>, example = 54)]
+ #[smithy(value_type = "Option<i64>")]
+ pub value_added_tax_amount: Option<MinorUnit>,
+
+ /// Value added tax (VAT) rate applied to the order or transaction.
+ #[schema(value_type = Option<f64>, example = 2.5)]
+ #[smithy(value_type = "Option<f64>")]
+ pub value_added_tax_percent: Option<VatPercentage>,
+
/// Duty or customs fee amount for international transactions.
#[smithy(value_type = "Option<i64>")]
pub duty_amount: Option<MinorUnit>,
+ /// Commodity code classifying the order as a whole, as opposed to the
+ /// per-item codes in `order_details`.
+ #[schema(value_type = Option<String>, example = "4900")]
+ #[smithy(value_type = "Option<String>")]
+ pub order_commodity_code: Option<String>,
+
+ /// Reference number of the value added tax (VAT) invoice for this order.
+ #[schema(value_type = Option<String>, example = "9999")]
+ #[smithy(value_type = "Option<String>")]
+ pub vat_invoice_reference_number: Option<String>,
+
/// Date the payer placed the order.
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub order_date: Option<PrimitiveDateTime>,
@@ -10346,6 +10370,8 @@ pub struct PaymentsRetrieveRequest {
/// Percentage value used to represent the discount applied on an item.
pub type DiscountPercentage = Percentage<DISCOUNT_PERCENTAGE_PRECISION_LENGTH>;
+pub type VatPercentage = ScalarPercentage<DISCOUNT_PERCENTAGE_PRECISION_LENGTH>;
+
#[derive(
Debug, Default, PartialEq, serde::Deserialize, serde::Serialize, Clone, ToSchema, SmithyModel,
)]
diff --git a/crates/common_utils/src/types.rs b/crates/common_utils/src/types.rs
index 840c588d1e..b34acc9305 100644
--- a/crates/common_utils/src/types.rs
+++ b/crates/common_utils/src/types.rs
@@ -191,6 +191,38 @@ impl<'de, const PRECISION: u8> Deserialize<'de> for Percentage<PRECISION> {
}
}
+/// A percentage validated with [`Percentage`] and represented as a JSON number.
+#[derive(Clone, Debug, PartialEq)]
+pub struct ScalarPercentage<const PRECISION: u8>(Percentage<PRECISION>);
+
+impl<const PRECISION: u8> ScalarPercentage<PRECISION> {
+ /// Return the percentage as a floating-point number.
+ pub fn get_percentage(&self) -> f64 {
+ self.0.get_percentage()
+ }
+}
+
+impl<const PRECISION: u8> Serialize for ScalarPercentage<PRECISION> {
+ fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+ where
+ S: serde::Serializer,
+ {
+ serializer.serialize_f64(self.get_percentage())
+ }
+}
+
+impl<'de, const PRECISION: u8> Deserialize<'de> for ScalarPercentage<PRECISION> {
+ fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+ where
+ D: Deserializer<'de>,
+ {
+ let value = f64::deserialize(deserializer)?;
+ Percentage::from_string(value.to_string())
+ .map(Self)
+ .map_err(serde::de::Error::custom)
+ }
+}
+
/// represents surcharge type and value
#[derive(Clone, Debug, PartialEq, Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case", tag = "type", content = "value")]
diff --git a/crates/diesel_models/src/payment_intent.rs b/crates/diesel_models/src/payment_intent.rs
index 7edcc7873a..e95537e782 100644
--- a/crates/diesel_models/src/payment_intent.rs
+++ b/crates/diesel_models/src/payment_intent.rs
@@ -93,6 +93,8 @@ pub struct PaymentIntent {
pub is_account_funded_transaction: Option<bool>,
pub recipient_details: Option<Encryption>,
pub enable_avs_check: Option<bool>,
+ pub value_added_tax_details: Option<ValueAddedTaxDetails>,
+ pub order_commodity_code: Option<String>,
pub settlement_conclusion_applied: Option<bool>,
pub merchant_reference_id: Option<common_utils::id_type::PaymentReferenceId>,
pub billing_address: Option<Encryption>,
@@ -221,6 +223,8 @@ pub struct PaymentIntent {
pub is_account_funded_transaction: Option<bool>,
pub recipient_details: Option<Encryption>,
pub enable_avs_check: Option<bool>,
+ pub value_added_tax_details: Option<ValueAddedTaxDetails>,
+ pub order_commodity_code: Option<String>,
pub settlement_conclusion_applied: Option<bool>,
}
@@ -328,6 +332,16 @@ pub struct TaxDetails {
pub payment_method_type: Option<PaymentMethodTypeTax>,
}
+#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, diesel::AsExpression)]
+#[diesel(sql_type = diesel::sql_types::Jsonb)]
+pub struct ValueAddedTaxDetails {
+ pub value_added_tax_amount: Option<MinorUnit>,
+ pub value_added_tax_percent: Option<f64>,
+ pub vat_invoice_reference_number: Option<String>,
+}
+
+common_utils::impl_to_sql_from_sql_json!(ValueAddedTaxDetails);
+
impl TaxDetails {
/// Get the tax amount
/// If default tax is present, return the default tax amount
@@ -436,6 +450,7 @@ pub struct PaymentIntentNew {
pub discount_amount: Option<MinorUnit>,
pub shipping_amount_tax: Option<MinorUnit>,
pub duty_amount: Option<MinorUnit>,
+ pub order_commodity_code: Option<String>,
pub order_date: Option<PrimitiveDateTime>,
pub mit_category: Option<storage_enums::MitCategory>,
pub tokenization: Option<common_enums::Tokenization>,
@@ -449,6 +464,7 @@ pub struct PaymentIntentNew {
pub is_account_funded_transaction: Option<bool>,
pub recipient_details: Option<Encryption>,
pub enable_avs_check: Option<bool>,
+ pub value_added_tax_details: Option<ValueAddedTaxDetails>,
pub settlement_conclusion_applied: Option<bool>,
}
@@ -531,7 +547,9 @@ pub struct PaymentIntentNew {
pub discount_amount: Option<MinorUnit>,
pub order_date: Option<PrimitiveDateTime>,
pub shipping_amount_tax: Option<MinorUnit>,
+ pub value_added_tax_details: Option<ValueAddedTaxDetails>,
pub duty_amount: Option<MinorUnit>,
+ pub order_commodity_code: Option<String>,
pub enable_partial_authorization: Option<EnablePartialAuthorizationBool>,
pub enable_overcapture: Option<common_types::primitive_wrappers::EnableOvercaptureBool>,
pub mit_category: Option<storage_enums::MitCategory>,
@@ -737,7 +755,9 @@ pub struct PaymentIntentUpdateFields {
pub discount_amount: Option<MinorUnit>,
pub order_date: Option<PrimitiveDateTime>,
pub shipping_amount_tax: Option<MinorUnit>,
+ pub value_added_tax_details: Option<ValueAddedTaxDetails>,
pub duty_amount: Option<MinorUnit>,
+ pub order_commodity_code: Option<String>,
pub enable_partial_authorization: Option<EnablePartialAuthorizationBool>,
pub enable_overcapture: Option<common_types::primitive_wrappers::EnableOvercaptureBool>,
pub shipping_cost: Option<MinorUnit>,
@@ -858,7 +878,9 @@ pub struct PaymentIntentUpdateInternal {
pub discount_amount: Option<MinorUnit>,
pub order_date: Option<PrimitiveDateTime>,
pub shipping_amount_tax: Option<MinorUnit>,
+ pub value_added_tax_details: Option<ValueAddedTaxDetails>,
pub duty_amount: Option<MinorUnit>,
+ pub order_commodity_code: Option<String>,
pub enable_partial_authorization: Option<EnablePartialAuthorizationBool>,
pub enable_overcapture: Option<common_types::primitive_wrappers::EnableOvercaptureBool>,
pub shipping_cost: Option<MinorUnit>,
@@ -937,7 +959,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -1001,7 +1025,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -1063,7 +1089,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: value.discount_amount,
order_date: value.order_date,
shipping_amount_tax: value.shipping_amount_tax,
+ value_added_tax_details: None,
duty_amount: value.duty_amount,
+ order_commodity_code: value.order_commodity_code.clone(),
enable_partial_authorization: value.enable_partial_authorization,
enable_overcapture: value.enable_overcapture,
shipping_cost: value.shipping_cost,
@@ -1135,7 +1163,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -1202,7 +1232,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -1269,7 +1301,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -1344,7 +1378,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -1410,7 +1446,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -1477,7 +1515,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -1543,7 +1583,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -1609,7 +1651,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -1674,7 +1718,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -1740,7 +1786,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -1801,7 +1849,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -1865,7 +1915,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -1929,7 +1981,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -1995,7 +2049,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -2062,7 +2118,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -2124,7 +2182,9 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
diff --git a/crates/diesel_models/src/schema.rs b/crates/diesel_models/src/schema.rs
index eb91b13e30..c3ad0b93e6 100644
--- a/crates/diesel_models/src/schema.rs
+++ b/crates/diesel_models/src/schema.rs
@@ -1375,6 +1375,8 @@ diesel::table! {
is_account_funded_transaction -> Nullable<Bool>,
recipient_details -> Nullable<Bytea>,
enable_avs_check -> Nullable<Bool>,
+ value_added_tax_details -> Nullable<Jsonb>,
+ order_commodity_code -> Nullable<Varchar>,
settlement_conclusion_applied -> Nullable<Bool>,
}
}
diff --git a/crates/diesel_models/src/schema_v2.rs b/crates/diesel_models/src/schema_v2.rs
index 2516e3ccab..f313de76bd 100644
--- a/crates/diesel_models/src/schema_v2.rs
+++ b/crates/diesel_models/src/schema_v2.rs
@@ -1284,6 +1284,8 @@ diesel::table! {
is_account_funded_transaction -> Nullable<Bool>,
recipient_details -> Nullable<Bytea>,
enable_avs_check -> Nullable<Bool>,
+ value_added_tax_details -> Nullable<Jsonb>,
+ order_commodity_code -> Nullable<Varchar>,
settlement_conclusion_applied -> Nullable<Bool>,
#[max_length = 64]
merchant_reference_id -> Nullable<Varchar>,
diff --git a/crates/hyperswitch_domain_models/src/merchant_account.rs b/crates/hyperswitch_domain_models/src/merchant_account.rs
index 5605aaa2ef..e2ff6aa052 100644
--- a/crates/hyperswitch_domain_models/src/merchant_account.rs
+++ b/crates/hyperswitch_domain_models/src/merchant_account.rs
@@ -267,6 +267,17 @@ impl MerchantAccount {
})
}
+ /// Extract merchant_vat_registration_id from merchant_details
+ pub fn get_merchant_vat_registration_id(&self) -> Option<Secret<String>> {
+ self.merchant_details.as_ref().and_then(|details| {
+ details
+ .get_inner()
+ .peek()
+ .get("merchant_vat_registration_id")
+ .and_then(|id| id.as_str().map(|s| Secret::new(s.to_string())))
+ })
+ }
+
/// Check whether the merchant account is a platform account
pub fn is_platform_account(&self) -> bool {
matches!(
diff --git a/crates/hyperswitch_domain_models/src/payments.rs b/crates/hyperswitch_domain_models/src/payments.rs
index 7f6ad73878..28a7b41d82 100644
--- a/crates/hyperswitch_domain_models/src/payments.rs
+++ b/crates/hyperswitch_domain_models/src/payments.rs
@@ -143,7 +143,11 @@ pub struct PaymentIntent {
pub discount_amount: Option<MinorUnit>,
pub order_date: Option<PrimitiveDateTime>,
pub shipping_amount_tax: Option<MinorUnit>,
+ pub value_added_tax_amount: Option<MinorUnit>,
+ pub value_added_tax_percent: Option<f64>,
pub duty_amount: Option<MinorUnit>,
+ pub order_commodity_code: Option<String>,
+ pub vat_invoice_reference_number: Option<String>,
pub enable_partial_authorization: Option<primitive_wrappers::EnablePartialAuthorizationBool>,
pub enable_overcapture: Option<EnableOvercaptureBool>,
pub mit_category: Option<common_enums::MitCategory>,
diff --git a/crates/hyperswitch_domain_models/src/payments/payment_intent.rs b/crates/hyperswitch_domain_models/src/payments/payment_intent.rs
index 9b0dbbfee7..568477a2d7 100644
--- a/crates/hyperswitch_domain_models/src/payments/payment_intent.rs
+++ b/crates/hyperswitch_domain_models/src/payments/payment_intent.rs
@@ -18,6 +18,7 @@ use common_utils::{
};
use diesel_models::{
PaymentIntent as DieselPaymentIntent, PaymentIntentNew as DieselPaymentIntentNew,
+ ValueAddedTaxDetails,
};
use error_stack::ResultExt;
#[cfg(feature = "v2")]
@@ -316,7 +317,11 @@ pub struct PaymentIntentUpdateFields {
pub discount_amount: Option<MinorUnit>,
pub order_date: Option<PrimitiveDateTime>,
pub shipping_amount_tax: Option<MinorUnit>,
+ pub value_added_tax_amount: Option<MinorUnit>,
+ pub value_added_tax_percent: Option<f64>,
pub duty_amount: Option<MinorUnit>,
+ pub order_commodity_code: Option<String>,
+ pub vat_invoice_reference_number: Option<String>,
pub is_confirm_operation: bool,
pub payment_channel: Option<common_enums::PaymentChannel>,
pub feature_metadata: Option<Secret<serde_json::Value>>,
@@ -555,7 +560,11 @@ pub struct PaymentIntentUpdateInternal {
pub discount_amount: Option<MinorUnit>,
pub order_date: Option<PrimitiveDateTime>,
pub shipping_amount_tax: Option<MinorUnit>,
+ pub value_added_tax_amount: Option<MinorUnit>,
+ pub value_added_tax_percent: Option<f64>,
pub duty_amount: Option<MinorUnit>,
+ pub order_commodity_code: Option<String>,
+ pub vat_invoice_reference_number: Option<String>,
pub enable_partial_authorization: Option<primitive_wrappers::EnablePartialAuthorizationBool>,
pub enable_overcapture: Option<primitive_wrappers::EnableOvercaptureBool>,
pub shipping_cost: Option<MinorUnit>,
@@ -1195,7 +1204,10 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: value.discount_amount,
order_date: value.order_date,
shipping_amount_tax: value.shipping_amount_tax,
+ value_added_tax_amount: value.value_added_tax_amount,
+ value_added_tax_percent: value.value_added_tax_percent,
duty_amount: value.duty_amount,
+ order_commodity_code: value.order_commodity_code.clone(),
installment_options: value.installment_options,
external_surcharge_strategy: None,
external_surcharge_applicable: None,
@@ -1417,7 +1429,11 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_amount: None,
+ value_added_tax_percent: None,
duty_amount: None,
+ order_commodity_code: None,
+ vat_invoice_reference_number: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -1478,7 +1494,11 @@ impl From<PaymentIntentUpdate> for PaymentIntentUpdateInternal {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_amount: None,
+ value_added_tax_percent: None,
duty_amount: None,
+ order_commodity_code: None,
+ vat_invoice_reference_number: None,
enable_partial_authorization: None,
enable_overcapture: None,
shipping_cost: None,
@@ -1589,7 +1609,16 @@ impl From<PaymentIntentUpdate> for DieselPaymentIntentUpdate {
discount_amount: value.discount_amount,
order_date: value.order_date,
shipping_amount_tax: value.shipping_amount_tax,
+ value_added_tax_details: (value.value_added_tax_amount.is_some()
+ || value.value_added_tax_percent.is_some()
+ || value.vat_invoice_reference_number.is_some())
+ .then(|| ValueAddedTaxDetails {
+ value_added_tax_amount: value.value_added_tax_amount,
+ value_added_tax_percent: value.value_added_tax_percent,
+ vat_invoice_reference_number: value.vat_invoice_reference_number.clone(),
+ }),
duty_amount: value.duty_amount,
+ order_commodity_code: value.order_commodity_code.clone(),
enable_partial_authorization: value.enable_partial_authorization,
enable_overcapture: value.enable_overcapture,
shipping_cost: value.shipping_cost,
@@ -1787,7 +1816,11 @@ impl From<PaymentIntentUpdateInternal> for diesel_models::PaymentIntentUpdateInt
discount_amount,
order_date,
shipping_amount_tax,
+ value_added_tax_amount,
+ value_added_tax_percent,
+ vat_invoice_reference_number,
duty_amount,
+ order_commodity_code,
enable_partial_authorization,
enable_overcapture,
shipping_cost,
@@ -1849,7 +1882,16 @@ impl From<PaymentIntentUpdateInternal> for diesel_models::PaymentIntentUpdateInt
discount_amount,
order_date,
shipping_amount_tax,
+ value_added_tax_details: (value_added_tax_amount.is_some()
+ || value_added_tax_percent.is_some()
+ || vat_invoice_reference_number.is_some())
+ .then(|| ValueAddedTaxDetails {
+ value_added_tax_amount,
+ value_added_tax_percent,
+ vat_invoice_reference_number: vat_invoice_reference_number.clone(),
+ }),
duty_amount,
+ order_commodity_code,
enable_partial_authorization,
enable_overcapture,
shipping_cost,
@@ -2423,7 +2465,9 @@ impl behaviour::Conversion for PaymentIntent {
tax_status: None,
discount_amount: None,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
order_date: None,
enable_partial_authorization: Some(enable_partial_authorization),
enable_overcapture: None,
@@ -2705,7 +2749,9 @@ impl behaviour::Conversion for PaymentIntent {
discount_amount: None,
mit_category: self.mit_category,
shipping_amount_tax: None,
+ value_added_tax_details: None,
duty_amount: None,
+ order_commodity_code: None,
order_date: None,
enable_partial_authorization: Some(self.enable_partial_authorization),
tokenization: None,
@@ -2800,7 +2846,16 @@ impl behaviour::Conversion for PaymentIntent {
discount_amount: self.discount_amount,
order_date: self.order_date,
shipping_amount_tax: self.shipping_amount_tax,
+ value_added_tax_details: (self.value_added_tax_amount.is_some()
+ || self.value_added_tax_percent.is_some()
+ || self.vat_invoice_reference_number.is_some())
+ .then(|| ValueAddedTaxDetails {
+ value_added_tax_amount: self.value_added_tax_amount,
+ value_added_tax_percent: self.value_added_tax_percent,
+ vat_invoice_reference_number: self.vat_invoice_reference_number.clone(),
+ }),
duty_amount: self.duty_amount,
+ order_commodity_code: self.order_commodity_code.clone(),
enable_partial_authorization: self.enable_partial_authorization,
enable_overcapture: self.enable_overcapture,
mit_category: self.mit_category,
@@ -2924,7 +2979,20 @@ impl behaviour::Conversion for PaymentIntent {
tax_status: storage_model.tax_status,
discount_amount: storage_model.discount_amount,
shipping_amount_tax: storage_model.shipping_amount_tax,
+ value_added_tax_amount: storage_model
+ .value_added_tax_details
+ .as_ref()
+ .and_then(|vat| vat.value_added_tax_amount),
+ value_added_tax_percent: storage_model
+ .value_added_tax_details
+ .as_ref()
+ .and_then(|vat| vat.value_added_tax_percent),
duty_amount: storage_model.duty_amount,
+ order_commodity_code: storage_model.order_commodity_code.clone(),
+ vat_invoice_reference_number: storage_model
+ .value_added_tax_details
+ .as_ref()
+ .and_then(|vat| vat.vat_invoice_reference_number.clone()),
order_date: storage_model.order_date,
enable_partial_authorization: storage_model.enable_partial_authorization,
enable_overcapture: storage_model.enable_overcapture,
@@ -3020,7 +3088,16 @@ impl behaviour::Conversion for PaymentIntent {
discount_amount: self.discount_amount,
order_date: self.order_date,
shipping_amount_tax: self.shipping_amount_tax,
+ value_added_tax_details: (self.value_added_tax_amount.is_some()
+ || self.value_added_tax_percent.is_some()
+ || self.vat_invoice_reference_number.is_some())
+ .then(|| ValueAddedTaxDetails {
+ value_added_tax_amount: self.value_added_tax_amount,
+ value_added_tax_percent: self.value_added_tax_percent,
+ vat_invoice_reference_number: self.vat_invoice_reference_number.clone(),
+ }),
duty_amount: self.duty_amount,
+ order_commodity_code: self.order_commodity_code.clone(),
enable_partial_authorization: self.enable_partial_authorization,
enable_overcapture: self.enable_overcapture,
mit_category: self.mit_category,
diff --git a/crates/hyperswitch_domain_models/src/router_data.rs b/crates/hyperswitch_domain_models/src/router_data.rs
index 3d6cde2706..67980df892 100644
--- a/crates/hyperswitch_domain_models/src/router_data.rs
+++ b/crates/hyperswitch_domain_models/src/router_data.rs
@@ -165,6 +165,7 @@ pub struct OrderInfo {
pub discount_amount: Option<MinorUnit>,
pub shipping_cost: Option<MinorUnit>,
pub duty_amount: Option<MinorUnit>,
+ pub order_commodity_code: Option<String>,
}
impl OrderInfo {
@@ -178,6 +179,7 @@ impl OrderInfo {
discount_amount,
shipping_cost,
duty_amount,
+ order_commodity_code,
} = self;
order_date.is_none()
&& order_details
@@ -187,6 +189,7 @@ impl OrderInfo {
&& discount_amount.is_none()
&& shipping_cost.is_none()
&& duty_amount.is_none()
+ && order_commodity_code.is_none()
}
}
@@ -195,8 +198,13 @@ pub struct TaxInfo {
pub tax_status: Option<common_enums::TaxStatus>,
pub customer_tax_registration_id: Option<Secret<String>>,
pub merchant_tax_registration_id: Option<Secret<String>>,
+ pub merchant_vat_registration_id: Option<Secret<String>>,
pub shipping_amount_tax: Option<MinorUnit>,
pub order_tax_amount: Option<MinorUnit>,
+ pub value_added_tax_amount: Option<MinorUnit>,
+ /// A percentage between 0 and 100 — 2.5 means 2.5%.
+ pub value_added_tax_percent: Option<f64>,
+ pub vat_invoice_reference_number: Option<String>,
}
impl TaxInfo {
@@ -207,14 +215,22 @@ impl TaxInfo {
tax_status,
customer_tax_registration_id,
merchant_tax_registration_id,
+ merchant_vat_registration_id,
shipping_amount_tax,
order_tax_amount,
+ value_added_tax_amount,
+ value_added_tax_percent,
+ vat_invoice_reference_number,
} = self;
tax_status.is_none()
&& customer_tax_registration_id.is_none()
&& merchant_tax_registration_id.is_none()
+ && merchant_vat_registration_id.is_none()
&& shipping_amount_tax.is_none()
&& order_tax_amount.is_none()
+ && value_added_tax_amount.is_none()
+ && value_added_tax_percent.is_none()
+ && vat_invoice_reference_number.is_none()
}
}
@@ -305,6 +321,12 @@ impl L2L3Data {
self.order_info.as_ref().and_then(|order| order.duty_amount)
}
+ pub fn get_order_commodity_code(&self) -> Option<String> {
+ self.order_info
+ .as_ref()
+ .and_then(|order| order.order_commodity_code.clone())
+ }
+
pub fn get_tax_status(&self) -> Option<common_enums::TaxStatus> {
self.tax_info.as_ref().and_then(|tax| tax.tax_status)
}
@@ -321,12 +343,36 @@ impl L2L3Data {
.and_then(|tax| tax.merchant_tax_registration_id.clone())
}
+ pub fn get_merchant_vat_registration_id(&self) -> Option<Secret<String>> {
+ self.tax_info
+ .as_ref()
+ .and_then(|tax| tax.merchant_vat_registration_id.clone())
+ }
+
pub fn get_shipping_amount_tax(&self) -> Option<MinorUnit> {
self.tax_info
.as_ref()
.and_then(|tax| tax.shipping_amount_tax)
}
+ pub fn get_value_added_tax_amount(&self) -> Option<MinorUnit> {
+ self.tax_info
+ .as_ref()
+ .and_then(|tax| tax.value_added_tax_amount)
+ }
+
+ pub fn get_value_added_tax_percent(&self) -> Option<f64> {
+ self.tax_info
+ .as_ref()
+ .and_then(|tax| tax.value_added_tax_percent)
+ }
+
+ pub fn get_vat_invoice_reference_number(&self) -> Option<String> {
+ self.tax_info
+ .as_ref()
+ .and_then(|tax| tax.vat_invoice_reference_number.clone())
+ }
+
pub fn get_order_tax_amount(&self) -> Option<MinorUnit> {
self.tax_info.as_ref().and_then(|tax| tax.order_tax_amount)
}
diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs
index c94bb05c50..13e724d59c 100644
--- a/crates/router/src/core/payments/helpers.rs
+++ b/crates/router/src/core/payments/helpers.rs
@@ -5312,6 +5312,10 @@ mod tests {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_amount: None,
+ value_added_tax_percent: None,
+ vat_invoice_reference_number: None,
+ order_commodity_code: None,
duty_amount: None,
enable_partial_authorization: None,
enable_overcapture: None,
@@ -5409,6 +5413,10 @@ mod tests {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_amount: None,
+ value_added_tax_percent: None,
+ vat_invoice_reference_number: None,
+ order_commodity_code: None,
duty_amount: None,
enable_partial_authorization: None,
enable_overcapture: None,
@@ -5506,6 +5514,10 @@ mod tests {
discount_amount: None,
order_date: None,
shipping_amount_tax: None,
+ value_added_tax_amount: None,
+ value_added_tax_percent: None,
+ vat_invoice_reference_number: None,
+ order_commodity_code: None,
duty_amount: None,
enable_partial_authorization: None,
enable_overcapture: None,
diff --git a/crates/router/src/core/payments/operations/payment_confirm.rs b/crates/router/src/core/payments/operations/payment_confirm.rs
index ce597187da..9feb4adbae 100644
--- a/crates/router/src/core/payments/operations/payment_confirm.rs
+++ b/crates/router/src/core/payments/operations/payment_confirm.rs
@@ -3210,6 +3210,18 @@ impl<F: Clone + Sync> UpdateTracker<F, PaymentData<F>, api::PaymentsRequest> for
discount_amount: payment_data.payment_intent.discount_amount,
order_date: payment_data.payment_intent.order_date,
shipping_amount_tax: payment_data.payment_intent.shipping_amount_tax,
+ value_added_tax_amount: payment_data.payment_intent.value_added_tax_amount,
+ value_added_tax_percent: payment_data
+ .payment_intent
+ .value_added_tax_percent,
+ vat_invoice_reference_number: payment_data
+ .payment_intent
+ .vat_invoice_reference_number
+ .clone(),
+ order_commodity_code: payment_data
+ .payment_intent
+ .order_commodity_code
+ .clone(),
duty_amount: payment_data.payment_intent.duty_amount,
enable_partial_authorization: payment_data
.payment_intent
diff --git a/crates/router/src/core/payments/operations/payment_create.rs b/crates/router/src/core/payments/operations/payment_create.rs
index 64aac805df..f4c8adaa88 100644
--- a/crates/router/src/core/payments/operations/payment_create.rs
+++ b/crates/router/src/core/payments/operations/payment_create.rs
@@ -2035,6 +2035,13 @@ impl PaymentCreate {
order_date: request.order_date,
discount_amount: request.discount_amount,
duty_amount: request.duty_amount,
+ order_commodity_code: request.order_commodity_code.clone(),
+ value_added_tax_amount: request.value_added_tax_amount,
+ value_added_tax_percent: request
+ .value_added_tax_percent
+ .as_ref()
+ .map(|percentage| percentage.get_percentage()),
+ vat_invoice_reference_number: request.vat_invoice_reference_number.clone(),
tax_status: request.tax_status,
shipping_amount_tax: request.shipping_amount_tax,
enable_partial_authorization: request.enable_partial_authorization,
diff --git a/crates/router/src/core/payments/operations/payment_update.rs b/crates/router/src/core/payments/operations/payment_update.rs
index ae3ff8b5a7..ea8e786094 100644
--- a/crates/router/src/core/payments/operations/payment_update.rs
+++ b/crates/router/src/core/payments/operations/payment_update.rs
@@ -1408,6 +1408,13 @@ impl PaymentUpdate {
discount_amount: payment_data.payment_intent.discount_amount,
order_date: payment_data.payment_intent.order_date,
shipping_amount_tax: payment_data.payment_intent.shipping_amount_tax,
+ value_added_tax_amount: payment_data.payment_intent.value_added_tax_amount,
+ value_added_tax_percent: payment_data.payment_intent.value_added_tax_percent,
+ vat_invoice_reference_number: payment_data
+ .payment_intent
+ .vat_invoice_reference_number
+ .clone(),
+ order_commodity_code: payment_data.payment_intent.order_commodity_code.clone(),
duty_amount: payment_data.payment_intent.duty_amount,
enable_partial_authorization: payment_data
.payment_intent
diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs
index a1eda48d28..8445be4940 100644
--- a/crates/router/src/core/payments/transformers.rs
+++ b/crates/router/src/core/payments/transformers.rs
@@ -2165,6 +2165,8 @@ where
let billing_address = unified_address.get_payment_billing();
let merchant_tax_registration_id =
processor.get_account().get_merchant_tax_registration_id();
+ let merchant_vat_registration_id =
+ processor.get_account().get_merchant_vat_registration_id();
Box::new(types::L2L3Data {
order_info: Some(types::OrderInfo {
@@ -2177,6 +2179,7 @@ where
discount_amount: payment_data.payment_intent.discount_amount,
shipping_cost: payment_data.payment_intent.shipping_cost,
duty_amount: payment_data.payment_intent.duty_amount,
+ order_commodity_code: payment_data.payment_intent.order_commodity_code.clone(),
}),
tax_info: Some(types::TaxInfo {
tax_status: payment_data.payment_intent.tax_status,
@@ -2184,7 +2187,14 @@ where
.as_ref()
.and_then(|customer| customer.tax_registration_id.clone()),
merchant_tax_registration_id,
+ merchant_vat_registration_id,
shipping_amount_tax: payment_data.payment_intent.shipping_amount_tax,
+ value_added_tax_amount: payment_data.payment_intent.value_added_tax_amount,
+ value_added_tax_percent: payment_data.payment_intent.value_added_tax_percent,
+ vat_invoice_reference_number: payment_data
+ .payment_intent
+ .vat_invoice_reference_number
+ .clone(),
order_tax_amount: payment_data
.payment_attempt
.net_amount
diff --git a/crates/router/src/core/unified_connector_service/transformers.rs b/crates/router/src/core/unified_connector_service/transformers.rs
index 3f5b357dec..4f6a1d7270 100644
--- a/crates/router/src/core/unified_connector_service/transformers.rs
+++ b/crates/router/src/core/unified_connector_service/transformers.rs
@@ -418,7 +418,12 @@ fn build_ucs_l2_l3_data(l2_l3_data: Option<&L2L3Data>) -> Option<payments_grpc::
let discount_amount = l2_l3_data.and_then(|data| data.get_discount_amount());
let shipping_cost = l2_l3_data.and_then(|data| data.get_shipping_cost());
let duty_amount = l2_l3_data.and_then(|data| data.get_duty_amount());
+ let order_commodity_code = l2_l3_data.and_then(|data| data.get_order_commodity_code());
let shipping_amount_tax = l2_l3_data.and_then(|data| data.get_shipping_amount_tax());
+ let value_added_tax_amount = l2_l3_data.and_then(|data| data.get_value_added_tax_amount());
+ let value_added_tax_percent = l2_l3_data.and_then(|data| data.get_value_added_tax_percent());
+ let vat_invoice_reference_number =
+ l2_l3_data.and_then(|data| data.get_vat_invoice_reference_number());
let tax_status = l2_l3_data.and_then(|data| data.get_tax_status());
let order_tax_amount = l2_l3_data.and_then(|data| data.get_order_tax_amount());
let customer_tax_registration_id = l2_l3_data
@@ -427,6 +432,9 @@ fn build_ucs_l2_l3_data(l2_l3_data: Option<&L2L3Data>) -> Option<payments_grpc::
let merchant_tax_registration_id = l2_l3_data
.and_then(|data| data.get_merchant_tax_registration_id())
.map(|tax_id| tax_id.peek().to_owned().into());
+ let merchant_vat_registration_id = l2_l3_data
+ .and_then(|data| data.get_merchant_vat_registration_id())
+ .map(|vat_id| vat_id.peek().to_owned().into());
let order_info = l2_l3_data
.and_then(|data| data.order_info.as_ref())
@@ -438,7 +446,7 @@ fn build_ucs_l2_l3_data(l2_l3_data: Option<&L2L3Data>) -> Option<payments_grpc::
discount_amount: discount_amount.map(|amount| amount.get_amount_as_i64()),
shipping_cost: shipping_cost.map(|amount| amount.get_amount_as_i64()),
duty_amount: duty_amount.map(|amount| amount.get_amount_as_i64()),
- order_commodity_code: None,
+ order_commodity_code,
});
let tax_info = l2_l3_data
@@ -449,12 +457,12 @@ fn build_ucs_l2_l3_data(l2_l3_data: Option<&L2L3Data>) -> Option<payments_grpc::
.map(|tax_status| payments_grpc::TaxStatus::foreign_from(tax_status).into()),
customer_tax_registration_id,
merchant_tax_registration_id,
+ merchant_vat_registration_id,
shipping_amount_tax: shipping_amount_tax.map(|amount| amount.get_amount_as_i64()),
order_tax_amount: order_tax_amount.map(|tax| tax.get_amount_as_i64()),
- value_added_tax_amount: None,
- value_added_tax_percent: None,
- vat_invoice_reference_number: None,
- merchant_vat_registration_id: None,
+ value_added_tax_amount: value_added_tax_amount.map(|amount| amount.get_amount_as_i64()),
+ value_added_tax_percent,
+ vat_invoice_reference_number,
});
if order_info.is_none() && tax_info.is_none() {
diff --git a/crates/router/src/utils/user/sample_data.rs b/crates/router/src/utils/user/sample_data.rs
index 77e77531f0..f502223a25 100644
--- a/crates/router/src/utils/user/sample_data.rs
+++ b/crates/router/src/utils/user/sample_data.rs
@@ -297,6 +297,10 @@ pub async fn generate_sample_data(
duty_amount: None,
tax_status: None,
shipping_amount_tax: None,
+ value_added_tax_amount: None,
+ value_added_tax_percent: None,
+ order_commodity_code: None,
+ vat_invoice_reference_number: None,
enable_partial_authorization: None,
enable_overcapture: None,
mit_category: None,
diff --git a/migrations/2026-10-19-120000_add_vat_fields_to_payment_intent/down.sql b/migrations/2026-10-19-120000_add_vat_fields_to_payment_intent/down.sql
new file mode 100644
index 0000000000..0b631505d2
--- /dev/null
+++ b/migrations/2026-10-19-120000_add_vat_fields_to_payment_intent/down.sql
@@ -0,0 +1,3 @@
+-- This file should undo anything in `up.sql`
+
+ALTER TABLE payment_intent DROP COLUMN IF EXISTS value_added_tax_details;
diff --git a/migrations/2026-10-19-120000_add_vat_fields_to_payment_intent/up.sql b/migrations/2026-10-19-120000_add_vat_fields_to_payment_intent/up.sql
new file mode 100644
index 0000000000..c2844f1580
--- /dev/null
+++ b/migrations/2026-10-19-120000_add_vat_fields_to_payment_intent/up.sql
@@ -0,0 +1,2 @@
+ALTER TABLE payment_intent
+ ADD COLUMN IF NOT EXISTS value_added_tax_details JSONB;
diff --git a/migrations/2026-10-19-123000_add_order_commodity_code_to_payment_intent/down.sql b/migrations/2026-10-19-123000_add_order_commodity_code_to_payment_intent/down.sql
new file mode 100644
index 0000000000..55a6397495
--- /dev/null
+++ b/migrations/2026-10-19-123000_add_order_commodity_code_to_payment_intent/down.sql
@@ -0,0 +1,4 @@
+-- This file should undo anything in `up.sql`
+
+ALTER TABLE payment_intent
+DROP COLUMN IF EXISTS order_commodity_code;
diff --git a/migrations/2026-10-19-123000_add_order_commodity_code_to_payment_intent/up.sql b/migrations/2026-10-19-123000_add_order_commodity_code_to_payment_intent/up.sql
new file mode 100644
index 0000000000..1d487f4050
--- /dev/null
+++ b/migrations/2026-10-19-123000_add_order_commodity_code_to_payment_intent/up.sql
@@ -0,0 +1,4 @@
+-- Your SQL goes here
+
+ALTER TABLE payment_intent
+ADD COLUMN IF NOT EXISTS order_commodity_code VARCHAR;