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
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
feat(openapi): Update v1 API endpoints for payment methods, customers and payment method sessions (#11154)
Gaurav Rawat8f7e09b88eb0
diff --git a/api-reference/docs.json b/api-reference/docs.jsonindex 4596a4fff3..aaf78d56df 100644--- a/api-reference/docs.json+++ b/api-reference/docs.json@@ -60,25 +60,32 @@{"group": "Payment Methods","pages": [- "v1/payment-methods/paymentmethods--create",- "v1/payment-methods/payment-method--retrieve",- "v1/payment-methods/payment-method--update",- "v1/payment-methods/payment-method--delete",- "v1/payment-methods/payment-method--set-default-payment-method-for-customer",- "v1/payment-methods/list-payment-methods-for-a-merchant",- "v1/payment-methods/list-customer-saved-payment-methods-for-a-payment",- "v1/payment-methods/list-payment-methods-for-a-customer",- "v1/customer-set-default-payment-method/customers--set-default-payment-method"+ "v2/payment-methods/payment-method--create-v1",+ "v2/payment-methods/payment-method--retrieve-v1",+ "v2/payment-methods/payment-method--update-v1",+ "v2/payment-methods/payment-method--delete-v1",+ "v2/payment-methods/payment-method--list-customer-saved-payment-methods-v1"]},{"group": "Customers","pages": [- "v1/customers/customers--create",- "v1/customers/customers--retrieve",- "v1/customers/customers--update",- "v1/customers/customers--delete",- "v1/customers/customers--list"+ "v2/customers/customers--create-v1",+ "v2/customers/customers--retrieve-v1",+ "v2/customers/customers--update-v1",+ "v2/customers/customers--delete-v1",+ "v2/customers/customers--list-v1"+ ]+ },+ {+ "group": "Payment Method Session",+ "pages": [+ "v2/payment-method-session/payment-method-session--create-v1",+ "v2/payment-method-session/payment-method-session--retrieve-v1",+ "v2/payment-method-session/payment-method-session--list-payment-methods-v1",+ "v2/payment-method-session/payment-method-session--update-a-saved-payment-method-v1",+ "v2/payment-method-session/payment-method-session--confirm-a-payment-method-session-v1",+ "v2/payment-method-session/payment-method-session--delete-a-saved-payment-method-v1"]},{@@ -129,6 +136,35 @@}]},+ {+ "group": "Deprecated APIs",+ "pages": [+ {+ "group": "Customers",+ "pages": [+ "v1/customers/customers--create",+ "v1/customers/customers--retrieve",+ "v1/customers/customers--update",+ "v1/customers/customers--delete",+ "v1/customers/customers--list"+ ]+ },+ {+ "group": "Payment Methods",+ "pages": [+ "v1/payment-methods/paymentmethods--create",+ "v1/payment-methods/payment-method--retrieve",+ "v1/payment-methods/payment-method--update",+ "v1/payment-methods/payment-method--delete",+ "v1/payment-methods/payment-method--set-default-payment-method-for-customer",+ "v1/payment-methods/list-payment-methods-for-a-merchant",+ "v1/payment-methods/list-customer-saved-payment-methods-for-a-payment",+ "v1/payment-methods/list-payment-methods-for-a-customer",+ "v1/customer-set-default-payment-method/customers--set-default-payment-method"+ ]+ }+ ]+ },{"group": "Account management APIs","pages": [@@ -269,7 +305,6 @@"v1/subscriptions/pause","v1/subscriptions/resume","v1/subscriptions/cancel"-]}]diff --git a/api-reference/v2/customers/customers--create-v1.mdx b/api-reference/v2/customers/customers--create-v1.mdxnew file mode 100644index 0000000000..27ffaf8c46--- /dev/null+++ b/api-reference/v2/customers/customers--create-v1.mdx@@ -0,0 +1,3 @@+---+openapi: post /v1/customers+---diff --git a/api-reference/v2/customers/customers--delete-v1.mdx b/api-reference/v2/customers/customers--delete-v1.mdxnew file mode 100644index 0000000000..84920b55ed--- /dev/null+++ b/api-reference/v2/customers/customers--delete-v1.mdx@@ -0,0 +1,3 @@+---+openapi: delete /v1/customers/{id}+---diff --git a/api-reference/v2/customers/customers--list-v1.mdx b/api-reference/v2/customers/customers--list-v1.mdxnew file mode 100644index 0000000000..d00ed93694--- /dev/null+++ b/api-reference/v2/customers/customers--list-v1.mdx@@ -0,0 +1,3 @@+---+openapi: get /v1/customers/list+---diff --git a/api-reference/v2/customers/customers--retrieve-v1.mdx b/api-reference/v2/customers/customers--retrieve-v1.mdxnew file mode 100644index 0000000000..fa40ff81cf--- /dev/null+++ b/api-reference/v2/customers/customers--retrieve-v1.mdx@@ -0,0 +1,3 @@+---+openapi: get /v1/customers/{id}+---diff --git a/api-reference/v2/customers/customers--update-v1.mdx b/api-reference/v2/customers/customers--update-v1.mdxnew file mode 100644index 0000000000..6604b5c572--- /dev/null+++ b/api-reference/v2/customers/customers--update-v1.mdx@@ -0,0 +1,3 @@+---+openapi: put /v1/customers/{id}+---diff --git a/api-reference/v2/customers/customers--update.mdx b/api-reference/v2/customers/customers--update.mdxindex c3e10b6256..8d4bed86c9 100644--- a/api-reference/v2/customers/customers--update.mdx+++ b/api-reference/v2/customers/customers--update.mdx@@ -1,3 +1,3 @@----openapi: post /v2/customers/{id}+openapi: put /v2/customers/{id}---diff --git a/api-reference/v2/openapi_spec_v2.json b/api-reference/v2/openapi_spec_v2.jsonindex 5c1ffb4a52..ac2d4906fd 100644--- a/api-reference/v2/openapi_spec_v2.json+++ b/api-reference/v2/openapi_spec_v2.json@@ -1556,6 +1556,78 @@"summary": "Customers - Create","description": "Creates a customer object and stores the customer details to be reused for future payments.\nIncase the customer already exists in the system, this API will respond with the customer details.","operationId": "Create a Customer",+ "parameters": [+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the customer",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CustomerRequest"+ },+ "examples": {+ "Create a customer with name and email": {+ "value": {+ "email": "[email protected]",+ "name": "John Doe"+ }+ }+ }+ }+ },+ "required": true+ },+ "responses": {+ "200": {+ "description": "Customer Created",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CustomerResponse"+ }+ }+ }+ },+ "400": {+ "description": "Invalid data"+ }+ },+ "security": [+ {+ "api_key": []+ }+ ]+ }+ },+ "/v1/customers": {+ "post": {+ "tags": [+ "Customers"+ ],+ "summary": "Customers - Create",+ "description": "Creates a customer object and stores the customer details to be reused for future payments.\nIncase the customer already exists in the system, this API will respond with the customer details.",+ "operationId": "Create a Customer",+ "parameters": [+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the customer",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],"requestBody": {"content": {"application/json": {@@ -1613,6 +1685,16 @@"schema": {"type": "string"}+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the customer",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"}],"responses": {@@ -1636,7 +1718,7 @@}]},- "post": {+ "put": {"tags": ["Customers"],@@ -1652,6 +1734,16 @@"schema": {"type": "string"}+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the customer",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"}],"requestBody": {@@ -1709,6 +1801,16 @@"schema": {"type": "string"}+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the customer",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"}],"responses": {@@ -1733,30 +1835,48 @@]}},- "/v2/customers/list": {+ "/v1/customers/{id}": {"get": {"tags": ["Customers"],- "summary": "Customers - List",- "description": "Lists all the customers for a particular merchant id.",- "operationId": "List all Customers for a Merchant",+ "summary": "Customers - Retrieve",+ "description": "Retrieves a customer's details.",+ "operationId": "Retrieve a Customer",+ "parameters": [+ {+ "name": "id",+ "in": "path",+ "description": "The unique identifier for the Customer",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the customer",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],"responses": {"200": {- "description": "Customers retrieved",+ "description": "Customer Retrieved","content": {"application/json": {"schema": {- "type": "array",- "items": {- "$ref": "#/components/schemas/CustomerResponse"- }+ "$ref": "#/components/schemas/CustomerResponse"}}}},- "400": {- "description": "Invalid Data"+ "404": {+ "description": "Customer was not found"}},"security": [@@ -1764,29 +1884,46 @@"api_key": []}]- }- },- "/v2/payments/create-intent": {- "post": {+ },+ "put": {"tags": [- "Payments"+ "Customers"+ ],+ "summary": "Customers - Update",+ "description": "Updates the customer's details in a customer object.",+ "operationId": "Update a Customer",+ "parameters": [+ {+ "name": "id",+ "in": "path",+ "description": "The unique identifier for the Customer",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the customer",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }],- "summary": "Payments - Create Intent",- "description": "**Creates a payment intent object when amount_details are passed.**\n\nYou will require the 'API - Key' from the Hyperswitch dashboard to make the first call, and use the 'client secret' returned in this API along with your 'publishable key' to make subsequent API calls from your client.",- "operationId": "Create a Payment Intent","requestBody": {"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/PaymentsCreateIntentRequest"+ "$ref": "#/components/schemas/CustomerUpdateRequest"},"examples": {- "Create a payment intent with minimal fields": {+ "Update name and email of a customer": {"value": {- "amount_details": {- "currency": "USD",- "order_amount": 6540- }+ "email": "[email protected]",+ "name": "John Doe"}}}@@ -1796,24 +1933,17 @@},"responses": {"200": {- "description": "Payment created",+ "description": "Customer was Updated","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/PaymentsIntentResponse"+ "$ref": "#/components/schemas/CustomerResponse"}}}},- "400": {- "description": "Missing Mandatory fields",- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/GenericErrorResponseOpenApi"- }- }- }+ "404": {+ "description": "Customer was not found"}},"security": [@@ -1821,40 +1951,48 @@"api_key": []}]- }- },- "/v2/payments/{id}/get-intent": {- "get": {+ },+ "delete": {"tags": [- "Payments"+ "Customers"],- "summary": "Payments - Get Intent",- "description": "**Get a payment intent object when id is passed in path**\n\nYou will require the 'API - Key' from the Hyperswitch dashboard to make the call.",- "operationId": "Get the Payment Intent details",+ "summary": "Customers - Delete",+ "description": "Delete a customer record.",+ "operationId": "Delete a Customer","parameters": [{"name": "id","in": "path",- "description": "The unique identifier for the Payment Intent",+ "description": "The unique identifier for the Customer","required": true,"schema": {"type": "string"}+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the customer",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"}],"responses": {"200": {- "description": "Payment Intent",+ "description": "Customer was Deleted","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/PaymentsIntentResponse"+ "$ref": "#/components/schemas/CustomerDeleteResponse"}}}},"404": {- "description": "Payment Intent not found"+ "description": "Customer was not found"}},"security": [@@ -1864,28 +2002,19 @@]}},- "/v2/payments/{id}/update-intent": {- "put": {+ "/v2/customers/list": {+ "get": {"tags": [- "Payments"+ "Customers"],- "summary": "Payments - Update Intent",- "description": "**Update a payment intent object**\n\nYou will require the 'API - Key' from the Hyperswitch dashboard to make the call.",- "operationId": "Update a Payment Intent",+ "summary": "Customers - List",+ "description": "Lists all the customers for a particular merchant id.",+ "operationId": "List all Customers for a Merchant","parameters": [- {- "name": "id",- "in": "path",- "description": "The unique identifier for the Payment Intent",- "required": true,- "schema": {- "type": "string"- }- },{"name": "X-Profile-Id","in": "header",- "description": "Profile ID associated to the payment intent",+ "description": "Profile ID associated to the customer","required": true,"schema": {"type": "string"@@ -1893,14 +2022,211 @@"example": "pro_abcdefghijklmnop"}],- "requestBody": {- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/PaymentsUpdateIntentRequest"- },- "examples": {- "Update a payment intent with minimal fields": {+ "responses": {+ "200": {+ "description": "Customers retrieved",+ "content": {+ "application/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/CustomerResponse"+ }+ }+ }+ }+ },+ "400": {+ "description": "Invalid Data"+ }+ },+ "security": [+ {+ "api_key": []+ }+ ]+ }+ },+ "/v1/customers/list": {+ "get": {+ "tags": [+ "Customers"+ ],+ "summary": "Customers - List",+ "description": "Lists all the customers for a particular merchant id.",+ "operationId": "List all Customers for a Merchant",+ "parameters": [+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the customer",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],+ "responses": {+ "200": {+ "description": "Customers retrieved",+ "content": {+ "application/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/CustomerResponse"+ }+ }+ }+ }+ },+ "400": {+ "description": "Invalid Data"+ }+ },+ "security": [+ {+ "api_key": []+ }+ ]+ }+ },+ "/v2/payments/create-intent": {+ "post": {+ "tags": [+ "Payments"+ ],+ "summary": "Payments - Create Intent",+ "description": "**Creates a payment intent object when amount_details are passed.**\n\nYou will require the 'API - Key' from the Hyperswitch dashboard to make the first call, and use the 'client secret' returned in this API along with your 'publishable key' to make subsequent API calls from your client.",+ "operationId": "Create a Payment Intent",+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentsCreateIntentRequest"+ },+ "examples": {+ "Create a payment intent with minimal fields": {+ "value": {+ "amount_details": {+ "currency": "USD",+ "order_amount": 6540+ }+ }+ }+ }+ }+ },+ "required": true+ },+ "responses": {+ "200": {+ "description": "Payment created",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentsIntentResponse"+ }+ }+ }+ },+ "400": {+ "description": "Missing Mandatory fields",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/GenericErrorResponseOpenApi"+ }+ }+ }+ }+ },+ "security": [+ {+ "api_key": []+ }+ ]+ }+ },+ "/v2/payments/{id}/get-intent": {+ "get": {+ "tags": [+ "Payments"+ ],+ "summary": "Payments - Get Intent",+ "description": "**Get a payment intent object when id is passed in path**\n\nYou will require the 'API - Key' from the Hyperswitch dashboard to make the call.",+ "operationId": "Get the Payment Intent details",+ "parameters": [+ {+ "name": "id",+ "in": "path",+ "description": "The unique identifier for the Payment Intent",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Payment Intent",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentsIntentResponse"+ }+ }+ }+ },+ "404": {+ "description": "Payment Intent not found"+ }+ },+ "security": [+ {+ "api_key": []+ }+ ]+ }+ },+ "/v2/payments/{id}/update-intent": {+ "put": {+ "tags": [+ "Payments"+ ],+ "summary": "Payments - Update Intent",+ "description": "**Update a payment intent object**\n\nYou will require the 'API - Key' from the Hyperswitch dashboard to make the call.",+ "operationId": "Update a Payment Intent",+ "parameters": [+ {+ "name": "id",+ "in": "path",+ "description": "The unique identifier for the Payment Intent",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment intent",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentsUpdateIntentRequest"+ },+ "examples": {+ "Update a payment intent with minimal fields": {"value": {"amount_details": {"currency": "USD",@@ -2656,6 +2982,18 @@"summary": "Payment Method - Create","description": "Creates and stores a payment method against a customer. In case of cards, this API should be used only by PCI compliant merchants.","operationId": "Create Payment Method",+ "parameters": [+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],"requestBody": {"content": {"application/json": {@@ -2688,19 +3026,31 @@]}},- "/v2/payment-methods/create-intent": {+ "/v1/payment-methods": {"post": {"tags": ["Payment Methods"],- "summary": "Payment Method - Create Intent",- "description": "Creates a payment method for customer with billing information and other metadata.",- "operationId": "Create Payment Method Intent",+ "summary": "Payment Method - Create",+ "description": "Creates and stores a payment method against a customer. In case of cards, this API should be used only by PCI compliant merchants.",+ "operationId": "Create Payment Method",+ "parameters": [+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],"requestBody": {"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/PaymentMethodIntentCreate"+ "$ref": "#/components/schemas/PaymentMethodCreate"}}},@@ -2708,7 +3058,7 @@},"responses": {"200": {- "description": "Payment Method Intent Created",+ "description": "Payment Method Created","content": {"application/json": {"schema": {@@ -2728,29 +3078,111 @@]}},- "/v2/payment-methods/{id}/confirm-intent": {+ "/v2/payment-methods/create-intent": {"post": {"tags": ["Payment Methods"],- "summary": "Payment Method - Confirm Intent",- "description": "Update a payment method with customer's payment method related information.",- "operationId": "Confirm Payment Method Intent",- "requestBody": {- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/PaymentMethodIntentConfirm"- }- }- },- "required": true- },- "responses": {- "200": {- "description": "Payment Method Intent Confirmed",- "content": {- "application/json": {+ "summary": "Payment Method - Create Intent",+ "description": "Creates a payment method for customer with billing information and other metadata.",+ "operationId": "Create Payment Method Intent",+ "parameters": [+ {+ "name": "id",+ "in": "path",+ "description": "The unique identifier for the Payment Method",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentMethodIntentCreate"+ }+ }+ },+ "required": true+ },+ "responses": {+ "200": {+ "description": "Payment Method Intent Created",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentMethodResponse"+ }+ }+ }+ },+ "400": {+ "description": "Invalid Data"+ }+ },+ "security": [+ {+ "api_key": []+ }+ ]+ }+ },+ "/v2/payment-methods/{id}/confirm-intent": {+ "post": {+ "tags": [+ "Payment Methods"+ ],+ "summary": "Payment Method - Confirm Intent",+ "description": "Update a payment method with customer's payment method related information.",+ "operationId": "Confirm Payment Method Intent",+ "parameters": [+ {+ "name": "id",+ "in": "path",+ "description": "The unique identifier for the Payment Method",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentMethodIntentConfirm"+ }+ }+ },+ "required": true+ },+ "responses": {+ "200": {+ "description": "Payment Method Intent Confirmed",+ "content": {+ "application/json": {"schema": {"$ref": "#/components/schemas/PaymentMethodResponse"}@@ -2769,13 +3201,77 @@}},"/v2/payment-methods/{id}/update-saved-payment-method": {- "patch": {+ "put": {+ "tags": [+ "Payment Methods"+ ],+ "summary": "Payment Method - Update",+ "description": "Update an existing payment method of a customer.",+ "operationId": "Update Payment Method",+ "parameters": [+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentMethodUpdate"+ }+ }+ },+ "required": true+ },+ "responses": {+ "200": {+ "description": "Payment Method Update",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentMethodResponse"+ }+ }+ }+ },+ "400": {+ "description": "Invalid Data"+ }+ },+ "security": [+ {+ "api_key": []+ }+ ]+ }+ },+ "/v1/payment-methods/{id}/update-saved-payment-method": {+ "put": {"tags": ["Payment Methods"],"summary": "Payment Method - Update","description": "Update an existing payment method of a customer.","operationId": "Update Payment Method",+ "parameters": [+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],"requestBody": {"content": {"application/json": {@@ -2825,6 +3321,16 @@"schema": {"type": "string"}+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"}],"responses": {@@ -2864,6 +3370,16 @@"schema": {"type": "string"}+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"}],"responses": {@@ -2888,32 +3404,40 @@]}},- "/v2/payment-methods/{payment_method_id}/check-network-token-status": {+ "/v1/payment-methods/{id}": {"get": {"tags": ["Payment Methods"],- "summary": "Payment Method - Check Network Token Status",- "description": "Check the status of a network token for a saved payment method",- "operationId": "Check Network Token Status",+ "operationId": "Retrieve Payment Method","parameters": [{- "name": "payment_method_id",+ "name": "id","in": "path","description": "The unique identifier for the Payment Method","required": true,"schema": {"type": "string"}+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"}],"responses": {"200": {- "description": "Network Token Status Retrieved",+ "description": "Payment Method Retrieved","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/NetworkTokenStatusCheckResponse"+ "$ref": "#/components/schemas/PaymentMethodResponse"}}}@@ -2927,40 +3451,528 @@"api_key": []}]- }- },- "/v2/customers/{id}/saved-payment-methods": {- "get": {+ },+ "delete": {"tags": ["Payment Methods"],- "summary": "Payment Method - List Customer Saved Payment Methods",- "description": "List the payment methods saved for a customer",- "operationId": "List Customer Saved Payment Methods",+ "summary": "Payment Method - Delete",+ "description": "Deletes a payment method of a customer.",+ "operationId": "Delete Payment Method","parameters": [{"name": "id","in": "path",- "description": "The unique identifier for the customer",+ "description": "The unique identifier for the Payment Method","required": true,"schema": {"type": "string"}+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"}],"responses": {"200": {- "description": "Payment Methods Retrieved",+ "description": "Payment Method Retrieved","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/CustomerPaymentMethodsListResponse"+ "$ref": "#/components/schemas/PaymentMethodDeleteResponse"+ }+ }+ }+ },+ "404": {+ "description": "Payment Method Not Found"+ }+ },+ "security": [+ {+ "api_key": []+ }+ ]+ }+ },+ "/v2/payment-methods/{payment_method_id}/check-network-token-status": {+ "get": {+ "tags": [+ "Payment Methods"+ ],+ "summary": "Payment Method - Check Network Token Status",+ "description": "Check the status of a network token for a saved payment method",+ "operationId": "Check Network Token Status",+ "parameters": [+ {+ "name": "payment_method_id",+ "in": "path",+ "description": "The unique identifier for the Payment Method",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Network Token Status Retrieved",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/NetworkTokenStatusCheckResponse"+ }+ }+ }+ },+ "404": {+ "description": "Payment Method Not Found"+ }+ },+ "security": [+ {+ "api_key": []+ }+ ]+ }+ },+ "/v2/customers/{id}/saved-payment-methods": {+ "get": {+ "tags": [+ "Payment Methods"+ ],+ "summary": "Payment Method - List Customer Saved Payment Methods",+ "description": "List the payment methods saved for a customer",+ "operationId": "List Customer Saved Payment Methods",+ "parameters": [+ {+ "name": "id",+ "in": "path",+ "description": "The unique identifier for the customer",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],+ "responses": {+ "200": {+ "description": "Payment Methods Retrieved",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CustomerPaymentMethodsListResponse"+ }+ }+ }+ },+ "404": {+ "description": "Customer Not Found"+ }+ },+ "security": [+ {+ "api_key": []+ }+ ]+ }+ },+ "/v1/customers/{id}/saved-payment-methods": {+ "get": {+ "tags": [+ "Payment Methods"+ ],+ "summary": "Payment Method - List Customer Saved Payment Methods",+ "description": "List the payment methods saved for a customer",+ "operationId": "List Customer Saved Payment Methods",+ "parameters": [+ {+ "name": "id",+ "in": "path",+ "description": "The unique identifier for the customer",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],+ "responses": {+ "200": {+ "description": "Payment Methods Retrieved",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CustomerPaymentMethodsListResponse"+ }+ }+ }+ },+ "404": {+ "description": "Customer Not Found"+ }+ },+ "security": [+ {+ "api_key": []+ }+ ]+ }+ },+ "/v2/payment-methods/token/{payment_method_temporary_token}/details": {+ "get": {+ "tags": [+ "Payment Methods"+ ],+ "summary": "Payment Method - Get Payment Method Token Data",+ "description": "Retrieve the Payment method id associated with a payment method token.",+ "operationId": "Get Payment Method Token Data",+ "parameters": [+ {+ "name": "payment_method_temporary_token",+ "in": "path",+ "description": "The unique identifier for the Payment Method Token",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],+ "responses": {+ "200": {+ "description": "Payment Method Token Data Retrieved",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentMethodGetTokenDetailsResponse"+ }+ }+ }+ },+ "404": {+ "description": "Payment Method Not Found | Payment method token either expired or does not exist"+ }+ },+ "security": [+ {+ "api_key": []+ }+ ]+ }+ },+ "/v2/payment-method-sessions": {+ "post": {+ "tags": [+ "Payment Method Session"+ ],+ "summary": "Payment Method Session - Create",+ "description": "Create a payment method session for a customer\nThis is used to list the saved payment methods for the customer\nThe customer can also add a new payment method using this session",+ "operationId": "Create a payment method session",+ "parameters": [+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method session",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentMethodSessionRequest"+ },+ "examples": {+ "Create a payment method session with customer_id": {+ "value": {+ "customer_id": "12345_cus_abcdefghijklmnopqrstuvwxyz"+ }+ }+ }+ }+ },+ "required": true+ },+ "responses": {+ "200": {+ "description": "Create the payment method session",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentMethodSessionResponse"+ }+ }+ }+ },+ "400": {+ "description": "The request is invalid"+ }+ },+ "security": [+ {+ "api_key": []+ }+ ]+ }+ },+ "/v1/payment-method-sessions": {+ "post": {+ "tags": [+ "Payment Method Session"+ ],+ "summary": "Payment Method Session - Create",+ "description": "Create a payment method session for a customer\nThis is used to list the saved payment methods for the customer\nThe customer can also add a new payment method using this session",+ "operationId": "Create a payment method session",+ "parameters": [+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method session",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentMethodSessionRequest"+ },+ "examples": {+ "Create a payment method session with customer_id": {+ "value": {+ "customer_id": "12345_cus_abcdefghijklmnopqrstuvwxyz"+ }+ }+ }+ }+ },+ "required": true+ },+ "responses": {+ "200": {+ "description": "Create the payment method session",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentMethodSessionResponse"+ }+ }+ }+ },+ "400": {+ "description": "The request is invalid"+ }+ },+ "security": [+ {+ "api_key": []+ }+ ]+ }+ },+ "/v2/payment-method-sessions/{id}": {+ "get": {+ "tags": [+ "Payment Method Session"+ ],+ "summary": "Payment Method Session - Retrieve",+ "description": "Retrieve the payment method session",+ "operationId": "Retrieve the payment method session",+ "parameters": [+ {+ "name": "id",+ "in": "path",+ "description": "The unique identifier for the Payment Method Session",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method session",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],+ "responses": {+ "200": {+ "description": "The payment method session is retrieved successfully",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentMethodSessionResponse"+ }+ }+ }+ },+ "404": {+ "description": "The request is invalid"+ }+ },+ "security": [+ {+ "api_key": []+ }+ ]+ },+ "delete": {+ "tags": [+ "Payment Method Session"+ ],+ "summary": "Payment Method Session - Delete a saved payment method",+ "description": "Delete a saved payment method from the given payment method session.",+ "operationId": "Delete a saved payment method",+ "parameters": [+ {+ "name": "id",+ "in": "path",+ "description": "The unique identifier for the Payment Method Session",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method session",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentMethodSessionDeleteSavedPaymentMethod"+ },+ "examples": {+ "Update the card holder name": {+ "value": {+ "payment_method_token": "token_9wcXDRVkfEtLEsSnYKgQ"+ }+ }+ }+ }+ },+ "required": true+ },+ "responses": {+ "200": {+ "description": "The payment method has been deleted successfully",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentMethodDeleteSessionResponse"+ }+ }+ }+ },+ "404": {+ "description": "The request is invalid"+ }+ },+ "security": [+ {+ "publishable_key__client_secret": []+ }+ ]+ }+ },+ "/v1/payment-method-sessions/{id}": {+ "get": {+ "tags": [+ "Payment Method Session"+ ],+ "summary": "Payment Method Session - Retrieve",+ "description": "Retrieve the payment method session",+ "operationId": "Retrieve the payment method session",+ "parameters": [+ {+ "name": "id",+ "in": "path",+ "description": "The unique identifier for the Payment Method Session",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method session",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],+ "responses": {+ "200": {+ "description": "The payment method session is retrieved successfully",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentMethodSessionResponse"}}}},"404": {- "description": "Customer Not Found"+ "description": "The request is invalid"}},"security": [@@ -2968,104 +3980,133 @@"api_key": []}]- }- },- "/v2/payment-methods/token/{payment_method_temporary_token}/details": {- "get": {+ },+ "delete": {"tags": [- "Payment Methods"+ "Payment Method Session"],- "summary": "Payment Method - Get Payment Method Token Data",- "description": "Retrieve the Payment method id associated with a payment method token.",- "operationId": "Get Payment Method Token Data",+ "summary": "Payment Method Session - Delete a saved payment method",+ "description": "Delete a saved payment method from the given payment method session.",+ "operationId": "Delete a saved payment method","parameters": [{- "name": "payment_method_temporary_token",+ "name": "id","in": "path",- "description": "The unique identifier for the Payment Method Token",+ "description": "The unique identifier for the Payment Method Session","required": true,"schema": {"type": "string"}+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method session",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"}],+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentMethodSessionDeleteSavedPaymentMethod"+ },+ "examples": {+ "Update the card holder name": {+ "value": {+ "payment_method_token": "token_9wcXDRVkfEtLEsSnYKgQ"+ }+ }+ }+ }+ },+ "required": true+ },"responses": {"200": {- "description": "Payment Method Token Data Retrieved",+ "description": "The payment method has been deleted successfully","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/PaymentMethodGetTokenDetailsResponse"+ "$ref": "#/components/schemas/PaymentMethodDeleteSessionResponse"}}}},"404": {- "description": "Payment Method Not Found | Payment method token either expired or does not exist"+ "description": "The request is invalid"}},"security": [{- "api_key": []+ "publishable_key__client_secret": []}]}},- "/v2/payment-method-sessions": {- "post": {+ "/v2/payment-method-sessions/{id}/list-payment-methods": {+ "get": {"tags": ["Payment Method Session"],- "summary": "Payment Method Session - Create",- "description": "Create a payment method session for a customer\nThis is used to list the saved payment methods for the customer\nThe customer can also add a new payment method using this session",- "operationId": "Create a payment method session",- "requestBody": {- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/PaymentMethodSessionRequest"- },- "examples": {- "Create a payment method session with customer_id": {- "value": {- "customer_id": "12345_cus_abcdefghijklmnopqrstuvwxyz"- }- }- }+ "summary": "Payment Method Session - List Payment Methods",+ "description": "List payment methods for the given payment method session.\nThis endpoint lists the enabled payment methods for the profile and the saved payment methods of the customer.",+ "operationId": "List Payment methods for a Payment Method Session",+ "parameters": [+ {+ "name": "id",+ "in": "path",+ "description": "The unique identifier for the Payment Method Session",+ "required": true,+ "schema": {+ "type": "string"}},- "required": true- },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method session",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"+ }+ ],"responses": {"200": {- "description": "Create the payment method session",+ "description": "The payment method session is retrieved successfully","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/PaymentMethodSessionResponse"+ "$ref": "#/components/schemas/PaymentMethodListResponseForSession"}}}},- "400": {+ "404": {"description": "The request is invalid"}},"security": [{- "api_key": []+ "publishable_key__client_secret": []}]}},- "/v2/payment-method-sessions/{id}": {+ "/v1/payment-method-sessions/{id}/list-payment-methods": {"get": {"tags": ["Payment Method Session"],- "summary": "Payment Method Session - Retrieve",- "description": "Retrieve the payment method session",- "operationId": "Retrieve the payment method session",+ "summary": "Payment Method Session - List Payment Methods",+ "description": "List payment methods for the given payment method session.\nThis endpoint lists the enabled payment methods for the profile and the saved payment methods of the customer.",+ "operationId": "List Payment methods for a Payment Method Session","parameters": [{"name": "id",@@ -3075,6 +4116,16 @@"schema": {"type": "string"}+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method session",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"}],"responses": {@@ -3083,7 +4134,7 @@"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/PaymentMethodSessionResponse"+ "$ref": "#/components/schemas/PaymentMethodListResponseForSession"}}}@@ -3094,17 +4145,19 @@},"security": [{- "ephemeral_key": []+ "publishable_key__client_secret": []}]- },- "delete": {+ }+ },+ "/v2/payment-method-sessions/{id}/update-saved-payment-method": {+ "put": {"tags": ["Payment Method Session"],- "summary": "Payment Method Session - Delete a saved payment method",- "description": "Delete a saved payment method from the given payment method session.",- "operationId": "Delete a saved payment method",+ "summary": "Payment Method Session - Update a saved payment method",+ "description": "Update a saved payment method from the given payment method session.",+ "operationId": "Update a saved payment method","parameters": [{"name": "id",@@ -3114,17 +4167,33 @@"schema": {"type": "string"}+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method session",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"}],"requestBody": {"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/PaymentMethodSessionDeleteSavedPaymentMethod"+ "$ref": "#/components/schemas/PaymentMethodSessionUpdateSavedPaymentMethod"},"examples": {"Update the card holder name": {"value": {+ "payment_method_data": {+ "card": {+ "card_cvc": "456",+ "card_holder_name": "Narayan Bhat"+ }+ },"payment_method_token": "token_9wcXDRVkfEtLEsSnYKgQ"}}@@ -3135,11 +4204,11 @@},"responses": {"200": {- "description": "The payment method has been deleted successfully",+ "description": "The payment method has been updated successfully","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/PaymentMethodDeleteSessionResponse"+ "$ref": "#/components/schemas/PaymentMethodSessionResponse"}}}@@ -3150,19 +4219,19 @@},"security": [{- "ephemeral_key": []+ "publishable_key__client_secret": []}]}},- "/v2/payment-method-sessions/{id}/list-payment-methods": {- "get": {+ "/v1/payment-method-sessions/{id}/update-saved-payment-method": {+ "put": {"tags": ["Payment Method Session"],- "summary": "Payment Method Session - List Payment Methods",- "description": "List payment methods for the given payment method session.\nThis endpoint lists the enabled payment methods for the profile and the saved payment methods of the customer.",- "operationId": "List Payment methods for a Payment Method Session",+ "summary": "Payment Method Session - Update a saved payment method",+ "description": "Update a saved payment method from the given payment method session.",+ "operationId": "Update a saved payment method","parameters": [{"name": "id",@@ -3172,15 +4241,48 @@"schema": {"type": "string"}+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment method session",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"}],+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/PaymentMethodSessionUpdateSavedPaymentMethod"+ },+ "examples": {+ "Update the card holder name": {+ "value": {+ "payment_method_data": {+ "card": {+ "card_cvc": "456",+ "card_holder_name": "Narayan Bhat"+ }+ },+ "payment_method_token": "token_9wcXDRVkfEtLEsSnYKgQ"+ }+ }+ }+ }+ },+ "required": true+ },"responses": {"200": {- "description": "The payment method session is retrieved successfully",+ "description": "The payment method has been updated successfully","content": {"application/json": {"schema": {- "$ref": "#/components/schemas/PaymentMethodListResponseForSession"+ "$ref": "#/components/schemas/PaymentMethodSessionResponse"}}}@@ -3191,19 +4293,19 @@},"security": [{- "ephemeral_key": []+ "publishable_key__client_secret": []}]}},- "/v2/payment-method-sessions/{id}/update-saved-payment-method": {- "put": {+ "/v2/payment-method-sessions/{id}/confirm": {+ "post": {"tags": ["Payment Method Session"],- "summary": "Payment Method Session - Update a saved payment method",- "description": "Update a saved payment method from the given payment method session.",- "operationId": "Update a saved payment method",+ "summary": "Payment Method Session - Confirm a payment method session",+ "description": "**Confirms a payment method session object with the payment method data**",+ "operationId": "Confirm the payment method session","parameters": [{"name": "id",@@ -3213,24 +4315,37 @@"schema": {"type": "string"}+ },+ {+ "name": "X-Profile-Id",+ "in": "header",+ "description": "Profile ID associated to the payment intent",+ "required": true,+ "schema": {+ "type": "string"+ },+ "example": "pro_abcdefghijklmnop"}],"requestBody": {"content": {"application/json": {"schema": {- "$ref": "#/components/schemas/PaymentMethodSessionUpdateSavedPaymentMethod"+ "$ref": "#/components/schemas/PaymentMethodSessionConfirmRequest"},"examples": {- "Update the card holder name": {+ "Confirm the payment method session with card details": {"value": {"payment_method_data": {"card": {- "card_cvc": "456",- "card_holder_name": "Narayan Bhat"+ "card_cvc": "123",+ "card_exp_month": "10",+ "card_exp_year": "25",+ "card_number": "4242424242424242"}},- "payment_method_token": "token_9wcXDRVkfEtLEsSnYKgQ"+ "payment_method_subtype": "credit",+ "payment_method_type": "card"}}}@@ -3240,7 +4355,7 @@},"responses": {"200": {- "description": "The payment method has been updated successfully",+ "description": "Payment Method created","content": {"application/json": {"schema": {@@ -3249,18 +4364,18 @@}}},- "404": {- "description": "The request is invalid"+ "400": {+ "description": "Missing Mandatory fields"}},"security": [{- "ephemeral_key": []+ "publishable_key__client_secret": []}]}},- "/v2/payment-method-sessions/{id}/confirm": {+ "/v1/payment-method-sessions/{id}/confirm": {"post": {"tags": ["Payment Method Session"@@ -3332,7 +4447,7 @@},"security": [{- "publishable_key": []+ "publishable_key__client_secret": []}]}@@ -20329,9 +21444,6 @@},"PaymentMethodUpdate": {"type": "object",- "required": [- "network_transaction_id"- ],"properties": {"payment_method_data": {"allOf": [@@ -20351,7 +21463,8 @@},"network_transaction_id": {"type": "string",- "description": "The network transaction ID provided by the card network during a Customer Initiated Transaction (CIT)\nwhen `setup_future_usage` is set to `off_session`."+ "description": "The network transaction ID provided by the card network during a Customer Initiated Transaction (CIT)\nwhen `setup_future_usage` is set to `off_session`.",+ "nullable": true}},"additionalProperties": falsediff --git a/api-reference/v2/payment-method-session/payment-method-session--confirm-a-payment-method-session-v1.mdx b/api-reference/v2/payment-method-session/payment-method-session--confirm-a-payment-method-session-v1.mdxnew file mode 100644index 0000000000..6010c5b0fe--- /dev/null+++ b/api-reference/v2/payment-method-session/payment-method-session--confirm-a-payment-method-session-v1.mdx@@ -0,0 +1,3 @@+---+openapi: post /v1/payment-method-sessions/{id}/confirm+---\ No newline at end of filediff --git a/api-reference/v2/payment-method-session/payment-method-session--create-v1.mdx b/api-reference/v2/payment-method-session/payment-method-session--create-v1.mdxnew file mode 100644index 0000000000..a35abcaf26--- /dev/null+++ b/api-reference/v2/payment-method-session/payment-method-session--create-v1.mdx@@ -0,0 +1,3 @@+---+openapi: post /v1/payment-method-sessions+---diff --git a/api-reference/v2/payment-method-session/payment-method-session--delete-a-saved-payment-method-v1.mdx b/api-reference/v2/payment-method-session/payment-method-session--delete-a-saved-payment-method-v1.mdxnew file mode 100644index 0000000000..45b3ab1ef6--- /dev/null+++ b/api-reference/v2/payment-method-session/payment-method-session--delete-a-saved-payment-method-v1.mdx@@ -0,0 +1,3 @@+---+openapi: delete /v1/payment-method-sessions/{id}+---diff --git a/api-reference/v2/payment-method-session/payment-method-session--list-payment-methods-v1.mdx b/api-reference/v2/payment-method-session/payment-method-session--list-payment-methods-v1.mdxnew file mode 100644index 0000000000..814146815d--- /dev/null+++ b/api-reference/v2/payment-method-session/payment-method-session--list-payment-methods-v1.mdx@@ -0,0 +1,3 @@+---+openapi: get /v1/payment-method-sessions/{id}/list-payment-methods+---\ No newline at end of filediff --git a/api-reference/v2/payment-method-session/payment-method-session--retrieve-v1.mdx b/api-reference/v2/payment-method-session/payment-method-session--retrieve-v1.mdxnew file mode 100644index 0000000000..7f1d8c0c61--- /dev/null+++ b/api-reference/v2/payment-method-session/payment-method-session--retrieve-v1.mdx@@ -0,0 +1,3 @@+---+openapi: get /v1/payment-method-sessions/{id}+---\ No newline at end of filediff --git a/api-reference/v2/payment-method-session/payment-method-session--update-a-saved-payment-method-v1.mdx b/api-reference/v2/payment-method-session/payment-method-session--update-a-saved-payment-method-v1.mdxnew file mode 100644index 0000000000..01be482b7a--- /dev/null+++ b/api-reference/v2/payment-method-session/payment-method-session--update-a-saved-payment-method-v1.mdx@@ -0,0 +1,3 @@+---+openapi: put /v1/payment-method-sessions/{id}/update-saved-payment-method+---diff --git a/api-reference/v2/payment-methods/payment-method--create-v1.mdx b/api-reference/v2/payment-methods/payment-method--create-v1.mdxnew file mode 100644index 0000000000..262c490c91--- /dev/null+++ b/api-reference/v2/payment-methods/payment-method--create-v1.mdx@@ -0,0 +1,3 @@+---+openapi: post /v1/payment-methods+---\ No newline at end of filediff --git a/api-reference/v2/payment-methods/payment-method--delete-v1.mdx b/api-reference/v2/payment-methods/payment-method--delete-v1.mdxnew file mode 100644index 0000000000..7f4e0f5b39--- /dev/null+++ b/api-reference/v2/payment-methods/payment-method--delete-v1.mdx@@ -0,0 +1,3 @@+---+openapi: delete /v1/payment-methods/{id}+---\ No newline at end of filediff --git a/api-reference/v2/payment-methods/payment-method--list-customer-saved-payment-methods-v1.mdx b/api-reference/v2/payment-methods/payment-method--list-customer-saved-payment-methods-v1.mdxnew file mode 100644index 0000000000..77578652da--- /dev/null+++ b/api-reference/v2/payment-methods/payment-method--list-customer-saved-payment-methods-v1.mdx@@ -0,0 +1,3 @@+---+openapi: get /v1/customers/{id}/saved-payment-methods+---\ No newline at end of filediff --git a/api-reference/v2/payment-methods/payment-method--retrieve-v1.mdx b/api-reference/v2/payment-methods/payment-method--retrieve-v1.mdxnew file mode 100644index 0000000000..0313d19228--- /dev/null+++ b/api-reference/v2/payment-methods/payment-method--retrieve-v1.mdx@@ -0,0 +1,3 @@+---+openapi: get /v1/payment-methods/{id}+---\ No newline at end of filediff --git a/api-reference/v2/payment-methods/payment-method--update-v1.mdx b/api-reference/v2/payment-methods/payment-method--update-v1.mdxnew file mode 100644index 0000000000..4152b11004--- /dev/null+++ b/api-reference/v2/payment-methods/payment-method--update-v1.mdx@@ -0,0 +1,3 @@+---+openapi: put /v1/payment-methods/{id}/update-saved-payment-method+---\ No newline at end of filediff --git a/api-reference/v2/payment-methods/payment-method--update.mdx b/api-reference/v2/payment-methods/payment-method--update.mdxindex 0adee195a6..7f5f41668f 100644--- a/api-reference/v2/payment-methods/payment-method--update.mdx+++ b/api-reference/v2/payment-methods/payment-method--update.mdx@@ -1,3 +1,3 @@----openapi: patch /v2/payment-methods/{id}/update-saved-payment-method+openapi: put /v2/payment-methods/{id}/update-saved-payment-method---\ No newline at end of filediff --git a/crates/api_models/src/payment_methods.rs b/crates/api_models/src/payment_methods.rsindex f693aa3848..993a3c825d 100644--- a/crates/api_models/src/payment_methods.rs+++ b/crates/api_models/src/payment_methods.rs@@ -517,7 +517,7 @@ pub struct PaymentMethodUpdate {/// The network transaction ID provided by the card network during a Customer Initiated Transaction (CIT)/// when `setup_future_usage` is set to `off_session`.- #[schema(value_type = String)]+ #[schema(value_type = Option<String>)]pub network_transaction_id: Option<masking::Secret<String>>,}diff --git a/crates/openapi/src/openapi_v2.rs b/crates/openapi/src/openapi_v2.rsindex a3200f1785..44c63c7cce 100644--- a/crates/openapi/src/openapi_v2.rs+++ b/crates/openapi/src/openapi_v2.rs@@ -115,10 +115,15 @@ Never share your secret api keys. Keep them guarded and secure.//Routes for customersroutes::customers::customers_create,+ routes::customers::customers_create_v1,routes::customers::customers_retrieve,+ routes::customers::customers_retrieve_v1,routes::customers::customers_update,+ routes::customers::customers_update_v1,routes::customers::customers_delete,+ routes::customers::customers_delete_v1,routes::customers::customers_list,+ routes::customers::customers_list_v1,//Routes for paymentsroutes::payments::payments_create_intent,@@ -134,22 +139,33 @@ Never share your secret api keys. Keep them guarded and secure.//Routes for payment methodsroutes::payment_method::create_payment_method_api,+ routes::payment_method::create_payment_method_api_v1,routes::payment_method::create_payment_method_intent_api,routes::payment_method::confirm_payment_method_intent_api,routes::payment_method::payment_method_update_api,+ routes::payment_method::payment_method_update_api_v1,routes::payment_method::payment_method_retrieve_api,+ routes::payment_method::payment_method_retrieve_api_v1,routes::payment_method::payment_method_delete_api,+ routes::payment_method::payment_method_delete_api_v1,routes::payment_method::network_token_status_check_api,routes::payment_method::list_customer_payment_method_api,+ routes::payment_method::list_customer_payment_method_api_v1,routes::payment_method::payment_method_get_token_details_api,//Routes for payment method sessionroutes::payment_method::payment_method_session_create,+ routes::payment_method::payment_method_session_create_v1,routes::payment_method::payment_method_session_retrieve,+ routes::payment_method::payment_method_session_retrieve_v1,routes::payment_method::payment_method_session_list_payment_methods,+ routes::payment_method::payment_method_session_list_payment_methods_v1,routes::payment_method::payment_method_session_update_saved_payment_method,+ routes::payment_method::payment_method_session_update_saved_payment_method_v1,routes::payment_method::payment_method_session_delete_saved_payment_method,+ routes::payment_method::payment_method_session_delete_saved_payment_method_v1,routes::payment_method::payment_method_session_confirm,+ routes::payment_method::payment_method_session_confirm_v1,//Routes for refundsroutes::refunds::refunds_create,diff --git a/crates/openapi/src/routes/customers.rs b/crates/openapi/src/routes/customers.rsindex e96f6b7b48..224b0b7b6f 100644--- a/crates/openapi/src/routes/customers.rs+++ b/crates/openapi/src/routes/customers.rs@@ -115,6 +115,13 @@ pub async fn customers_list() {}#[utoipa::path(post,path = "/v2/customers",+ params (+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the customer",+ example = "pro_abcdefghijklmnop"+ )+ ),request_body (content = CustomerRequest,examples (( "Create a customer with name and email" =(@@ -136,13 +143,54 @@ pub async fn customers_list() {}#[cfg(feature = "v2")]pub async fn customers_create() {}+/// Customers - Create+///+/// Creates a customer object and stores the customer details to be reused for future payments.+/// Incase the customer already exists in the system, this API will respond with the customer details.+#[utoipa::path(+ post,+ path = "/v1/customers",+ params (+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the customer",+ example = "pro_abcdefghijklmnop"+ )+ ),+ request_body (+ content = CustomerRequest,+ examples (( "Create a customer with name and email" =(+ value =json!( {+ "email": "[email protected]",+ "name": "John Doe"+ })+ )))+ ),+ responses(+ (status = 200, description = "Customer Created", body = CustomerResponse),+ (status = 400, description = "Invalid data")++ ),+ tag = "Customers",+ operation_id = "Create a Customer",+ security(("api_key" = []))+)]+#[cfg(feature = "v2")]+pub async fn customers_create_v1() {}/// Customers - Retrieve////// Retrieves a customer's details.#[utoipa::path(get,path = "/v2/customers/{id}",- params (("id" = String, Path, description = "The unique identifier for the Customer")),+ params (+ ("id" = String, Path, description = "The unique identifier for the Customer"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the customer",+ example = "pro_abcdefghijklmnop"+ )+ ),responses((status = 200, description = "Customer Retrieved", body = CustomerResponse),(status = 404, description = "Customer was not found")@@ -154,11 +202,36 @@ pub async fn customers_create() {}#[cfg(feature = "v2")]pub async fn customers_retrieve() {}+/// Customers - Retrieve+///+/// Retrieves a customer's details.+#[utoipa::path(+ get,+ path = "/v1/customers/{id}",+ params (+ ("id" = String, Path, description = "The unique identifier for the Customer"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the customer",+ example = "pro_abcdefghijklmnop"+ )+ ),+ responses(+ (status = 200, description = "Customer Retrieved", body = CustomerResponse),+ (status = 404, description = "Customer was not found")+ ),+ tag = "Customers",+ operation_id = "Retrieve a Customer",+ security(("api_key" = []))+)]+#[cfg(feature = "v2")]+pub async fn customers_retrieve_v1() {}+/// Customers - Update////// Updates the customer's details in a customer object.#[utoipa::path(- post,+ put,path = "/v2/customers/{id}",request_body (content = CustomerUpdateRequest,@@ -169,7 +242,14 @@ pub async fn customers_retrieve() {}}))))),- params (("id" = String, Path, description = "The unique identifier for the Customer")),+ params (+ ("id" = String, Path, description = "The unique identifier for the Customer"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the customer",+ example = "pro_abcdefghijklmnop"+ )+ ),responses((status = 200, description = "Customer was Updated", body = CustomerResponse),(status = 404, description = "Customer was not found")@@ -181,13 +261,54 @@ pub async fn customers_retrieve() {}#[cfg(feature = "v2")]pub async fn customers_update() {}+/// Customers - Update+///+/// Updates the customer's details in a customer object.+#[utoipa::path(+ put,+ path = "/v1/customers/{id}",+ request_body (+ content = CustomerUpdateRequest,+ examples (( "Update name and email of a customer" =(+ value =json!( {+ "email": "[email protected]",+ "name": "John Doe"+ })+ )))+ ),+ params (+ ("id" = String, Path, description = "The unique identifier for the Customer"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the customer",+ example = "pro_abcdefghijklmnop"+ )+ ),+ responses(+ (status = 200, description = "Customer was Updated", body = CustomerResponse),+ (status = 404, description = "Customer was not found")+ ),+ tag = "Customers",+ operation_id = "Update a Customer",+ security(("api_key" = []))+)]+#[cfg(feature = "v2")]+pub async fn customers_update_v1() {}+/// Customers - Delete////// Delete a customer record.#[utoipa::path(delete,path = "/v2/customers/{id}",- params (("id" = String, Path, description = "The unique identifier for the Customer")),+ params (+ ("id" = String, Path, description = "The unique identifier for the Customer"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the customer",+ example = "pro_abcdefghijklmnop"+ )+ ),responses((status = 200, description = "Customer was Deleted", body = CustomerDeleteResponse),(status = 404, description = "Customer was not found")@@ -199,12 +320,43 @@ pub async fn customers_update() {}#[cfg(feature = "v2")]pub async fn customers_delete() {}+/// Customers - Delete+///+/// Delete a customer record.+#[utoipa::path(+ delete,+ path = "/v1/customers/{id}",+ params (+ ("id" = String, Path, description = "The unique identifier for the Customer"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the customer",+ example = "pro_abcdefghijklmnop"+ )+ ),+ responses(+ (status = 200, description = "Customer was Deleted", body = CustomerDeleteResponse),+ (status = 404, description = "Customer was not found")+ ),+ tag = "Customers",+ operation_id = "Delete a Customer",+ security(("api_key" = []))+)]+#[cfg(feature = "v2")]+pub async fn customers_delete_v1() {}/// Customers - List////// Lists all the customers for a particular merchant id.#[utoipa::path(get,path = "/v2/customers/list",+ params (+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the customer",+ example = "pro_abcdefghijklmnop"+ )+ ),responses((status = 200, description = "Customers retrieved", body = Vec<CustomerResponse>),(status = 400, description = "Invalid Data"),@@ -215,3 +367,27 @@ pub async fn customers_delete() {})]#[cfg(feature = "v2")]pub async fn customers_list() {}++/// Customers - List+///+/// Lists all the customers for a particular merchant id.+#[utoipa::path(+ get,+ path = "/v1/customers/list",+ params (+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the customer",+ example = "pro_abcdefghijklmnop"+ )+ ),+ responses(+ (status = 200, description = "Customers retrieved", body = Vec<CustomerResponse>),+ (status = 400, description = "Invalid Data"),+ ),+ tag = "Customers",+ operation_id = "List all Customers for a Merchant",+ security(("api_key" = []))+)]+#[cfg(feature = "v2")]+pub async fn customers_list_v1() {}diff --git a/crates/openapi/src/routes/payment_method.rs b/crates/openapi/src/routes/payment_method.rsindex 04f7ec9e17..2bb0b64c56 100644--- a/crates/openapi/src/routes/payment_method.rs+++ b/crates/openapi/src/routes/payment_method.rs@@ -207,6 +207,14 @@ pub async fn default_payment_method_set_api() {}#[utoipa::path(post,path = "/v2/payment-methods/create-intent",+ params (+ ("id" = String, Path, description = "The unique identifier for the Payment Method"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method",+ example = "pro_abcdefghijklmnop"+ )+ ),request_body(content = PaymentMethodIntentCreate,// TODO: Add examples@@ -221,13 +229,20 @@ pub async fn default_payment_method_set_api() {})]#[cfg(feature = "v2")]pub async fn create_payment_method_intent_api() {}-/// Payment Method - Confirm Intent////// Update a payment method with customer's payment method related information.#[utoipa::path(post,path = "/v2/payment-methods/{id}/confirm-intent",+ params (+ ("id" = String, Path, description = "The unique identifier for the Payment Method"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method",+ example = "pro_abcdefghijklmnop"+ )+ ),request_body(content = PaymentMethodIntentConfirm,// TODO: Add examples@@ -242,13 +257,19 @@ pub async fn create_payment_method_intent_api() {})]#[cfg(feature = "v2")]pub async fn confirm_payment_method_intent_api() {}-/// Payment Method - Create////// Creates and stores a payment method against a customer. In case of cards, this API should be used only by PCI compliant merchants.#[utoipa::path(post,path = "/v2/payment-methods",+ params(+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method",+ example = "pro_abcdefghijklmnop"+ )+ ),request_body(content = PaymentMethodCreate,// TODO: Add examples@@ -264,6 +285,34 @@ pub async fn confirm_payment_method_intent_api() {}#[cfg(feature = "v2")]pub async fn create_payment_method_api() {}+/// Payment Method - Create+///+/// Creates and stores a payment method against a customer. In case of cards, this API should be used only by PCI compliant merchants.+#[utoipa::path(+ post,+ path = "/v1/payment-methods",+ params(+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method",+ example = "pro_abcdefghijklmnop"+ )+ ),+ request_body(+ content = PaymentMethodCreate,+ // TODO: Add examples+ ),+ responses(+ (status = 200, description = "Payment Method Created", body = PaymentMethodResponse),+ (status = 400, description = "Invalid Data"),+ ),+ tag = "Payment Methods",+ operation_id = "Create Payment Method",+ security(("api_key" = []))+)]+#[cfg(feature = "v2")]+pub async fn create_payment_method_api_v1() {}+/// Payment Method - Retrieve////// Retrieves a payment method of a customer.@@ -272,6 +321,11 @@ pub async fn create_payment_method_api() {}path = "/v2/payment-methods/{id}",params (("id" = String, Path, description = "The unique identifier for the Payment Method"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method",+ example = "pro_abcdefghijklmnop"+ )),responses((status = 200, description = "Payment Method Retrieved", body = PaymentMethodResponse),@@ -284,12 +338,41 @@ pub async fn create_payment_method_api() {}#[cfg(feature = "v2")]pub async fn payment_method_retrieve_api() {}+#[utoipa::path(+ get,+ path = "/v1/payment-methods/{id}",+ params (+ ("id" = String, Path, description = "The unique identifier for the Payment Method"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method",+ example = "pro_abcdefghijklmnop"+ )+ ),+ responses(+ (status = 200, description = "Payment Method Retrieved", body = PaymentMethodResponse),+ (status = 404, description = "Payment Method Not Found"),+ ),+ tag = "Payment Methods",+ operation_id = "Retrieve Payment Method",+ security(("api_key" = []))+)]+#[cfg(feature = "v2")]+pub async fn payment_method_retrieve_api_v1() {}+/// Payment Method - Update////// Update an existing payment method of a customer.#[utoipa::path(- patch,+ put,path = "/v2/payment-methods/{id}/update-saved-payment-method",+ params(+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method",+ example = "pro_abcdefghijklmnop"+ )+ ),request_body(content = PaymentMethodUpdate,// TODO: Add examples@@ -305,6 +388,33 @@ pub async fn payment_method_retrieve_api() {}#[cfg(feature = "v2")]pub async fn payment_method_update_api() {}+/// Payment Method - Update+///+/// Update an existing payment method of a customer.+#[utoipa::path(+ put,+ path = "/v1/payment-methods/{id}/update-saved-payment-method",+ params(+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method",+ example = "pro_abcdefghijklmnop"+ )+ ),+ request_body(+ content = PaymentMethodUpdate,+ // TODO: Add examples+ ),+ responses(+ (status = 200, description = "Payment Method Update", body = PaymentMethodResponse),+ (status = 400, description = "Invalid Data"),+ ),+ tag = "Payment Methods",+ operation_id = "Update Payment Method",+ security(("api_key" = []))+)]+#[cfg(feature = "v2")]+pub async fn payment_method_update_api_v1() {}/// Payment Method - Delete////// Deletes a payment method of a customer.@@ -313,6 +423,11 @@ pub async fn payment_method_update_api() {}path = "/v2/payment-methods/{id}",params (("id" = String, Path, description = "The unique identifier for the Payment Method"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method",+ example = "pro_abcdefghijklmnop"+ )),responses((status = 200, description = "Payment Method Retrieved", body = PaymentMethodDeleteResponse),@@ -325,6 +440,31 @@ pub async fn payment_method_update_api() {}#[cfg(feature = "v2")]pub async fn payment_method_delete_api() {}+/// Payment Method - Delete+///+/// Deletes a payment method of a customer.+#[utoipa::path(+ delete,+ path = "/v1/payment-methods/{id}",+ params (+ ("id" = String, Path, description = "The unique identifier for the Payment Method"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method",+ example = "pro_abcdefghijklmnop"+ )+ ),+ responses(+ (status = 200, description = "Payment Method Retrieved", body = PaymentMethodDeleteResponse),+ (status = 404, description = "Payment Method Not Found"),+ ),+ tag = "Payment Methods",+ operation_id = "Delete Payment Method",+ security(("api_key" = []))+)]+#[cfg(feature = "v2")]+pub async fn payment_method_delete_api_v1() {}+/// Payment Method - Check Network Token Status////// Check the status of a network token for a saved payment method@@ -344,7 +484,6 @@ pub async fn payment_method_delete_api() {})]#[cfg(feature = "v2")]pub async fn network_token_status_check_api() {}-/// Payment Method - Get Payment Method Token Data////// Retrieve the Payment method id associated with a payment method token.@@ -353,6 +492,11 @@ pub async fn network_token_status_check_api() {}path = "/v2/payment-methods/token/{payment_method_temporary_token}/details",params (("payment_method_temporary_token" = String, Path, description = "The unique identifier for the Payment Method Token"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method",+ example = "pro_abcdefghijklmnop"+ )),responses((status = 200, description = "Payment Method Token Data Retrieved", body = PaymentMethodGetTokenDetailsResponse),@@ -364,7 +508,6 @@ pub async fn network_token_status_check_api() {})]#[cfg(feature = "v2")]pub async fn payment_method_get_token_details_api() {}-/// Payment Method - List Customer Saved Payment Methods////// List the payment methods saved for a customer@@ -373,6 +516,11 @@ pub async fn payment_method_get_token_details_api() {}path = "/v2/customers/{id}/saved-payment-methods",params (("id" = String, Path, description = "The unique identifier for the customer"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method",+ example = "pro_abcdefghijklmnop"+ )),responses((status = 200, description = "Payment Methods Retrieved", body = CustomerPaymentMethodsListResponse),@@ -385,6 +533,30 @@ pub async fn payment_method_get_token_details_api() {}#[cfg(feature = "v2")]pub async fn list_customer_payment_method_api() {}+/// Payment Method - List Customer Saved Payment Methods+///+/// List the payment methods saved for a customer+#[utoipa::path(+ get,+ path = "/v1/customers/{id}/saved-payment-methods",+ params (+ ("id" = String, Path, description = "The unique identifier for the customer"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method",+ example = "pro_abcdefghijklmnop"+ )+ ),+ responses(+ (status = 200, description = "Payment Methods Retrieved", body = CustomerPaymentMethodsListResponse),+ (status = 404, description = "Customer Not Found"),+ ),+ tag = "Payment Methods",+ operation_id = "List Customer Saved Payment Methods",+ security(("api_key" = []))+)]+#[cfg(feature = "v2")]+pub async fn list_customer_payment_method_api_v1() {}/// Payment Method Session - Create////// Create a payment method session for a customer@@ -394,6 +566,13 @@ pub async fn list_customer_payment_method_api() {}#[utoipa::path(post,path = "/v2/payment-method-sessions",+ params (+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method session",+ example = "pro_abcdefghijklmnop"+ )+ ),request_body(content = PaymentMethodSessionRequest,examples (( "Create a payment method session with customer_id" = (@@ -412,6 +591,40 @@ pub async fn list_customer_payment_method_api() {})]pub fn payment_method_session_create() {}+/// Payment Method Session - Create+///+/// Create a payment method session for a customer+/// This is used to list the saved payment methods for the customer+/// The customer can also add a new payment method using this session+#[cfg(feature = "v2")]+#[utoipa::path(+ post,+ path = "/v1/payment-method-sessions",+ params (+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method session",+ example = "pro_abcdefghijklmnop"+ )+ ),+ request_body(+ content = PaymentMethodSessionRequest,+ examples (( "Create a payment method session with customer_id" = (+ value =json!( {+ "customer_id": "12345_cus_abcdefghijklmnopqrstuvwxyz"+ })+ )))+ ),+ responses(+ (status = 200, description = "Create the payment method session", body = PaymentMethodSessionResponse),+ (status = 400, description = "The request is invalid")+ ),+ tag = "Payment Method Session",+ operation_id = "Create a payment method session",+ security(("api_key" = []))+)]+pub fn payment_method_session_create_v1() {}+/// Payment Method Session - Retrieve////// Retrieve the payment method session@@ -421,6 +634,11 @@ pub fn payment_method_session_create() {}path = "/v2/payment-method-sessions/{id}",params (("id" = String, Path, description = "The unique identifier for the Payment Method Session"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method session",+ example = "pro_abcdefghijklmnop"+ )),responses((status = 200, description = "The payment method session is retrieved successfully", body = PaymentMethodSessionResponse),@@ -428,10 +646,35 @@ pub fn payment_method_session_create() {}),tag = "Payment Method Session",operation_id = "Retrieve the payment method session",- security(("ephemeral_key" = []))+ security(("api_key" = [])))]pub fn payment_method_session_retrieve() {}+/// Payment Method Session - Retrieve+///+/// Retrieve the payment method session+#[cfg(feature = "v2")]+#[utoipa::path(+ get,+ path = "/v1/payment-method-sessions/{id}",+ params (+ ("id" = String, Path, description = "The unique identifier for the Payment Method Session"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method session",+ example = "pro_abcdefghijklmnop"+ )+ ),+ responses(+ (status = 200, description = "The payment method session is retrieved successfully", body = PaymentMethodSessionResponse),+ (status = 404, description = "The request is invalid")+ ),+ tag = "Payment Method Session",+ operation_id = "Retrieve the payment method session",+ security(("api_key" = []))+)]+pub fn payment_method_session_retrieve_v1() {}+/// Payment Method Session - List Payment Methods////// List payment methods for the given payment method session.@@ -442,6 +685,11 @@ pub fn payment_method_session_retrieve() {}path = "/v2/payment-method-sessions/{id}/list-payment-methods",params (("id" = String, Path, description = "The unique identifier for the Payment Method Session"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method session",+ example = "pro_abcdefghijklmnop"+ )),responses((status = 200, description = "The payment method session is retrieved successfully", body = PaymentMethodListResponseForSession),@@ -449,10 +697,36 @@ pub fn payment_method_session_retrieve() {}),tag = "Payment Method Session",operation_id = "List Payment methods for a Payment Method Session",- security(("ephemeral_key" = []))+ security(("publishable_key__client_secret" = [])))]pub fn payment_method_session_list_payment_methods() {}+/// Payment Method Session - List Payment Methods+///+/// List payment methods for the given payment method session.+/// This endpoint lists the enabled payment methods for the profile and the saved payment methods of the customer.+#[cfg(feature = "v2")]+#[utoipa::path(+ get,+ path = "/v1/payment-method-sessions/{id}/list-payment-methods",+ params (+ ("id" = String, Path, description = "The unique identifier for the Payment Method Session"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method session",+ example = "pro_abcdefghijklmnop"+ )+ ),+ responses(+ (status = 200, description = "The payment method session is retrieved successfully", body = PaymentMethodListResponseForSession),+ (status = 404, description = "The request is invalid")+ ),+ tag = "Payment Method Session",+ operation_id = "List Payment methods for a Payment Method Session",+ security(("publishable_key__client_secret" = []))+)]+pub fn payment_method_session_list_payment_methods_v1() {}+/// Payment Method Session - Update a saved payment method////// Update a saved payment method from the given payment method session.@@ -462,6 +736,11 @@ pub fn payment_method_session_list_payment_methods() {}path = "/v2/payment-method-sessions/{id}/update-saved-payment-method",params (("id" = String, Path, description = "The unique identifier for the Payment Method Session"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method session",+ example = "pro_abcdefghijklmnop"+ )),request_body(content = PaymentMethodSessionUpdateSavedPaymentMethod,@@ -484,10 +763,50 @@ pub fn payment_method_session_list_payment_methods() {}),tag = "Payment Method Session",operation_id = "Update a saved payment method",- security(("ephemeral_key" = []))+ security(("publishable_key__client_secret" = [])))]pub fn payment_method_session_update_saved_payment_method() {}+/// Payment Method Session - Update a saved payment method+///+/// Update a saved payment method from the given payment method session.+#[cfg(feature = "v2")]+#[utoipa::path(+ put,+ path = "/v1/payment-method-sessions/{id}/update-saved-payment-method",+ params (+ ("id" = String, Path, description = "The unique identifier for the Payment Method Session"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method session",+ example = "pro_abcdefghijklmnop"+ )+ ),+ request_body(+ content = PaymentMethodSessionUpdateSavedPaymentMethod,+ examples(( "Update the card holder name" = (+ value =json!( {+ "payment_method_token": "token_9wcXDRVkfEtLEsSnYKgQ",+ "payment_method_data": {+ "card": {+ "card_holder_name": "Narayan Bhat",+ "card_cvc": "456"+ }+ }+ }+ )+ )))+ ),+ responses(+ (status = 200, description = "The payment method has been updated successfully", body = PaymentMethodSessionResponse),+ (status = 404, description = "The request is invalid")+ ),+ tag = "Payment Method Session",+ operation_id = "Update a saved payment method",+ security(("publishable_key__client_secret" = []))+)]+pub fn payment_method_session_update_saved_payment_method_v1() {}+/// Payment Method Session - Delete a saved payment method////// Delete a saved payment method from the given payment method session.@@ -497,6 +816,11 @@ pub fn payment_method_session_update_saved_payment_method() {}path = "/v2/payment-method-sessions/{id}",params (("id" = String, Path, description = "The unique identifier for the Payment Method Session"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method session",+ example = "pro_abcdefghijklmnop"+ )),request_body(content = PaymentMethodSessionDeleteSavedPaymentMethod,@@ -513,10 +837,43 @@ pub fn payment_method_session_update_saved_payment_method() {}),tag = "Payment Method Session",operation_id = "Delete a saved payment method",- security(("ephemeral_key" = []))+ security(("publishable_key__client_secret" = [])))]pub fn payment_method_session_delete_saved_payment_method() {}+/// Payment Method Session - Delete a saved payment method+///+/// Delete a saved payment method from the given payment method session.+#[cfg(feature = "v2")]+#[utoipa::path(+ delete,+ path = "/v1/payment-method-sessions/{id}",+ params (+ ("id" = String, Path, description = "The unique identifier for the Payment Method Session"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment method session",+ example = "pro_abcdefghijklmnop"+ )+ ),+ request_body(+ content = PaymentMethodSessionDeleteSavedPaymentMethod,+ examples(( "Update the card holder name" = (+ value =json!( {+ "payment_method_token": "token_9wcXDRVkfEtLEsSnYKgQ",+ }+ )+ )))+ ),+ responses(+ (status = 200, description = "The payment method has been deleted successfully", body = PaymentMethodDeleteSessionResponse),+ (status = 404, description = "The request is invalid")+ ),+ tag = "Payment Method Session",+ operation_id = "Delete a saved payment method",+ security(("publishable_key__client_secret" = []))+)]+pub fn payment_method_session_delete_saved_payment_method_v1() {}/// Card network tokenization - Create using raw card data////// Create a card network token for a customer and store it as a payment method.@@ -596,7 +953,52 @@ pub async fn tokenize_card_using_pm_api() {}),tag = "Payment Method Session",operation_id = "Confirm the payment method session",- security(("publishable_key" = [])),+ security(("publishable_key__client_secret" = [])),)]#[cfg(feature = "v2")]pub fn payment_method_session_confirm() {}++/// Payment Method Session - Confirm a payment method session+///+/// **Confirms a payment method session object with the payment method data**+#[utoipa::path(+ post,+ path = "/v1/payment-method-sessions/{id}/confirm",+ params (("id" = String, Path, description = "The unique identifier for the Payment Method Session"),+ (+ "X-Profile-Id" = String, Header,+ description = "Profile ID associated to the payment intent",+ example = "pro_abcdefghijklmnop"+ )+ ),+ request_body(+ content = PaymentMethodSessionConfirmRequest,+ examples(+ (+ "Confirm the payment method session with card details" = (+ value = json!({+ "payment_method_type": "card",+ "payment_method_subtype": "credit",+ "payment_method_data": {+ "card": {+ "card_number": "4242424242424242",+ "card_exp_month": "10",+ "card_exp_year": "25",+ "card_cvc": "123"+ }+ },+ })+ )+ ),+ ),+ ),+ responses(+ (status = 200, description = "Payment Method created", body = PaymentMethodSessionResponse),+ (status = 400, description = "Missing Mandatory fields")+ ),+ tag = "Payment Method Session",+ operation_id = "Confirm the payment method session",+ security(("publishable_key__client_secret" = [])),+)]+#[cfg(feature = "v2")]+pub fn payment_method_session_confirm_v1() {}