# VyaFac API VyaFac is a powerful and secure payment gateway API designed to streamline transaction processing. Developers can leverage OpenAPI specifications to manage products, pricing options with tax plans, and customer accounts along with their payment methods. The API also enables the creation and management of subscriptions and payment links, providing a seamless and efficient payment experience. Version: 1.0.0 ## Security ### BearerAuth Type: http Scheme: bearer Bearer Format: JWT ## Download OpenAPI description [VyaFac API](https://docs.vyafac.com/_bundle/openapi.yaml) ## Products Manage and retrieve product details, create new products, update existing ones, and remove products from the system. ### Product listing - [GET /products](https://docs.vyafac.com/openapi/products/listproducts.md): Fetch a paginated list of products with optional filters like date, search query, limit, without_pagination and without_one_off. ### Create product - [POST /products](https://docs.vyafac.com/openapi/products/createproduct.md): Create a new product with a name, description, and pricing details. ### Update product - [PATCH /products/{id}](https://docs.vyafac.com/openapi/products/updateproduct.md): Update details of a product. ### Product details - [GET /products/{id}](https://docs.vyafac.com/openapi/products/getproduct.md): Fetch detailed information about a product using its unique identifier. ### Delete product - [DELETE /products/{id}](https://docs.vyafac.com/openapi/products/deleteproduct.md): Delete a product from the system ## PricingOptions Define and manage pricing options, including discounts, offers, and different pricing tiers for products and services. ### List pricing options - [GET /products/{productId}/pricing-options](https://docs.vyafac.com/openapi/pricingoptions/listpricingoptions.md): List pricing options for a specific product. ### Create pricing option - [POST /products/{productId}/pricing-options](https://docs.vyafac.com/openapi/pricingoptions/createpricingoption.md): Create a pricing option for a product. ### Get pricing option - [GET /products/{productId}/pricing-options/{pricingOptionId}](https://docs.vyafac.com/openapi/pricingoptions/getpricingoption.md): Retrieve details of a pricing option. ### Update pricing option - [PUT /products/{productId}/pricing-options/{pricingOptionId}](https://docs.vyafac.com/openapi/pricingoptions/updatepricingoption.md): Update an existing pricing option. ### Delete pricing option - [DELETE /products/{productId}/pricing-options/{pricingOptionId}](https://docs.vyafac.com/openapi/pricingoptions/deletepricingoption.md): Delete a pricing option. ## Customers Manage customer accounts, retrieve customer details, and handle customer-related operations such as creation, updates, and deletions. ### Customer listing - [GET /customers](https://docs.vyafac.com/openapi/customers/listcustomers.md): Fetch a paginated list of customers with optional filters like date range, search query and limit. ### Create customer - [POST /customers](https://docs.vyafac.com/openapi/customers/createcustomer.md): Creates a new customer with an attached payment method (card). For more information about card handling, see Card Handling. ### Update customer - [PATCH /customers/{id}](https://docs.vyafac.com/openapi/customers/updatecustomer.md): Update details of a customer. ### Customer details - [GET /customers/{id}](https://docs.vyafac.com/openapi/customers/getcustomer.md): Fetch detailed information about a customer using its unique identifier. ### Delete customer - [DELETE /customers/{id}](https://docs.vyafac.com/openapi/customers/deletecustomer.md): Delete a customer from the system ## PaymentMethods Handle the configuration and management of different payment methods, including credit cards, PayPal, and other online payment systems. ### List customer payment methods - [GET /customers/{customer_id}/payment-methods](https://docs.vyafac.com/openapi/paymentmethods/listcustomerpaymentmethods.md): Retrieve all payment methods for a specific customer. ### Create customer payment method - [POST /customers/{customer_id}/payment-methods](https://docs.vyafac.com/openapi/paymentmethods/createcustomerpaymentmethod.md): Add a new payment method for a customer. ### Update a customer’s payment method - [PATCH /customers/{customer_id}/payment-methods/{id}](https://docs.vyafac.com/openapi/paymentmethods/updatecustomerpaymentmethod.md): Update a specific payment method. ### Delete a customer’s payment method - [DELETE /customers/{customer_id}/payment-methods/{id}](https://docs.vyafac.com/openapi/paymentmethods/deletecustomerpaymentmethod.md): Remove a specific payment method. ## Subscriptions Manage and retrieve subscription details, create new subscriptions, update existing ones, and handle cancellations or renewals. ### Subscription listing - [GET /subscriptions](https://docs.vyafac.com/openapi/subscriptions/listsubscriptions.md): Fetch a paginated list of subscriptions with optional filters like date, email, search query and limit. ### Create subscription - [POST /subscriptions](https://docs.vyafac.com/openapi/subscriptions/createsubscription.md): Create a new subscription with trial days, products, and start and end dates. Note: - Add a key named collect_automated_tax in your request body. - Set it to true if any product has automated tax. - Otherwise, set it to false. - Add a key named automated_tax inside each product object in your products array. - Set it to any value if the product has automated tax. - Otherwise, set it to null. ### Update subscription - [PATCH /subscriptions/{id}](https://docs.vyafac.com/openapi/subscriptions/updatesubscription.md): Update details of a subscription. ### Subscription details - [GET /subscriptions/{id}](https://docs.vyafac.com/openapi/subscriptions/getsubscription.md): Fetch detailed information about a subscription using its unique identifier. ### Cancel subscription - [DELETE /subscriptions/{id}](https://docs.vyafac.com/openapi/subscriptions/cancelsubscription.md): Cancel a subscription ### Subscription details excluding one-off products - [GET /subscriptions/{id}/without-one-off](https://docs.vyafac.com/openapi/subscriptions/getsubscriptionwithoutoneoff.md): Fetch detailed information about a subscription using its unique identifier. This endpoint returns the subscription details excluding any one-off products. ## SubscriptionItems Define and manage items within a subscription, including adding, updating, or removing items linked to an active subscription. ### List subscription items - [GET /subscriptions/{subscriptionId}/items](https://docs.vyafac.com/openapi/subscriptionitems/listsubscriptionitems.md): List all items in a specific subscription. ### Create subscription item - [POST /subscriptions/{subscriptionId}/items](https://docs.vyafac.com/openapi/subscriptionitems/createsubscriptionitem.md): Create a new item in a specific subscription. ### Get subscription item - [GET /subscriptions/{subscriptionId}/items/{itemId}](https://docs.vyafac.com/openapi/subscriptionitems/getsubscriptionitem.md): Retrieve details of a specific subscription item. ### Update subscription item - [PATCH /subscriptions/{subscriptionId}/items/{itemId}](https://docs.vyafac.com/openapi/subscriptionitems/updatesubscriptionitem.md): Update an existing subscription item. ### Delete subscription item - [DELETE /subscriptions/{subscriptionId}/items/{itemId}](https://docs.vyafac.com/openapi/subscriptionitems/deletesubscriptionitem.md): Delete a subscription item. ## PaymentLinks Generate and manage payment links for one-time or recurring payments, allowing users to complete transactions securely via a hosted link. ### List payment links - [GET /payment-links](https://docs.vyafac.com/openapi/paymentlinks/listpaymentlinks.md): List payment links with optional limit. ### Create payment link - [POST /payment-links](https://docs.vyafac.com/openapi/paymentlinks/createpaymentlink.md): Create a new payment link. ### Delete payment link - [DELETE /payment-links](https://docs.vyafac.com/openapi/paymentlinks/deletepaymentlink.md): Delete one or more payment links. ### Get payment link - [GET /payment-links/{id}](https://docs.vyafac.com/openapi/paymentlinks/getpaymentlink.md): Retrieve details of a payment link. ### Update payment link - [PATCH /payment-links/{id}](https://docs.vyafac.com/openapi/paymentlinks/updatepaymentlink.md): Update an existing payment link. ## PaymentLinkItems Manage specific items associated with payment links, including their details, pricing, and configurations for seamless checkout experiences. ### List payment link items - [GET /payment-links/{linkId}/items](https://docs.vyafac.com/openapi/paymentlinkitems/listpaymentlinkitems.md): List items for a specific payment link. ### Create payment link item - [POST /payment-links/{linkId}/items](https://docs.vyafac.com/openapi/paymentlinkitems/createpaymentlinkitem.md): Create a new item for a payment link. ### Get payment link item - [GET /payment-links/{linkId}/items/{itemId}](https://docs.vyafac.com/openapi/paymentlinkitems/getpaymentlinkitem.md): Retrieve details of a payment link item. ### Update payment link item - [PATCH /payment-links/{linkId}/items/{itemId}](https://docs.vyafac.com/openapi/paymentlinkitems/updatepaymentlinkitem.md): Update an existing payment link item. ### Delete payment link item - [DELETE /payment-links/{linkId}/items/{itemId}](https://docs.vyafac.com/openapi/paymentlinkitems/deletepaymentlinkitem.md): Delete a payment link item. ## Calculate Taxes Endpoints related to calculating and retrieving tax information. ### Tax codes - [GET /taxes/codes](https://docs.vyafac.com/openapi/calculate-taxes/gettaxcodes.md): Retrieve a list of available tax codes, including their names and descriptions. These tax codes can be used to classify products or services for automated tax calculation. ### Calculate tax - [POST /taxes/calculate](https://docs.vyafac.com/openapi/calculate-taxes/calculatetax.md): Calculate tax based on the provided location, product details, and amount. Note: - The to_state field is required for validating the postal code. - The tax is calculated using the provided to_country, to_postal_code, to_state, to_city, tax_code, product_type, and amount fields. - The response returns tax details such as rate, subtotal, tax amount, total amount, and applicable region information.