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-Signature-Primary: <x-signature-primary>' \
  --header 'X-Signature-Secondary: <x-signature-secondary>' \
  --data '
{
  "eventType": "<string>",
  "date": "2023-11-07T05:31:56Z",
  "signedAt": "1689221338",
  "notificationConfig": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "description": "<string>"
  },
  "payment": {
    "id": "<string>",
    "date": "2023-11-07T05:31:56Z",
    "dateUpdated": "2023-11-07T05:31:56Z",
    "status": "PENDING",
    "orderId": "<string>",
    "currencyCode": "<string>",
    "amount": 1,
    "paymentMethod": {
      "descriptor": "<string>",
      "paymentType": "FIRST_PAYMENT",
      "paymentMethodToken": "<string>",
      "isVaulted": true,
      "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"
      }
    },
    "transactions": [
      {
        "date": "2023-11-07T05:31:56Z",
        "amount": 1,
        "currencyCode": "AED",
        "transactionType": "SALE",
        "processorName": "<string>",
        "processorMerchantId": "<string>",
        "processorStatus": "PENDING",
        "processorTransactionId": "<string>",
        "processorStatusReason": {
          "type": "APPLICATION_ERROR",
          "declineType": "SOFT_DECLINE",
          "code": "ERROR",
          "message": "<string>"
        },
        "reason": "Item returned."
      }
    ],
    "customerId": "<string>",
    "metadata": {},
    "processorData": {},
    "customer": {
      "emailAddress": "jsmith@example.com",
      "mobileNumber": "<string>",
      "firstName": "<string>",
      "lastName": "<string>",
      "billingAddress": {
        "firstName": "<string>",
        "lastName": "<string>",
        "addressLine1": "<string>",
        "addressLine2": "<string>",
        "city": "<string>",
        "state": "<string>",
        "countryCode": "AW",
        "postalCode": "<string>"
      },
      "shippingAddress": {
        "firstName": "<string>",
        "lastName": "<string>",
        "addressLine1": "<string>",
        "addressLine2": "<string>",
        "city": "<string>",
        "state": "<string>",
        "countryCode": "AW",
        "postalCode": "<string>"
      },
      "taxId": "<string>",
      "nationalDocumentId": "<string>"
    },
    "processor": {
      "name": "<string>",
      "processorMerchantId": "<string>",
      "amountCaptured": 123,
      "amountRefunded": 123
    },
    "statusReason": {
      "type": "APPLICATION_ERROR",
      "declineType": "SOFT_DECLINE",
      "code": "ERROR",
      "message": "<string>"
    },
    "riskData": {
      "fraudChecks": {
        "source": "FRAUD_PROVIDER",
        "preAuthorizationResult": "THREE_DS",
        "postAuthorizationResult": "ACCEPT"
      },
      "cvvCheck": {
        "source": "PROCESSOR",
        "result": "MATCHED"
      },
      "avsCheck": {
        "source": "PROCESSOR",
        "result": {
          "streetAddress": "NOT_MATCHED",
          "postalCode": "NOT_VERIFIED"
        }
      }
    }
  },
  "version": "2.3"
}
'

Headers

X-Signature-Primary
string
required

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
required

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

Body

application/json
eventType
string
required

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

date
string<date-time>
required

The date-time that the webhook was sent.

signedAt
string
required

The Unix timestamp at which the webhook payload was signed.

Example:

"1689221338"

notificationConfig
Notification Config · object
required

The notification configuration details.

payment
Payment Details · object
required
version
string

The payload version

Example:

"2.3"

Response

200

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