<p>Not simple at the moment. This is because a single address could be used for both shipping and billing on an order during checkout.</p>

<p>You could subvert an existing address field you don't utilize (like <code>attention</code> or <code>title</code>) to store their preference, but that's pretty hacky.</p>

<p>If the user is logged in you have access to their last used shipping and billing addresses with:</p>

<pre><code>{{ craft.commerce.customer.lastUsedBillingAddress ?? '' }}
{{ craft.commerce.customer.lastUsedshippingAddress ?? '' }}
</code></pre>

<p>Do you think an <code>address.usedAs</code> field would be useful? It would likely store something like: <code>billing</code>, <code>shipping</code>, or <code>both</code>. Thoughts?</p>

CC BY-SA 3.0
2017-03-08T12:31:12.173Z
Thanks Luke. A 'usedAs' field as you describe is precisely the kind of thing that would solve this issue. It would especially be useful in B2B scenarios where there could be many Shipping Addresses and only one Billing Address - and we need to know which is which.
Mike
CC BY-SA 3.0
2017-03-08T10:26:52.250Z
2017-03-09T01:14:52.417Z
2017-03-09T01:14:52.417Z
Luke Holder
<p>Is there any method to differentiate between a shipping and billing address in Commerce once a customer has gone through a checkout? I ask because if they come back to their account and want to review their attached addresses and edit them, we want to be able to display them as a Shipping Address and a Billing Address. But from the docs, it appears you can only loop through all addresses with no way to really differentiate them beyond their ID.</p>

<p>This is a pretty common scenario in B2B stores where there may be different shipping addresses for different outlets but one billing address for the head office.</p>

<plugin-craftcommerce>
Craft Commerce - How To differentiate between Shipping and Billing Addresses?
# Craft Commerce - How To differentiate between Shipping and Billing Addresses?

(Asked by: username_0 on 2017-03-08)

Is there any method to differentiate between a shipping and billing address in Commerce once a customer has gone through a checkout? I ask because if they come back to their account and want to review their attached addresses and edit them, we want to be able to display them as a Shipping Address and a Billing Address. But from the docs, it appears you can only loop through all addresses with no way to really differentiate them beyond their ID.

This is a pretty common scenario in B2B stores where there may be different shipping addresses for different outlets but one billing address for the head office.

**Tags:** plugin-craftcommerce

---

## 1 answers

### Answer by username_1 on 2017-03-08. Score: 1 | Accepted answer

Not simple at the moment. This is because a single address could be used for both shipping and billing on an order during checkout.
You could subvert an existing address field you don't utilize (like attention or title) to store their preference, but that's pretty hacky.
If the user is logged in you have access to their last used shipping and billing addresses with:
{{ craft.commerce.customer.lastUsedBillingAddress ?? '' }}
{{ craft.commerce.customer.lastUsedshippingAddress ?? '' }}

Do you think an address.usedAs field would be useful? It would likely store something like: billing, shipping, or both. Thoughts?

> **Comments:**
> **username_0**: Thanks Luke. A 'usedAs' field as you describe is precisely the kind of thing that would solve this issue. It would especially be useful in B2B scenarios where there could be many Shipping Addresses and only one Billing Address - and we need to know which is which.  

---

