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.
VyaFac API (1.0.0)
Download OpenAPI description
Languages
Servers
Mock server
https://docs.vyafac.com/_mock/openapi/
- Mock server
https://docs.vyafac.com/_mock/openapi/customers
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
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>'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
- Mock server
https://docs.vyafac.com/_mock/openapi/customers
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
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"
}
}
}'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" }
- Mock server
https://docs.vyafac.com/_mock/openapi/customers/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
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"
}'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" }
- Mock server
https://docs.vyafac.com/_mock/openapi/customers/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
https://docs.vyafac.com/_mock/openapi/customers/cus_EsrjpTa0yPenKvOq58wp5WKM \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'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" }
- Mock server
https://docs.vyafac.com/_mock/openapi/customers/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
https://docs.vyafac.com/_mock/openapi/customers/cus_EsrjpTa0yPenKvOq58wp5WKM \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'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" }