curl -X POST https://api.sandbox.primer.io/payment-refund \
-H "X-API-KEY: <apiKey>" \
-H "Content-Type: application/json" \
-d '{}'
{
"eventType":"PAYMENT.REFUND",
"date":"2021-02-21T15:36:16.367687",
"notificationConfig":{
"id":"cc51f9f0-7e1c-492b-9d37-f83a818f6070",
"description":"Refund webhook"
},
"signedAt": "1689221338",
"version":"2.1",
"payment":{
"id":"DdRZ6YY0",
"date":"2022-01-01T12:12:12.000000",
"amount":3000,
"currencyCode":"GBP",
"customerId":"cust-123",
"orderId":"order-123",
"status":"SETTLED",
"paymentMethod":{
"paymentMethodToken":"-lcWjvBASh2EpYaHgVwxNjUzNTYzNjIy",
"analyticsId":"LUi5pETUV2EpYaHgV77SEamK25L",
"paymentMethodType":"PAYMENT_CARD",
"paymentMethodData":{
"paymentType":"FIRST_PAYMENT",
"last4Digits":"1111",
"expirationMonth":"03",
"expirationYear":"2030",
"cardholderName":"ADYEN",
"network":"Visa",
"isNetworkTokenized":false,
"binData":{
"network":"VISA",
"issuerCountryCode":"US",
"issuerName":"JPMORGAN CHASE BANK, N.A.",
"regionalRestriction":"UNKNOWN",
"accountNumberType":"UNKNOWN",
"accountFundingType":"UNKNOWN",
"prepaidReloadableIndicator":"NOT_APPLICABLE",
"productUsageType":"UNKNOWN",
"productCode":"UNKNOWN",
"productName":"UNKNOWN"
}
},
"threeDSecureAuthentication":{
"responseCode":"NOT_PERFORMED"
}
},
"processor":{
"name":"STRIPE",
"processorMerchantId":"acct_1G2EpYaHgVZqNWFwi8c",
"amountCaptured":3000,
"amountRefunded":3000
},
"transactions":[
{
"date":"2022-05-26T11:14:11.946300",
"amount":3000,
"currencyCode":"GBP",
"transactionType":"SALE",
"processorTransactionId":"pi_3L3ed23NWFwiNWFwi8c1iget38p",
"processorName":"STRIPE",
"processorMerchantId":"acct_1GORcaGv23NWFwi8c",
"processorStatus":"SETTLED"
},
{
"date":"2022-05-26T11:14:11.946300",
"amount":3001,
"currencyCode":"GBP",
"transactionType":"REFUND",
"processorTransactionId":"pi_3L3ed23NWFwiNWFwi8c1iget38p",
"processorName":"STRIPE",
"processorMerchantId":"acct_1GORcaGv23NWFwi8c",
"processorStatus":"FAILED",
"processorStatusReason":{
"type":"APPLICATION_ERROR",
"declineType":"SOFT_DECLINE",
"code":"UNKNOWN",
"message":"Refund amount too large"
}
}
]
}
}
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:
processorStatus is SETTLED, the refund was successful and the funds have been returned to the customerprocessorStatus is FAILED, the refund was unsuccessfulcurl -X POST https://api.sandbox.primer.io/payment-refund \
-H "X-API-KEY: <apiKey>" \
-H "Content-Type: application/json" \
-d '{}'
{
"eventType":"PAYMENT.REFUND",
"date":"2021-02-21T15:36:16.367687",
"notificationConfig":{
"id":"cc51f9f0-7e1c-492b-9d37-f83a818f6070",
"description":"Refund webhook"
},
"signedAt": "1689221338",
"version":"2.1",
"payment":{
"id":"DdRZ6YY0",
"date":"2022-01-01T12:12:12.000000",
"amount":3000,
"currencyCode":"GBP",
"customerId":"cust-123",
"orderId":"order-123",
"status":"SETTLED",
"paymentMethod":{
"paymentMethodToken":"-lcWjvBASh2EpYaHgVwxNjUzNTYzNjIy",
"analyticsId":"LUi5pETUV2EpYaHgV77SEamK25L",
"paymentMethodType":"PAYMENT_CARD",
"paymentMethodData":{
"paymentType":"FIRST_PAYMENT",
"last4Digits":"1111",
"expirationMonth":"03",
"expirationYear":"2030",
"cardholderName":"ADYEN",
"network":"Visa",
"isNetworkTokenized":false,
"binData":{
"network":"VISA",
"issuerCountryCode":"US",
"issuerName":"JPMORGAN CHASE BANK, N.A.",
"regionalRestriction":"UNKNOWN",
"accountNumberType":"UNKNOWN",
"accountFundingType":"UNKNOWN",
"prepaidReloadableIndicator":"NOT_APPLICABLE",
"productUsageType":"UNKNOWN",
"productCode":"UNKNOWN",
"productName":"UNKNOWN"
}
},
"threeDSecureAuthentication":{
"responseCode":"NOT_PERFORMED"
}
},
"processor":{
"name":"STRIPE",
"processorMerchantId":"acct_1G2EpYaHgVZqNWFwi8c",
"amountCaptured":3000,
"amountRefunded":3000
},
"transactions":[
{
"date":"2022-05-26T11:14:11.946300",
"amount":3000,
"currencyCode":"GBP",
"transactionType":"SALE",
"processorTransactionId":"pi_3L3ed23NWFwiNWFwi8c1iget38p",
"processorName":"STRIPE",
"processorMerchantId":"acct_1GORcaGv23NWFwi8c",
"processorStatus":"SETTLED"
},
{
"date":"2022-05-26T11:14:11.946300",
"amount":3001,
"currencyCode":"GBP",
"transactionType":"REFUND",
"processorTransactionId":"pi_3L3ed23NWFwiNWFwi8c1iget38p",
"processorName":"STRIPE",
"processorMerchantId":"acct_1GORcaGv23NWFwi8c",
"processorStatus":"FAILED",
"processorStatusReason":{
"type":"APPLICATION_ERROR",
"declineType":"SOFT_DECLINE",
"code":"UNKNOWN",
"message":"Refund amount too large"
}
}
]
}
}
curl -X POST https://api.sandbox.primer.io/payment-refund \
-H "X-API-KEY: <apiKey>" \
-H "Content-Type: application/json" \
-d '{}'
{
"eventType":"PAYMENT.REFUND",
"date":"2021-02-21T15:36:16.367687",
"notificationConfig":{
"id":"cc51f9f0-7e1c-492b-9d37-f83a818f6070",
"description":"Refund webhook"
},
"signedAt": "1689221338",
"version":"2.1",
"payment":{
"id":"DdRZ6YY0",
"date":"2022-01-01T12:12:12.000000",
"amount":3000,
"currencyCode":"GBP",
"customerId":"cust-123",
"orderId":"order-123",
"status":"SETTLED",
"paymentMethod":{
"paymentMethodToken":"-lcWjvBASh2EpYaHgVwxNjUzNTYzNjIy",
"analyticsId":"LUi5pETUV2EpYaHgV77SEamK25L",
"paymentMethodType":"PAYMENT_CARD",
"paymentMethodData":{
"paymentType":"FIRST_PAYMENT",
"last4Digits":"1111",
"expirationMonth":"03",
"expirationYear":"2030",
"cardholderName":"ADYEN",
"network":"Visa",
"isNetworkTokenized":false,
"binData":{
"network":"VISA",
"issuerCountryCode":"US",
"issuerName":"JPMORGAN CHASE BANK, N.A.",
"regionalRestriction":"UNKNOWN",
"accountNumberType":"UNKNOWN",
"accountFundingType":"UNKNOWN",
"prepaidReloadableIndicator":"NOT_APPLICABLE",
"productUsageType":"UNKNOWN",
"productCode":"UNKNOWN",
"productName":"UNKNOWN"
}
},
"threeDSecureAuthentication":{
"responseCode":"NOT_PERFORMED"
}
},
"processor":{
"name":"STRIPE",
"processorMerchantId":"acct_1G2EpYaHgVZqNWFwi8c",
"amountCaptured":3000,
"amountRefunded":3000
},
"transactions":[
{
"date":"2022-05-26T11:14:11.946300",
"amount":3000,
"currencyCode":"GBP",
"transactionType":"SALE",
"processorTransactionId":"pi_3L3ed23NWFwiNWFwi8c1iget38p",
"processorName":"STRIPE",
"processorMerchantId":"acct_1GORcaGv23NWFwi8c",
"processorStatus":"SETTLED"
},
{
"date":"2022-05-26T11:14:11.946300",
"amount":3001,
"currencyCode":"GBP",
"transactionType":"REFUND",
"processorTransactionId":"pi_3L3ed23NWFwiNWFwi8c1iget38p",
"processorName":"STRIPE",
"processorMerchantId":"acct_1GORcaGv23NWFwi8c",
"processorStatus":"FAILED",
"processorStatusReason":{
"type":"APPLICATION_ERROR",
"declineType":"SOFT_DECLINE",
"code":"UNKNOWN",
"message":"Refund amount too large"
}
}
]
}
}
The type of the webhook raised. PAYMENT.REFUND in this case.
The date-time that the webhook was sent.
The Unix timestamp at which the webhook payload was signed.
"1689221338"
The notification configuration details.
Show child attributes
Show child attributes
The payload version
"2.1"
Return a 200 status to indicate that the data was received successfully