<div id="integration-guide">

<div class="ig-section">
<div class="ig-section-header">
<div class="ig-section-icon" style="background:#ecfdf5;color:#059669;"><i class="fas fa-hand-pointer"></i></div>
<h2>Payment Actions</h2>
</div>
<p class="ig-section-desc">Perform post-payment operations - capture authorised funds, issue refunds, and send digital receipts.</p>

<!-- Required Scopes -->
<div class="ig-subsection">
<h3>Required scopes</h3>
<p>Include the relevant scopes when requesting your OAuth access token:</p>
<table class="ig-comparison">
<thead>
<tr><th>Action</th><th>Scope</th></tr>
</thead>
<tbody>
<tr><td><strong>Capture</strong></td><td><code>captures/create</code></td></tr>
<tr><td><strong>Refund</strong></td><td><code>refunds/create</code></td></tr>
<tr><td><strong>Digital Receipt</strong></td><td><code>transactions/id/receipts/create</code></td></tr>
</tbody>
</table>
</div>

<!-- What Are Payment Actions -->
<div class="ig-subsection">
<h3>What are payment actions?</h3>
<p>Payment actions are operations you can perform on a payment after it has been authorised. While a standard payment completes in a single step, many real-world payment flows require additional steps - such as capturing funds after fulfilling an order, returning money to a shopper, or sending them a record of their purchase.</p>
<p>Teya supports three payment actions:</p>
<ul>
<li><strong>Capture</strong> - Collect funds that have been authorised but not yet captured.</li>
<li><strong>Refund</strong> - Return funds to a shopper for a payment that has been captured.</li>
<li><strong>Digital Receipts</strong> - Send a shopper a digital receipt for a completed payment via email.</li>
</ul>
</div>

<!-- Capture -->
<div class="ig-subsection">
<h3>Capture</h3>
<p>By default, payments are captured immediately after authorisation. In some cases you may want to capture the payment separately - this is known as a <strong>manual capture</strong>.</p>
<p>A common use case is order fulfilment. After a payment is authorised, you ship the goods. If delivered successfully, you capture the payment. If delivery fails, you cancel the payment instead.</p>

```admonition
icon: fas fa-info-circle
title: One capture per payment
content: Each authorised payment can only be captured once. You may capture any amount up to the full authorised amount, but once a capture request is made, no further captures are possible. For example, if a payment was authorised for £100.00 and you capture £10.00, the remaining £90.00 cannot be captured and will be released back to the shopper.
```

<h4>Capture a payment</h4>
<p>To capture a payment, make a POST request using the payment ID returned when the payment was authorised:</p>

<div id="capture-code" data-code-flow="directApi" data-code-operation="capture"></div>

```admonition
icon: fas fa-code
title: API Reference
content: <code>POST /v1/transactions/{id}/capture</code> - Capture an authorised payment
```
</div>

<!-- Refunds -->
<div class="ig-subsection">
<h3>Refunds</h3>
<p>To return funds to your shopper, you can refund a payment after it has been captured.</p>
<p>A refund does one of the following:</p>
<ul>
<li>If the payment has <strong>not</strong> been captured, it reverses the payment.</li>
<li>If the payment <strong>has</strong> been captured, it refunds the payment.</li>
</ul>
<p>You can issue multiple refunds against a single payment. The combined total of all refunds cannot exceed the original payment amount. For example, if a shopper paid £50.00, you could issue two separate refunds of £25.00 each, but not a third.</p>

<h4>Refund a payment</h4>
<p>To issue a refund, make a POST request with the ID of the payment you want to refund:</p>

<div id="refund-code" data-code-flow="directApi" data-code-operation="refund"></div>

```admonition
icon: fas fa-code
title: API Reference
content: <code>POST /v3/refunds</code> - Refund a payment
```
</div>

<!-- Digital Receipts -->
<div class="ig-subsection">
<h3>Digital Receipts</h3>
<p>Send a digital receipt to a shopper for a completed payment via email.</p>

<h4>Send a receipt</h4>
<p>To send a digital receipt, make a POST request with the payment ID and the shopper's email address:</p>

<div id="receipt-code" data-code-flow="directApi" data-code-operation="receipt"></div>

```admonition
icon: fas fa-code
title: API Reference
content: <code>POST /v1/transactions/{id}/receipts</code> - Send a digital receipt
```
</div>

<!-- Related -->
<div class="ig-subsection">
<h3>Related</h3>
<ul>
<li><a href="/partners/online-payments/webhooks">Webhooks</a> - Receive payment event notifications</li>
<li><a href="/partners/online-payments/testing">Testing</a> - Test cards and integration checklist</li>
<li><a href="/partners/online-payments/troubleshooting">Troubleshooting</a> - Common issues and best practices</li>
<li><a href="/apis/online-payments/apis">API Reference</a> - Full API endpoint documentation</li>
</ul>
</div>

</div>
</div>

<script src="/js/playground.js"></script>
