Report a payment attempt
POST / v1 / payment_records /:id / report_payment_attempt
Report a new payment attempt on the specified Payment Record. A new payment attempt can only be specified if all other payment attempts are canceled or failed.
Parameters
- id string Required The ID of the Payment Record.
- initiated _ at timestamp Required When the reported payment was initiated. Measured in seconds since the Unix epoch.
- description string An arbitrary string attached to the object. Often useful for displaying to users.
- failed object Information about the payment attempt failure.
- guaranteed object Information about the payment attempt guarantee.
- metadata map Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata. - outcome enum The outcome of the reported payment. Possible enum values
failedThe payment failed.guaranteedThe payment was guaranteed. - payment _ method _ details object Information about the Payment Method debited for this payment.
- shipping _ details object Shipping information for this payment.
Returns
The updated Payment Record object with a new latest_payment_attempt_record, or an error (for example, if the Payment Record already has funds guaranteed).
Response
{ "id": "pr_5RV730PrHyAEi", "object": "payment_record", "amount_canceled": { "currency": "usd", "value": 0 }, "amount_failed": { "currency": "usd", "value": 0 }, "amount_guaranteed": { "currency": "usd", "value": 0 }, "amount_refunded": { "currency": "usd", "value": 0 }, "amount_requested": { "currency": "usd", "value": 1000 }, "created": 1730211363, "customer_details": null, "customer_presence": "on_session", "description": "computer software", "latest_payment_attempt_record": "par_345kjsi8WE", "livemode": true, "metadata": {}, "payment_method_details": { "billing_details": null, "custom": { "display_name": "newpay", "type": "custom" }, "payment_method": null, "type": "custom" }, "processor_details": { "type": "custom", "custom": { "payment_reference": "npp2358872734k" } }, "shipping_details": null}
Report a refund
POST / v1 / payment_records /:id / report_refund
Report that the most recent payment attempt on the specified Payment Record was refunded.
Parameters
- id string Required The ID of the Payment Record.
- outcome enum Required The outcome of the reported refund. Possible enum values
refundedThe payment was refunded. - processor _ details object Required Processor information for this refund.
- amount object A positive integer in the smallest currency unit representing how much of this payment to refund. Can refund only up to the remaining, unrefunded amount of the payment.
- initiated _ at timestamp When the reported refund was initiated. Measured in seconds since the Unix epoch.
- metadata map Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata. - refunded object Information about the payment attempt refund.
Returns
The updated Payment Record object with its most recent payment attempt refunded.
Response
{ "id": "pr_5RV730PrHyAEi", "object": "payment_record", "amount_canceled": { "currency": "usd", "value": 0 }, "amount_failed": { "currency": "usd", "value": 0 }, "amount_guaranteed": { "currency": "usd", "value": 0 }, "amount_refunded": { "currency": "usd", "value": 1000 }, "amount_requested": { "currency": "usd", "value": 1000 }, "created": 1730211363, "customer_details": null, "customer_presence": "on_session", "description": "computer software", "latest_payment_attempt_record": "par_1ArV730PrHyQuG", "livemode": true, "metadata": {}, "payment_method_details": { "billing_details": null, "custom": { "display_name": "newpay", "type": "custom" }, "payment_method": null, "type": "custom" }, "processor_details": { "type": "custom", "custom": { "payment_reference": "npp2358872734k" } }, "shipping_details": null}
Report payment attempt canceled
POST / v1 / payment_records /:id / report_payment_attempt_canceled
Report that the most recent payment attempt on the specified Payment Record was canceled.
Parameters
- canceled _ at timestamp Required When the reported payment was canceled. Measured in seconds since the Unix epoch.
- id string Required The ID of the Payment Record.
- metadata map Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata.
Returns
The updated Payment Record object with its most recent payment attempt canceled, or an error (for example, if the latest payment attempt is already guaranteed).
Response
{ "id": "pr_5RV730PrHyAEi", "object": "payment_record", "amount_canceled": { "currency": "usd", "value": 1000 }, "amount_failed": { "currency": "usd", "value": 0 }, "amount_guaranteed": { "currency": "usd", "value": 0 }, "amount_refunded": { "currency": "usd", "value": 0 }, "amount_requested": { "currency": "usd", "value": 1000 }, "created": 1730211363, "customer_details": null, "customer_presence": "on_session", "description": "computer software", "latest_payment_attempt_record": "par_1ArV730PrHyQuG", "livemode": true, "metadata": {}, "payment_method_details": { "billing_details": null, "custom": { "display_name": "newpay", "type": "custom" }, "payment_method": null, "type": "custom" }, "processor_details": { "type": "custom", "custom": { "payment_reference": "npp2358872734k" } }, "shipping_details": null}
