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 "paymentMethod": {
21 "descriptor": "string",
22 "paymentType": "FIRST_PAYMENT",
23 "paymentMethodToken": "string",
24 "vaultedPaymentMethodToken": "string",
25 "analyticsId": "string",
26 "paymentMethodType": "string",
27 "paymentMethodData": {
28 "first6Digits": "string",
29 "last4Digits": "string",
30 "expirationMonth": "string",
31 "expirationYear": "string",
32 "cardholderName": "string",
33 "network": "string",
34 "isNetworkTokenized": true,
35 "binData": {
36 "network": "string",
37 "issuerCountryCode": "AW",
38 "issuerName": "string",
39 "issuerCurrencyCode": "AED",
40 "regionalRestriction": "DOMESTIC_USE_ONLY",
41 "accountNumberType": "PRIMARY_ACCOUNT_NUMBER",
42 "accountFundingType": "CREDIT",
43 "prepaidReloadableIndicator": "RELOADABLE",
44 "productUsageType": "CONSUMER",
45 "productCode": "string",
46 "productName": "string"
47 }
48 },
49 "threeDSecureAuthentication": {
50 "responseCode": "NOT_PERFORMED",
51 "reasonCode": "GATEWAY_UNAVAILABLE",
52 "reasonText": "string",
53 "protocolVersion": "string",
54 "challengeIssued": true
55 }
56 },
57 "processor": {
58 "name": "string",
59 "processorMerchantId": "string",
60 "amountCaptured": 0,
61 "amountRefunded": 0
62 },
63 "statusReason": {
64 "type": "APPLICATION_ERROR",
65 "declineType": "SOFT_DECLINE",
66 "code": "ERROR",
67 "message": "string"
68 },
69 "transactions": [
70 {
71 "processorMerchantId": "string",
72 "transactionType": "SALE",
73 "processorTransactionId": "string",
74 "processorName": "string",
75 "processorStatus": "PENDING",
76 "processorStatusReason": {
77 "type": "APPLICATION_ERROR",
78 "declineType": "SOFT_DECLINE",
79 "code": "ERROR",
80 "message": "string"
81 }
82 }
83 ],
84 "riskData": {
85 "fraudChecks": {
86 "source": "string",
87 "preAuthorizationResult": "ACCEPT",
88 "postAuthorizationResult": "ACCEPT"
89 },
90 "cvvCheck": {
91 "source": "string",
92 "result": "MATCHED"
93 },
94 "avsCheck": {
95 "source": "string",
96 "result": {
97 "streetAddress": "MATCHED",
98 "postalCode": "MATCHED"
99 }
100 }
101 }
102 }
103}