Skip to content

Conversation

AnuthaDev
Copy link
Contributor

@AnuthaDev AnuthaDev commented Jul 13, 2025

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

  • Consistently use kebab case in endpoint URLs
  • Use plural form of resources in URLs, i.e. instead of /v2/organization, use /v2/organizations

Renamed (current version removed) endpoints:
/v2/organization -> /v2/organizations
/v2/routing-algorithm -> /v2/routing-algorithms
/v2/payment-methods-session -> /v2/payment-method-sessions
(refunds) /update_metadata -> update-metadata

Duplicated (current version not removed) endpoints:

/v2/user -> /v2/users
/create_merchant -> /create-merchant
/v2/process_tracker/revenue_recovery_workflow -> /v2/process-trackers/revenue-recovery-workflow
/list_attempts -> /list-attempts

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Closes #8629

How did you test it?

  1. Organization

Request:

curl --location 'http://localhost:8080/v2/organizations' \
--header 'Authorization: admin-api-key=test_admin' \
--header 'Content-Type: application/json' \
--data '{
    "organization_name": "v2_org_1752571446"
}'

Response:

{
    "id": "org_4YoqpRWuOelFCr7Lbh2l",
    "organization_name": "v2_org_1752571419",
    "organization_details": null,
    "metadata": null,
    "modified_at": "2025-07-15 09:23:39.045598",
    "created_at": "2025-07-15 09:23:39.045496"
}
  1. Payment Method Sessions:

Request:

curl --location 'http://localhost:8080/v2/payment-method-sessions' \
--header 'x-profile-id: pro_k5m9OvIbAwRr29ZJrZFN' \
--header 'Authorization: api-key=dev_e0A7pdYme3jeCbLscKnTIXBci4IcuiixFCwaN0H3usrmeVSkKcn5r701nisZsvZc' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_e0A7pdYme3jeCbLscKnTIXBci4IcuiixFCwaN0H3usrmeVSkKcn5r701nisZsvZc' \
--data-raw '{
    "customer_id": "12345_cus_01980d66d85c78f28c2f25980c48a60b",
     "billing": {
        "address": {
            "first_name": "John",
            "last_name": "Dough"
        },
        "email": "[email protected]"
    }
}'

Response:

{
    "id": "12345_pms_01980d66e6ab715093173e3078818fc5",
    "customer_id": "12345_cus_01980d66d85c78f28c2f25980c48a60b",
    "billing": {
        "address": {
            "city": null,
            "country": null,
            "line1": null,
            "line2": null,
            "line3": null,
            "zip": null,
            "state": null,
            "first_name": "John",
            "last_name": "Dough"
        },
        "phone": null,
        "email": "[email protected]"
    },
    "psp_tokenization": null,
    "network_tokenization": null,
    "tokenization_data": null,
    "expires_at": "2025-07-15T09:40:04.299Z",
    "client_secret": "cs_01980d66e6ab715093173e43f85db63a",
    "return_url": null,
    "next_action": null,
    "authentication_details": null,
    "associated_payment_methods": null,
    "associated_token_id": null
}

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@AnuthaDev AnuthaDev added this to the July 2025 Release milestone Jul 13, 2025
@AnuthaDev AnuthaDev self-assigned this Jul 13, 2025
@AnuthaDev AnuthaDev added A-core Area: Core flows api-v2 labels Jul 13, 2025
Copy link

semanticdiff-com bot commented Jul 13, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/routes.rs  86% smaller
  crates/router/src/lib.rs  65% smaller
  api-reference/v2/openapi_spec_v2.json  0% smaller
  api-reference/v2/organization/organization--create.mdx Unsupported file format
  api-reference/v2/organization/organization--merchant-account--list.mdx Unsupported file format
  api-reference/v2/organization/organization--retrieve.mdx Unsupported file format
  api-reference/v2/organization/organization--update.mdx Unsupported file format
  api-reference/v2/payment-method-session/payment-method-session--confirm-a-payment-method-session.mdx Unsupported file format
  api-reference/v2/payment-method-session/payment-method-session--create.mdx Unsupported file format
  api-reference/v2/payment-method-session/payment-method-session--delete-a-saved-payment-method.mdx Unsupported file format
  api-reference/v2/payment-method-session/payment-method-session--list-payment-methods.mdx Unsupported file format
  api-reference/v2/payment-method-session/payment-method-session--retrieve.mdx Unsupported file format
  api-reference/v2/payment-method-session/payment-method-session--update-a-saved-payment-method.mdx Unsupported file format
  api-reference/v2/revenue-recovery/revenue-recovery--retrieve.mdx Unsupported file format
  api-reference/v2/routing/routing--create.mdx Unsupported file format
  api-reference/v2/routing/routing--retrieve.mdx Unsupported file format
  crates/hyperswitch_connectors/src/connectors/hyperswitch_vault.rs  0% smaller
  crates/openapi/src/routes/organization.rs  0% smaller
  crates/openapi/src/routes/payment_method.rs  0% smaller
  crates/openapi/src/routes/refunds.rs  0% smaller
  crates/openapi/src/routes/revenue_recovery.rs  0% smaller
  crates/openapi/src/routes/routing.rs  0% smaller
  crates/router/src/routes/app.rs  0% smaller
  cypress-tests-v2/cypress/support/commands.js  0% smaller

@AnuthaDev AnuthaDev marked this pull request as ready for review July 13, 2025 22:14
@AnuthaDev AnuthaDev requested review from a team as code owners July 13, 2025 22:14
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Jul 13, 2025
@AnuthaDev AnuthaDev requested a review from knutties July 14, 2025 09:28
jarnura
jarnura previously approved these changes Jul 15, 2025
Copy link
Contributor

@deepanshu-iiitu deepanshu-iiitu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Connector changes look good

likhinbopanna
likhinbopanna previously approved these changes Jul 16, 2025
prasunna09
prasunna09 previously approved these changes Jul 16, 2025
SanchithHegde
SanchithHegde previously approved these changes Jul 16, 2025
Copy link
Member

@SanchithHegde SanchithHegde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please inform all affected teams about these API changes.

jarnura
jarnura previously approved these changes Jul 17, 2025
@likhinbopanna likhinbopanna added this pull request to the merge queue Jul 18, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jul 18, 2025
)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 18, 2025
@likhinbopanna likhinbopanna added this pull request to the merge queue Jul 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 18, 2025
@likhinbopanna likhinbopanna added this pull request to the merge queue Jul 21, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 21, 2025
@likhinbopanna likhinbopanna enabled auto-merge July 21, 2025 13:31
@likhinbopanna likhinbopanna added this pull request to the merge queue Jul 21, 2025
Merged via the queue into main with commit db14764 Jul 21, 2025
17 of 23 checks passed
@likhinbopanna likhinbopanna deleted the v2-api-fix branch July 21, 2025 15:41
pixincreate added a commit that referenced this pull request Jul 22, 2025
…ordea-sepa

* 'main' of github.com:juspay/hyperswitch:
  refactor(connector): [Adyen] map ssn and session validity for Pix (#8702)
  feat(core): Implement UCS kill switch for emergency fallback (#8651)
  fix(openapi): Added Error Response Schema for Status Code 400 (#8684)
  feat(connector): Add template code for breadpay (#8655)
  chore(version): 2025.07.21.1
  refactor(payments): fetch payment method information in attempts list api v2 and add custom billing connector template (#8681)
  fix(router): Make v2 endpoints follow standard naming conventions (#8630)
  fix(connector): [Cybersource] Add type_selection_indicator as 1 for all cards  (#8663)
  feat(routing): Add API key auth for decision engine endpoints (#8640)
  feat(authentication): Added eligibility flow for modular authentication (#8431)
  feat(connector): [BLACKHAWKNETWORK] Add Template Code  (#8632)
  fix: remove straight through routing from routing approach (#8695)
  fix(connector): [Access Worldpay] correct enum deserialization for payment responses for (#8689)
  chore(version): 2025.07.21.0
pixincreate added a commit that referenced this pull request Jul 22, 2025
…ayload-recurring

* 'main' of github.com:juspay/hyperswitch: (48 commits)
  fix(connector): Add Trustpay in Authentication Providers Config (#8622)
  refactor(connector): [Adyen] map ssn and session validity for Pix (#8702)
  feat(core): Implement UCS kill switch for emergency fallback (#8651)
  fix(openapi): Added Error Response Schema for Status Code 400 (#8684)
  feat(connector): Add template code for breadpay (#8655)
  chore(version): 2025.07.21.1
  refactor(payments): fetch payment method information in attempts list api v2 and add custom billing connector template (#8681)
  fix(router): Make v2 endpoints follow standard naming conventions (#8630)
  fix(connector): [Cybersource] Add type_selection_indicator as 1 for all cards  (#8663)
  feat(routing): Add API key auth for decision engine endpoints (#8640)
  feat(authentication): Added eligibility flow for modular authentication (#8431)
  feat(connector): [BLACKHAWKNETWORK] Add Template Code  (#8632)
  fix: remove straight through routing from routing approach (#8695)
  fix(connector): [Access Worldpay] correct enum deserialization for payment responses for (#8689)
  chore(version): 2025.07.21.0
  feat(debit_routing): add debit routing support for apple pay (#8673)
  refactor(router): decrypt the wallet token before the debit routing call (#8598)
  chore: update org retrieve api response to include org type (#8660)
  feat(routing): Add routing evaluation rule endpoint and related flow (#8656)
  fix(connector): [AUTHORIZEDOTNET] Added Invoice Number Fix (#8685)
  ...
pixincreate added a commit that referenced this pull request Jul 22, 2025
…acilitapay-mca-metadata

* 'main' of github.com:juspay/hyperswitch:
  fix(connector): Add Trustpay in Authentication Providers Config (#8622)
  refactor(connector): [Adyen] map ssn and session validity for Pix (#8702)
  feat(core): Implement UCS kill switch for emergency fallback (#8651)
  fix(openapi): Added Error Response Schema for Status Code 400 (#8684)
  feat(connector): Add template code for breadpay (#8655)
  chore(version): 2025.07.21.1
  refactor(payments): fetch payment method information in attempts list api v2 and add custom billing connector template (#8681)
  fix(router): Make v2 endpoints follow standard naming conventions (#8630)
  fix(connector): [Cybersource] Add type_selection_indicator as 1 for all cards  (#8663)
  feat(routing): Add API key auth for decision engine endpoints (#8640)
  feat(authentication): Added eligibility flow for modular authentication (#8431)
  feat(connector): [BLACKHAWKNETWORK] Add Template Code  (#8632)
  fix: remove straight through routing from routing approach (#8695)
  fix(connector): [Access Worldpay] correct enum deserialization for payment responses for (#8689)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows api-v2 M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FIX]: Make v2 endpoints follow standard API conventions
6 participants