|
1
|
post: |
|
2
|
operationId: PostPaymentsIdRefund |
|
3
|
summary: Refund Payment |
|
4
|
description: >- |
|
5
|
Refund an amount of a payment. This uses the `refundPayment` method of the |
|
6
|
payment provider associated with the payment's collection. |
|
7
|
x-authenticated: true |
|
8
|
parameters: |
|
9
|
- name: id |
|
10
|
in: path |
|
11
|
description: The payment's ID. |
|
12
|
required: true |
|
13
|
schema: |
|
14
|
type: string |
|
15
|
- name: fields |
|
16
|
in: query |
|
17
|
description: >- |
|
18
|
Comma-separated fields that should be included in the returned data. if |
|
19
|
a field is prefixed with `+` it will be added to the default fields, |
|
20
|
using `-` will remove it from the default fields. without prefix it will |
|
21
|
replace the entire default fields. |
|
22
|
required: false |
|
23
|
schema: |
|
24
|
type: string |
|
25
|
title: fields |
|
26
|
description: >- |
|
27
|
Comma-separated fields that should be included in the returned data. |
|
28
|
if a field is prefixed with `+` it will be added to the default |
|
29
|
fields, using `-` will remove it from the default fields. without |
|
30
|
prefix it will replace the entire default fields. |
|
31
|
externalDocs: |
|
32
|
url: '#select-fields-and-relations' |
|
33
|
security: |
|
34
|
- api_token: [] |
|
35
|
- cookie_auth: [] |
|
36
|
- jwt_token: [] |
|
37
|
requestBody: |
|
38
|
content: |
|
39
|
application/json: |
|
40
|
schema: |
|
41
|
$ref: ../components/schemas/AdminRefundPayment.yaml |
|
42
|
x-codeSamples: |
|
43
|
- lang: JavaScript |
|
44
|
label: JS SDK |
|
45
|
source: |
|
46
|
$ref: ../code_samples/JavaScript/admin_payments_{id}_refund/post.js |
|
47
|
- lang: Shell |
|
48
|
label: cURL |
|
49
|
source: |
|
50
|
$ref: ../code_samples/Shell/admin_payments_{id}_refund/post.sh |
|
51
|
tags: |
|
52
|
- Payments |
|
53
|
responses: |
|
54
|
'200': |
|
55
|
description: OK |
|
56
|
content: |
|
57
|
application/json: |
|
58
|
schema: |
|
59
|
$ref: ../components/schemas/AdminPaymentResponse.yaml |
|
60
|
'400': |
|
61
|
$ref: ../components/responses/400_error.yaml |
|
62
|
'401': |
|
63
|
$ref: ../components/responses/unauthorized.yaml |
|
64
|
'404': |
|
65
|
$ref: ../components/responses/not_found_error.yaml |
|
66
|
'409': |
|
67
|
$ref: ../components/responses/invalid_state_error.yaml |
|
68
|
'422': |
|
69
|
$ref: ../components/responses/invalid_request_error.yaml |
|
70
|
'500': |
|
71
|
$ref: ../components/responses/500_error.yaml |
|
72
|
x-workflow: refundPaymentWorkflow |
|
73
|
x-events: |
|
74
|
- name: payment.refunded |
|
75
|
payload: |- |
|
76
|
```ts |
|
77
|
{ |
|
78
|
id, // the ID of the payment |
|
79
|
} |
|
80
|
``` |
|
81
|
description: Emitted when a payment is refunded. |
|
82
|
deprecated: false |