Globalization for Marketplaces
Published by Miranda Danielson on September 13, 2021
Last updated on November 4, 2021
New features to enable configuration of multi-currency and multi-language Marketplaces.
New Resource: Locale
1"Locale": {2 "ID": "en-US-USD",3 "Currency": "USD",4 "Language": "en-US"5}
The Locale
resource is assignable to Buyers and Buyer User Groups. Both Currency
and Language
are string properties with a maximum length of 100. We recommend using ISO-4217 currency codes and ISO-639-1 language code - ISO-3166 Country Codes respectively for compatibility with other platforms such as payment processors, tax calculation services, and content management systems. The ID property is writable and follows the same convention as all other writable IDs in OrderCloud.
The
Language
property will not control any OrderCloud behavior, but is provided to make the process of building a multi-language UI easier for the developer.The
Currency
property will impact a few OrderCloud behaviors (outlined below).A
Locale
object will be returned on both theUser
resource and theMeUser
resource. If noLocale
is assigned, the object will be null.Only ever assign one Locale per party (Buyer or UserGroup). Assigning multiple to the same party is considered a misconfiguration and will yield unexpected results
Locale
will drive a few different behaviors around products and ordering:A user will only see product pricing in the
Currency
from their assignedLocale
, if noLocale
is assigned, they will only be able to view pricing whereCurrency
is null.A user will only be able to create a
LineItem
if theLineItem.Product
has pricing available in theCurrency
from their assignedLocale
. If noLocale
is assigned, they will only be able to create aLineItem
if theLineItem.Product
has pricing available whereCurrency
is null.A user will only be able to create and submit an
Order
with aCurrency
from their assignedLocale
. If a user'sLocale
changes between the time anOrder
is created and submitted, submitting the order will fail.
New Endpoints
GET v1/locales/{localeID}
GET v1/locales
POST v1/locales
PUT v1/locales
PATCH v1/locales/{localeID}
DELETE v1/locales/{localeID}
GET v1/locales/assignments
POST v1/locales/assignments
DELETE v1/locales/{localeID}/assignments
New Properties
Order.Currency
Read-only
Inherited from the Order.FromUser's assigned Locale, if no Locale is assigned, the property will be null.
Payment.Currency
Read-only
Inherited from Order.Currency
Payment.Transaction.Currency
Writable, can be null
Can be used when you have multiple currencies in the same payment. For example, the presentment currency (currency of the charge to the customer) could be different than the settlement currency (currency of the destination account).
PriceSchedule.Currency
Writable, can be null
Calling POST v1/products/assignments with a PriceScheduleID will require that the party being assigned has a Locale with a Currency that matches the PriceSchedule.
Modifying Currency on a PriceSchedule will first do a check to ensure it is not assigned to any parties, and will throw an error if so.
User.Locale
Read-only
Helpful for displaying correct information in the UI based on a user's Language and/or Currency
Still have questions?
Ask in our Community Channel