Payment Attempts API

Resolve a payment attempt

Changed on

Resolve a payment attempt that succeeded or failed outside of Primer. No payment is created, and the tokenised payment instrument associated with the attempt is invalidated so it cannot be reused. Call this endpoint when you have processed the payment yourself (e.g. via a different PSP) and want to record the outcome against the attempt. Set `vaultPaymentMethod` to vault the card used for the attempt instead of invalidating it. This requires `outcome` to be `SUCCEEDED`.

post/payment-attempts/{id}/resolve

Request

  • Base URL
    https://api.sandbox.primer.io
  • URL
    https://api.sandbox.primer.io/payment-attempts/{id}/resolve
  • Auth
    API key in header X-API-KEY

Path parameters

idstring uuid required

ID of the payment attempt to resolve.

Headers

X-API-VERSIONstring required
Example:2.4

Specifies the version of the API to use. This must be set to 2.4.

Request body

outcome'SUCCEEDED' | 'FAILED' required

The outcome of the payment attempt, as processed outside of Primer.

vaultPaymentMethodboolean

Vault the card used for the attempt instead of invalidating it. Requires outcome to be SUCCEEDED to be set.

Response

Successful Response

paymentAttemptIdstring uuid required

ID of the payment attempt the outcome was reported for.

Example response

{
  "vaultedPaymentMethod": {
    "createdAt": "2021-03-01T12:00:00.123456",
    "token": "_xlXlmBcTnuFxc2N3HAI73wxNjE1NTU5ODY5",
    "tokenType": "MULTI_USE",
    "analyticsId": "vuXhpZouWxaZpRZ-x_brZmtT",
    "paymentMethodType": "PAYMENT_CARD",
    "paymentMethodData": {
      "last4Digits": "1111",
      "expirationMonth": "12",
      "expirationYear": "2030",
      "cardholderName": "John Biggins",
      "network": "Visa",
      "networkTransactionId": "020210628190752",
      "accountFundingType": "DEBIT"
    },
    "customerId": "customer-123",
    "description": "My first card",
    "deleted": false,
    "default": true
  }
}

Changes