Addresses API
This allows you to manage your addresses with Terminal Africa
Sample Payload
typescript
const addressPayload = {
first_name: 'Terminal',
last_name: 'Africa',
email: 'email@example.com',
phone: '+2348123456789',
is_residential: true,
line1: '01, Terminal Africa HQ',
line2: 'Alausa',
metadata: {customerId: 1},
city: 'Ikeja',
state: 'Lagos',
country: 'NG',
zip: '100123',
}
Create Address
typescript
const address: any = await TerminalAfrica.createAddress(addressPayload);
Update Address
typescript
const addressId: any = 'AD-0123456789';
const address: any = await TerminalAfrica.updateAddress(addressId, addressPayload);
Get Addresses
Request
typescript
const queryParams = `?page=1&perPage=10`;
const addresses: any = await TerminalAfrica.getAddresses(queryParams);
Get Address
typescript
const addressId = 'AD-12345678'
const address: any = await TerminalAfrica.getAddress(addressId);
Validate Address
typescript
const address: any = await TerminalAfrica.validateAddress(addressPayload);
Set Default Sender Address
typescript
const addressId = 'AD-123456789'
const addressData: {
address_id: addressId
}
const address: any = await TerminalAfrica.setDefaultSenderAddress(addressData);
Get Sender Default Address
typescript
const address: any = await TerminalAfrica.getDefaultSenderAddress();