Skip to content

Refund payment with reference

Request

This endpoint is used to refund a captured payment.

Security
bearer and basic and apiKey
Path
idstringrequired

PayId assigned by Computop Paygate in the initial request.

Headers
Idempotency-Keystring

A unique key provided by you to ensure that a particular operation is not processed multiple times in case of retries.

Bodyapplication/jsonrequired
transIdstring, <= 64 charactersrequired

Transaction ID created in your system. It should be unique for each payment.

amountobject(amount)required
refNrstring

Your unique reference number for the specific operation. You can pass this value to reconcile different operations in a payment (authorization, capture, refund, etc) individually. It is recommended to limit the length to 18 characters so that it works for all payment methods. Allowed characters: (A-Z, a-z) and digits (0-9)

metadataobject

A collection of additional custom data provided by you to store extra information about the transaction. This is a set of JSON key value pairs passed by you. Paygate will return the data as it is in the response.

orderobject(order)
statementDescriptorstring

Short, clear description of the transaction that appears on the customer's statement. It is recommend sending a maximum of 22 characters. Allowed characters: a-z, A-Z, 0-9, spaces, and special characters / - ? : ( ) . , +

paymentMethodsobject(paymentRefund)
curl -i -X POST \
  -u '<username>:<password>' \
  'https://test.computop-paygate.com/api/v2/payments/{id}/refunds' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: string' \
  -H 'X-API-Key: YOUR_API_KEY_HERE' \
  -d '{
    "tranId": "6B29FC40-1067-B31D-00DD010662DA",
    "amount": {
      "value": 1200,
      "currency": "EUR"
    },
    "statementDescriptor": "Example Store Purchase",
    "refNr": "6B29FC40-1067-B31D",
    "paymentMethods": {
      "amazonPay": {
        "amazonPaySimulationCode": "CAPTURE_INITIATED"
      }
    }
  }'

Responses

Successful operation

Bodyapplication/json
payIdstring
merchantIdstring
transIdstring
xIdstring
refNrstring
statusstring
responseCodestring
responseDescriptionstring
metadataobject
paymentMethodsobject(paymentRefundResponse)
Response
{ "merchantId": "MerchantIdTest", "payId": "6B29FC4093DD010662DE", "xId": "6B29FC4093DD010662DB", "transId": "trans-id-123", "refNr": "6729FC4093DA010662DA", "status": "OK", "responseCode": "00000000", "responseDescription": "success", "paymentMethods": { "amazonPay": { … } } }