The VNSwitch API lets your systems accept payments, refund them, save payment methods, charge customers on a schedule, send payouts and handle disputes through one integration. VNSwitch routes each request to the payment providers enabled for your account, so your code stays the same when providers change.

This documentation is for developers who connect their own platform to VNSwitch. It covers the public API (version 1) only.

The API follows REST conventions:

  • Request and response bodies are JSON (UTF-8). Send Content-Type: application/json.
  • Every request is authenticated with a key in the api-key header. See Authentication.
  • Amounts are integers in the currency’s smallest unit. VND has none: 150000 is 150,000 VND. See Amounts and currencies.
  • Errors use HTTP status codes and a JSON error body. See Errors.
  • Results that arrive later (for example a bank confirming a payment) are sent to you as Webhooks.

How to read these docs

Prose is in the middle column. Code examples are on the right (below the text on small screens). Choose cURL, Node.js, Python or Java with the tabs at the top: every example on the page switches to that language.

Values in angle brackets, such as <YOUR_API_KEY>, are placeholders. Replace them with your own values. The examples use the same customer, amounts and IDs throughout, so you can follow them in order.

New to VNSwitch? Start with the Quick start: a sandbox payment and a verified webhook in about 15 minutes.

Getting help

Email with your merchant ID, the payment_id or refund_id involved, and the time of the request. Never send API keys or full card numbers by email.