Payment Refund

Primer notifies you with a PAYMENT.REFUND Webhook when a refund request has been fully processed by a payment processor and the refund has reached a final state.

Check the transaction with the most recent transactionType: "REFUND" in the transactions array:

  • if processorStatus is SETTLED, the refund was successful and the funds have been returned to the customer
  • if processorStatus is FAILED, the refund was unsuccessful

Learn more about how Primer handles webhooks.

Headers

X-Signature-Primary
string

An HMAC signature generated using the webhook payload and a shared signing secret. This is then converted to a base64 encoded string.

X-Signature-Secondary
string

A secondary signature that is added when you have rotated your secret within the past 24 hours.

Payload

The payload of this webhook request is an object.
eventType
optional string

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

date
optional datetime

The date-time that the webhook was sent.

notificationConfig
optional object

The notification configuration details.

version
optional string

The payload version

payment
optional object

Response

200
any

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

Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{
  "eventType": "string",
  "date": "2023-01-01T00:00:00Z",
  "notificationConfig": {
    "id": "string",
    "description": "string"
  },
  "version": "string",
  "payment": {
    "id": "string",
    "date": "2023-01-01T00:00:00Z",
    "status": "PENDING",
    "orderId": "string",
    "currencyCode": "string",
    "amount": 0,
    "customerId": "string",
    "metadata": {
      "string": {}
    },
    "paymentMethod": {
      "descriptor": "string",
      "paymentType": "FIRST_PAYMENT",
      "paymentMethodToken": "string",
      "vaultedPaymentMethodToken": "string",
      "analyticsId": "string",
      "paymentMethodType": "string",
      "paymentMethodData": {
        "first6Digits": "string",
        "last4Digits": "string",
        "expirationMonth": "string",
        "expirationYear": "string",
        "cardholderName": "string",
        "network": "string",
        "isNetworkTokenized": true,
        "binData": {
          "network": "string",
          "issuerCountryCode": "AW",
          "issuerName": "string",
          "issuerCurrencyCode": "AED",
          "regionalRestriction": "DOMESTIC_USE_ONLY",
          "accountNumberType": "PRIMARY_ACCOUNT_NUMBER",
          "accountFundingType": "CREDIT",
          "prepaidReloadableIndicator": "RELOADABLE",
          "productUsageType": "CONSUMER",
          "productCode": "string",
          "productName": "string"
        }
      },
      "threeDSecureAuthentication": {
        "responseCode": "NOT_PERFORMED",
        "reasonCode": "GATEWAY_UNAVAILABLE",
        "reasonText": "string",
        "protocolVersion": "string",
        "challengeIssued": true
      }
    },
    "processor": {
      "name": "string",
      "processorMerchantId": "string",
      "amountCaptured": 0,
      "amountRefunded": 0
    },
    "statusReason": {
      "type": "APPLICATION_ERROR",
      "declineType": "SOFT_DECLINE",
      "code": "ERROR",
      "message": "string"
    },
    "transactions": [
      {
        "transactionType": "SALE",
        "processorTransactionId": "string",
        "processorName": "string",
        "processorMerchantId": "string",
        "processorStatus": "PENDING",
        "processorStatusReason": {
          "type": "APPLICATION_ERROR",
          "declineType": "SOFT_DECLINE",
          "code": "ERROR",
          "message": "string"
        }
      }
    ],
    "riskData": {
      "fraudCheck": {
        "source": "string",
        "preAuthorizationResult": "ACCEPT",
        "postAuthorizationResult": "ACCEPT"
      }
    }
  }
}