Skip to content

VyaFac API (1.0.0)

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.

Download OpenAPI description
Languages
Servers
Mock server

https://docs.vyafac.com/_mock/openapi/

Products

Manage and retrieve product details, create new products, update existing ones, and remove products from the system.

Operations

PricingOptions

Define and manage pricing options, including discounts, offers, and different pricing tiers for products and services.

Operations

Customers

Manage customer accounts, retrieve customer details, and handle customer-related operations such as creation, updates, and deletions.

Operations

PaymentMethods

Handle the configuration and management of different payment methods, including credit cards, PayPal, and other online payment systems.

Operations

Subscriptions

Manage and retrieve subscription details, create new subscriptions, update existing ones, and handle cancellations or renewals.

Operations

Request

Fetch a paginated list of subscriptions with optional filters like date, email, search query and limit.

Security
BearerAuth
Query
datestring(date)

Filter subscriptions created on a specific date.

Example: date=2024-12-06
emailstring(date)

Filter subscriptions based on customer email.

Example: email=2024-12-06
querystring

Search for subscriptions by customer name or description, and products.

Example: query=Christie
limitinteger

Limit the number of results per page.

Default 100
Example: limit=100
Headers
Acceptstringrequired

The response format must be JSON.

Example: application/json
curl -i -X GET \
  'https://docs.vyafac.com/_mock/openapi/subscriptions?date=2024-12-06&email=2024-12-06&query=Christie&limit=100' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

A list of subscriptions retrieved successfully.

Bodyapplication/json
Response
application/json
{ "status": "success", "message": "Products retrieved successfully!", "meta": { "total": 5, "per_page": 100, "current_page": 1, "last_page": 1, "next_page_url": null, "prev_page_url": null }, "data": [ { … } ], "errors": [], "code": 200, "timestamp": "2025-02-27T11:20:47+00:00", "version": "1.0.0" }

Request

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.
Security
BearerAuth
Headers
Acceptstringrequired

The response format must be JSON.

Example: application/json
Bodyapplication/jsonrequired
curl -i -X POST \
  https://docs.vyafac.com/_mock/openapi/subscriptions \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "customer_id": "cus_kUdHjYwiUSXnbXfqTgKN0rh0",
    "trial_days": 10,
    "collect_automated_tax": true,
    "coupon_code": null,
    "products": [
      {
        "product_id": "pro_mUMe9iAzjoEm5GgArWL3lIG0",
        "pricing_option_id": "price_ZGhjedgcbI0lE9B1nQH5k234",
        "quantity": 5,
        "automated_tax": 6
      }
    ],
    "starts_at": "2025-02-25",
    "ends_at": "2025-12-30"
  }'

Responses

Subscription created successfully.

Bodyapplication/json
Response
application/json
{ "status": "success", "message": "Subscription created successfully!", "meta": null, "data": { "id": "sub_MezhDcoPLVAC8zjHMFhlB5mB", "status": "trialing", "total_value": 234, "cycle_start_date": null, "cancels_at": null, "items": [ … ], "created_at": "2025-02-28T06:11:46.000000Z", "updated_at": "2025-02-28T06:11:46.000000Z" }, "errors": [], "code": 200, "timestamp": "2025-02-28T06:11:46+00:00", "version": "1.0.0" }

Request

Update details of a subscription.

Security
BearerAuth
Path
idstringrequired

Unique identifier of the subscription.

Example: sub_EsrjpTa0yPenKvOq58wp5WKM
Headers
Acceptstringrequired

The response format must be JSON.

Example: application/json
Bodyapplication/json
curl -i -X PATCH \
  https://docs.vyafac.com/_mock/openapi/subscriptions/sub_EsrjpTa0yPenKvOq58wp5WKM \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "cancels_at": "2027-12-17"
  }'

Responses

Subscription updated successfully!

Bodyapplication/json
Response
application/json
{ "status": "success", "message": "Subscription updated successfully!", "meta": null, "data": { "id": "sub_MezhDcoPLVAC8zjHMFhlB5mB", "status": "trialing", "total_value": 234, "cycle_start_date": null, "cancels_at": "2027-12-17", "items": [ … ], "created_at": "2025-02-28T06:11:46.000000Z", "updated_at": "2025-02-28T06:24:56.000000Z" }, "errors": [], "code": 200, "timestamp": "2025-02-28T06:24:56+00:00", "version": "1.0.0" }

Request

Fetch detailed information about a subscription using its unique identifier.

Security
BearerAuth
Path
idstringrequired

Unique identifier of the subscription.

Example: sub_EsrjpTa0yPenKvOq58wp5WKM
Headers
Acceptstringrequired

The response format must be JSON.

Example: application/json
curl -i -X GET \
  https://docs.vyafac.com/_mock/openapi/subscriptions/sub_EsrjpTa0yPenKvOq58wp5WKM \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Subscription details retrieved successfully.

Bodyapplication/json
Response
application/json
{ "status": "success", "message": "Subscription details retrieved!", "meta": null, "data": { "id": "sub_MezhDcoPLVAC8zjHMFhlB5mB", "status": "trialing", "total_value": 234, "cycle_start_date": null, "cancels_at": "2027-12-17", "items": [ … ], "created_at": "2025-02-28T06:11:46.000000Z", "updated_at": "2025-02-28T06:24:56.000000Z" }, "errors": [], "code": 200, "timestamp": "2025-02-28T06:24:56+00:00", "version": "1.0.0" }

Request

Cancel a subscription

Security
BearerAuth
Path
idstringrequired

Unique identifier of the subscription.

Example: sub_EsrjpTa0yPenKvOq58wp5WKM
Headers
Acceptstringrequired

The response format must be JSON.

Example: application/json
curl -i -X DELETE \
  https://docs.vyafac.com/_mock/openapi/subscriptions/sub_EsrjpTa0yPenKvOq58wp5WKM \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Subscription cancelled successfully.

Bodyapplication/json
Response
application/json
{ "status": "success", "message": "Subscription cancelled successfully!", "meta": null, "data": null, "errors": [], "code": 200, "timestamp": "2025-02-28T06:28:32+00:00", "version": "1.0.0" }

Subscription details excluding one-off products

Request

Fetch detailed information about a subscription using its unique identifier. This endpoint returns the subscription details excluding any one-off products.

Security
BearerAuth
Path
idstringrequired

Unique identifier of the subscription.

Example: sub_EsrjpTa0yPenKvOq58wp5WKM
Headers
Acceptstringrequired

The response format must be JSON.

Example: application/json
curl -i -X GET \
  https://docs.vyafac.com/_mock/openapi/subscriptions/sub_EsrjpTa0yPenKvOq58wp5WKM/without-one-off \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Subscription details retrieved successfully.

Bodyapplication/json
Response
application/json
{ "status": "success", "message": "Subscription details retrieved!", "meta": null, "data": { "id": "sub_MezhDcoPLVAC8zjHMFhlB5mB", "status": "trialing", "total_value": 234, "cycle_start_date": null, "cancels_at": "2027-12-17", "items": [ … ], "created_at": "2025-02-28T06:11:46.000000Z", "updated_at": "2025-02-28T06:24:56.000000Z" }, "errors": [], "code": 200, "timestamp": "2025-02-28T06:24:56+00:00", "version": "1.0.0" }

SubscriptionItems

Define and manage items within a subscription, including adding, updating, or removing items linked to an active subscription.

Operations

PaymentLinkItems

Manage specific items associated with payment links, including their details, pricing, and configurations for seamless checkout experiences.

Operations

Calculate Taxes

Endpoints related to calculating and retrieving tax information.

Operations