A sdk for interact with Change SOAP API
npm install change-request
or
yarn add change-request
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',
});
- Change Request
A Client entity
Type: object
-
agency
number The Change agency related to the client -
fullName
string Client full name -
shortName
string Client CPF with only numbers -
code
number Client CPF as integer -
type
number Client type on Change -
subType
string Client sub-type on Change -
address
string Address first line -
city
string Address city -
state
string Address state initials -
countryCode
number Address country code following Change internal rules -
originCountryCode
number Client origin country code following Change internal rules -
zipCode
string Address zip code -
createdAt
Date When client have been created on Change -
isActive
boolean Client status -
phone
string Obligation of the operation defined by Change -
mobile
string Obligation of the operation defined by Change -
birthDate
Date Obligation of the operation defined by Change -
rg
string Client RG only numbers -
email
string Client email -
operationalLimit
number Client operational limit in dollars -
operationalLimitPeriod
number Operational limit period in days
TODO - Create Remittance transaction entity
Type: object
A Paper Money transaction entity
Type: object
-
bank
string Bank inforamtion -
agency
number The agencyId of tha agency responsible for the money -
account
string The account number where the tranference will be made -
purposeCode
number Change purpodeCode for paper money -
clientCode
number Client cpf as integer -
currencyCode
string Currency code following ISO 4217 -
quotationValue
number Quotation value with 4 deciamals precision and without taxes -
nationalCurrencyValue
number National currency value without taxes -
foreignCurrencyValue
number Foreign currency value without taxes -
levelingRate
number Leveling rate with 4 deciamals precision -
countryCode
number Country code -
iofValue
number Total IOF value of the national currency value -
deliveryCost
number Delivery cost of the operation -
modality
string Modality of the operation defined by Change -
obligation
string Obligation of the operation defined by Change
Creates new RequestChange entity
-
baseURL
string public URL of change instance -
timeout
number Max time to waiting before cancel request (optional, default30000
)
Create new remittance transaction on Change
-
transactionData
-
Throws ClientBlocked
Returns object The created transaction
Create new paper money transaction on Change
-
transactionData
-
Throws ClientBlocked
Returns object The created transaction
Create new Client on change
-
clientData
-
Throws ClientAlreadyExists
Returns object The created clien
Search client by code (CPF)
-
code
number The client CPF
Returns object The client found
Search client by shortName (CPF)
-
shortName
string The client CPF
Returns object The client found
TODO
-
transactionData
object An transaction object
Returns object The transaction found
Search transaction by code
-
code
string The trnsaction unique code
Returns object The transaction found
Delete Invoice By Id
-
changeTransactionCode
string The Change invoice unique code
Returns object Message with success with invoice id deleted
Client has a blocked status on Change and the operation can't proceed
Type: ClientBlocked
Client already exists on Change, use an update method instead an insert method
Type: ClientAlreadyExists