Skip to main content
POST
/
api
/
pay
/
{projectId}
/
transactionsV2
Create Transaction V2
curl --request POST \
  --url https://localhost:44371/api/pay/{projectId}/transactionsV2 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
{
  "success": true,
  "code": 200,
  "errorMessage": null,
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

Description

Processes a new payment transaction using the enhanced v2 API format. This version includes additional fields for extended customer information, enhanced metadata, and improved processor-specific options. The v2 format is recommended for new integrations as it provides better support for advanced payment scenarios, custom fields, and future processor capabilities.

Input

  • Path Parameter: projectId (guid, required) — Project identifier matching authenticated API key.
  • Body: model (TransactionCreateCommandRequestV2, required) — Enhanced transaction details with additional fields for description, company, country, phone, and custom metadata.

Output

Returns a TransactionCreateCommandResponseV2 containing the transaction ID, approval status, authorization code, fraud check results (AVS, CVV), and processor response details.

Example Request

POST /api/payment/projects/3fa85f64-5717-4562-b3fc-2c963f66afa6/transactions/v2
Content-Type: application/json
Authorization: Bearer {project-api-key}

{
  "amount": 149.99,
  "transactionType": "Sale",
  "description": "Premium Widget Purchase",
  "customFields": {"orderId": "ORD-2025-001"}
}

Example Response

{
  "success": true,
  "code": 200,
  "transactionId": "9d0e1f2a-3456-7890-bcde-f123456789ab",
  "status": "Approved",
  "authorizationCode": "XYZ789",
  "avsResult": "Y",
  "cvvResult": "M"
}

Errors

  • 400 Bad Request — Missing required fields or validation errors.
  • 404 Not Found — Project not found or payment processor not configured.
  • 401 Unauthorized — Invalid or missing API key.

Notes

  • V2 format includes additional fields like description, company, country, phone, and custom fields.
  • V2 responses include enhanced fraud check results (AVS, CVV) when supported by processor.
  • V2 is the recommended format for new integrations; v1 maintained for backward compatibility.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

projectId
string<guid>
required

The unique identifier of the project for which to create the transaction (must match authenticated API key).

Body

application/json

The v2 transaction creation request with enhanced fields for customer data, metadata, and processor options.

Base structure for command requests that modify data. Represents the unified transaction creation payload used by modern payment clients. Consolidates CyberSource and Payflow fields into a single schema while capturing anti-fraud metadata.

securedProperties
string[] | null

Property paths within the request that contain sensitive values. Downstream processors use this list to encrypt card security codes and encrypted card numbers.

paymentType
enum<string>

Indicates the payment rail used for the transaction. Drives which sections of the payload must be populated (credit card vs. PayPal).

Available options:
CreditCard,
PayPal
type
enum<string>

Transaction action requested by the caller. Includes operations such as authorization, capture, or credit.

Available options:
Authorize,
Capture,
AuthorizeAndCapture,
CreditAuthorizeAndCapture,
CreditAuthorize,
CreditCapture,
PreAuthorize,
LiabilityChange,
LiabilityAssumption,
ChargeBackCredit,
ChargeBackDebit,
ChargebackInquiry
tags
object[] | null

Collection of tags persisted with the transaction. Captures custom metadata used in Chargeworx reporting.

additionalData
object

Additional contextual information accompanying the transaction. Currently used to transmit customer IP addresses for fraud scoring.

paymentProcessorData
object

Optional overrides forwarded to the payment processors. Allows clients to modify descriptors or add customer service contact information per transaction.

useAntiFraud
boolean

Indicates whether the transaction should evaluate anti-fraud rules. When false, the request bypasses optional fraud checks for trusted back-office workflows.

browserFingerprint
string | null

Browser fingerprint hash reported by the client. Shared with risk systems to correlate suspicious device patterns.

Maximum string length: 100
sessionId
string | null

Identifier of the authenticated session initiating the payment. Helps trace multiple payment attempts made during the same customer journey.

recaptchaV3Score
number<double> | null

reCAPTCHA v3 score forwarded from the client. Provides an additional risk signal for web-based transactions.

email
string<email> | null

Email address of the customer authorizing the payment. Required for credit card flows to support receipt delivery and fraud screening.

Maximum string length: 250
renewalAgreement
string | null

Description of the renewal or subscription agreement accepted by the customer. Helps merchants confirm compliance during recurring billing scenarios.

Maximum string length: 100
customerId
string | null

Merchant defined customer identifier within the processor. Enables reuse of the same stored payment profile across multiple transactions.

Maximum string length: 50
merchantReference
string | null

Merchant reference used for idempotency and reconciliation. Chargeworx consults this reference to prevent duplicate credit card transactions.

Maximum string length: 100
checkExistingTransactionByMerchantReference
boolean

Indicates whether to reuse the last successful response when the merchant reference matches. Allows clients to retry credit card flows without creating duplicate processor charges.

referenceTransactionId
string<guid> | null

Identifier of the prior transaction related to the current request. Used for follow-up operations such as capture, refund, or void actions.

mockedProcessorResponse
enum<string>

Mock response directive for integration testing. Enables test environments to simulate CyberSource or Payflow responses without hitting external services.

Available options:
None,
Accepted,
DeclinedInvalidCreditCardLength,
DeclinedExpiredCard,
DeclinedBadAddress,
DeclinedCustomProcessorCode
mockedProcessorCode
string | null

Optional processor code to return when mocking responses. Allows QA to emulate specific gateway error scenarios.

Maximum string length: 100
deliveryPersonAddress
object

Delivery address associated with the transaction. Required for credit card flows so CyberSource can perform address-based fraud checks.

transactionItems
object[] | null

Collection of invoice items included in the transaction. Used to pass itemized data to processors regardless of the payment rail.

paymentInfoId
string<guid> | null

Identifier of a stored payment profile to reuse. When present, the system loads persisted card data instead of requiring the full credit card payload.

creditCardInfo
object

Credit card information supplied when no stored profile is referenced. Required for new credit card transactions to encrypt and tokenize card data.

transactionPayflow
object

Payflow configuration supplied when charging through PayPal. Required when PaymentType is PaymentType.PayPal.

Response

Always returned. Check the success property and status field in the response body to determine if the transaction was approved or declined.

Standard response structure containing operation status and error information. Standard command response indicating the result of a data modification. Create response containing the identifier of the newly created entity. Represents the response returned after processing a v2 transaction request. Provides processor feedback along with base command metadata for the v2 schema.

success
boolean

True if the operation completed successfully; false if an error occurred.

Example:

true

code
enum<string>

Result code indicating the outcome of the operation.

Available options:
Unknown,
Success,
BadRequest,
Unauthorized,
NotFound,
Error
Example:

200

errorMessage
string | null

Human-readable error message when an error occurs.

Example:

null

id
string<guid>

Unique identifier of the newly created entity.

Example:

"3fa85f64-5717-4562-b3fc-2c963f66afa6"

processorMessage
string | null

Human-readable message produced by the processor. Typically includes approval indicators or decline explanations.

errorType
string | null

Categorized error type when the request fails. Helps API clients present user-friendly messaging based on failure grouping.

eventId
enum<string>

Event recorded in the transaction history. Indicates whether the processor handled the request as an authorization, capture, or other action.

Available options:
Authorize,
Captured,
CreditCaptured,
CreditAuthorize,
AuthorizeReverse,
PreAuthorize,
ChargeBackCredit,
ChargeBackDebit,
ChargebackInquiry
eventResult
enum<string>

Outcome of the recorded event. Provides additional success/failure detail beyond the base status.

Available options:
Pending,
Accepted,
Rejected
paymentInfoId
string<guid>

Identifier of the payment profile associated with the transaction. Used for subsequent follow-up transactions referencing the same payment method.

isCreditCardIssue
boolean

Indicates whether the failure stemmed from the credit card itself. Guides UI messaging to prompt card updates when necessary.

resultCode
enum<string>

Processor result code describing the transaction outcome. Aligns with the TransactionResultCode enumeration surfaced in the Chargeworx portal.

Available options:
Undefined,
ChargeworxAcceptedProcessorAccepted,
ChargeworxDeclinedProcessorAccepted,
ChargeworxDeclinedProcessorRejected,
Exception