ShopCurrency
Private Shop Currency API endpoints
A page of the currencies the shop sells in, unpublished ones included: the base currency first, then the extra currencies in the order they were added.
Query parameters
pageoptionalintegerPage number
Defaults to 1.
per_pageoptionalintegerItems per page
Defaults to 50.
Returnsobject
Shop currencies list response
Error responses
400objectThe shop has no base currency (base_currency_missing).
422objectpage is not an integer of at least 1, or per_page is not an integer from 1 to 500.
Add an extra currency with the gateway that takes card payments in it. Customers can pick the new currency unless published is false, and it comes last in the list. A currency removed earlier comes back with none of its old rate, price ending or gateways.
Request body
currency_codeRequiredstringA code from GET /currencies, in any letter case. It cannot be the base currency or a currency the shop already sells in.
card_gateway_idRequiredintegerThe gateway, one of GET /gateways, that takes card payments in this currency: a Stripe, Braintree or Authorize.Net gateway. A Braintree gateway that another currency of the shop uses is refused.
paypal_gateway_idoptionalinteger | nullThe gateway, one of GET /gateways, that takes PayPal payments in this currency: a PayPal gateway or a Braintree gateway with PayPal turned on, which may also be the card gateway. A Braintree gateway that another currency of the shop uses is refused.
custom_exchange_rateoptionalnumber | nullThe shop's own rate, with at most 4 decimals: a base currency price multiplied by it gives the price in this currency. Leave it out or send null to use automatic_exchange_rate.
price_endingoptionalinteger | nullThe cents every converted price ends in: 99 gives 11.99, 0 gives whole numbers. Leave it out or send null to keep converted prices to the cent.
publishedoptionalbooleanWhether customers can pick the currency.
Defaults to true.
ReturnsShopCurrency
The added shop currency
Error responses
400objectMultiple currencies are not available for the shop (feature_not_available), or the shop has no base currency (base_currency_missing).
422objectValidation failed: currency_code is not in GET /currencies, is the base currency or is a currency the shop already sells in; a gateway id is not one of the shop's connected gateways, is the wrong kind of gateway or is a Braintree gateway another currency of the shop uses; or a value has the wrong type or is out of range.
One of the currencies the shop sells in, the base currency included.
Path parameters
currency_codeRequiredstringCurrency code, in any letter case
ReturnsShopCurrency
Shop currency object response
Error responses
400objectThe shop has no base currency (base_currency_missing).
404objectThe shop does not sell in this currency.
Change an extra currency's rate, price ending or gateways: send only the keys you want to change; every other value stays as it is. The currency code cannot change: remove the currency and add it again instead.
Path parameters
currency_codeRequiredstringCurrency code, in any letter case
Request body
card_gateway_idoptionalintegerThe gateway, one of GET /gateways, that takes card payments in this currency: a Stripe, Braintree or Authorize.Net gateway. It cannot be null. A Braintree gateway that another currency of the shop uses is refused.
paypal_gateway_idoptionalinteger | nullThe gateway, one of GET /gateways, that takes PayPal payments in this currency: a PayPal gateway or a Braintree gateway with PayPal turned on, which may also be the card gateway. null unlinks PayPal. A Braintree gateway that another currency of the shop uses is refused.
custom_exchange_rateoptionalnumber | nullThe shop's own rate, with at most 4 decimals: a base currency price multiplied by it gives the price in this currency. null goes back to automatic_exchange_rate.
price_endingoptionalinteger | nullThe cents every converted price ends in: 99 gives 11.99, 0 gives whole numbers. null keeps converted prices to the cent.
ReturnsShopCurrency
The updated shop currency
Error responses
400objectMultiple currencies are not available for the shop (feature_not_available), the currency is the base currency (base_currency_not_editable), or the shop has no base currency (base_currency_missing).
404objectThe shop does not sell in this currency.
422objectValidation failed: card_gateway_id is null; a gateway id is not one of the shop's connected gateways, is the wrong kind of gateway or is a Braintree gateway another currency of the shop uses; or a value has the wrong type or is out of range.
Remove an extra currency and return it as it was. Customers can no longer pick it, and it is gone from the list. Open carts in the currency move to the base currency shortly after. Adding it again later starts fresh, without its old rate, price ending or gateways.
Path parameters
currency_codeRequiredstringCurrency code, in any letter case
ReturnsShopCurrency
The removed shop currency, serialised as it was just before the removal.
Error responses
400objectMultiple currencies are not available for the shop (feature_not_available), the currency is the base currency (base_currency_not_editable), or a subscription in the currency is active, trial, pre_order or gift_waiting_to_start (currency_has_active_subscriptions). Paused subscriptions and subscriptions set to cancel are active. A shop with no base currency gets base_currency_missing.
404objectThe shop does not sell in this currency.
Let customers pick an extra currency. The currency needs a card gateway. Publishing a currency that is already published changes nothing.
Path parameters
currency_codeRequiredstringCurrency code, in any letter case
ReturnsShopCurrency
The published shop currency
Error responses
400objectMultiple currencies are not available for the shop (feature_not_available), the currency is the base currency (base_currency_not_editable), or it has no card gateway (currency_has_no_card_gateway). A shop with no base currency gets base_currency_missing.
404objectThe shop does not sell in this currency.
Stop customers picking an extra currency. Open carts in the currency move to the base currency shortly after. Its rates, price ending and gateways stay, so it can be published again. Unpublishing a currency that is already unpublished changes nothing.
Path parameters
currency_codeRequiredstringCurrency code, in any letter case
ReturnsShopCurrency
The unpublished shop currency
Error responses
400objectMultiple currencies are not available for the shop (feature_not_available), the currency is the base currency (base_currency_not_editable), or a subscription in the currency is active, trial, pre_order or gift_waiting_to_start (currency_has_active_subscriptions). Paused subscriptions and subscriptions set to cancel are active. A shop with no base currency gets base_currency_missing.
404objectThe shop does not sell in this currency.