5. Company Customer Transaction

Step by step of how to create an company customer transaction in FXaaS.

📑 Summary

  • Objective
  • Functionalities
  • Requirements
  • Outbound Transaction Flow
    • Creating Outbound Transaction
    • Data for Creating an Outbound Transaction
    • Remessa Online's Partner Bank Account Details
    • Outbound Transaction Statuses
  • Inbound Transaction Flow
    • Creating Inbound Transaction
    • Payment Order
    • Data for Creating an Inbound Transaction
    • Inbound Transaction Statuses

Objective


Allow the partner to generate an inbound or outbound transaction by passing some specific parameters. In order to create a transaction, the partner must first make a quote. The quote id will be used when completing the transaction.

Functionalities


Through the company customer transaction module, it is possible to:

Requirements


  • The partner must first create a quote that cannot have expired (all quotes expire after 5 minutes of creation);
  • The parameters corresponding to each type of transaction must be passed (we will go through each one);
  • The customer requesting the transaction must have an "approved" status in the back office;
  • A single customer can only have 1 open OUTBOUND transaction;
  • A single customer can have n open INBOUND transactions.

Outbound Transaction Flow


πŸ“ 1. Creating Outbound Transaction

Creating an outbound transaction takes place after the quote has been created and validated by the API. Once the outbound transaction is created, the payment should be made to Remessa Online's partner bank account. If the partner does not have custody of the value, the partner can display the account details so the customer can transfer the value. After Remessa Online's partner bank receives the payment, we will start the transaction flow on our end.

The available purposes for outbound transactions are:

Outbound Purposes

Outbound Purposes

The outbound transaction flow is described below:

Outbound Transaction Flow

Outbound Transaction Flow

Some steps of this process are asynchronous, so the partner can register webhooks which will automate the delivery of notifications with the updated transaction status.

πŸ“˜

Upload Invoice

After creating the transaction,If the outbound transaction is for the purpose of services payment or comex, the customer must send the document that proves the transaction.

πŸ“ 2. Data for Creating an Outbound Transaction

To request an outbound transaction, you need to provide the required parameters:

Field NameIs requiredDescription
taxIdYesValid Brazilian company tax id number (CNPJ).
classificationYesValid identification for specific purposes from the Central Bank of Brazil.
quoteIdYesQuotation ID.
externalIdNoExternal transaction ID created by the partner.

πŸ“˜

Classification

The classification is a subcategory of the transaction, this information is required by the central bank of Brazil for legal entity transactions.

The classifications accepted by the API are:

  • Copyright, assignment, or use of computer programs (SOFTWARE_COPYRIGHT);
  • Computer Professionals (SOFTWARE_PROFESSIONALS);
  • Legal Professions (LEGAL_PROFESSIONAL);
  • Copyright, copying license, distribution (COPYRIGHT);
  • Air transport, import freight (AIR_TRANSPORT_FREIGHT);
  • Advertising, market research, and opinion polls (ADVERTISING_MARKET_RESEARCH);
  • Business consulting and public relations (BUSINESS_CONSULTING);
  • Other Services (OTHER_SERVICES).

Below you can see an example of a full request for creating an outbound transaction:

curl --request POST \
     --url https://fx-sandbox.remessaonline.com.br/v1/api/transactions \
     --header 'Authorization: Bearer {{token}}' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'x-token: {{x-token}}' \
     --data '
{
    "taxId": "33456204000190",
    "quoteId": "333208aa-2cf1-43c9-96f4-d96bc2679a57",
    "externalId": "ext-33456204000190-1",
    "classification": "SOFTWARE_COPYRIGHT"
}

πŸ“ 3. Remessa Online's Partner Bank Account Details

Field NameDescription
BankBanco TopΓ‘zio SA (082)
Agency0001
Checking Account Number6685193-2
FavoredBanco TopΓ‘zio SA
CNPJ07.679.404/0001-00
Account TypeChecking Account (Conta Corrente)
Transaction TypeTED (Credit in Checking Account)
PIX Key
c027f762-36df-4301-addd-c3d8995c43f7

🚧

Payment Methods & Transfer Validation

The customer must submit the TED or PIX from an account in their name. If the transaction is made by a third party, the transaction will be canceled and the amount will be returned by the partner bank.

πŸ“ 4. Outbound Transaction Statuses

The process of creating and confirming an outbound transaction will return some statuses that highlight what stage the transaction is at. These statuses can be:

StatusDescription
PENDINGTransaction in process of creation. Wait for confirmation.
AWAITING_PAYMENTAwaiting confirmation of payment. The identification takes approximately 2 working hours (within Brazilian business hours).
AWAITING_DOCUMENT_UPLOADUploading the document is required to proceed to the next steps.
PAYMENT_UNDER_CONFIRMATIONWe are waiting for the payment order of the amount in foreign currency to be sent to our partner bank's account.
PAYMENT_CONFIRMEDWe received the payment made by the company.
TRANSACTION_SETTLEDThe transaction is being registered with the Central Bank in Brazil.
TRANSACTION_CONFIRMEDTransaction confirmed at the partner bank.
UNDER_ANALYSISWe identified a pending payment with the customer.
PAYMENT_RETURNEDThe transaction was returned by the beneficiary's bank. This happens when there is an error in the data or by bank policy. The customer is required to contact our customer service for more information.
CANCELEDThe transaction was canceled in our system.
FINISHEDTransaction sent to the beneficiary.
REFUNDEDThe transaction was refunded.

🚧

AWAITING_PAYMENT

This status means that we are waiting for the payment of the amount in BRL to be made to our partner bank's account. Only at this point the partner should display the bank account details so that the customer can pay the transfer.

Inbound Transaction Flow


πŸ“ 1. Creating Inbound Transaction

Creating an inbound transaction takes place after the quote has been generated and validated by the API. In addition, the partner must also have created a bank account linked to the customer who is making the inbound transaction. You can create a customer bank account through this endpoint.

The available purposes for inbound transactions are:

Inbound Purposes

Inbound Purposes

The inbound transaction flow is described below:

Inbound Transaction Flow

Inbound Transaction Flow

The withdrawal amount becomes available as soon as our partner bank identifies that the remittance has been paid by the remitter. This amount is then held by the bank until the customer creates the transaction and redeems the money into their bank account registered with FXaaS.

There also are some asynchronous steps in this process. For these steps, the partner can register webhooks which will automate the delivery of notifications with the updated transaction status.

πŸ“ 2. Payment Order

1367

Inbound Transaction Payment Order Flow

The payment order is a financial instrument to enable the partner to receive money from abroad, whereby the customer can withdraw the amount to his or her bank account. In order to receive a payment order, the customer must receive a deposit into his or her account in FXaaS. The remitter pays the amount into the customer's account and Remessa Online makes it available for withdrawal in Brazil.

  • A payment order can only be used by the user who received it;
  • When the customer decides to withdraw the money received through the order, the amount of the transaction must be equal to the amount received in the order;
  • The payment order should only be used for the purposes of FOREIGN_AVAILABILITY and RESIDENT_MAINTENANCE for individual customers and SERVICE for companies;
  • For the purposes of INVESTMENT_RETURN, a payment order will not be required.

πŸ“˜

Webhook subscription

Don't forget to register on the webhook for the event PAYMENT_ORDER_RECEIVED.

These are the Payment Order statuses:

StatusDescription
OPENThe payment order is open and can be used in an inbound transaction.
WITHDRAWThe payment order was used in an inbound transaction and is in the process of being withdrawn.

πŸ“ 3. Data for Creating an Inbound Transaction

To request an inbound transaction, you need to provide the required parameters:

Field NameIs requiredDescription
taxIdYesValid Brazilian company tax id number (CNPJ).
classificationYesValid identification for specific purposes from the Central Bank of Brazil.
bankAccountIdYesBank Account ID.
quoteIdYesQuotation ID.
externalIdNoExternal transaction ID created by the partner.
paymentOrderIdYesThis is the Id of the payment order made by the remitter abroad. This Id will be returned to the partner via webhook as soon as the payment is identified by Remessa Online Partner Bank.
expectedNumberOfDocumentsNoThis parameter can be included in the operation to indicate how many documents will be sent for the respective operation. The maximum allowed is 4 documents. For INBOUND transactions, the document is only required if the operation is of the comex purpose.

πŸ“˜

Upload Invoice

After creating the transaction,If the inbound transaction is for the purpose of comex, the customer must send the document that proves the transaction.

Below you can see an example of a full request for creating an inbound transaction:

curl --request POST \
     --url https://fx-sandbox.remessaonline.com.br/v1/api/transactions \
     --header 'Authorization: Bearer {{token}}' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'x-token: {{x-token}}' \
     --data '
{
    "taxId": "00905849000295",
    "quoteId": "ffb31597-61b3-4cac-8eba-5e5d39709bed",
    "bankAccountId": "42dc0b71-876d-4be7-840f-241a967a4ae2",
    "classification": "SOFTWARE_COPYRIGHT",
		"paymentOrderId": "2aa9eba9-b51c-44ab-aa9b-377dae3f4c39"
}

πŸ“ 4. Inbound Transaction Statuses

The process of creating and confirming an inbound transaction will return some statuses that highlight what stage the transaction is at. These statuses can be:

StatusDescription
PENDINGTransaction in process of creation. Wait for confirmation.
PAYMENT_UNDER_CONFIRMATIONWe are waiting for the payment order of the amount in foreign currency to be sent to our partner bank's account.
WITHDRAW_IN_PROGRESSWe received the payment order sent by the partner.
PAYMENT_RETURNEDThe transaction was returned by the bank This happens when there is an error in the data or by bank policy. The customer is required to contact our customer service for more information.
CANCELEDThe transaction was canceled in our system. The customer is required to contact our customer service for more information.
FINISHEDMoney has been sent to the destination account.

Addition of Multi-Document Sending for Business Operations

In order to facilitate the sending or receiving of business operations, it is possible to include multiple documents to validate the nature of the operation. These documents can be an invoice or a group of documents.

To enable the sending of multiple documents for these operations, we have implemented this functionality in the FXaaS API.

  • expectedNumberOfDocuments: This parameter can be included in the operation to indicate how many documents will be sent for the respective operation. The maximum allowed is 4 documents.

When passing this number, a request should be made to the document upload endpoint for each document. For example, if expectedNumberOfDocuments is set to 2, two requests should be made to the transaction document upload endpoint.

The transactions that need documents to be completed are:

  • Inbound: COMEX;
  • Outbound: COMEX, SERVICE;

After the documents are uploaded, the transaction will undergo analysis and proceed through the completion process.