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
Languageproperty will not control any OrderCloud behavior, but is provided to make the process of building a multi-language UI easier for the developer.The
Currencyproperty will impact a few OrderCloud behaviors (outlined below).A
Localeobject will be returned on both theUserresource and theMeUserresource. If noLocaleis 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
Localewill drive a few different behaviors around products and ordering:A user will only see product pricing in the
Currencyfrom their assignedLocale, if noLocaleis assigned, they will only be able to view pricing whereCurrencyis null.A user will only be able to create a
LineItemif theLineItem.Producthas pricing available in theCurrencyfrom their assignedLocale. If noLocaleis assigned, they will only be able to create aLineItemif theLineItem.Producthas pricing available whereCurrencyis null.A user will only be able to create and submit an
Orderwith aCurrencyfrom their assignedLocale. If a user'sLocalechanges between the time anOrderis created and submitted, submitting the order will fail.
New Endpoints
GET v1/locales/{localeID}GET v1/localesPOST v1/localesPUT v1/localesPATCH v1/locales/{localeID}DELETE v1/locales/{localeID}GET v1/locales/assignmentsPOST v1/locales/assignmentsDELETE 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