Payvala

Assistant

Payvala Assistant

Suggestions

Press Enter to send ยท Shift+Enter for new line

Versioning Overview

An API version is a stable contract between your integration and Payvala. It defines how requests must be structured, how responses are shaped, which validation rules are enforced, and how each resource behaves. As long as your integration stays on a given version, that contract does not change in ways that would break your code.

Versioning exists because payment integrations are long-lived and operationally sensitive. A change to a field type, a new required parameter, or a stricter validation rule can cause failed payments, broken reconciliation, or rejected webhooks in production. Versions let Payvala evolve the platform while you decide when to adopt changes that affect your integration.

Each version covers the following parts of the contract:

Request formats

Endpoint paths, HTTP methods, required and optional parameters, and accepted data types.

Response structures

Field names, field types, nesting, and the shape of lists, errors, and pagination.

Validation rules

Accepted value ranges, formats, and the error codes returned for invalid input.

API behavior

Resource state transitions, idempotency semantics, and the side effects of each operation.

Scope of this pageThis page describes versioning concepts and the recommended upgrade process. Values shown as <API_VERSION>, <BASE_URL>, <DEPRECATION_DATE>, <SUNSET_DATE>, and <RECOMMENDED_VERSION> are placeholders and must be replaced with confirmed Payvala values before publication.

How API Versioning Works

Every API request is evaluated against a specific API version. The version determines which request schema is validated, which response schema is returned, and which behavior rules are applied. Two integrations calling the same endpoint on different versions can receive differently shaped responses.

The version is selected by the client on each request. Common mechanisms in REST APIs include a request header, a URL path segment, or an account-level default. The exact mechanism for Payvala must be confirmed and documented here. The examples below use placeholders and do not represent a confirmed Payvala implementation.

In general, version selection follows this order: the version supplied on the request is used if present; otherwise, a configured default for the account applies, if one exists. Explicitly setting the version on every request is recommended so that behavior never depends on implicit defaults.

Example: version specified in a request header (placeholder)

Illustrative only. Replace the header name, base URL, and path with Payvala's confirmed values.

bash
curl -X POST "<BASE_URL>/payments" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -H "<VERSION_HEADER_NAME>: <API_VERSION>" \
  -d '{
    "amount": 1000,
    "currency": "INR",
    "reference": "order_10045"
  }'

Example: version specified in the URL path (placeholder)

Illustrative alternative. Use only if Payvala confirms path-based versioning.

bash
curl -X POST "<BASE_URL>/<API_VERSION>/payments" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 1000,
    "currency": "INR",
    "reference": "order_10045"
  }'

Example: centralizing the version in client configuration

Keep the version in one place so it is applied consistently to every request.

typescript
const PAYVALA_CONFIG = {
  baseUrl: "<BASE_URL>",
  apiVersion: "<API_VERSION>",
};

async function payvalaRequest(path: string, body: unknown) {
  const response = await fetch(PAYVALA_CONFIG.baseUrl + path, {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + process.env.PAYVALA_API_KEY,
      "Content-Type": "application/json",
      "<VERSION_HEADER_NAME>": PAYVALA_CONFIG.apiVersion,
    },
    body: JSON.stringify(body),
  });
  return response.json();
}
Replace before publishingThe version mechanism (header, path, or account default), the header name, and the base URL are not confirmed in the source material. Replace <BASE_URL>, <VERSION_HEADER_NAME>, and <API_VERSION> with Payvala's confirmed implementation, and remove the example that does not apply.

Version Format

A version identifier is the string your integration sends to select an API version. APIs typically use one of two formats. The format Payvala uses must be confirmed; both are shown here for explanation only.

With major-version identifiers (for example v1 or v2), a new identifier is issued only when breaking changes are introduced. Non-breaking changes are added to the existing version without changing the identifier.

With date-based identifiers (for example 2026-01 or 2026-07), each identifier marks the point in time at which the API contract was fixed. A new identifier is released when breaking changes are introduced, and the date indicates which contract applies.

Common version identifier formats (illustrative)

FormatExampleMeaningTypical use
Major versionv1, v2Incremented when a breaking change is releasedPath-based versioning
Date-based version2026-01, 2026-07Date on which the contract was fixedHeader-based versioning
Payvala format<API_VERSION>To be confirmed by PayvalaTo be confirmed by Payvala

Storing the version identifier in configuration

Store the identifier as an explicit configuration value, separate from application code.

json
{
  "payvala": {
    "baseUrl": "<BASE_URL>",
    "apiVersion": "<API_VERSION>",
    "environment": "sandbox"
  }
}

What to store and configure

  • The full version identifier exactly as documented, without modification
  • The version as a configuration value, not a hard-coded string in multiple files
  • A separate version value per environment (Sandbox and Production) during upgrades
  • The version used by each deployed service, recorded in your integration documentation

Choosing an API Version

The version you should use depends on the state of your integration and the lifecycle status of the version. Use the table below to decide.

Version selection guide

SituationRecommended actionNotes
New integrationUse <RECOMMENDED_VERSION>Always start on the recommended supported version. Never start on a deprecated version.
Existing integration on a supported versionStay on the current version until a migration is required or beneficialReview the changelog periodically. Upgrading is not required while the version remains supported.
Existing integration on a deprecated versionPlan and schedule migration to a supported versionDeprecated versions still work but will reach sunset on <SUNSET_DATE>.
Integration on a sunset or retired versionMigrate immediatelyRequests may be rejected or behave unpredictably.

Version status reference

Version typeDescriptionUse for new integrations
RecommendedThe version Payvala advises for all new work: <RECOMMENDED_VERSION>Yes
SupportedFully maintained and safe to use in productionYes, if the recommended version is not suitable
DeprecatedStill functional, scheduled for sunset on <SUNSET_DATE>No
Finding the recommended versionThe recommended version and the list of supported versions are published in the Version Change History section. Replace <RECOMMENDED_VERSION> with the confirmed value.

API Compatibility

Backward compatibility means that an integration written against a version continues to work when Payvala releases changes within that same version. Payvala may add capabilities to a version without notice, provided existing requests and responses continue to behave as documented.

Compatibility depends on how your code consumes the API. A new optional response field is compatible only if your client ignores fields it does not recognize. Clients that use strict schema validation or fail on unknown properties may break on changes that are compatible by design.

The table below classifies common changes. 'Usually No' means migration is normally unnecessary but your client should be verified against the change.

Change compatibility

Change TypeCompatibilityMigration Required
Add optional response fieldCompatibleUsually No
Add new endpointCompatibleNo
Add optional request parameterCompatibleNo
Add new enum value to a response fieldPotentially breaking for strict clientsUsually No, verify handling of unknown values
Add new webhook event typeCompatibleUsually No, ensure unknown events are ignored
Remove response fieldBreakingYes
Rename response fieldBreakingYes
Change required parameterBreakingYes
Change field typeBreakingYes
Tighten validation rulesBreakingYes
Change authentication requirementsBreakingYes
Write tolerant clientsIgnore unknown response fields, treat unknown enum values as a safe default, and do not depend on field order. This keeps compatible changes from affecting your integration.

Breaking Changes

A breaking change is any change that can cause a correctly written integration on a previous version to fail or behave incorrectly. Breaking changes are released only in a new API version and are never applied to a version you are already using.

The following categories are treated as breaking: removed fields, renamed fields, changed field types, new required parameters, changed validation rules, changed response structures, changed authentication requirements, and changed resource behavior.

Changed response structure and field type

A scalar field becomes an object. Previous response:

json
{
  "id": "pay_123",
  "amount": 1000
}

New response

Code that reads amount as a number now receives an object.

json
{
  "id": "pay_123",
  "amount": {
    "value": 1000,
    "currency": "INR"
  }
}

Renamed field

Before and after. Code reading customer_ref receives undefined after the rename.

json
// Before
{ "customer_ref": "cus_88" }

// After
{ "customer_id": "cus_88" }

New required parameter

A request that was valid before is rejected because the new parameter is missing.

json
// Before: valid request
{
  "amount": 1000,
  "currency": "INR"
}

// After: reference is now required
{
  "amount": 1000,
  "currency": "INR",
  "reference": "order_10045"
}

Tightened validation

A value previously accepted now fails validation.

json
// Before: reference up to 255 characters accepted
// After:  reference limited to 40 characters

// Request that is now rejected
{
  "reference": "a-very-long-order-reference-that-exceeds-the-new-limit-0001"
}

Why each category is breaking

CategoryWhy it breaks integrations
Removed fieldsCode that reads the field receives no value, which can cause null errors or incorrect business logic.
Renamed fieldsEquivalent to removing the old field and adding a new one. Existing parsing no longer finds the data.
Changed field typesDeserialization can fail, and numeric or string comparisons produce wrong results.
New required parametersPreviously valid requests are rejected until the parameter is supplied.
Changed validation rulesInputs that were accepted may now be rejected, often only for specific data in production.
Changed response structuresNested or restructured data invalidates parsers, mappers, and stored schemas.
Changed authentication requirementsExisting credentials or signing methods may no longer be accepted.
Changed resource behaviorStatus transitions, timing, or side effects differ, which can break reconciliation and retry logic.

Version Lifecycle

Every API version moves through a defined lifecycle: Current, Supported, Deprecated, Sunset, and Retired. The status of each version is published in the Version Change History.

  1. Current

    The latest released version and the one recommended for new integrations.

    What to do: Use for new integrations. Adopt new capabilities as needed.

  2. Supported

    A previous version that remains fully maintained, with security and critical fixes.

    What to do: Continue using. Review the changelog and plan an upgrade at a convenient time.

  3. Deprecated

    The version still works but is scheduled for removal on <SUNSET_DATE>. No new features are added.

    What to do: Begin migration planning immediately. Do not start new integrations on this version.

  4. Sunset

    The version has reached its end-of-life date. Requests may be restricted or rejected.

    What to do: Complete migration. Production traffic on this version is at risk.

  5. Retired

    The version is permanently removed and no longer served.

    What to do: No action possible on this version. Requests will fail.

Lifecycle summary

StatusMeaningDeveloper action
CurrentLatest version, recommendedUse for new integrations
SupportedMaintained, safe for productionContinue; plan upgrades
DeprecatedScheduled for sunset on <SUNSET_DATE>Migrate to <RECOMMENDED_VERSION>
SunsetEnd-of-life reachedMigrate immediately
RetiredRemovedNot available
Confirm lifecycle policyStage definitions and the behavior of each stage must be confirmed by Payvala. The definitions above describe a standard lifecycle model and are not a statement of Payvala's confirmed policy.

Upgrading Your Integration

Upgrading is a planned change, not a configuration toggle. Follow this workflow to reduce risk and keep production stable.

1

Review version changes

Read the changelog for every version between your current version and the target. Note each change and its migration requirement.

2

Identify breaking changes

List the breaking changes that affect endpoints, fields, and webhooks your integration actually uses. Ignore changes to features you do not use.

3

Update API requests

Adjust request payloads, add new required parameters, and update authentication where the new version requires it. Set <API_VERSION> to the target version.

4

Update response handling

Change parsers, data models, and mappers to match the new response structures and field types. Update stored schemas if you persist responses.

5

Run tests

Run unit and integration tests against the new request and response shapes. Add tests for each breaking change you identified.

6

Test in Sandbox

Point a non-production environment at the Sandbox using the new version. Exercise every endpoint and webhook your integration depends on.

7

Validate business flows

Verify end-to-end flows such as payment creation, confirmation, refund, and reconciliation. Confirm that amounts, statuses, and reports match expectations.

8

Deploy to Production

Release the change using your standard deployment process. Prefer a gradual rollout and keep the previous version configuration available for rollback.

9

Monitor after deployment

Watch error rates, validation failures, webhook processing, and reconciliation results. Be prepared to roll back if anomalies appear.

Version Migration Guide

This guide walks through a migration from your current version to a target version. Migration follows this sequence: Current Version, Review Changelog, Compare API Contracts, Identify Breaking Changes, Update Code, Run Tests, Sandbox Validation, Production Migration.

1

Confirm your current version

Check configuration and recent request logs to confirm the version in use. Do not assume; verify in each service that calls Payvala.

2

Review the changelog

Read all entries between your current version and <RECOMMENDED_VERSION> in the Version Change History.

3

Compare API contracts

Compare request and response schemas for each endpoint you use. Record differences in fields, types, validation, and behavior.

4

Identify breaking changes

Map each difference to the code that depends on it and classify it as breaking or compatible.

5

Update code

Implement the changes shown in the examples below, then change the configured version to <API_VERSION>.

6

Run tests

Run the full automated suite and add regression tests for changed behavior.

7

Validate in Sandbox

Run realistic end-to-end scenarios in the Sandbox using the target version.

8

Migrate Production

Deploy with a rollback plan and monitor closely.

Before: request and response on the current version (example data)

Illustrative example. Field names and structures are not confirmed Payvala behavior.

json
// Request
POST <BASE_URL>/payments
<VERSION_HEADER_NAME>: <CURRENT_VERSION>

{
  "amount": 1000,
  "currency": "INR"
}

// Response
{
  "id": "pay_123",
  "status": "created",
  "amount": 1000
}

After: request and response on the target version (example data)

Illustrative example. A new required field is added and the response structure changes.

json
// Request
POST <BASE_URL>/payments
<VERSION_HEADER_NAME>: <API_VERSION>

{
  "amount": 1000,
  "currency": "INR",
  "reference": "order_10045"
}

// Response
{
  "id": "pay_123",
  "status": "created",
  "amount": {
    "value": 1000,
    "currency": "INR"
  }
}

Updating response handling

Update parsing to read the new structure. Remove the old handling once migration is complete.

typescript
// Before
const amount: number = payment.amount;

// After
const amount: number = payment.amount.value;
const currency: string = payment.amount.currency;

Migration checklist

  • Current version confirmed in all services and environments
  • Changelog reviewed for every version up to the target
  • API contracts compared for every endpoint in use
  • Breaking changes identified and mapped to code
  • Request payloads updated, including new required parameters
  • Response parsers and data models updated
  • Webhook handlers verified against the new payloads
  • Automated tests updated and passing
  • Sandbox validation completed for all business flows
  • Reconciliation and reporting verified
  • Rollback plan documented and tested
  • Production deployment scheduled with monitoring in place
  • Version used by the integration recorded in internal documentation

Deprecation & Sunset Policy

Deprecation and sunset communicate when a version will stop working. Understanding the difference helps you plan migration before production is affected.

Status definitions

StatusBehaviorKey date
SupportedFully functional and maintainedNone
DeprecatedFunctional, but no new features and scheduled for removal<DEPRECATION_DATE>
SunsetEnd-of-life reached; requests may be restricted or rejected<SUNSET_DATE>
RetiredPermanently removedConfirmed by Payvala

After receiving a deprecation notice

  • Identify every service and environment using the deprecated version
  • Review the changelog and migration requirements for <RECOMMENDED_VERSION>
  • Assign an owner and schedule the migration
  • Complete testing in Sandbox well before <SUNSET_DATE>
  • Deploy to Production and confirm no traffic remains on the deprecated version
Migration windowDevelopers should be given a documented migration period between <DEPRECATION_DATE> and <SUNSET_DATE>. The exact duration must be confirmed by Payvala and stated here. Start migration as early as possible rather than waiting for the sunset date.
Why new integrations should avoid deprecated versionsA new integration on a deprecated version inherits an immediate migration obligation, receives no new capabilities, and will need rework before sunset. Always use <RECOMMENDED_VERSION> for new work.

Version Change History

Review the change history before upgrading. Each entry lists the release status, the date, a summary of changes, and whether migration is required.

Version history (EXAMPLE DATA, NOT REAL PAYVALA INFORMATION)

VersionStatusRelease DateChangesMigration Required
<VERSION_A>Current<RELEASE_DATE_A>Example: restructured amount field in payment responses; added required reference parameterYes
<VERSION_B>Supported<RELEASE_DATE_B>Example: added optional metadata field; added new endpointNo
<VERSION_C>Deprecated<RELEASE_DATE_C>Example: renamed customer reference field; tightened validation on referenceYes
<VERSION_D>Sunset<RELEASE_DATE_D>Example: initial releaseYes

Versioning Best Practices

Recommended practices

  • Always use a supported version. Never build new integrations on a deprecated version.
  • Keep version configuration explicit. Send the version on every request rather than relying on defaults.
  • Do not rely on undocumented behavior. Use only fields, formats, and behavior described in the documentation.
  • Review changelogs before upgrades, covering every version between your current and target version.
  • Test before Production. Validate in Sandbox, including webhooks and error paths.
  • Handle response changes safely. Ignore unknown fields and handle unknown enum values gracefully.
  • Monitor deprecation notices. Assign an owner to track announcements and dates.
  • Plan migrations early. Begin work as soon as a version is deprecated.
  • Document the version used by the integration, per service and per environment.
  • Keep rollback plans for major upgrades, including the ability to restore the previous version configuration.

Plan your next upgrade

Test version changes in the Sandbox before moving to Production.

Secure. Reliable. Scalable.

Payvala is built with enterprise-grade security, 99.9% uptime, and scalable infrastructure.