Skip to Content
Docs
Fraud warnings

Simulate a fraud warning

POST/charges/{transaction_id}/simulate/fraud_warning

Simulates 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

AuthorizationstringRequired
HTTP Basic auth: your API key as the password, with an empty username. See Authentication.
idempotency-keystring

A 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_idstringRequired

Unique identifier for the charge.

Parameters

typestring

The type of fraud warning, stored as the fraud warning's fraud_type.

One of made_with_lost_card, made_with_stolen_card, card_never_received, fraudulent_card_application, made_with_counterfeit_card, unauthorized_use_of_card, misc, account_takeover, modification_of_payment_order or manipulation_of_cardholder.

Default: made_with_lost_card

input_methodstring

How the card was input.

Default: swiped

actionableboolean

Whether the fraud warning requires action.

Default: false

raw_codestring

The raw fraud code identifier.

Default:

Returns

Fraud warning simulated successfully.

Errors

400
Invalid request parameters.
401
The API key or access token is missing, unknown or no longer works (invalid_key, invalid_token, legacy_keys_ended, legacy_keys_off or permission_denied).
403
The endpoint is only available in the sandbox. A 403 can also mean the key may not make this request; code says why.
404
Charge not found.
409
Another request with the same idempotency-key is still being processed (request_in_progress). Wait, then retry with the same key.
500
Internal server error.
503
Service unavailable. Retry after the number of seconds in Retry-After, or after a few seconds when there's none.
Was this page helpful?