Skip to main content
POST
/
payment-refund
Payment Refund
curl --request POST \
  --url https://api.sandbox.primer.io/payment-refund \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "eventType": "<string>",
  "date": "2023-11-07T05:31:56Z",
  "notificationConfig": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "description": "<string>"
  },
  "version": "2.1",
  "signedAt": "1689221338",
  "payment": {
    "id": "<string>",
    "date": "2023-11-07T05:31:56Z",
    "status": "PENDING",
    "orderId": "<string>",
    "currencyCode": "<string>",
    "amount": 1,
    "customerId": "<string>",
    "metadata": {},
    "paymentMethod": {
      "descriptor": "<string>",
      "paymentType": "FIRST_PAYMENT",
      "paymentMethodToken": "<string>",
      "analyticsId": "<string>",
      "paymentMethodType": "<string>",
      "paymentMethodData": {
        "last4Digits": "<string>",
        "expirationMonth": "<string>",
        "expirationYear": "<string>",
        "first6Digits": "<string>",
        "cardholderName": "<string>",
        "network": "<string>",
        "isNetworkTokenized": false,
        "binData": {
          "network": "AMEX",
          "regionalRestriction": "DOMESTIC_USE_ONLY",
          "accountNumberType": "PRIMARY_ACCOUNT_NUMBER",
          "accountFundingType": "CREDIT",
          "prepaidReloadableIndicator": "RELOADABLE",
          "productUsageType": "CONSUMER",
          "productCode": "<string>",
          "productName": "<string>",
          "issuerCountryCode": "AW",
          "issuerName": "<string>",
          "issuerCurrencyCode": "AED"
        }
      },
      "threeDSecureAuthentication": {
        "responseCode": "NOT_PERFORMED"
      }
    },
    "processor": {
      "name": "<string>",
      "processorMerchantId": "<string>",
      "amountCaptured": 123,
      "amountRefunded": 123
    },
    "statusReason": {
      "type": "APPLICATION_ERROR",
      "declineType": "SOFT_DECLINE",
      "code": "ERROR",
      "message": "<string>"
    },
    "transactions": [
      {
        "date": "2023-11-07T05:31:56Z",
        "amount": 1,
        "currencyCode": "<string>",
        "processorMerchantId": "<string>",
        "transactionType": "SALE",
        "processorTransactionId": "<string>",
        "processorName": "<string>",
        "processorStatus": "PENDING",
        "processorStatusReason": {
          "type": "APPLICATION_ERROR",
          "declineType": "SOFT_DECLINE",
          "code": "ERROR",
          "message": "<string>"
        },
        "reason": "Item returned."
      }
    ]
  }
}
'

Authorizations

X-API-KEY
string
header
required

Body

application/json
eventType
string

The type of the webhook raised. PAYMENT.REFUND in this case.

date
string<date-time>

The date-time that the webhook was sent.

notificationConfig
Notification Config · object

The notification configuration details.

version
string

The payload version

Example:

"2.1"

signedAt
string

Timestamp when the webhook content was signed

Example:

"1689221338"

payment
Payment Details · object

Response

200

Return a 200 status to indicate that the data was received successfully