swagger: '2.0'
schemes:
  - https
host: greysystems.eu
basePath: /api/v1
info:
  version: 1.0.0-beta
  title: GS-Transfer Online REST API
  contact:
    email: developers@greysystems.eu
    url: 'http://www.greysystems.eu/#contact'
  license:
    name: All Rights reserved GreySystems 2022
    url: 'http://www.greysystems.eu'
  termsOfService: 'https://www.greysystems.eu'
  x-logo:
    url: 'http://www.greysystems.eu/wp-content/uploads/2017/07/logo-Grey-menu.png'
    background: '#FFFFFF'
  description: |
    This page contains the documentation on how to use the GS-Transfer API.

    **API is in beta version, breaking changes may be introduced before the final release candidate is released**

    # Introduction

    The GS-Transfer API is built on top of HTTP:
    - RESTFul
    - Predictable resource URLs. 
    - Accepts and returns JSON in the HTTP body. 
    - Returns HTTP response codes to indicate errors. 

    You can use your favorite HTTP/REST library for your programming language to consume this API. 

    # The GS-Transfer System
    The GS-Transfer is an integrated set of APIs to create and manage moneypools created by customers for other customers.
    There are the differentes modules exposed by this API: 

    * **Catalogs**: This module is used to get the catalog information like, cities, currencies, etc 
    * **Customers**: Register and manage the system customer. 
    * **Sendings**: Send transfers. 
    * **Payments**: Paid Transfers. 

    # Authentication
    ### Please, note that the users should already be registered in the system, in order to get access to the system.

    The Transfer Api uses the [Oauth2](https://oauth.net/2/)  standard as authentication protocol. Specifically the security used is JWT tokens.

    Currently, the final user won't be authenticated in our system to made an operation. Therefore, we recommend to use the [Client Credential](https://oauth.net/2/grant-types/client-credentials/) flow defined in Oauth, very useful for services that call the API without user intervention.

    **How do I get a token?** To get a valid token, you will  do a POST call to **/auth/token** endpoint using these parameters in a form body:
    * **grant_type (required)**: The grant_type parameter must be set to client_credentials.
    * **scope (optional)**: Your service can support different scopes for the client credentials grant. In practice, not many services actually support this.
    * **Client Authentication (required)**: The client needs to authenticate themselves for this request. Typically the service will allow either additional request parameters **client_id** and **client_secret**, or accept the client ID and secret in the HTTP Basic auth header.

    In the response, you will get a valid access token, the expiration time, the refresh token and the refresh token expiration time.

    Let see a response screenshot for a valid client_credential request:
    ![access token](resources/authorizations/access_token.png)

    Furthermore, if the access token is expired, you can refresh it calling again to **/auth/token**  with this parameters:
    * **grant_type (required)**: The grant_type parameter must be set to client_credentials.
    * **scope (optional)**: Your service can support different scopes for the client credentials grant. In practice, not many services actually support this.
    * **refresh_token (required)**: The refresh token given in the previous call.
    * **Client Authentication (required)**: The client needs to authenticate themselves for this request. Typically the service will allow either additional request parameters client_id and client_secret, or accept the client ID and secret in the HTTP Basic auth header.

    Once the token has been refreshed, you can use the new access token in a normal way.

    **How do I use the tokens?** As stated in the introduction, the tokens types are JWT ones, and you should set that token in the HTTP Authorization Header of the API call in this way:

    ```
    Authorization: Bearer {the_token}
    ```

    # Common HTTP Error Responses

    The MTC Rest API uses the following common HTTP status codes to communicate general issues or errors to the clients: 
     
    * HTTP **401** (Non authorized): The token provided is expired, inexistent or non-valid.
    * HTTP **400** (Invalid Request): The request provided is invalid (request is not well formed, a mandatory field is not provided, etc..).
    * HTTP **403** (Forbidden): You are not allowed to access or update the requested resource. 
    * HTTP **409** (Conflict): There is a conflict when trying to execute the operation (status change not allowed, compliance, etc..). 
    * HTTP **500** (Internal Server Error): Some internal component has failed to process your request. Please, notify to Grey Systems team.



    # Annexes
    ## Gender

    | Code | Description |
    |-----|-------|
    | M   | Male     |
    | F   | Female     |

    ## Civil status

    | Code | Description |
    |-----|-------|
    | DIV   | Divorced     |
    | MAR   | Married     |
    | UNM   | Unmarried     |
    | WID   | Widowed     |

    ## Identity document type

    | Code | Description |
    |-----|-------|
    | NICD   | National identity document     |
    | LICI   | Libreta Cívica     |
    | LIEN   | Libreta de Enrolamiento     |
    | CEID   | Cédula de Identidad     |
    | PASS   | Passport     |
    | UALI   | US Alien Id     |

    ## Labour code type

    | Code | Description |
    |-----|-------|
    | CDI   | CDI     |
    | CUIL   | CUIL     |
    | CUIT   | CUIT     |

    ## Activity branches

    | Code | Description | Requires additional information|
    |-----|-------|-----------------------------|
    |1|Administrative activities and support services|No|
    |2|Art and Entertainment Activities|No|
    |3|Insurance activities|No|
    |4|Bank activities|No|
    |5|Professional, scientific and technical activities (except Lawyers, Accountants)|No|
    |6|Travel agencies|No|
    |7|Agriculture, livestock, fishing, hunting, forestry|No|
    |8|Money exchange|No|
    |9|Auction houses and auctioneers|No|
    |10|Casinos, Gambling halls|No|
    |11|Anticuarios Antique dealers|No|
    |12|Merchants and distributors of precious metals|No|
    |13|Wholesale and retail trade (except supermarkets, gastronomy, garages, free shops)|No|
    |14|Vehicle dealerships (cars, boats and aircraft)|No|
    |15|Building|No|
    |16|Brokerage / Brokers / Stockbrokers / Investors |No|
    |17|Lawyers / Law Firm|No|
    |18|Accountants / Accountants Study|No|
    |19|Mining and quarrying|No|
    |20|Garages / Free shops|No|
    |21|Gastronomy (restaurants, bars)|No|
    |22|Racecourses|No|
    |23|Hotels, Hostels, Holiday Villages|No|
    |24|Importers / Exporters|No|
    |25|Manufacturing industry (specify)|No|
    |26|Information and communication|No|
    |27|Real Estate|No|
    |28|Institutions and Teaching Professionals|No|
    |29|Institutions and Health Professionals|No|
    |30|Non-Governmental Organizations (NGO's)|No|
    |31|Nonprofit organizations|No|
    |32|Others (specify)|**Yes**|
    |33|Producers, dealers and distributors of weapons|No|
    |34|Services to households and domestic service|No|
    |35|Supplies (water, sewage, sanitation, electricity, gas supply, others)|No|
    |36|Supermarkets|No|
    |37|Transportation and storage|No|

    ## Position jobs

    | Code | Description | Requires additional information|
    |-----|-------|-----------------------------|
    |1|Administrative|No|
    |2|Auxiliary/Assistant|No|
    |3|Analyst|No|
    |4|ATM|No|
    |5|Treasurer|No|
    |6|Worker / operator|No|
    |7|Pawn|No|
    |8|Secretary / receptionist / telephone operator|No|
    |9|Seller|No|
    |10|Account executive, sales executive|No|
    |11|Programmer / Developer and other Systems|No|
    |12|User Support / Help Desk / Call Center Operator|No|
    |13|Boss / Manager / Foreman|No|
    |14|Deputy Manager|No|
    |15|Manager|No|
    |16|Director|No|
    |17|Driver, cadet, ordinance|No|
    |18|Consultant|No|
    |19|Other (specify)|**Yes**|

    ## Payour mode

    | Code | Description |
    |-----|-------|
    | OF   | Cash pick-up money-transfer. |
    | BA   | Money is deposited directly in the beneficiary bank account. |
    | HD   | Money is delivered at beneficiary’s address. |
    | MBP  | Mobile Payment. |
    | CSA  | Cash pick-up anywhere. |

    ## Customer relationship

    | Code | Description | Requires additional information|
    |-----|-------|-----------------------------|
    |1|Father|No|
    |2|Mother|No|
    |3|Son|No|
    |4|Daugher|No|
    |5|Husband|No|
    |6|Wifi|No|    
    |7|Cousin|No|
    |8|Brother|No|
    |9|Sister|No|
    |10|Uncle|No|
    |11|Aunt|No|
    |12|Friend|No|
    |13|Niece|No|
    |14|Newhew|No|
    |15|Grand father|No|
    |16|Grand mohter|No|
    |17|Grand son|No|
    |18|Grand daughter|No|
    |19|Grand father in law|No|
    |20|Grand mohter in law|No|
    |21|Grand sister in law|No|
    |22|Grand brother in law|No|
    |23|Grand fiance|No|
    |24|Business associate|No|  
    |25|Service provider|No|
    |26|Employer|No|
    |27|Employee|No|
    |28|Self|No|
    |29|Other|**Yes**|

    ## Suspicious behaviour

    | Code | Description | Requires additional information | Operation |
    |-----|-------|-----------------------------|-----------------------------|
    |1|Nothing to report | No | Both |
    |2|Accompanied customer | No | Both |
    |3|Reluctant to produce an ID document | No | Both |
    |4|Reluctant to produce a proof of address | No | Both |
    |5|Just below the limit to avoid completing form | No | Send |
    |6|Reluctant to produce a proof of address | No | Send |
    |7|Other | **Yes** | Both |
    |9|Client has many beneficiaries | No | Send |
    |10|Less than 26 years old sends high amounts | No | Send |
    |11|Does not seem to know his/her beneficiary | No | Send |
    |12|Pays with many small notes | No | Send |
    |15|Refused to show other document or required information | No | Both |
    |16|Present aldulterated documentation | No | Both |
    |17|Suspend or modify operation conditions after requiring mandatory documentation |No |Send |
    |18|Customer is using counterfeit banknotes | No | Send |
    |19|Does not seem to know his/her sender | No | Payment |
    |20|Client has many senders | No| Payment |
tags:
  - name: catalogs
    description: Manage corporate catalogs.
  - name: customers
    description: Manage customers.
  - name: sendings
    description: Sending transfers.
  - name: payments
    description: Receiving transfers.
securityDefinitions:
  JWT:
    description: 'You can obtain a JSON Web Token (`access_token`), using our OpenID Connect Authorizations Server'
    type: apiKey
    name: 'Authorization: Bearer access_token'
    in: header
security:
  - JWT: []
paths:
  '/catalog/country/{iso3}/city':
    get:
      tags:
        - catalogs
      summary: Search cities by country and name.
      description: 'Returns a list of cities, filtering them by country and by the name passed by parameters. The name must contain at least three characters.'
      parameters:
        - name: iso3
          in: path
          required: true
          type: String
          description: ISO 3166 country iso code (Alpha3).
        - name: name
          in: query
          required: false
          type: String
          description: 'Search term to look for cities within a country specific by countryIso3 parameter. This parameter is optional, but to avoid overloads we recommend its use, entering at least three characters.'
      responses:
        '200':
          description: Returns a list with the cities which match the filter.
          schema:
            type: array
            items:
              $ref: '#/definitions/City'
        '400':
          description: 'Invalid parameters, response contains detailed error.'
          schema:
            $ref: '#/definitions/Error'
        '404':
          description: Country or cities not found.
          schema:
            $ref: '#/definitions/Error'
  /customer:
    post:
      summary: Create or update customers.
      description: |
        Creates new customers in the Pushmoney system. Please, note that all new customers sent to the server to be created will be checked against a black list service. If the new customer matches in any blacklist, it will be created as blocked. This method ever returns the same response if both the customer is created blocked or unblocked.

        `This method requires authentication`
      operationId: customeSave
      parameters:
        - name: Customer
          in: body
          required: true
          schema:
            $ref: '#/definitions/CustomerCreateRequest'
      tags:
        - customers
      responses:
        '200':
          description: 'Customer successfully created or updated, with the code generated by the system that unique identifies the customer'
          schema:
            $ref: '#/definitions/CustomerCreateResponse'
        '400':
          description: Invalid Request. Message attribute of response contains detailed information about the issue
          schema:
            $ref: '#/definitions/Error'
        '401':
          description: Unauthorized.
          schema:
            $ref: '#/definitions/Error'
        '409':
          description: 'Conflict. Message attribute of response contains duplicate customer, etc.'
          schema:
            $ref: '#/definitions/Error'
  /customer/search:
    post:
      summary: Search customers.
      description: |
        Search customers in the Pushmoney system.

        `This method requires authentication`
      operationId: customeSave
      parameters:
        - name: Customer
          in: body
          required: true
          schema:
            $ref: '#/definitions/CustomerSearchRequest'
      tags:
        - customers
      responses:
        '200':
          description: Returns a list of customers or an empty list.
          schema:
            $ref: '#/definitions/CustomerSearchResponse'
        '400':
          description: Invalid Request. Message attribute of response contains detailed information about the issue
          schema:
            $ref: '#/definitions/Error'
        '401':
          description: Unauthorized.
          schema:
            $ref: '#/definitions/Error'
        '409':
          description: 'Conflict. Message attribute of response contains duplicate customer, etc.'
          schema:
            $ref: '#/definitions/Error'
  /transfer/send:
    post:
      summary: Send a transfer.
      description: |
        Creates new transfers in the Pushmoney system.

        `This method requires authentication`
      operationId: sendTransfer
      parameters:
        - name: SendRequest
          in: body
          required: true
          schema:
            $ref: '#/definitions/SendRequest'
      tags:
        - sendings
      responses:
        '200':
          description: Transfer successfully send.
          schema:
            $ref: '#/definitions/SendResponse'
        '400':
          description: Invalid Request. Message attribute of response contains detailed information about the issue
          schema:
            $ref: '#/definitions/Error'
        '401':
          description: Unauthorized.
          schema:
            $ref: '#/definitions/Error'
        '409':
          description: 'Conflict. Message attribute of response contains duplicate customer, etc.'
          schema:
            $ref: '#/definitions/Error'
  /transfer/send/cancel:
    post:
      summary: Cancel transfer sent.
      description: |
        Cancel transfers sent in the Pushmoney system.

        `This method requires authentication`
      operationId: sendCancelTransfer
      parameters:
        - name: SendTransferCancellation
          in: body
          required: true
          schema:
            $ref: '#/definitions/SendTransferCancellation'
      tags:
        - sendings
      responses:
        '200':
          description: Transfer successfully cancelled.
        '400':
          description: Invalid Request. Message attribute of response contains detailed information about the issue
          schema:
            $ref: '#/definitions/Error'
        '401':
          description: Unauthorized.
          schema:
            $ref: '#/definitions/Error'
        '409':
          description: 'Conflict. Message attribute of response contains duplicate customer, etc.'
          schema:
            $ref: '#/definitions/Error'
  /transfer/payment:
    post:
      summary: Pay a transfer.
      description: |
        Pay a transfer.

        `This method requires authentication`
      operationId: searchTransfer
      parameters:
        - name: PayTransferRequest
          in: body
          required: true
          schema:
            $ref: '#/definitions/PayTransferRequest'
      tags:
        - payments
      responses:
        '200':
          description: Transfer successfully paid.
          schema:
            $ref: '#/definitions/PayTransferResponse'
        '400':
          description: Invalid Request. Message attribute of response contains detailed information about the issue
          schema:
            $ref: '#/definitions/Error'
        '401':
          description: Unauthorized.
          schema:
            $ref: '#/definitions/Error'
        '409':
          description: 'Conflict. Message attribute of response contains duplicate customer, etc.'
          schema:
            $ref: '#/definitions/Error'
  /transfer/payment/rollback:
    post:
      summary: Payment rollback.
      description: |
        Payment rollback in the Pushmoney system.

        `This method requires authentication`
      operationId: rollbackPayTransfer
      parameters:
        - name: PayTransferCancellation
          in: body
          required: true
          schema:
            $ref: '#/definitions/PayTransferCancellation'
      tags:
        - payments
      responses:
        '200':
          description: Transfer payment successfully roolback.
        '400':
          description: Invalid Request. Message attribute of response contains detailed information about the issue
          schema:
            $ref: '#/definitions/Error'
        '401':
          description: Unauthorized.
          schema:
            $ref: '#/definitions/Error'
        '409':
          description: 'Conflict. Message attribute of response contains duplicate customer, etc.'
          schema:
            $ref: '#/definitions/Error'
definitions:
  Error:
    type: object
    required:
      - code
      - message
    properties:
      code:
        type: String
        description: The error code. This error code should define the error type returned.
        example: code
      message:
        type: String
        description: The error description. A message that resume the error thrown by the system.
        example: Something happened.
  City:
    type: object
    required:
      - id
      - name
    properties:
      id:
        description: Id of the city.
        type: BigInteger
        example: 12341234
      name:
        description: Name of the city (locale based). Will return non-ascii characters for those cities that are originally written using non-latin alphabet.
        type: String
        example: London
  CustomerCreateRequest:
    type: object
    required:
      - firstName
      - lastname
      - gender
      - phone1
      - email
      - nationality
      - birthCountry
      - birthCityId
      - birthDate
      - address
      - civilStatus
      - occupation
      - document
      - labourTypeCode
      - labourNumber
      - activityBranchId
      - positionJobId
    properties:
      code:
        description: Customer code. Code customer local property is ignored in case it is provided in the creation of a customer
        type: String
        example: '111212'
      codeExternal:
        description: Customer code in your system.
        type: String
        example: CR2323
      firstName:
        description: Customer first name.
        type: String
        example: Ben
      lastname:
        description: Customer last name.
        type: String
        example: Simmons
      gender:
        description: Customer gender. (Review annex).
        type: String
        example: M
      phone1:
        description: Customer principal phone.
        type: String
        example: '+34666666666'
      phone2:
        description: Customer secondary number.
        type: String
        example: '+34666666666'
      email:
        description: Customer email.
        type: String
        example: mail@mail.com
      nationality:
        description: Customer's nationality. ISO 3166 country iso code (Alpha3).
        type: String
        example: ARG
      birthCountry:
        description: Customer's country of birth . ISO 3166 country iso code (Alpha3).
        type: String
        example: ARG
      birthCityId:
        description: Customer's city of birth.
        type: Integer
        example: 1123
      birthDate:
        description: Customer birthdate.
        type: LocalDate
        example: '2021-05-23'
      address:
        description: Customer address.
        $ref: '#/definitions/Address'
      civilStatus:
        description: Code of civil status. (Review annex).
        type: String
        example: DIV
      occupation:
        description: Occupation.
        type: String
        example: Tester
      document:
        description: Customer identity document.
        $ref: '#/definitions/IdentityDocument'
      labourTypeCode:
        description: Code of labour type. (Review annex).
        type: String
        example: CUIT
      labourNumber:
        description: Labour number.
        type: String
        example: '343434'
      activityBranchId:
        description: Id of activity branch. (Review annex).
        type: BigInteger
        example: 12
      activityBranchExtraInfo:
        description: 'This field is required for some cases, check the annexes.'
        type: String
        example: Building
      positionJobId:
        description: Id of position job. (Review annex).
        type: BigInteger
        example: 12
      positionJobExtraInfo:
        description: 'This field is required for some cases, check the annexes.'
        type: String
        example: Director
  CustomerCreateResponse:
    type: object
    required:
      - code
    properties:
      code:
        description: The customer's code.
        type: String
        example: '1212'
  CustomerSearchRequest:
    type: object
    properties:
      firstName:
        description: Customer first name.
        type: String
        example: Ben
      lastname:
        description: Customer last name.
        type: String
        example: Simmons
      birthDate:
        description: Customer birthdate.
        type: LocalDate
        example: '2021-05-23'
      idDocumentNumber:
        description: Document number.
        type: String
        example: 23234G
      code:
        description: Internal customer code in our system
        type: String
        example: '111212'
      codeExternal:
        description: Customer code in your system.
        type: String
        example: CR2323
  CustomerSearchResponse:
    type: object
    required:
      - code
      - firstName
      - lastname
      - gender
      - phone1
      - email
      - nationality
      - birthCountry
      - birthCityId
      - birthDate
      - address
      - civilStatus
      - occupation
      - document
      - labourTypeCode
      - labourNumber
      - activityBranchId
      - positionJobId
    properties:
      code:
        description: Customer code. Code customer local property is ignored in case it is provided in the creation of a customer
        type: String
        example: '111212'
      codeExternal:
        description: Customer code in your system.
        type: String
        example: CR2323
      firstName:
        description: Customer first name.
        type: String
        example: Ben
      lastname:
        description: Customer last name.
        type: String
        example: Simmons
      gender:
        description: Customer gender. (Review annex).
        type: String
        example: M
      phone1:
        description: Customer principal phone.
        type: String
        example: '+34666666666'
      phone2:
        description: Customer secondary number.
        type: String
        example: '+34666666666'
      email:
        description: Customer email.
        type: String
        example: mail@mail.com
      nationality:
        description: Customer's nationality. ISO 3166 country iso code (Alpha3).
        type: String
        example: ARG
      birthCountry:
        description: Customer's country of birth . ISO 3166 country iso code (Alpha3).
        type: String
        example: ARG
      birthCityId:
        description: Customer's city of birth.
        type: Integer
        example: 1123
      birthDate:
        description: Customer birthdate.
        type: LocalDate
        example: '2021-05-23'
      address:
        description: Customer address.
        $ref: '#/definitions/Address'
      civilStatus:
        description: Code of civil status. (Review annex).
        type: String
        example: DIV
      occupation:
        description: Occupation.
        type: String
        example: Tester
      document:
        description: Customer identity document.
        $ref: '#/definitions/IdentityDocument'
      labourTypeCode:
        description: Code of labour type. (Review annex).
        type: String
        example: CUIT
      labourNumber:
        description: Labour number.
        type: String
        example: '343434'
      activityBranchId:
        description: Id of activity branch. (Review annex).
        type: BigInteger
        example: 12
      activityBranchExtraInfo:
        description: 'This field is required for some cases, check the annexes.'
        type: String
        example: Building
      positionJobId:
        description: Id of position job. (Review annex).
        type: BigInteger
        example: 12
      positionJobExtraInfo:
        description: 'This field is required for some cases, check the annexes.'
        type: String
        example: Director
  Address:
    type: object
    required:
      - street
      - country
      - cityId
      - postalCode
    properties:
      street:
        description: Street and number.
        type: Integer
        example: 'Elm Street, 13'
      country:
        description: Country of residence. ISO 3166 country iso code (Alpha3).
        type: String
        example: ARG
      cityId:
        description: Customer residence city.
        type: Integer
        example: 12121
      postalCode:
        description: Postal Code.
        type: String
        example: 1232F
  IdentityDocument:
    type: object
    required:
      - number
      - type
      - expiryDate
      - deliveryDate
      - deliveryCountry
    properties:
      number:
        description: Document number.
        type: String
        example: 23234G
      type:
        description: Code of document type. (Review annex).
        type: String
        example: PASS
      expiryDate:
        description: Expiration date of the identity document.
        type: LocalDate
        example: '2021-05-23'
      deliveryDate:
        description: Delivery date of the identity document.
        type: LocalDate
        example: '2021-05-23'
      deliveryCountry:
        description: 'ISO 3166 country iso code (Alpha3), Country that issued the identity document.'
        type: String
        example: ARG
  SendRequest:
    type: object
    required:
      - agentId
      - senderCustomer
      - beneficiaryCustomer
      - sourceCurrency
      - sourceCountry
      - destinationCountry
      - payoutCurrency
      - calculatorMode
      - payoutMode
      - customerRelationship
      - suspiciousBehaviour
      - operator
    properties:
      agentId:
        description: Identifier of the sending agent.
        type: BigInteger
        example: 11212
      senderCustomer:
        description: Sender customer.
        $ref: '#/definitions/PrimaryCustomer'
      beneficiaryCustomer:
        description: Beneficiary customer.
        $ref: '#/definitions/SecondaryCustomer'
      sourceCountry:
        description: 'ISO 3166 country iso code (Alpha3), Sending country code ISO.'
        type: String
        example: ARG
      destinationCountry:
        description: 'ISO 3166 country iso code (Alpha3), Pay-out country code ISO.'
        type: String
        example: ESP
      sourceAmount:
        description: Source amount.
        $ref: '#/definitions/Amount'
      destinationAmount:
        description: Destination amount.
        $ref: '#/definitions/Amount'
      payoutMode:
        description: Kind of service to provide. (Review annex).
        type: String
        example: CSA
      customerRelationship:
        description: Customer eelationship. (Review annex).
        type: BigInteger
        example: 12
      customerRelationshipExtraInfo:
        description: 'This field is required for some cases, check the annexes.'
        type: String
        example: Coworker
      suspiciousBehaviour:
        description: Suspicious behaviour. (Review annex).
        type: Integer
        example: 1
      otherSuspiciousBehaviour:
        description: 'This field is required for some cases, check the annexes.'
        type: String
        example: null
      operator:
        description: Information of the operator that performs the operation.
        type: String
        example: Michael Mic
  PrimaryCustomer:
    type: object
    required:
      - firstName
      - lastname
      - gender
      - phone1
      - email
      - nationality
      - birthCountry
      - birthCityId
      - birthDate
      - address
      - civilStatus
      - occupation
      - document
      - labourTypeCode
      - labourNumber
      - activityBranchId
      - positionJobId
    properties:
      code:
        description: Customer code. Code customer local property is ignored in case it is provided in the creation of a customer
        type: String
        example: '111212'
      codeExternal:
        description: Customer code in your system.
        type: String
        example: CR2323
      firstName:
        description: Customer first name.
        type: String
        example: Ben
      lastname:
        description: Customer last name.
        type: String
        example: Simmons
      gender:
        description: Customer gender. (Review annex).
        type: String
        example: M
      phone1:
        description: Customer principal phone.
        type: String
        example: '+34666666666'
      phone2:
        description: Customer secondary number.
        type: String
        example: '+34666666666'
      email:
        description: Customer email.
        type: String
        example: mail@mail.com
      nationality:
        description: Customer's nationality. ISO 3166 country iso code (Alpha3).
        type: String
        example: ARG
      birthCountry:
        description: Customer's country of birth . ISO 3166 country iso code (Alpha3).
        type: String
        example: ARG
      birthCityId:
        description: Customer's city of birth.
        type: Integer
        example: 1123
      birthDate:
        description: Customer birthdate.
        type: LocalDate
        example: '2021-05-23'
      address:
        description: Customer address.
        $ref: '#/definitions/Address'
      civilStatus:
        description: Code of civil status. (Review annex).
        type: String
        example: DIV
      occupation:
        description: Occupation.
        type: String
        example: Tester
      document:
        description: Customer identity document.
        $ref: '#/definitions/IdentityDocument'
      labourTypeCode:
        description: Code of labour type. (Review annex).
        type: String
        example: CUIT
      labourNumber:
        description: Labour number.
        type: String
        example: '343434'
      activityBranchId:
        description: Id of activity branch. (Review annex).
        type: BigInteger
        example: 12
      activityBranchExtraInfo:
        description: 'This field is required for some cases, check the annexes.'
        type: String
        example: Building
      positionJobId:
        description: Id of position job. (Review annex).
        type: BigInteger
        example: 12
      positionJobExtraInfo:
        description: 'This field is required for some cases, check the annexes.'
        type: String
        example: Director
  SecondaryCustomer:
    type: object
    required:
      - firstName
      - lastname
      - nationality
      - phone1
      - birthDate
    properties:
      codeExternal:
        description: Customer code in your system.
        type: String
        example: CR2323
      firstName:
        description: Customer first name.
        type: String
        example: Ben
      lastname:
        description: Customer last name.
        type: String
        example: Simmons
      gender:
        description: Customer gender. (Review annex).
        type: String
        example: M
      phone1:
        description: Customer principal phone.
        type: String
        example: '+34666666666'
      phone2:
        description: Customer secondary number.
        type: String
        example: '+34666666666'
      email:
        description: Customer email.
        type: String
        example: mail@mail.com
      nationality:
        description: Customer's nationality. ISO 3166 country iso code (Alpha3).
        type: String
        example: ARG
      birthCountry:
        description: Customer's country of birth . ISO 3166 country iso code (Alpha3).
        type: String
        example: ARG
      birthCityId:
        description: Customer's city of birth.
        type: Integer
        example: 1123
      birthDate:
        description: Customer birthdate.
        type: LocalDate
        example: '2021-05-23'
      address:
        description: Customer address.
        $ref: '#/definitions/Address'
      civilStatus:
        description: Code of civil status. (Review annex).
        type: String
        example: DIV
      occupation:
        description: Occupation.
        type: String
        example: Tester
      document:
        description: Customer identity document.
        $ref: '#/definitions/IdentityDocument'
      labourTypeCode:
        description: Code of labour type. (Review annex).
        type: String
        example: CUIT
      labourNumber:
        description: Labour number.
        type: String
        example: '343434'
      activityBranchId:
        description: Id of activity branch. (Review annex).
        type: BigInteger
        example: 12
      activityBranchExtraInfo:
        description: 'This field is required for some cases, check the annexes.'
        type: String
        example: Building
      positionJobId:
        description: Id of position job. (Review annex).
        type: BigInteger
        example: 12
      positionJobExtraInfo:
        description: 'This field is required for some cases, check the annexes.'
        type: String
        example: Director
      bankAccountNumber:
        description: Bank account number to deposit the money. *Not optional for “BA” money transfers. Only applies on “BA” (Bank Account) money transfers.*
        type: String
        example: null
      bankAgencyName:
        description: Branch name of the office linked with the customer’s bank account. *Only applies on “BA” (Bank Account) money transfers.*
        type: String
        example: null
      bankAccountType:
        description: Bank account type. CA = Current Account. SA = Saving Account
        type: String
        example: null
  SendResponse:
    type: object
    required:
      - uniqueReferenceNumber
      - transactionCode
    properties:
      uniqueReferenceNumber:
        description: Is the "Unique Reference Number" for a Money Transfer. This code identifies a transaction making it unique within Push Money system.
        type: String
        example: '23131212'
      transactionCode:
        description: 'Is the alphanumeric code to be used by the beneficiary to pick-up the money at destination. It is extremely important that the beneficiary knows about it. In some cases, both “URN” and “Transaction Code” are the same.'
        type: String
        example: TC11223
  PayTransferRequest:
    type: object
    required:
      - agentId
      - transactionCode
      - senderCustomer
      - beneficiaryCustomer
      - destinationCountry
      - sourceCountry
      - sourceAmount
      - destinationAmount
      - suspiciousBehaviour
      - operator
      - sendingDate
    properties:
      agentId:
        description: Identifier of the receiving agent.
        type: BigInteger
        example: 11212
      transactionCode:
        description: Transaction code.
        type: String
        example: TC11212
      senderCustomer:
        description: Sender customer.
        $ref: '#/definitions/SecondaryCustomer'
      beneficiaryCustomer:
        description: Beneficiary customer.
        $ref: '#/definitions/PrimaryCustomer'
      sourceCountry:
        description: 'ISO 3166 country iso code (Alpha3), Sending country code ISO.'
        type: String
        example: ARG
      destinationCountry:
        description: 'ISO 3166 country iso code (Alpha3), Pay-out country code ISO.'
        type: String
        example: ESP
      sourceAmount:
        description: Source amount.
        $ref: '#/definitions/Amount'
      destinationAmount:
        description: Destination amount.
        $ref: '#/definitions/Amount'
      suspiciousBehaviour:
        description: Suspicious behaviour. (Review annex).
        type: Integer
        example: 1
      otherSuspiciousBehaviour:
        description: 'This field is required for some cases, check the annexes.'
        type: String
        example: null
      operator:
        description: Information of the operator that performs the operation.
        type: String
        example: Michael Mic
      sendingDate:
        description: Sending date.
        type: LocalDate
        example: '2021-05-23'
  PayTransferResponse:
    type: object
    required:
      - uniqueReferenceNumber
      - transactionCode
    properties:
      uniqueReferenceNumber:
        description: Is the "Unique Reference Number" for a Money Transfer. This code identifies a transaction making it unique within Push Money system.
        type: String
        example: '23131212'
      transactionCode:
        description: Transaction code.
        type: String
        example: TC11223
  Amount:
    description: The amount and currency of the operation.
    type: object
    required:
      - amount
      - ccy
    properties:
      amount:
        description: Amount.
        type: BigDecimal
        example: 300.56
      ccy:
        description: ISO 3166 currency iso code (Alpha3).
        type: String
        example: EUR
  SendTransferCancellation:
    type: object
    required:
      - agentId
      - uniqueReferenceNumber
      - transactionCode
      - reason
      - operator
    properties:
      agentId:
        description: Identifier of the sending agent.
        type: BigInteger
        example: 11212
      uniqueReferenceNumber:
        description: The "Unique Reference Number" for a Money Transfer.
        type: String
        example: '23131212'
      transactionCode:
        description: Transaction Code
        type: String
        example: TC11223
      reason:
        description: Reason for cancellation.
        type: String
        example: The customer wants his money back
      operator:
        description: Information of the operator that performs the operation.
        type: String
        example: Michael Mic
  PayTransferCancellation:
    type: object
    required:
      - agentId
      - uniqueReferenceNumber
      - transactionCode
      - reason
      - operator
    properties:
      agentId:
        description: Identifier of the receiving agent.
        type: BigInteger
        example: 11212
      uniqueReferenceNumber:
        description: The "Unique Reference Number" for a Money Transfer.
        type: String
        example: '23131212'
      transactionCode:
        description: Transaction Code
        type: String
        example: TC11223
      reason:
        description: Reason for cancellation.
        type: String
        example: The customer wants his money back
      operator:
        description: Information of the operator that performs the operation.
        type: String
        example: Michael Mic
