Simulate a fraud warning
/charges/{transaction_id}/simulate/fraud_warningSimulates a fraud warning on a charge. This endpoint is only available in the sandbox and is useful for testing fraud warning handling flows.
The charge is marked as fraudulent and a fraud_warning.created webhook is sent. The fraud warning's ID is frdwrn_ followed by the digits of the charge ID (for example frdwrn_296645958265997312 for chrg_296645958265997312); retrieve it with GET /fraud_warnings/{transaction_id}.
Headers
AuthorizationstringRequiredidempotency-keystringA unique key, such as a UUID, that makes a POST or DELETE request safe to retry. Pay.com keeps each key for 24 hours, separately for each workspace.
- A retry with the same key, endpoint and body gets the first request's stored status and body, without running the request again.
- If the first request is still being processed, a retry gets 409
idempotency_error(request_in_progress). - The same key on another endpoint, or with another body, gets 400
idempotency_error(invalid_parameters). - GET, PUT and PATCH requests ignore the key.
The response repeats the key in its Idempotency-Key header.
Path parameters
transaction_idstringRequiredUnique identifier for the charge.
Parameters
typestringThe type of fraud warning, stored as the fraud warning's fraud_type.
input_methodstringHow the card was input.
actionablebooleanWhether the fraud warning requires action.
raw_codestringThe raw fraud code identifier.
Returns
Fraud warning simulated successfully.
Errors
400401invalid_key, invalid_token, legacy_keys_ended, legacy_keys_off or permission_denied).403code says why.404409idempotency-key is still being processed (request_in_progress). Wait, then retry with the same key.500503Retry-After, or after a few seconds when there's none.