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-PrimarystringRequired

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

X-Signature-SecondarystringRequired
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
stringOptional

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

date
datetimeOptional
The date-time that the webhook was sent.
notificationConfig
objectOptional
The notification configuration details.
version
stringOptional
The payload version
payment
objectOptional

Response

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