Report refunds

1. Get reporting token

Start by generating a reporting token. Make a HTTP POST request to the relevant endpoint + /api/oauth/token/ using the access token you generated. Remember to use a Reporting access token.

Request

curl --location --request POST 'https://uat.app.payvyne.com/api/oauth/token' 
--header 'Content-Type: application/x-www-form-urlencoded' 
--data-urlencode 'grant_type=client_credentials' 
--data-urlencode 'client_id=<reporting_key>'
--data-urlencode 'client_secret=<reporting_secret>’

2. Return refunds

Send an HTTP GET request to the relevant endpoint + /api/reporting/v1/refunds/merchant and include any required query parameters in the request.

Refund queries can contain the following terms:

  • id
  • paymentId
  • currency
  • amount
  • status
  • createdAt

Request

Parameter

Value

size

40

query

currency = ‘GBP’ AND amount < 1.00 AND status = ‘FAILED’

cursor

Null

curl --request GET \
     --url 'http://app.payvyne.com/api/reporting/v1/refunds/merchant?size=40&query=currency%20%3D%20%E2%80%98GBP%E2%80%99%20AND%20amount%20%3C%201%20AND%20status%20%3D%20%E2%80%98FAILED%E2%80%99' \
     --header 'Accept: application/json'

🚧

Be aware

The queries specified in your GET request requires URL encoding.

Response

{
    "elements": [
        {
            "id": "e6e005426b2d43eb",
            "paymentId": "910c40aa1423ff42",
            "amount": "0.40",
            "createdAt": "2022-05-17T15:25:43.361Z",
            "status": "FAILED",
            "initiator": "VYNE_MERCHANT",
            "initiatorId": "da98bd3a4bd2b9c7",
            "accountNumber": "63849203",
            "currency": "GBP",
            "sortCode": "001111",
            "payerId": "cc858257-f778-51ed-9c89-8d28dd30ea1a"
        },
        {
            "id": "d26600a5987f7515",
            "paymentId": "0d7819fed2e2e0de",
            "amount": "0.40",
            "createdAt": "2022-05-17T15:34:11.077Z",
            "status": "FAILED",
            "initiator": "VYNE_MERCHANT",
            "initiatorId": "da98bd3a4bd2b9c7",
            "accountNumber": "63849203",
            "currency": "GBP",
            "sortCode": "001111",
            "payerId": "cc858257-f778-51ed-9c89-8d28dd30ea1a"
        },
        {
            "id": "08373758bb98519c",
            "paymentId": "0d7819fed2e2e0de",
            "amount": "0.10",
            "createdAt": "2022-05-18T10:48:41.571Z",
            "status": "FAILED",
            "initiator": "VYNE_MERCHANT",
            "initiatorId": "da98bd3a4bd2b9c7",
            "accountNumber": "63849203",
            "currency": "GBP",
            "sortCode": "001111",
            "payerId": "cc858257-f778-51ed-9c89-8d28dd30ea1a"
        }
    ],
    "size": 3
}

Did this page help you?