Allows to create the address of the user
with data or errors.
country: Represents the country code under ISO 3166-1 alpha 2
const {data, error} = await checkout.createAddress({
first_name: 'Jhon',
last_name: 'Doe',
phone: '+59 663663663',
identity_document: '1150218418',
lat: -0.1637022,
lng: -78.499344,
address1: 'El Bosque, Quito, Ecuador',
address2: 'casa',
city: 'Quito',
zipcode: '2040E',
state_name: 'Pichincha',
state_code: "SS12",
country: 'EC',
address_type: 'home',
additional_description: 'casa',
is_default: false,
is_billing_address: false
})
Allows you to delete an address
As a parameter for this method you must enter the "id" of the address you want to delete.
const { data, error } = await checkout.deleteAddress(1002)
Allows you to edit the user's address
As parameters for this method, you need to enter the address id and the payload of the new address to edit.
const addressPayload = {
first_name: 'Jhon',
last_name: 'Doe',
phone: '+59 663663663',
identity_document: '1150218418',
lat: -0.1637022,
lng: -78.499344,
address1: 'El Bosque, Quito, Ecuador',
address2: 'casa',
city: 'Quito',
zipcode: '2040E',
state_name: 'Pichincha',
state_code: "SS13",
country: 'EC',
address_type: 'home',
additional_description: 'casa',
is_default: false,
is_billing_address: false
}
const { data, error } = await checkout.editAddress(1093, addressPayload);
Allows you to get all the shipping addresses of the user
const { data, error } = await checkout.getAddresses();
Generated using TypeDoc
Will allow us to use the methods related to addresses where we can perform the following actions: create a user address, get shipping addresses, edit address and delete address