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

# Create a mass payment instruction

Create a new mass payment instruction in async mode only. A mass payment instruction requires either a single sell currency or existing trade ID to be specified in order to create an instruction. Note that within a mass payment instruction it is not possible to use different sell currencies per payment.

<Warning>Please note that if a trade ID is being passed in the request, the payments in a mass payment instruction must be of the same BUY currency.</Warning>


## OpenAPI

````yaml /openapi.json post /mass-payments
openapi: 3.0.0
info:
  description: |
    Ebury API allows customers:
      to retrieve accounts, balances, beneficiaries, and transactions;
      to get buy/sell estimates and quotes, book trades and retrieve trade history;
      to allocate payments to a trade and beneficiary, and to submit payments in bulk;
      to download documents such as trade receipt, payment instruction and payment receipt;
      to manage the authorised persons on their account.
    The Metadata API allows applications to clarify some parts of the Ebury API
      that are impractical to express schematically.
  termsOfService: https://docs.ebury.io/#terms-of-use
  title: Ebury API
  version: '0.1'
servers:
  - url: https://{environment}.ebury.io
    variables:
      environment:
        default: api
        enum:
          - api
          - sandbox
security:
  - api_key: []
paths:
  /mass-payments:
    post:
      tags:
        - Multi Payments
      summary: Create a mass payment instruction
      description: >-
        Submit mass payment request in async mode. Requires either a sell
        currency or existing trade ID to create the instruction
      parameters:
        - description: The ID of the client
          in: query
          name: client_id
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: The access token
          required: true
          schema:
            type: string
        - description: The ID of the contact
          in: header
          name: X-Contact-ID
          required: false
          schema:
            type: string
        - description: VoP authorization ID to confirm not full-match payment
          in: query
          name: vop_authorization_id
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewMassPayment'
        description: Request Payload
        required: true
      responses:
        '202':
          description: Masspayment request accepted, see response body for status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MassPaymentResponse'
        '400':
          description: >-
            Formatting or schema validation error. See error message for further
            details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: Access denied due to authentication failure
        '403':
          description: >-
            Could not complete action due to data constraints. Refer to error
            message for additional details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Client ID not found
        '422':
          description: VoP check failed, or provided `vop_authorization_id` is not valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '502':
          description: Internal integration error. Contact support,
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
components:
  schemas:
    NewMassPayment:
      required:
        - auto_commit
        - payment_instructions
      type: object
      properties:
        external_reference_id:
          description: >-
            The external reference: unique ID supplied by customer which can be
            used later to filter.
          type: string
          default: ''
        auto_commit:
          description: >-
            If true, send successful instructions for payment. If false, hold
            until customer hits commit endpoint.
          type: boolean
        sell_currency:
          description: If `trade_id` omitted, `sell_currency` must be supplied.
          type: string
        trade_id:
          description: >-
            Trade ID to book payments against. If customer wants the trade to be
            auto booked then this parameter should not be supplied.
          type: string
        payment_instructions:
          description: Array of multiple payment instruction given by the customer.
          type: array
          items:
            $ref: '#/components/schemas/NewMultiPaymentItem'
    MassPaymentResponse:
      properties:
        mass_payment_id:
          description: The UUID of the MassPayment just created
          type: string
          format: uuid
        external_reference_id:
          description: The external reference for the MassPayment, if supplied
          type: string
        mass_payment_status:
          $ref: '#/components/schemas/EnumMassPaymentStatus'
    ErrorMessage:
      description: An error message.
      properties:
        code:
          type: string
          description: The code for the error.
        details:
          description: Error details
          type: string
        message:
          type: string
          description: A short description of the cause of the error.
      required:
        - code
        - message
        - details
      type: object
    NewMultiPaymentItem:
      required:
        - account_number
        - bank_address
        - bank_code
        - bank_country
        - bank_name
        - beneficiary_address
        - beneficiary_country
        - beneficiary_name
        - direction
        - iban
        - payment_amount
        - payment_currency
        - reason_for_trade
        - swift_code
        - trade_type
        - value_date
      properties:
        account_number:
          description: Destination account number
          type: string
          nullable: true
        bank_address:
          description: Destination bank address
          type: string
          nullable: true
        bank_code:
          description: Destination bank code
          type: string
          nullable: true
        bank_country:
          description: Destination bank country
          type: string
          minLength: 1
        bank_name:
          description: Destination bank name
          type: string
          nullable: true
        beneficiary_address:
          description: Address of beneficiary
          type: string
          nullable: true
        beneficiary_name:
          description: Name of beneficiary
          type: string
          nullable: true
        beneficiary_country:
          description: Country of beneficiary
          type: string
          nullable: true
        direction:
          description: Type of payment, 'buy' or 'sell'
          type: string
          enum:
            - buy
            - sell
        iban:
          description: IBAN of the destination account
          type: string
          nullable: true
        payment_currency:
          description: Destination currency
          type: string
          minLength: 1
        payment_amount:
          description: Amount to be paid
          type: number
          format: float
          minimum: 0
        reason_for_trade:
          description: Reason for trade
          type: string
          nullable: true
        payment_reference:
          description: Reference of payment
          type: string
          nullable: true
        swift_code:
          description: SWIFT code of destination bank
          type: string
          nullable: true
        trade_type:
          description: Type of trade. 'spot' is the only supported value at the moment
          type: string
          enum:
            - spot
        value_date:
          description: Date when the transaction will be performed
          type: string
          nullable: true
        beneficiary_reference:
          description: Reference of beneficiary
          type: string
          nullable: true
        purpose_of_payment:
          description: Text describing the purpose of the payment
          type: string
          nullable: true
        reference:
          description: Payment reference
          type: string
          nullable: true
        inn:
          description: The INN of the bank account
          type: string
          pattern: ^[0-9]{10}([0-9]{2})?$
          nullable: true
        vo:
          description: The VO of the bank account
          type: string
          nullable: true
        kio:
          description: The KIO of the bank account
          type: string
          nullable: true
        russian_central_bank_account:
          description: Russian central bank account
          type: string
          nullable: true
      type: object
    EnumMassPaymentStatus:
      description: This is an enumeration of the status of a MassPayment
      enum:
        - Queued for processing
        - Processing
        - Processed
        - Queued for creating
        - Creating
        - Created
        - Cancelled
        - Failed
      type: string
  securitySchemes:
    api_key:
      description: An API Key.
      in: header
      name: x-api-key
      type: apiKey

````