> ## 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.

# Mass Payment Model

This model is a representation of a mass payment.

**Fields**

<ResponseField name="mass_payment_id" type="string">
  Unique UUID of the mass payment.
</ResponseField>

<ResponseField name="external_reference_id" type="string">
  Unique ID of the external reference submitted by the client.
</ResponseField>

<ResponseField name="error" type="object">
  The generic [error message](/api/getting-started#error-handling) for the mass payment request, if any.
</ResponseField>

<ResponseField name="mass_payment_status" type="string">
  The [MassPaymentStatus](#masspaymentstatus).
</ResponseField>

<ResponseField name="sell_currency" type="string">
  The sell currency of the mass payment.
</ResponseField>

<ResponseField name="trades_created" type="number">
  Total number of created trades.
</ResponseField>

<ResponseField name="payments_summary" type="object">
  The [PaymentsSummaryTypes](#paymentssummary-types)
</ResponseField>

<ResponseField name="links" type="object">
  Links to the [PaymentsSummaryLinks](#paymentssummary-links)
</ResponseField>

## MassPaymentStatus

The mass\_payment\_status values of the mass payment instruction.

**Values**

| Value | Description |
| - | - |
| `queued for processing` | The mass payment submission request has been received by Ebury and it has been queued for payment instruction, validation and beneficiary creation. |
| `processing` | The mass payment request is being processed. [PaymentsSummaryTypes](#paymentssummary-types) will have value=0 because the mass payment instruction validation and beneficiary creation is not yet complete. |
| `processed` | The payment has been processed. [PaymentsSummaryTypes](#paymentssummary-types) will now contain values (except for payments\_created and trade\_created which will have value=0) because the payment has not yet reached "created". |
| `queued for creating` | The mass payment submission request has been received by Ebury and it has been queued for payment instruction validation and beneficiary creation. |
| `creating` | The mass payment has been picked up from the queue and it has been submitted for trade and payment creation. [PaymentsSummaryTypes](#paymentssummary-types) will now contain values (except for payments\_created and trade\_created which will have value=0) because the payment has not yet reached "created". |
| `created` | The payment and trade have been created. [PaymentsSummaryTypes](#paymentssummary-types) will now contain relevant values as the process is now complete. Also PaymentsSummeryLinks object will contain a new property funding\_account\_href. |

<img src="https://mintcdn.com/ebury/hyecsfNgRYJYRIcg/images/MassPayment_Flow.png?fit=max&auto=format&n=hyecsfNgRYJYRIcg&q=85&s=8eb0d9c1c9b4fd3aff7eeed6c8cbc0b4" style={{ display: "block", margin: "0 auto" }} width="831" height="201" data-path="images/MassPayment_Flow.png" />

## PaymentsSummary Types

This is an enumeration of PaymentsSummary types.

**Fields**

<ResponseField name="payments_received" type="number">
  Total count of received payments
</ResponseField>

<ResponseField name="payments_processed" type="number">
  Total count of processed payments
</ResponseField>

<ResponseField name="payments_errored" type="number">
  Total count of errored payments
</ResponseField>

<ResponseField name="payments_created" type="number">
  Total count of created payments
</ResponseField>

## PaymentsSummary Links

This is an enumeration of PaymentsSummary Links. Each link helps the user agent to fetch resources related to payment errors, payments created successfully, trade and funding accounts associated with the mass payment id. The mass\_payment\_id does not need to be stored as the said resources may be accessed with the provided links.

**Fields**

<ResponseField name="payments_errored_href" type="string">
  `/mass-payments/$mass_payment_id/errors` \*\*
</ResponseField>

<ResponseField name="payments_created_href" type="string">
  `/payments?mass_payment_id=$mass_payment_id` \*
</ResponseField>

<ResponseField name="trades_href" type="string">
  `/trades?client_id=$client_id&mass_payment_id=$mass_payment_id` \*
</ResponseField>

<ResponseField name="funding_account_href" type="string">
  `/mass-payments/$mass_payment_id/funding_account` \*
</ResponseField>

\*\* Following URL response will return back data when mass\_payment\_status is "processed" and includes errors.

\* Following URL response will return back data when mass\_payment\_status is "created".
