Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: pinch-api Refunds API
version: '2020.1'
servers:
- url: https://api.getpinch.com.au/test
security:
- sec0: []
tags:
- name: Refunds
paths:
/refunds/nonce:
post:
summary: Check Refund Nonce
description: Check if a Nonce has already been added
operationId: check-refund-nonce
requestBody:
content:
application/json:
schema:
type: object
required:
- nonce
properties:
nonce:
type: string
responses:
'200':
description: '200'
content:
application/json:
examples:
Nonce Exists:
value: "{\n \"isNonceReplay\": true,\n \"nonce\": \"test1234\",\n \"data\": {\n \"id\": \"ref_XGPRRXNZ\",\n \"amount\": 100,\n \"currency\": \"AUD\",\n \"refundFeeCharged\": 0,\n \"requestedDate\": \"2021-05-11T02:29:56.6079210Z\",\n \"submittedDate\": null,\n \"completedDate\": null,\n \"reasonForRefund\": \"Requested by Payer\",\n \"notes\": null,\n \"convertedAmount\": null,\n \"conversionRate\": null,\n \"convertedCurrency\": null,\n \"isGross\": false,\n \"status\": \"requested\",\n \"paymentId\": null,\n \"transferId\": null,\n \"refundedFees\": null,\n \"nonce\": \"test1234\"\n }\n}"
Nonce Doesn't Exist:
value: "{\n \"isNonceReplay\": false,\n \"nonce\": \"test12345\"\n}"
schema:
oneOf:
- title: Nonce Exists
type: object
properties:
isNonceReplay:
type: boolean
example: true
default: true
nonce:
type: string
example: test1234
data:
type: object
properties:
id:
type: string
example: ref_XGPRRXNZ
amount:
type: integer
example: 100
default: 0
currency:
type: string
example: AUD
refundFeeCharged:
type: integer
example: 0
default: 0
requestedDate:
type: string
example: '2021-05-11T02:29:56.6079210Z'
submittedDate: {}
completedDate: {}
reasonForRefund:
type: string
example: Requested by Payer
notes: {}
convertedAmount: {}
conversionRate: {}
convertedCurrency: {}
isGross:
type: boolean
example: false
default: true
status:
type: string
example: requested
paymentId: {}
transferId: {}
refundedFees: {}
nonce:
type: string
example: test1234
- title: Nonce Doesn't Exist
type: object
properties:
isNonceReplay:
type: boolean
example: false
default: true
nonce:
type: string
example: test12345
deprecated: false
tags:
- Refunds
/refunds:
post:
summary: Create a Refund
description: ''
operationId: create-a-refund
requestBody:
content:
application/json:
schema:
type: object
required:
- paymentId
- amount
- reason
properties:
paymentId:
type: string
description: Payment Id in pmt_XXXXXXXXXXXXXX format
amount:
type: integer
format: int32
reason:
type: string
nonce:
type: string
description: Optional. A nonce is a one-time-use reference that represents a unique payment. Used to prevent double submissions of payments. If left empty all submissions will be treated as unique.
examples:
Request Example:
value:
paymentId: pmt_XXXXXXXXXXXXXX
amount: 1000
reason: Requested by Payer
nonce: unique-string
responses:
'201':
description: '201'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"ref_995DGQ38\",\n \"amount\": 100,\n \"currency\": \"AUD\",\n \"refundFeeCharged\": 0,\n \"requestedDate\": \"2021-05-14T00:08:11.7803470Z\",\n \"submittedDate\": null,\n \"completedDate\": null,\n \"reasonForRefund\": \"Requested by Payer\",\n \"notes\": null,\n \"convertedAmount\": null,\n \"conversionRate\": null,\n \"convertedCurrency\": null,\n \"isGross\": false,\n \"status\": \"requested\",\n \"paymentId\": null,\n \"transferId\": null,\n \"refundedFees\": null,\n \"nonce\": \"5781b2f0-9a09-4579-bbb8-eea734633b13\"\n}"
schema:
type: object
properties:
id:
type: string
example: ref_995DGQ38
amount:
type: integer
example: 100
default: 0
currency:
type: string
example: AUD
refundFeeCharged:
type: integer
example: 0
default: 0
requestedDate:
type: string
example: '2021-05-14T00:08:11.7803470Z'
submittedDate: {}
completedDate: {}
reasonForRefund:
type: string
example: Requested by Payer
notes: {}
convertedAmount: {}
conversionRate: {}
convertedCurrency: {}
isGross:
type: boolean
example: false
default: true
status:
type: string
example: requested
paymentId: {}
transferId: {}
refundedFees: {}
nonce:
type: string
example: 5781b2f0-9a09-4579-bbb8-eea734633b13
'400':
description: '400'
content:
application/json:
examples:
Result:
value: "[\n {\n \"propertyName\": \"\",\n \"errorMessage\": \"Could not find a payment with ID: pmt_XXXXXXXXXXXXXX\",\n \"attemptedValue\": null,\n \"customState\": null,\n \"severity\": 0,\n \"errorCode\": null,\n \"formattedMessageArguments\": null,\n \"formattedMessagePlaceholderValues\": null,\n \"resourceName\": null\n }\n]"
schema:
type: array
items:
type: object
properties:
propertyName:
type: string
example: ''
errorMessage:
type: string
example: 'Could not find a payment with ID: pmt_XXXXXXXXXXXXXX'
attemptedValue: {}
customState: {}
severity:
type: integer
example: 0
default: 0
errorCode: {}
formattedMessageArguments: {}
formattedMessagePlaceholderValues: {}
resourceName: {}
'403':
description: '403'
content:
application/json:
examples:
403 Nonce Replay:
value: "{\n \"isNonceReplay\": true,\n \"nonce\": \"5781b2f0-9a09-4579-bbb8-eea734633b13\",\n \"data\": {\n \"id\": \"ref_995DGQ38\",\n \"amount\": 100,\n \"currency\": \"AUD\",\n \"refundFeeCharged\": 0,\n \"requestedDate\": \"2021-05-14T00:08:11.7803470Z\",\n \"submittedDate\": null,\n \"completedDate\": null,\n \"reasonForRefund\": \"Requested by Payer\",\n \"notes\": null,\n \"convertedAmount\": null,\n \"conversionRate\": null,\n \"convertedCurrency\": null,\n \"isGross\": false,\n \"status\": \"requested\",\n \"paymentId\": null,\n \"transferId\": null,\n \"refundedFees\": null,\n \"nonce\": \"5781b2f0-9a09-4579-bbb8-eea734633b13\"\n }\n}"
schema:
type: object
properties:
isNonceReplay:
type: boolean
example: true
default: true
nonce:
type: string
example: 5781b2f0-9a09-4579-bbb8-eea734633b13
data:
type: object
properties:
id:
type: string
example: ref_995DGQ38
amount:
type: integer
example: 100
default: 0
currency:
type: string
example: AUD
refundFeeCharged:
type: integer
example: 0
default: 0
requestedDate:
type: string
example: '2021-05-14T00:08:11.7803470Z'
submittedDate: {}
completedDate: {}
reasonForRefund:
type: string
example: Requested by Payer
notes: {}
convertedAmount: {}
conversionRate: {}
convertedCurrency: {}
isGross:
type: boolean
example: false
default: true
status:
type: string
example: requested
paymentId: {}
transferId: {}
refundedFees: {}
nonce:
type: string
example: 5781b2f0-9a09-4579-bbb8-eea734633b13
deprecated: false
tags:
- Refunds
get:
summary: List Refunds
description: ''
operationId: list-refunds
parameters:
- name: page
in: query
description: The current page
schema:
type: integer
format: int32
default: 1
- name: pageSize
in: query
description: How many items to return for each page. Maximum 500.
schema:
type: integer
format: int32
default: 50
- name: startDate
in: query
schema:
type: string
format: date
- name: endDate
in: query
schema:
type: string
format: date
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"page\": 1,\n \"pageSize\": 50,\n \"totalPages\": 1,\n \"totalItems\": 6,\n \"data\": [\n {\n \"id\": \"ref_XXXXXXXX\",\n \"amount\": 1245,\n \"currency\": \"AUD\",\n \"refundFeeCharged\": 0,\n \"requestedDate\": \"2021-05-14T05:22:00.0980330Z\",\n \"completedDate\": null,\n \"reasonForRefund\": \"duplicate transaction\",\n \"notes\": null,\n \"convertedAmount\": null,\n \"conversionRate\": null,\n \"convertedCurrency\": null,\n \"isGross\": false,\n \"status\": \"requested\",\n \"transferId\": null,\n \"refundedFees\": null,\n \"nonce\": null\n },\n {\n \"id\": \"ref_XXXXXXXX\",\n \"amount\": 100,\n \"currency\": \"AUD\",\n \"refundFeeCharged\": 0,\n \"requestedDate\": \"2021-05-11T02:29:56.6079210Z\",\n \"completedDate\": null,\n \"reasonForRefund\": \"Requested by Payer\",\n \"notes\": null,\n \"convertedAmount\": null,\n \"conversionRate\": null,\n \"convertedCurrency\": null,\n \"isGross\": false,\n \"status\": \"requested\",\n \"transferId\": null,\n \"refundedFees\": null,\n \"nonce\": \"test1234\"\n },\n {\n \"id\": \"ref_XXXXXXXX\",\n \"amount\": 100,\n \"currency\": \"AUD\",\n \"refundFeeCharged\": 0,\n \"requestedDate\": \"2021-05-11T01:08:37.2754508Z\",\n \"completedDate\": null,\n \"reasonForRefund\": \"Requested by Payer\",\n \"notes\": null,\n \"convertedAmount\": null,\n \"conversionRate\": null,\n \"convertedCurrency\": null,\n \"isGross\": false,\n \"status\": \"requested\",\n \"transferId\": null,\n \"refundedFees\": null,\n \"nonce\": \"test123\"\n },\n {\n \"id\": \"ref_XXXXXXXX\",\n \"amount\": 100,\n \"currency\": \"AUD\",\n \"refundFeeCharged\": 0,\n \"requestedDate\": \"2021-05-11T01:08:34.2568023Z\",\n \"completedDate\": null,\n \"reasonForRefund\": \"Requested by Payer\",\n \"notes\": null,\n \"convertedAmount\": null,\n \"conversionRate\": null,\n \"convertedCurrency\": null,\n \"isGross\": false,\n \"status\": \"requested\",\n \"transferId\": null,\n \"refundedFees\": null,\n \"nonce\": \"test123\"\n },\n {\n \"id\": \"ref_XXXXXXXX\",\n \"amount\": 1000,\n \"currency\": \"AUD\",\n \"refundFeeCharged\": 0,\n \"requestedDate\": \"2021-05-11T01:07:58.5216275Z\",\n \"completedDate\": null,\n \"reasonForRefund\": \"Requested by Payer\",\n \"notes\": null,\n \"convertedAmount\": null,\n \"conversionRate\": null,\n \"convertedCurrency\": null,\n \"isGross\": false,\n \"status\": \"requested\",\n \"transferId\": null,\n \"refundedFees\": null,\n \"nonce\": \"test123\"\n },\n {\n \"id\": \"ref_XXXXXXXX\",\n \"amount\": 1000,\n \"currency\": \"AUD\",\n \"refundFeeCharged\": 0,\n \"requestedDate\": \"2021-05-11T00:00:41.6762465Z\",\n \"completedDate\": null,\n \"reasonForRefund\": \"Requested by Payer\",\n \"notes\": null,\n \"convertedAmount\": null,\n \"conversionRate\": null,\n \"convertedCurrency\": null,\n \"isGross\": false,\n \"status\": \"requested\",\n \"transferId\": null,\n \"refundedFees\": null,\n \"nonce\": \"0e44d18b-8b69-4b9f-8736-bdd86a9e4aea\"\n }\n ]\n}"
schema:
type: object
properties:
page:
type: integer
example: 1
default: 0
pageSize:
type: integer
example: 50
default: 0
totalPages:
type: integer
example: 1
default: 0
totalItems:
type: integer
example: 6
default: 0
data:
type: array
items:
type: object
properties:
id:
type: string
example: ref_XXXXXXXX
amount:
type: integer
example: 1245
default: 0
currency:
type: string
example: AUD
refundFeeCharged:
type: integer
example: 0
default: 0
requestedDate:
type: string
example: '2021-05-14T05:22:00.0980330Z'
completedDate: {}
reasonForRefund:
type: string
example: duplicate transaction
notes: {}
convertedAmount: {}
conversionRate: {}
convertedCurrency: {}
isGross:
type: boolean
example: false
default: true
status:
type: string
example: requested
transferId: {}
refundedFees: {}
nonce: {}
'400':
description: '400'
content:
application/json:
examples:
Result:
value: '{}'
schema:
type: object
properties: {}
deprecated: false
tags:
- Refunds
components:
securitySchemes:
sec0:
type: oauth2
flows: {}
x-readme:
headers:
- key: pinch-version
value: '2020.1'
explorer-enabled: true
proxy-enabled: true