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 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
Transaction
TODO - Create Remittance transaction entity
Type: object
PaperMoney
A Paper Money transaction entity
Type: object
Properties
-
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
RequestChange
Creates new RequestChange entity
Parameters
-
baseURL
string public URL of change instance -
timeout
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