6. Counterparty

Step by step of how to create, update and delete counterparties.

📑 Summary

  • Objective
  • Functionalities
  • Counterparty Creation
  • Examples
    • Outbound
    • Inbound
  • Counterparty Update
  • Counterparty Delete

Objective


The counterparty is a foreign entity that will send or receive the transferred values. This guide will explain how to create counterparties for inbound and outbound transactions.

Functionalities


Through the counterparty module, it is possible to:

Counterparty Creation


The required parameters to create a counterparty will depend on the direction of the intended transaction. The table below summarizes the required fields according to the direction of the intended transaction:

Field NameTransaction InboundTransaction OutboundDescription
namerequiredrequiredName of the counterparty, individual or legal.
currencyrequiredrequiredUSD, EUR, AUD or CHF
directionrequiredrequiredINBOUND or OUTBOUND
ffcoptionaloptionalAn arbitrary string that can be used to identify the bank account.
bankAccount.swiftCodenot requiredrequiredswift code of the bank receiving the transfer. swift.com
bankAccount.accountNumberTypenot requiredrequiredAvailable types are iban or account. It is informed by the bank receiving the transfer.
bankAccount.accountNumbernot requiredrequirediban or account code of the bank receiving the transfer.
bankAccount.bankNamerequirednot requiredName of the bank
bankAccount.countryrequiredrequiredCountry in which the counterparty's bank account is located (ISO 3166-1 alpha-2)
address.addressLine1optionalrequiredMaxLength: 100. Example: Av Paulista, 530
address.addressLine2optionaloptionalMaxLength: 50. Example: Cnj 53
address.cityoptionalrequiredMaxLength: 100. Example: São Paulo
address.stateoptionalrequiredMaxLength: 50. Example: SP
address.postalCodeoptionalrequiredMaxLength: 10. Example: 05423040
address.countryoptionalrequiredCountry in which the counterparty's address is located (ISO 3166-1 alpha-2)

Examples


📍 Outbound

1. Creating a counterparty for an OUTBOUND transaction to send American Dollars (USD) to the United States (US) for the purpose of CRYPTO:

a. First, verify with the bank receiving the transfer if the account number type is iban or account;

b. Assuming for this example that the account number type is account, the request body payload will be the following:

  1. {
        "direction": "OUTBOUND",
        "name": "counterparty name",
        "currency": "USD",
        "bankAccount": {
            "country": "US",
            "swiftCode": "CHASUS33",
            "accountNumberType": "account",
            "accountNumber": "670912227",
        },
        "address": {
            "country": "US",
            "addressLine1": "7 Straits View, Marina One",
            "addressLine2": "East Tower #05-01",
            "city": "New York",
            "state": "NY",
            "postalCode": "018936"
        }
    }
    

2. Creating a counterparty for an OUTBOUND transaction to send Euros (EUR) to Portugal (PT) for the purpose of PAYMENT_PROCESSING:

a. First, verify with the bank receiving the transfer if the account number type is iban or account;

b. Assuming for this example that the account number type is iban, the request body payload will be the following:

{  
    "direction": "OUTBOUND",  
    "name": "counterparty name",  
    "currency": "EUR",  
    "bankAccount": {
        "country": "PT",
        "swiftCode": "BPNPPTPL",
        "accountNumberType": "iban",
        "accountNumber": "PT97003506511651388376186"
    } 
    "address": {  
        "country": "PT",  
        "addressLine1": "Av. Alm. Reis 1 H, 1150-007",  
        "city": "Lisboa",  
        "state": "PT",  
        "postalCode": "1150-007"  
    }  
}

📍 Inbound

1. Creating a counterparty for an INBOUND transaction exchanging American Dollars (USD) to Reais (BRL) from a bank account located in the United States (US):

a. It is not necessary to check bank account field requirements. The request body payload will be the following:

{
    "direction": "INBOUND",
    "name": "counterparty name",
    "currency": "USD",
    "bankAccount": {
        "country": "US",
        "bankName": "Remessa bank"
    }
}

2. Creating a counterparty for an INBOUND transaction exchanging Euros (EUR) to Reais (BRL) from a bank account located in Germany (DE):

a. It is not necessary to check bank account field requirements. The request body payload will be the following:

{
    "direction": "INBOUND",
    "name": "counterparty name",
    "currency": "EUR",
    "bankAccount": {
        "country": "DE",
        "bankName": "Remessa bank"
    }
}

Counterparty Update


It is possible to update any optional attributes partially using the endpoint Update counterparty . For the following attributes the criteria is:

  1. Address: if counterparty's address already has attributes, it is possible to update any attribute. To update an address that was previously null, it is necessary to provide addressLine1, city, state, country and postalCode.

2.bankAccount: it is possible to update bankAccount attributes according to the following criteria:

  1. when counterparty is used for inbound transactions, it is possible to update bankName and country;
  2. when counterparty is used for outbound transactions, it is possible to update accountType, branchCode, bankCode, bankLocalCode, accountNumber and bankName;
  3. to enable the possibility of a counterparty used in inbound transactions to be used for outbound transactions, it is necessary to add the required information described in the counterparty creation table above.

Counterparty Delete


It is possible to delete a counterparty using the endpoint Delete counterparty giving the id as parameter .