Skip to main content
POST
/
v1
/
instant_payments
/
{instant_payment_id}
/
cancel
Cancel an instant payment
curl --request POST \
  --url https://api.sandbox.lead.bank/v1/instant_payments/{instant_payment_id}/cancel \
  --header 'Authorization: Bearer <token>'
{
  "id": "instant_payment_xyz123",
  "account_id": "account_xyz123",
  "account_number_id": "account_number_xyz123",
  "direction": "outgoing",
  "status": "posted",
  "amount": 5000,
  "currency_code": "USD",
  "debtor": {
    "name": "Alex Smith",
    "account_number": "1234567890"
  },
  "debtor_agent": {
    "routing_number": "111000111"
  },
  "creditor_agent": {
    "routing_number": "111000111"
  },
  "creditor": {
    "name": "Alex Smith",
    "account_number": "1234567890"
  },
  "payment_identifiers": {
    "end_to_end_id": "E2E-20240101-001",
    "uetr": "8dc981d2-e8c2-4a7b-8df0-0781b46328d9",
    "transaction_id": "TXN-20240101-001"
  },
  "return": {
    "reason": "duplicate",
    "details": "<string>"
  },
  "rejection": {
    "rejected_by": "lead",
    "reason": "non_sufficient_funds",
    "details": "<string>"
  },
  "related_objects": {
    "original_payment_id": "instant_payment_xyz123",
    "return_payment_ids": [
      "instant_payment_xyz456"
    ]
  },
  "return_requests": [
    {
      "status": "pending",
      "reason": "duplicate",
      "created_at": "2022-06-27T11:22:33Z",
      "details": "<string>",
      "deadline": "2022-07-11T23:30:00-04:00",
      "resolution": {
        "resolved_at": "2022-06-27T11:22:33Z",
        "resolved_by": "counterparty",
        "accepted_amount": 5000,
        "rejection_reason": "no_answer_from_customer",
        "rejection_details": "<string>"
      }
    }
  ],
  "created_at": "2022-06-27T11:22:33Z",
  "updated_at": "2022-06-27T11:22:40Z",
  "counterparty_status": "posted",
  "description": "Payment for invoice 12345"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

instant_payment_id
string
required

ID of the instant payment object you want to cancel.

Pattern: ^instant_payment_\w+$

Response

Updated canceled instant payment object.

id
string
required

The unique identifier of the instant payment object.

Pattern: ^instant_payment_\w+$
Example:

"instant_payment_xyz123"

account_id
string
required

The ID of the Account object.

Pattern: ^account_\w+$
Example:

"account_xyz123"

account_number_id
string
required

The ID of the Lead Bank Account Number object.

Pattern: ^account_number_\w+$
Example:

"account_number_xyz123"

direction
enum<string>
required

Who is initiating the transaction.

outgoing: You are sending a transaction to a counterparty. incoming: You are receiving a transaction from a counterparty.

Available options:
outgoing,
incoming
Example:

"outgoing"

status
enum<string>
required

The current status of the instant payment object. If outgoing: created, under_review, canceled, rejected, posted. If incoming: under_review, rejected, posted.

Available options:
created,
under_review,
canceled,
rejected,
posted
Example:

"posted"

amount
integer<int64>
required

The amount of the instant payment in cents.

Required range: x >= 0
Example:

5000

currency_code
enum<string>
required

A three-letter currency code as defined in ISO 4217.

Available options:
USD
Example:

"USD"

debtor
object
required

The details of the debtor (payer) sending the funds.

debtor_agent
object
required

The details of the financial institution where the debtor (payer) holds their account.

creditor_agent
object
required

The details of the financial institution where the creditor (payee) holds their account.

creditor
object
required

The details of the creditor (payee) receiving the funds.

payment_identifiers
object
required

The instant payment's identifiers.

return
object
required

If this instant payment is a return, this object contains details on the return.

rejection
object
required

If this instant payment was rejected, this object contains details on the rejection.

This instant payment's related instant payments or other objects.

return_requests
object[]
required

The return requests that reference this instant payment.

created_at
string<date-time>
required

The ISO 8601 format timestamp that represents when the instant payment object was created.

Example:

"2022-06-27T11:22:33Z"

updated_at
string<date-time>
required

The ISO 8601 format timestamp that represents when the instant payment object was last updated.

Example:

"2022-06-27T11:22:40Z"

counterparty_status
enum<string> | null

The current status of the instant payment from the counterparty's perspective. If outgoing: posted, under_review, or rejected. If incoming: posted or null.

Available options:
posted,
under_review,
rejected
Example:

"posted"

description
string

Free-form information on the reason for the payment.

Example:

"Payment for invoice 12345"