Skip to main content
Use void to cancel an authorization before capture, or refund to return funds after a transaction has been captured.

When to Use Each

OperationUse When
VoidCancel an authorization before capturing funds
RefundReturn funds after a charge or capture has completed
Voids release the hold on the customer’s card immediately. Refunds may take 5-10 business days to appear on the customer’s statement.

Void

Cancel an authorization before capturing. Uses DELETE method.
Void requires re-sending the currency, amount, card, and other details from the original authorization.
const response = await fetch('https://api.orchestrasolutions.com/PaymentGateway/void', {
  method: 'DELETE',
  headers: {
    'Content-Type': 'application/json',
    'X-Api-Key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    refTransId: 'original-transaction-id',
    amount: 50.00,
    currency: 'USD',
    paymentGatewayAccountName: 'stripe-production',
    card: {
      cardNumber: '4111111111111111',
      cardHolderName: 'Jane Smith',
      expirationMonth: 12,
      expirationYear: 2027,
      cvv: '123'
    }
  })
});

Void Parameters

ParameterTypeRequiredDescription
refTransIdstringYesTransaction ID to void
amountnumberYesOriginal authorization amount
currencystringYesISO 4217 currency code
cardobjectYesCard details from original authorization
paymentGatewayAccountNamestringConditionalStored gateway account name
paymentGatewayAccountobjectConditionalInline gateway credentials
myRefstringNoYour custom reference
certificateNamestringNoClient certificate name if required by gateway
networkTokenBrandstringNoFor network tokens: Visa, MasterCard, or Amex

Refund

Refund a captured transaction. Uses PUT method.
const response = await fetch('https://api.orchestrasolutions.com/PaymentGateway/refund', {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
    'X-Api-Key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    refTransId: 'original-transaction-id',
    amount: 25.00,
    currency: 'USD',
    paymentGatewayAccountName: 'stripe-production',
    card: {
      cardNumber: '4111111111111111',
      cardHolderName: 'Jane Smith',
      expirationMonth: 12,
      expirationYear: 2027,
      cvv: '123'
    }
  })
});

Refund Parameters

ParameterTypeRequiredDescription
refTransIdstringYesTransaction ID to refund
amountnumberYesAmount to refund (can be partial)
currencystringYesISO 4217 currency code
cardobjectYesCard details
paymentGatewayAccountNamestringConditionalStored gateway account name
paymentGatewayAccountobjectConditionalInline gateway credentials
payerDetailsobjectNoBilling information
myRefstringNoYour custom reference
certificateNamestringNoClient certificate name if required by gateway
networkTokenBrandstringNoFor network tokens: Visa, MasterCard, or Amex

Partial Refunds

You can refund less than the original amount:
// Original charge was $100.00
// Refund only $25.00
const response = await fetch('https://api.orchestrasolutions.com/PaymentGateway/refund', {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
    'X-Api-Key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    refTransId: 'original-transaction-id',
    amount: 25.00,  // Partial refund
    currency: 'USD',
    paymentGatewayAccountName: 'stripe-production',
    card: {
      cardNumber: '4111111111111111',
      cardHolderName: 'Jane Smith',
      expirationMonth: 12,
      expirationYear: 2027,
      cvv: '123'
    }
  })
});

Response Codes

CodeDescription
202Accepted - sent to payment gateway
400Bad request - invalid parameters
401Not authenticated - invalid API key
409Conflict - rejected by payment gateway
500Error with payment gateway
503Temporary failure with payment gateway