Skip to content

fix: add missing id field to PtsV2CreateOrderPost201Response#238

Open
mohcinz wants to merge 1 commit intoCyberSource:masterfrom
mohcinz:fix/add-id-field-PtsV2CreateOrderPost201Response
Open

fix: add missing id field to PtsV2CreateOrderPost201Response#238
mohcinz wants to merge 1 commit intoCyberSource:masterfrom
mohcinz:fix/add-id-field-PtsV2CreateOrderPost201Response

Conversation

@mohcinz
Copy link

@mohcinz mohcinz commented Feb 26, 2026

Problem

The PtsV2CreateOrderPost201Response model was missing the id field,
even though the CyberSource API returns it in the JSON response of
POST /pts/v2/orders.

This blocks the full order-to-authorization flow since the id returned
by the Create Order endpoint is required to perform the subsequent
authorization call.

Root Cause

The id field was absent from the OpenAPI spec definition of
PtsV2CreateOrderPost201Response in both cybersource-rest-spec.json
and cybersource-rest-spec-java.json, causing it to be missing from
the auto-generated Java model.

Fix

  • Added the id property to the OpenAPI spec in both spec files
  • Regenerated the SDK to produce the updated PtsV2CreateOrderPost201Response.java
  • Updated the documentation in docs/PtsV2CreateOrderPost201Response.md

Files Changed

File Change
generator/cybersource-rest-spec.json Added id field to spec definition
generator/cybersource-rest-spec-java.json Added id field to spec definition
src/main/java/Model/PtsV2CreateOrderPost201Response.java Regenerated with id field
docs/PtsV2CreateOrderPost201Response.md Updated documentation

How to Verify

// Before fix
PtsV2CreateOrderPost201Response response = orderApi.createOrder(request);
response.getId(); // ❌ method did not exist

// After fix
PtsV2CreateOrderPost201Response response = orderApi.createOrder(request);
response.getId(); // ✅ returns the order id correctly

Related Issue

Closes #[ISSUE_NUMBER]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant