> 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

## Resource: Capturing and Voiding Payments

## Article: Capturing and Voiding Payments

## Article Link: https://dev.wix.com/docs/api-reference/business-management/payments/payment-service-provider-service-plugin/capturing-and-voiding-payments.md

## Article Content:

# Capturing and Voiding Payments
Usually, when Wix calls [Create Transaction](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/transactions/create-transaction.md) the whole payment flow is implemented, including capturing the payment. Learn more about [processing payments](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/processing-payments.md).

However, if `authorizeOnly` is set to `true` in the request, Wix will send a request to your [Capture Transaction](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/transactions/capture-transaction.md) or [Void Transaction](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/transactions/void-transaction.md) endpoint when the transaction is captured or voided.

<blockquote class="important">
  <strong>Important:</strong>
  
  Wix only sends `authorizeOnly:true` to PSPs that have enabled **Full Auth Capture** for card payments. This can be done while [becoming a PSP](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/introduction.md#how-to-become-a-payment-service-provider-psp) or once you're already integrated with Wix. 
</blockquote>

The Wix app implementing the payment flow defines whether to handle capture when creating the transaction, or to handle creation and capture separately. If they are handled separately, the Wix app also defines when to call [Capture Transaction](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/transactions/capture-transaction.md) or [Void Transaction](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/transactions/void-transaction.md). This can be through a standardized workflow, Wix user interaction with a customized dashboard page, or another way that the Wix app defines.

To learn more about capture and void workflows, see [Sample Capture and Void Flows](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/sample-capture-and-void-flows.md).


## About the Capture Transaction and Void Transaction endpoints
In general, an implementation of these endpoints must do 2 things:
1. Accept requests in the format indicated in the service plugin reference, capture or void payments accordingly, and respond with the appropriate HTTP status code and response body.
1. Send webhooks to Wix to confirm payment events and to notify Wix about any changes to a payment status. Webhooks are sent using the [Submit Event](https://dev.wix.com/docs/api-reference/business-management/payments/payment-service-provider-service-plugin/callbacks/submit-event.md) API.

Here are some important things to keep in mind when implementing the endpoints:
* These endpoints are only called if `authorizeOnly` is set to `true` in the Capture Transaction request.
* Wix uses reason codes to indicate the statuses of payments. Your endpoints should respond with the appropriate reason code for each payment status. For a list of reason codes, see [Reason Codes](https://dev.wix.com/docs/api-reference/business-management/payments/payment-service-provider-service-plugin/reason-codes.md).
* Requests made to these endpoints include a `Digest` header whose value is a [JSON Web Token](https://en.wikipedia.org/wiki/JSON_Web_Token). The PSP should use this value to validate all requests to the endpoint. Learn more about [JWT validation](https://dev.wix.com/docs/api-reference/business-management/payments/payment-service-provider-service-plugin/validate-endpoint-requests.md).

## Send webhooks
In addition to responding to requests to the [Capture Transaction](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/transactions/capture-transaction.md) and [Void Transaction](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/transactions/void-transaction.md) endpoints, the PSP must send webhooks to Wix to confirm capture or void events and to notify Wix about any changes to a payment status. Webhooks are sent using the [Submit Event](https://dev.wix.com/docs/api-reference/business-management/payments/payment-service-provider-service-plugin/callbacks/submit-event.md) API. 

Webhook requests must use 0Auth 2.0 authentication. To learn more, see [Webhooks](https://dev.wix.com/docs/api-reference/business-management/payments/payment-service-provider-service-plugin/webhooks.md).