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

Request

Retrieve all payment methods for a specific customer.

Security
BearerAuth
Path
customer_idstringrequired
Query
limitinteger
Default 250
Headers
Acceptstringrequired
Example: application/json
curl -i -X GET \
  'https://docs.vyafac.com/_mock/openapi/customers/{customer_id}/payment-methods?limit=250' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Payment methods retrieved successfully.

Bodyapplication/json
Response
application/json
{ "status": "success", "message": "Operation successful.", "meta": { "total": 7, "per_page": 100, "current_page": 1, "last_page": 1, "next_page_url": null, "prev_page_url": null }, "data": [ { … }, { … } ], "errors": null, "code": 200, "timestamp": "2025-05-22T06:44:17+00:00", "version": "1.0.0" }

Request

Add a new payment method for a customer.

Security
BearerAuth
Path
customer_idstringrequired
Headers
Acceptstringrequired
Example: application/json
Bodyapplication/jsonrequired
curl -i -X POST \
  'https://docs.vyafac.com/_mock/openapi/customers/{customer_id}/payment-methods' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "default": false,
    "card": {
      "token": "supt_cn9r834cr9m83xjr34x",
      "last_four": "0032",
      "exp_month": "12",
      "exp_year": "2030"
    },
    "address": {
      "card_holder_name": "Usman Zahid",
      "country": "US",
      "address_line_1": "6860 Dallas Pkwy",
      "zip_code": "75024",
      "state": "New York",
      "city": "New York"
    }
  }'

Responses

Payment method created successfully.

Bodyapplication/json
Response
application/json
{ "status": "success", "message": "Payment Method created successfully!", "meta": null, "data": { "id": "pm_PZJX52RIDP8lP4c8WVyz5H0E", "default": false, "card_last_four": "1111", "type": "MC", "expiry_month": "12", "expiry_year": "2030", "created_at": "2025-05-22T06:47:30+00:00", "updated_at": "2025-05-22T06:47:30+00:00" }, "errors": null, "code": 200, "timestamp": "2025-05-22T06:47:30+00:00", "version": "1.0.0" }

Update a customer’s payment method

Request

Update a specific payment method.

Security
BearerAuth
Path
customer_idstringrequired
idstringrequired
Headers
Acceptstringrequired
Example: application/json
Bodyapplication/jsonrequired
curl -i -X PATCH \
  'https://docs.vyafac.com/_mock/openapi/customers/{customer_id}/payment-methods/{id}' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "default": true
  }'

Responses

Payment method updated successfully.

Bodyapplication/json
Response
application/json
{ "status": "success", "message": "Payment Method updated successfully!", "meta": null, "data": null, "errors": null, "code": 200, "timestamp": "2025-05-22T06:32:24+00:00", "version": "1.0.0" }

Delete a customer’s payment method

Request

Remove a specific payment method.

Security
BearerAuth
Path
customer_idstringrequired
idstringrequired
Headers
Acceptstringrequired
Example: application/json
curl -i -X DELETE \
  'https://docs.vyafac.com/_mock/openapi/customers/{customer_id}/payment-methods/{id}' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Payment method deleted successfully.

Bodyapplication/json
Response
application/json
{ "status": "success", "message": "Payment Method deleted successfully!", "meta": null, "data": null, "errors": null, "code": 200, "timestamp": "2025-05-22T06:47:45+00:00", "version": "1.0.0" }

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