> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# VoidTransaction

# Package: paymentServiceProviderServicePlugin

# Namespace: PspTransactionsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/payments/payment-service-provider-service-plugin/transactions/void-transaction.md

## Introduction

This endpoint is used to send requests to void transactions to a Payment Service Provider (PSP).

Wix calls this endpoint to void a transaction.
Learn more about [implementing this endpoint](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/capturing-and-voiding-payments.md).

---

## REST API

### Schema

```
 Method: voidTransaction
 Description: This endpoint is used to send requests to void transactions to a Payment Service Provider (PSP).  Wix calls this endpoint to void a transaction. Learn more about [implementing this endpoint](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/capturing-and-voiding-payments.md).
 URL: null
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  wixTransactionId, pluginTransactionId, voidAmount, merchantCredentials
 Method parameters: 
   param name: merchantCredentials | type: merchantCredentials | description: Credentials that the PSP provided when the merchant connected their account. | required: true | validation: format map
        - name: key | type: string | description: none  
        - name: value | type: string | description: none  
   param name: pluginTransactionId | type: pluginTransactionId | description: PSP transaction GUID. | required: true | validation: minLength 1, maxLength 200
   param name: siteId | type: siteId | description: Wix site GUID.  | validation: format GUID
   param name: voidAmount | type: voidAmount | description: Total amount to void in a currency’s minor units. This must be the same as the authorized amount. Learn more about [currencies](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/currencies.md). | required: true 
   param name: wixTransactionId | type: wixTransactionId | description: Wix transaction GUID. | required: true | validation: format GUID
 Return type: VoidTransactionResponse
  - name: reasonCode | type: integer | description: Wix [reason code](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/reason-codes.md#void-declined) indicating a failed request.  
  - name: errorCode | type: string | description: PSP-specific error code.  | validation: maxLength 50
  - name: errorMessage | type: string | description: PSP-specific error message.  | validation: maxLength 300


```

### Examples

### Void Already Captured Transaction
```curl
curl -X POST https://psp.example.com/void \
 -H 'Content-Type: application/json' \
 -H 'Digest: JWT=ai0zIQqt71bmnkgEJ1CRJchjKJup' \
 -d '
{
  "wixTransactionId": "a57c2c68-61d2-480c-930b-9982b058730d",
  "pluginTransactionId": "bb5fd2a7-05a7-4958-bf3f-66daf4db0a4a",
  "voidAmount": "1540",
  "merchantCredentials": {
    "client_id": "e89b-12d3-a456-42665",
    "client_secret": "a15a3ee3-22d3-4a3f-920e-2186e13a19d1"
  }
}'
```

### Void Already Voided Transaction
```curl
curl -X POST https://psp.example.com/void \
 -H 'Content-Type: application/json' \
 -H 'Digest: JWT=ai0zIQqt71bmnkgEJ1CRJchjKJup' \
 -d '
{
  "wixTransactionId": "a57c2c68-61d2-480c-930b-9982b058730d",
  "pluginTransactionId": "bb5fd2a7-05a7-4958-bf3f-66daf4db0a4a",
  "voidAmount": "1540",
  "merchantCredentials": {
    "client_id": "e89b-12d3-a456-42665",
    "client_secret": "a15a3ee3-22d3-4a3f-920e-2186e13a19d1"
  }
}'
```

### Void Transaction
```curl
curl -X POST https://psp.example.com/void \
 -H 'Content-Type: application/json' \
 -H 'Digest: JWT=ai0zIQqt71bmnkgEJ1CRJchjKJup' \
 -d '
{
  "wixTransactionId": "a57c2c68-61d2-480c-930b-9982b058730d",
  "pluginTransactionId": "bb5fd2a7-05a7-4958-bf3f-66daf4db0a4a",
  "voidAmount": "1540",
  "merchantCredentials": {
    "client_id": "e89b-12d3-a456-42665",
    "client_secret": "a15a3ee3-22d3-4a3f-920e-2186e13a19d1"
  }
}'
```

---