> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ebury.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Payment Models

## Payment

```json theme={null}
{
    "payment_id": "string",
    "contact_id": "string",
    "trade_id": "string",
    "multipayment": "string",
    "multipayment_id": "string",
    "multipayment_unique_id": "string",
    "mass_payment_id": "string",
    "uuid": "string",
    "is_uuid_used_for_tracking": "boolean",
    "account_number": "string",
    "amount": "number",
    "bank_identifier": "string",
    "beneficiary_id": "string",
    "beneficiary_name": "string",
    "beneficiary_aml_id": "string",
    "beneficiary_active": "boolean",
    "beneficiary_authorised": "boolean",
    "beneficiary_blocked": "boolean",
    "beneficiary_completed": "boolean",
    "beneficiary_verified": "boolean",
    "created_date": "string",
    "external_reference_id": "string",
    "fee_amount": "number",
    "fee_currency": "string",
    "iban": "string",
    "payment_currency": "string",
    "payment_date": "string",
    "payment_instruction": "string",
    "payment_receipt": "string",
    "status": "string",
    "internal_status": {
        "code": "number",
        "message": "string"
    },
    "swift_code": "string",
    "authorised_by": "string",
    "authorised_date": "string",
    "rejected_by": "string",
    "rejected_date": "string",
    "cancelled": "boolean",
    "cancelled_by": "string",
    "cancelled_date": "string",
    "can_be_cancelled": "boolean",
    "authorisation_workflow": "string",
    "invoice_required": "boolean",
    "reference": "string",
    "charges": "string",
    "AML_status": "number",
    "AML_overdue": "boolean",
    "executed": "boolean",
    "fully_funded": "boolean",
    "over_paid": "boolean",
    "returned": "boolean",
    "verified": "boolean",
    "approvals_workflow": {
        "authorisations": [
            {
                "date": "string",
                "status": "number",
                "contact_id": "string",
                "level": "number",
                "contact_name": "string"
            }
        ],
        "contact_authorisation_actions": {
            "allowed": ["string"],
            "executed": "string"
        },
        "minimum_remaining_authorisations": "number",
        "n_eyes_plus_status": "string"
    }
}
```

This model is a representation of a payment.

**Fields**

<ResponseField name="payment_id" type="string">
  Unique identifier for the payment (Always)
</ResponseField>

<ResponseField name="contact_id" type="string">
  Unique identifier of the contact who booked the payment (Always)
</ResponseField>

<ResponseField name="trade_id" type="string">
  Unique identifier of the trade the payment is allocated to (Always)
</ResponseField>

<ResponseField name="multipayment" type="string">
  Unique identifier for the multi payment formatted
</ResponseField>

<ResponseField name="multipayment_id" type="string">
  Unique identifier for the multi payment
</ResponseField>

<ResponseField name="multipayment_unique_id" type="string">
  Internal unique reference for the multi-payment
</ResponseField>

<ResponseField name="mass_payment_id" type="string">
  Unique identifier for the mass payment
</ResponseField>

<ResponseField name="uuid" type="string">
  Unique End-to-end Transaction Reference (UETR) used for SWIFT gpi tracking.
</ResponseField>

<ResponseField name="is_uuid_used_for_tracking" type="boolean">
  Boolean flag indicating if the `uuid` can be used for SWIFT tracking. It is `true` only if the payment is recent (\< 124 days), valid, and uses `SCHEMA_SWIFT`.
</ResponseField>

<ResponseField name="account_number" type="string">
  Account number of the beneficiary
</ResponseField>

<ResponseField name="amount" type="number">
  Payment amount
</ResponseField>

<ResponseField name="bank_identifier" type="string">
  The identifier of the beneficiary's bank
</ResponseField>

<ResponseField name="beneficiary_id" type="string">
  Unique identifier for the beneficiary
</ResponseField>

<ResponseField name="beneficiary_name" type="string">
  Name of the beneficiary
</ResponseField>

<ResponseField name="beneficiary_aml_id" type="string">
  Beneficiary ID formatted
</ResponseField>

<ResponseField name="beneficiary_active" type="boolean">
  Indicates if the beneficiary account is currently active
</ResponseField>

<ResponseField name="beneficiary_authorised" type="boolean">
  Indicates if the beneficiary has been authorised in the system
</ResponseField>

<ResponseField name="beneficiary_blocked" type="boolean">
  Indicates if the beneficiary is blocked from receiving payments
</ResponseField>

<ResponseField name="beneficiary_completed" type="boolean">
  Indicates if the beneficiary profile setup is complete
</ResponseField>

<ResponseField name="beneficiary_verified" type="boolean">
  Indicates if the beneficiary identity/account has been verified
</ResponseField>

<ResponseField name="created_date" type="string">
  Payment instruction created date
</ResponseField>

<ResponseField name="external_reference_id" type="string">
  Unique reference submitted by the client to identify the payment
</ResponseField>

<ResponseField name="fee_amount" type="number">
  Fee amount
</ResponseField>

<ResponseField name="fee_currency" type="string">
  Fee currency
</ResponseField>

<ResponseField name="iban" type="string">
  The IBAN of the beneficiary's bank account
</ResponseField>

<ResponseField name="ordered_by_name" type="string">
  Name of the contact who ordered the payment
</ResponseField>

<ResponseField name="payment_currency" type="string">
  Currency the payment was made in
</ResponseField>

<ResponseField name="payment_date" type="string">
  Target payment date. YYYY-MM-DD format
</ResponseField>

<ResponseField name="payment_instruction" type="string">
  URI to download payment instruction
</ResponseField>

<ResponseField name="payment_receipt" type="string">
  URI to download payment receipt
</ResponseField>

<ResponseField name="status" type="string">
  Simplified representation of the payment status designed for easy consumption in client applications. See [Status](#status)
</ResponseField>

<ResponseField name="internal_status" type="object">
  The raw/detailed internal status used by the system to track the complete lifecycle of payments. See [Internal Status](#internal-status)
</ResponseField>

<ResponseField name="swift_code" type="string">
  The SWIFT code of the beneficiary's bank account
</ResponseField>

<ResponseField name="authorised_by" type="string">
  The user who authorised the payment
</ResponseField>

<ResponseField name="authorised_date" type="string">
  The date when payment was authorised
</ResponseField>

<ResponseField name="rejected_by" type="string">
  The user who rejected the payment
</ResponseField>

<ResponseField name="rejected_date" type="string">
  The date when payment was rejected
</ResponseField>

<ResponseField name="cancelled" type="boolean">
  Boolean flag indicating if the payment has been cancelled
</ResponseField>

<ResponseField name="cancelled_by" type="string">
  The user who cancelled the payment
</ResponseField>

<ResponseField name="cancelled_date" type="string">
  The date when payment was cancelled
</ResponseField>

<ResponseField name="can_be_cancelled" type="boolean">
  Boolean indicating if the payment is currently in a state that allows cancellation
</ResponseField>

<ResponseField name="authorisation_workflow" type="string">
  The authorisation workflow of the payment. Acceptable values:

  * `simple`
  * `4-eyes`
</ResponseField>

<ResponseField name="invoice_required" type="boolean">
  Whether or not the payment requires an invoice
</ResponseField>

<ResponseField name="reference" type="string">
  The payment reference
</ResponseField>

<ResponseField name="charges" type="string">
  Charges applied to the payment
</ResponseField>

<ResponseField name="AML_status" type="number">
  Numerical status code representing the AML check result
</ResponseField>

<ResponseField name="AML_overdue" type="boolean">
  Indicates if the AML verification process has exceeded the expected timeframe
</ResponseField>

<ResponseField name="executed" type="boolean">
  Boolean indicating if the payment has been successfully executed
</ResponseField>

<ResponseField name="fully_funded" type="boolean">
  Indicates if the account has sufficient funds to cover the payment
</ResponseField>

<ResponseField name="over_paid" type="boolean">
  Indicates if the payment amount exceeds the trade or balance allocation
</ResponseField>

<ResponseField name="returned" type="boolean">
  Boolean indicating if the payment was returned by the receiving bank
</ResponseField>

<ResponseField name="verified" type="boolean">
  Indicates if the payment details have been verified
</ResponseField>

<ResponseField name="approvals_workflow" type="object">
  New approvals workflow related fields. See [Approvals Workflow](#approvals-workflow)
</ResponseField>

## Status

A simplified representation of the payment status designed for easy consumption in client applications.

**Values**

| Value | Description |
| - | - |
| `Need more beneficiary information` | Beneficiary information is not complete, more details are required. |
| `Validating beneficiary information` | Beneficiary information is complete, but not validated yet. |
| `Waiting for payment date` | Payment is ready to be executed, waiting for payment execution date. |
| `Payment complete` | Payment has been executed. |
| `Executing Payment` | Payment is in the process of being executed. |
| `Payment pending of authorization` | Payment has been verified but not authorised. |
| `Payment rejected` | Payment has been rejected. |
| `Payment cancelled` | Payment has been cancelled. |

## Payment Status Filter

Valid values for the `status` query parameter when filtering payments.

**Values**

| Value | Description |
| - | - |
| `pending` | Payments not yet executed (excludes completed, rejected, and cancelled). |
| `pending_to_authorise` | Payments awaiting authorisation. |
| `authorised` | Payments that have been authorised. |
| `cancelled` | Payments that have been cancelled. |
| `rejected` | Payments that have been rejected. |
| `complete` | Payments that have been fully executed. |
| `pending_your_approval` | (N-Eyes Plus) Payments awaiting approval from the current contact. |
| `pending_others_approval` | (N-Eyes Plus) Payments awaiting approval from other contacts. |

## Internal Status

The raw/detailed internal status used by the system to track the complete lifecycle of payments.

**Values**

| Status | CODE | Description |
| - | - | - |
| START | 0 | Initial state |
| CREATED | 1 | Payment created |
| PENDING\_OF\_AUTHORIZATION | 2 | Awaiting authorization |
| AUTHORISED | 3 | Payment authorized |
| REJECTED | 4 | Payment rejected |
| CANCELLED | 5 | Payment cancelled |
| DELIVERED | 6 | Payment delivered |
| DISCARDED | 7 | Payment discarded |
| QUERIED | 8 | Payment queried |
| AMENDED | 9 | Payment amended |
| MESSAGED | 10 | Message sent |
| ABORTED | 11 | Process aborted |
| RECONCILED | 12 | Payment reconciled |
| PENDING\_RETURN | 13 | Awaiting return |
| RETURNED | 14 | Payment returned |
| INVALIDATED | 15 | Payment invalidated |
| CLOSED | 16 | Payment closed |

## Payment Fee

```json theme={null}
{
    "fee_amount": "number",
    "fee_currency": "string",
    "payment_amount": "number",
    "payment_country": "string",
    "payment_currency": "string",
    "payment_instruction": "number",
    "payment_is_intra": "boolean"
}
```

This model is a representation of a payment fee.

**Fields**

<ResponseField name="fee_amount" type="number">
  Fee amount (Always)
</ResponseField>

<ResponseField name="fee_currency" type="string">
  Fee currency (Always)
</ResponseField>

<ResponseField name="payment_amount" type="number">
  Payment amount
</ResponseField>

<ResponseField name="payment_currency" type="string">
  Currency the payment was made in (Always)
</ResponseField>

<ResponseField name="payment_country" type="string">
  The destination country of the payment (Always)
</ResponseField>

<ResponseField name="payment_instruction" type="number">
  Payment instruction (Always)
</ResponseField>

<ResponseField name="payment_is_intra" type="boolean">
  True if payment is Ebury intra payments, False otherwise
</ResponseField>

## Approvals Workflow

For clients that have NEyes Plus enabled, the payments will go through the new Approvals Workflow, which means the following fields will be populated:

| Value | Description |
| - | - |
| `authorisations` | List of current authorisations the payment has already received. Includes the date when the payment was approved / rejected and the contact identifier and name |
| `contact_authorisation_actions` | Includes `allowed` actions for the current contact (`approve` / `reject` if the contact is allowed to perform those actions according to the Approvals Workflow, and `cancel` for the creator of the payment) and the `executed` action, if any |
| `n_eyes_plus_status` | Neyes Plus status of the payment |
