@frentecorretora/change_request
v5.11.2
Published
A sdk for interact with Change SOAP API
Downloads
1,112
Keywords
Readme
Change Request
A sdk for interact with Change SOAP API
Instalation
npm install change-request
or
yarn add change-request
Usage
const RequestChange = require('change-request');
const url = 'http://sampleurl.com';
const timeout = 30000;
const requestChange = new RequestChange(url, timeout);
await requestChange.insertClient({
agency: 10000,
fullName: 'MAdasdas asdasdas',
code: 87037473014,
subType: 'F',
address: 'Rua Baquirivu 392',
city: 'São Paulo',
state: 'SP',
originCountryCode: 1058,
countryCode: 1058,
zipCode: '59148370',
});
API
Table of Contents
- Change Request
Client
A Client entity
Type: object
Properties
agency
number The Change agency related to the clientfullName
string Client full nameshortName
string Client CPF with only numberscode
number Client CPF as integertype
number Client type on ChangesubType
string Client sub-type on Changeaddress
string Address first linecity
string Address citystate
string Address state initialscountryCode
number Address country code following Change internal rulesoriginCountryCode
number Client origin country code following Change internal ruleszipCode
string Address zip codecreatedAt
Date When client have been created on ChangeisActive
boolean Client statusphone
string Obligation of the operation defined by Changemobile
string Obligation of the operation defined by ChangebirthDate
Date Obligation of the operation defined by Changerg
string Client RG only numbersemail
string Client emailoperationalLimit
number Client operational limit in dollarsoperationalLimitPeriod
number Operational limit period in days
Transaction
TODO - Create Remittance transaction entity
Type: object
PaperMoney
A Paper Money transaction entity
Type: object
Properties
bank
string Bank inforamtionagency
number The agencyId of tha agency responsible for the moneyaccount
string The account number where the tranference will be madepurposeCode
number Change purpodeCode for paper moneyclientCode
number Client cpf as integercurrencyCode
string Currency code following ISO 4217quotationValue
number Quotation value with 4 deciamals precision and without taxesnationalCurrencyValue
number National currency value without taxesforeignCurrencyValue
number Foreign currency value without taxeslevelingRate
number Leveling rate with 4 deciamals precisioncountryCode
number Country codeiofValue
number Total IOF value of the national currency valuedeliveryCost
number Delivery cost of the operationmodality
string Modality of the operation defined by Changeobligation
string Obligation of the operation defined by Change
RequestChange
Creates new RequestChange entity
Parameters
baseURL
string public URL of change instancetimeout
number Max time to waiting before cancel request (optional, default30000
)
insertTransaction
Create new remittance transaction on Change
Parameters
transactionData
Throws ClientBlocked
Returns object The created transaction
insertPaperMoneyTransaction
Create new paper money transaction on Change
Parameters
transactionData
Throws ClientBlocked
Returns object The created transaction
insertClient
Create new Client on change
Parameters
clientData
Throws ClientAlreadyExists
Returns object The created clien
searchClientByCode
Search client by code (CPF)
Parameters
code
number The client CPF
Returns object The client found
searchClientByShortName
Search client by shortName (CPF)
Parameters
shortName
string The client CPF
Returns object The client found
searchTransaction
TODO
Parameters
transactionData
object An transaction object
Returns object The transaction found
searchTransactionByCode
Search transaction by code
Parameters
code
string The trnsaction unique code
Returns object The transaction found
deleteInvoiceById
Delete Invoice By Id
Parameters
changeTransactionCode
string The Change invoice unique code
Returns object Message with success with invoice id deleted
ClientBlocked
Client has a blocked status on Change and the operation can't proceed
Type: ClientBlocked
ClientAlreadyExists
Client already exists on Change, use an update method instead an insert method
Type: ClientAlreadyExists