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

Request

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

Security
BearerAuth
Query
datestring(date)

Filter customers created on a specific date.

Example: date=2024-12-06
querystring

Search for customers by name or description.

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/customers?date=2024-12-06&query=Christie&limit=100' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

A list of customers retrieved successfully.

Bodyapplication/json
Response
application/json
{ "status": "success", "message": "Customers 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

Creates a new customer with an attached payment method (card). For more information about card handling, see Card Handling.

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/customers \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Christina James",
    "email": "christinaJames@example.com",
    "description": "A returnig customer.",
    "phone": "5321689543",
    "payment_method": {
      "default": 1,
      "card": {
        "token": "supt_os8eyf8ewyro34jkmn",
        "last_four": "1111",
        "exp_month": "12",
        "exp-year": "2030"
      },
      "address": {
        "card_holder_name": "Christine Yii",
        "country": "US",
        "address_line_1": "6860 Dallas Pkwy",
        "zip_code": "75024",
        "state": "Michigan",
        "city": "Detroit"
      }
    }
  }'

Responses

Customer created successfully.

Bodyapplication/json
Response
application/json
{ "status": "success", "message": "Customer created successfully!", "meta": null, "data": { "id": "cus_ol9lb3ffbefnPufmXgGxtF94", "name": "Beatrice Rogahn", "email": "Rusty.Willms@yahoo.com", "description": "Quam explicabo culpa labore nostrum.", "phone": "5321689543", "payment_methods": [ … ], "created_at": "2025-02-28T05:07:00.000000Z", "updated_at": "2025-02-28T05:07:00.000000Z" }, "errors": [], "code": 201, "timestamp": "2025-02-28T05:07:02+00:00", "version": "1.0.0" }

Request

Update details of a customer.

Security
BearerAuth
Path
idstringrequired

Unique identifier of the product.

Example: cus_EsrjpTa0yPenKvOq58wp5WKM
Headers
Acceptstringrequired

The response format must be JSON.

Example: application/json
Bodyapplication/json
curl -i -X PATCH \
  https://docs.vyafac.com/_mock/openapi/customers/cus_EsrjpTa0yPenKvOq58wp5WKM \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "New customer name",
    "email": "updated.email@hotmail.com",
    "description": "Updated description",
    "phone": "352164859653"
  }'

Responses

Customer updated successfully!

Bodyapplication/json
Response
application/json
{ "status": "success", "message": "Customer updated successfully!", "meta": null, "data": { "id": "cus_3UaLAQ5rw5gjT9l7sX0CbZMq", "name": "Updated name", "email": "updated.email@hotmail.com", "description": "aksgdkjhasjdhjhasjd", "phone": "352164859653", "payment_methods": [ … ], "created_at": "2025-02-25T10:11:00.000000Z", "updated_at": "2025-02-28T05:16:50.000000Z" }, "errors": [], "code": 200, "timestamp": "2025-02-28T05:16:50+00:00", "version": "1.0.0" }

Request

Fetch detailed information about a customer using its unique identifier.

Security
BearerAuth
Path
idstringrequired

Unique identifier of the product.

Example: cus_EsrjpTa0yPenKvOq58wp5WKM
Headers
Acceptstringrequired

The response format must be JSON.

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

Responses

Product details retrieved successfully.

Bodyapplication/json
Response
application/json
{ "status": "success", "message": "Customer retrieved successfully!", "meta": null, "data": { "id": "cus_3UaLAQ5rw5gjT9l7sX0CbZMq", "name": "Chritina James", "email": "updated.email@hotmail.com", "description": "aksgdkjhasjdhjhasjd", "phone": "352164859653", "payment_methods": [ … ], "created_at": "2025-02-25T10:11:00.000000Z", "updated_at": "2025-02-28T05:16:50.000000Z" }, "errors": [], "code": 200, "timestamp": "2025-02-28T05:20:19+00:00", "version": "1.0.0" }

Request

Delete a customer from the system

Security
BearerAuth
Path
idstringrequired

Unique identifier of the product.

Example: cus_EsrjpTa0yPenKvOq58wp5WKM
Headers
Acceptstringrequired

The response format must be JSON.

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

Responses

Customer deleted successfully.

Bodyapplication/json
Response
application/json
{ "status": "success", "message": "Customer(s) deleted successfully!", "meta": null, "data": null, "errors": [], "code": 200, "timestamp": "2025-02-28T05:21:47+00:00", "version": "1.0.0" }

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

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