Documentation

Currency Conversion

Overview

Ingrid's currency convertion let's our Shipping Selector display prices according to FX rates provided to us via an API. We provide you with two environments:

Before you start

To enable currency conversion you need to contact with our customer support team. We need an information about the base currency of each and every applicable Region.

After that you need to provide us with FX rates. The decimal separator is the dot (.). You can change the FX rates yourself via the currency conversion API.

Setup

Let's configure the conversion from SEK (region currency) to EUR and USD.

Please note, that FX rates are applicable for every session, so in order to keep performance of our system unaffected the update is eventually consistent.

POST /v1/currency_conversion/fxrates/upload HTTP/1.1
Host: api.ingrid.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE=
Content-Length: 76

{
"base": "SEK",
"rates": {
"EUR": "0.092",
"USD": "0.088"
}
}
curl --location --request POST 'https://api.ingrid.com/v1/currency_conversion/fxrates/upload' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE=' \
--data-raw '{
"base": "SEK",
"rates": {
"EUR": "0.092",
"USD": "0.088"
}
}'
var https = require("follow-redirects").https;
var fs = require("fs");

var options = {
method: "POST",
hostname: "api.ingrid.com",
path: "/v1/currency_conversion/fxrates/upload",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: "Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE=",
},
maxRedirects: 20,
};

var req = https.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});

res.on("error", function (error) {
console.error(error);
});
});

var postData = JSON.stringify({
base: "SEK",
rates: {
EUR: "0.092",
USD: "0.088",
},
});

req.write(postData);

req.end();
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.ingrid.com/v1/currency_conversion/fxrates/upload',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"base": "SEK",
"rates": {
"EUR": "0.092",
"USD": "0.088"
}
}'
,
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE='
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import http.client
import json

conn = http.client.HTTPSConnection("api.ingrid.com")
payload = json.dumps({
"base": "SEK",
"rates": {
"EUR": "0.092",
"USD": "0.088"
}
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE='
}
conn.request("POST", "/v1/currency_conversion/fxrates/upload", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

In order to verify if the conversion work we can check the session pricing. The conversion will be triggered based on session purchase_currency. Assuming that the price of delivery is 10SEK we will have:

No conversion. The original price in SEK will be shown.

POST /v1/delivery_checkout/session.create HTTP/1.1
Host: api.ingrid.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE=
Content-Length: 381

{
"purchase_country": "SE",
"purchase_currency": "SEK",
"cart": {
"cart_id": "cart-identifier",
"total_value": 1000,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"price": 1000,
"quantity": 1
}
]
},
"locales": [
"sv-SE"
]
}
curl --location --request POST 'https://api.ingrid.com/v1/delivery_checkout/session.create' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE=' \
--data-raw '{
"purchase_country": "SE",
"purchase_currency": "SEK",
"cart": {
"cart_id": "cart-identifier",
"total_value": 1000,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"price": 1000,
"quantity": 1
}
]
},
"locales": [
"sv-SE"
]
}'
var request = require("request");
var options = {
method: "POST",
url: "https://api.ingrid.com/v1/delivery_checkout/session.create",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: "Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE=",
},
body: JSON.stringify({
purchase_country: "SE",
purchase_currency: "SEK",
cart: {
cart_id: "cart-identifier",
total_value: 1000,
items: [
{
sku: "sku-1",
name: "Item name 1",
price: 1000,
quantity: 1,
},
],
},
locales: ["sv-SE"],
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.ingrid.com/v1/delivery_checkout/session.create',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"purchase_country": "SE",
"purchase_currency": "SEK",
"cart": {
"cart_id": "cart-identifier",
"total_value": 1000,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"price": 1000,
"quantity": 1
}
]
},
"locales": [
"sv-SE"
]
}'
,
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE='
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import http.client
import json

conn = http.client.HTTPSConnection("api.ingrid.com")
payload = json.dumps({
"purchase_country": "SE",
"purchase_currency": "SEK",
"cart": {
"cart_id": "cart-identifier",
"total_value": 1000,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"price": 1000,
"quantity": 1
}
]
},
"locales": [
"sv-SE"
]
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE='
}
conn.request("POST", "/v1/delivery_checkout/session.create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"session": {
"checkout_session_id": "VM2-687c1634243e4a3292ad885e3e571134",
"status": "ACTIVE",
"updated_at": "2022-09-28T09:53:41Z",
"cart": {
"total_value": 1000,
"total_discount": 0,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"quantity": 1,
"price": 1000
}
],
"cart_id": "cart-identifier"
},
"delivery_groups": [
{
"items": [
{
"sku": "sku-1"
}
],
"shipping": {
"delivery_type": "delivery",
"carrier": "PostNord",
"supports": {},
"warehouse": {
"address": {
"name": "Main Warehouse",
"address_lines": [
"Sveavägen 21"
],
"city": "Stockholm",
"postal_code": "112 22",
"country": "SE"
}
},
"carrier_product_id": "pnl"
},
"category": {
"id": "delivery-9892c6c022b948138d7e52128b44bc07",
"name": "Delivery",
"presented_category_name": "Delivery"
},
"pricing": {
"currency": "SEK",
"price": 1000,
"price_components": [
{
"type": "PRICE_COMPONENT_TYPE_SHIPPING",
"value": 1000
}
]
},
"selection": "PRESELECTED_CHOICE",
"delivery_time": {
"pickup_from_merchant": {
"earliest": "2022-09-29T00:00:00+02:00",
"latest": "2022-09-29T00:00:00+02:00"
},
"customer_delivery_promise": {
"earliest": "2022-09-29T00:00:00+02:00",
"latest": "2022-09-30T00:00:00+02:00"
},
"carrier_delivery_promise": {
"earliest": "2022-09-29T00:00:00+02:00",
"latest": "2022-09-30T00:00:00+02:00"
}
},
"addresses": {}
}
]
},
"html_snippet":"<div></div>",
"token": "Y2xpZW50dHdvOjBmOTVhMWYxMzXXXjRhNzQ4MjJkY2Y5ODZiNjA2MGE2"
}

Convertion from SEK to EUR. 10SEK * 0.092 = 0.92EUR.

POST /v1/delivery_checkout/session.create HTTP/1.1
Host: api.ingrid.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE=
Content-Length: 381

{
"purchase_country": "SE",
"purchase_currency": "EUR",
"cart": {
"cart_id": "cart-identifier",
"total_value": 1000,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"price": 1000,
"quantity": 1
}
]
},
"locales": [
"sv-SE"
]
}
curl --location --request POST 'https://api.ingrid.com/v1/delivery_checkout/session.create' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE=' \
--data-raw '{
"purchase_country": "SE",
"purchase_currency": "EUR",
"cart": {
"cart_id": "cart-identifier",
"total_value": 1000,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"price": 1000,
"quantity": 1
}
]
},
"locales": [
"sv-SE"
]
}'
var request = require("request");
var options = {
method: "POST",
url: "https://api.ingrid.com/v1/delivery_checkout/session.create",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: "Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE=",
},
body: JSON.stringify({
purchase_country: "SE",
purchase_currency: "EUR",
cart: {
cart_id: "cart-identifier",
total_value: 1000,
items: [
{
sku: "sku-1",
name: "Item name 1",
price: 1000,
quantity: 1,
},
],
},
locales: ["sv-SE"],
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.ingrid.com/v1/delivery_checkout/session.create',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"purchase_country": "SE",
"purchase_currency": "EUR",
"cart": {
"cart_id": "cart-identifier",
"total_value": 1000,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"price": 1000,
"quantity": 1
}
]
},
"locales": [
"sv-SE"
]
}'
,
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE='
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import http.client
import json

conn = http.client.HTTPSConnection("api.ingrid.com")
payload = json.dumps({
"purchase_country": "SE",
"purchase_currency": "EUR",
"cart": {
"cart_id": "cart-identifier",
"total_value": 1000,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"price": 1000,
"quantity": 1
}
]
},
"locales": [
"sv-SE"
]
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE='
}
conn.request("POST", "/v1/delivery_checkout/session.create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"session": {
"checkout_session_id": "VM2-1a68385d5fec407284ccd2cc329f01a2",
"status": "ACTIVE",
"updated_at": "2022-09-28T10:10:25Z",
"cart": {
"total_value": 1000,
"total_discount": 0,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"quantity": 1,
"price": 1000
}
],
"cart_id": "cart-identifier"
},
"delivery_groups": [
{
"items": [
{
"sku": "sku-1"
}
],
"shipping": {
"delivery_type": "delivery",
"carrier": "PostNord",
"supports": {},
"warehouse": {
"address": {
"name": "Main Warehouse",
"address_lines": [
"Sveavägen 21"
],
"city": "Stockholm",
"postal_code": "112 22",
"country": "SE"
}
},
"carrier_product_id": "pnl"
},
"category": {
"id": "delivery-9892c6c022b948138d7e52128b44bc07",
"name": "Delivery",
"presented_category_name": "Delivery"
},
"pricing": {
"currency": "EUR",
"price": 92,
"price_components": [
{
"type": "PRICE_COMPONENT_TYPE_SHIPPING",
"value": 92
}
]
},
"selection": "PRESELECTED_CHOICE",
"delivery_time": {
"pickup_from_merchant": {
"earliest": "2022-09-29T00:00:00+02:00",
"latest": "2022-09-29T00:00:00+02:00"
},
"customer_delivery_promise": {
"earliest": "2022-09-29T00:00:00+02:00",
"latest": "2022-09-30T00:00:00+02:00"
},
"carrier_delivery_promise": {
"earliest": "2022-09-29T00:00:00+02:00",
"latest": "2022-09-30T00:00:00+02:00"
}
},
"addresses": {}
}
]
},
"html_snippet":"<div></div>",
"token": "Y2xpZW50dHdvOmQ5ZDdmMGI5NXXXODQ4Njk5M2MxNjQ4Y2RmNjVlMjI0"
}
Convertion from SEK to USD. 10SEK \* 0.088 = 0.88USD.

POST /v1/delivery_checkout/session.create HTTP/1.1
Host: api.ingrid.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE=
Content-Length: 381

{
"purchase_country": "SE",
"purchase_currency": "USD",
"cart": {
"cart_id": "cart-identifier",
"total_value": 1000,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"price": 1000,
"quantity": 1
}
]
},
"locales": [
"sv-SE"
]
}
curl --location --request POST 'https://api.ingrid.com/v1/delivery_checkout/session.create' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE=' \
--data-raw '{
"purchase_country": "SE",
"purchase_currency": "USD",
"cart": {
"cart_id": "cart-identifier",
"total_value": 1000,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"price": 1000,
"quantity": 1
}
]
},
"locales": [
"sv-SE"
]
}'
var request = require("request");
var options = {
method: "POST",
url: "https://api.ingrid.com/v1/delivery_checkout/session.create",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: "Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE=",
},
body: JSON.stringify({
purchase_country: "SE",
purchase_currency: "USD",
cart: {
cart_id: "cart-identifier",
total_value: 1000,
items: [
{
sku: "sku-1",
name: "Item name 1",
price: 1000,
quantity: 1,
},
],
},
locales: ["sv-SE"],
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.ingrid.com/v1/delivery_checkout/session.create',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"purchase_country": "SE",
"purchase_currency": "USD",
"cart": {
"cart_id": "cart-identifier",
"total_value": 1000,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"price": 1000,
"quantity": 1
}
]
},
"locales": [
"sv-SE"
]
}'
,
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE='
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import http.client
import json

conn = http.client.HTTPSConnection("api.ingrid.com")
payload = json.dumps({
"purchase_country": "SE",
"purchase_currency": "USD",
"cart": {
"cart_id": "cart-identifier",
"total_value": 1000,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"price": 1000,
"quantity": 1
}
]
},
"locales": [
"sv-SE"
]
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE='
}
conn.request("POST", "/v1/delivery_checkout/session.create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"session": {
"checkout_session_id": "VM2-299bbf682fda45d2aa3f067317861372",
"status": "ACTIVE",
"updated_at": "2022-09-28T10:14:36Z",
"cart": {
"total_value": 1000,
"total_discount": 0,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"quantity": 1,
"price": 1000
}
],
"cart_id": "cart-identifier"
},
"delivery_groups": [
{
"items": [
{
"sku": "sku-1"
}
],
"shipping": {
"delivery_type": "delivery",
"carrier": "PostNord",
"supports": {},
"warehouse": {
"address": {
"name": "Main Warehouse",
"address_lines": [
"Sveavägen 21"
],
"city": "Stockholm",
"postal_code": "112 22",
"country": "SE"
}
},
"carrier_product_id": "pnl"
},
"category": {
"id": "delivery-9892c6c022b948138d7e52128b44bc07",
"name": "Delivery",
"presented_category_name": "Delivery"
},
"pricing": {
"currency": "USD",
"price": 88,
"price_components": [
{
"type": "PRICE_COMPONENT_TYPE_SHIPPING",
"value": 88
}
]
},
"selection": "PRESELECTED_CHOICE",
"delivery_time": {
"pickup_from_merchant": {
"earliest": "2022-09-29T00:00:00+02:00",
"latest": "2022-09-29T00:00:00+02:00"
},
"customer_delivery_promise": {
"earliest": "2022-09-29T00:00:00+02:00",
"latest": "2022-09-30T00:00:00+02:00"
},
"carrier_delivery_promise": {
"earliest": "2022-09-29T00:00:00+02:00",
"latest": "2022-09-30T00:00:00+02:00"
}
},
"addresses": {}
}
]
},
"html_snippet":"<div></div>",
"token": "Y2xpZW50dHdvOjXXXTkwMjZkNTY2NzQyZDRiNTM4YWE3NGZlYmQ0NTQ1"
}

Convertion from SEK to GBP. Since this conversion is not configured Ingrid will not allow you to create a session and will return an error

POST /v1/delivery_checkout/session.create HTTP/1.1
Host: api.ingrid.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE=
Content-Length: 381

{
"purchase_country": "SE",
"purchase_currency": "GBP",
"cart": {
"cart_id": "cart-identifier",
"total_value": 1000,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"price": 1000,
"quantity": 1
}
]
},
"locales": [
"sv-SE"
]
}
curl --location --request POST 'https://api.ingrid.com/v1/delivery_checkout/session.create' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE=' \
--data-raw '{
"purchase_country": "SE",
"purchase_currency": "GBP",
"cart": {
"cart_id": "cart-identifier",
"total_value": 1000,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"price": 1000,
"quantity": 1
}
]
},
"locales": [
"sv-SE"
]
}'
var request = require("request");
var options = {
method: "POST",
url: "https://api.ingrid.com/v1/delivery_checkout/session.create",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: "Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE=",
},
body: JSON.stringify({
purchase_country: "SE",
purchase_currency: "GBP",
cart: {
cart_id: "cart-identifier",
total_value: 1000,
items: [
{
sku: "sku-1",
name: "Item name 1",
price: 1000,
quantity: 1,
},
],
},
locales: ["sv-SE"],
}),
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.ingrid.com/v1/delivery_checkout/session.create',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"purchase_country": "SE",
"purchase_currency": "GBP",
"cart": {
"cart_id": "cart-identifier",
"total_value": 1000,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"price": 1000,
"quantity": 1
}
]
},
"locales": [
"sv-SE"
]
}'
,
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE='
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import http.client
import json

conn = http.client.HTTPSConnection("api.ingrid.com")
payload = json.dumps({
"purchase_country": "SE",
"purchase_currency": "GBP",
"cart": {
"cart_id": "cart-identifier",
"total_value": 1000,
"items": [
{
"sku": "sku-1",
"name": "Item name 1",
"price": 1000,
"quantity": 1
}
]
},
"locales": [
"sv-SE"
]
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer XXE5ODA0NTU0Y2JmNDRkYjhiYTdhM2NhX2EyZjFiNGE='
}
conn.request("POST", "/v1/delivery_checkout/session.create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"error": "can't generate prices: currency conversion not configured",
"trace_id": "D202209281017383M3NPNDM9G4B0FYC"
}

Supported Currencies

The full list of currencies and their codes supported by Ingrid is presented below.

    "AED": "United Arab Emirates dirham",
"AFN": "Afghan afghani",
"ALL": "Albanian lek",
"AMD": "Armenian dram",
"ANG": "Netherlands Antillean guilder",
"AOA": "Angolan kwanza",
"ARS": "Argentine peso",
"AUD": "Australian dollar",
"AWG": "Aruban florin",
"AZN": "Azerbaijani manat",
"BAM": "Bosnia and Herzegovina convertible mark",
"BBD": "Barbados dollar",
"BDT": "Bangladeshi taka",
"BGN": "Bulgarian lev",
"BHD": "Bahraini dinar",
"BIF": "Burundian franc",
"BMD": "Bermudian dollar",
"BND": "Brunei dollar",
"BOB": "Boliviano",
"BOV": "Bolivian Mvdol",
"BRL": "Brazilian real",
"BSD": "Bahamian dollar",
"BTN": "Bhutanese ngultrum",
"BWP": "Botswana pula",
"BYN": "New Belarusian ruble",
"BYR": "Belarusian ruble",
"BZD": "Belize dollar",
"CAD": "Canadian dollar",
"CDF": "Congolese franc",
"CHE": "WIR Euro",
"CHF": "Swiss franc",
"CHW": "WIR Franc",
"CLF": "Unidad de Fomento",
"CLP": "Chilean peso",
"CNY": "Chinese yuan",
"COP": "Colombian peso",
"COU": "Unidad de Valor Real (UVR)",
"CRC": "Costa Rican colon",
"CUC": "Cuban convertible peso",
"CUP": "Cuban peso",
"CVE": "Cape Verde escudo",
"CZK": "Czech koruna",
"DJF": "Djiboutian franc",
"DKK": "Danish krone",
"DOP": "Dominican peso",
"DZD": "Algerian dinar",
"EGP": "Egyptian pound",
"ERN": "Eritrean nakfa",
"ETB": "Ethiopian birr",
"EUR": "Euro",
"FJD": "Fiji dollar",
"FKP": "Falkland Islands pound",
"GBP": "Pound sterling",
"GEL": "Georgian lari",
"GHS": "Ghanaian cedi",
"GIP": "Gibraltar pound",
"GMD": "Gambian dalasi",
"GNF": "Guinean franc",
"GTQ": "Guatemalan quetzal",
"GYD": "Guyanese dollar",
"HKD": "Hong Kong dollar",
"HNL": "Honduran lempira",
"HRK": "Croatian kuna",
"HTG": "Haitian gourde",
"HUF": "Hungarian forint",
"IDR": "Indonesian rupiah",
"ILS": "Israeli new shekel",
"INR": "Indian rupee",
"IQD": "Iraqi dinar",
"IRR": "Iranian rial",
"ISK": "Icelandic króna",
"JMD": "Jamaican dollar",
"JOD": "Jordanian dinar",
"JPY": "Japanese yen",
"KES": "Kenyan shilling",
"KGS": "Kyrgyzstani som",
"KHR": "Cambodian riel",
"KMF": "Comoro franc",
"KPW": "North Korean won",
"KRW": "South Korean won",
"KWD": "Kuwaiti dinar",
"KYD": "Cayman Islands dollar",
"KZT": "Kazakhstani tenge",
"LAK": "Lao kip",
"LBP": "Lebanese pound",
"LKR": "Sri Lankan rupee",
"LRD": "Liberian dollar",
"LSL": "Lesotho loti",
"LYD": "Libyan dinar",
"MAD": "Moroccan dirham",
"MDL": "Moldovan leu",
"MGA": "Malagasy ariary",
"MKD": "Macedonian denar",
"MMK": "Myanmar kyat",
"MNT": "Mongolian tögrög",
"MOP": "Macanese pataca",
"MRO": "Mauritanian ouguiya",
"MUR": "Mauritian rupee",
"MVR": "Maldivian rufiyaa",
"MWK": "Malawian kwacha",
"MXN": "Mexican peso",
"MXV": "Mexican Unidad de Inversion (UDI)",
"MYR": "Malaysian ringgit",
"MZN": "Mozambican metical",
"NAD": "Namibian dollar",
"NGN": "Nigerian naira",
"NIO": "Nicaraguan córdoba",
"NOK": "Norwegian krone",
"NPR": "Nepalese rupee",
"NZD": "New Zealand dollar",
"OMR": "Omani rial",
"PAB": "Panamanian balboa",
"PEN": "Peruvian Sol",
"PGK": "Papua New Guinean kina",
"PHP": "Philippine peso",
"PKR": "Pakistani rupee",
"PLN": "Polish złoty",
"PYG": "Paraguayan guaraní",
"QAR": "Qatari riyal",
"RON": "Romanian leu",
"RSD": "Serbian dinar",
"RUB": "Russian ruble",
"RWF": "Rwandan franc",
"SAR": "Saudi riyal",
"SBD": "Solomon Islands dollar",
"SCR": "Seychelles rupee",
"SDG": "Sudanese pound",
"SEK": "Swedish krona",
"SGD": "Singapore dollar",
"SHP": "Saint Helena pound",
"SLL": "Sierra Leonean leone",
"SOS": "Somali shilling",
"SRD": "Surinamese dollar",
"SSP": "South Sudanese pound",
"STD": "São Tomé and Príncipe dobra",
"SVC": "Salvadoran colón",
"SYP": "Syrian pound",
"SZL": "Swazi lilangeni",
"THB": "Thai baht",
"TJS": "Tajikistani somoni",
"TMT": "Turkmenistani manat",
"TND": "Tunisian dinar",
"TOP": "Tongan paʻanga",
"TRY": "Turkish lira",
"TTD": "Trinidad and Tobago dollar",
"TWD": "New Taiwan dollar",
"TZS": "Tanzanian shilling",
"UAH": "Ukrainian hryvnia",
"UGX": "Ugandan shilling",
"USD": "United States dollar",
"USN": "United States dollar (next day)",
"UYI": "Uruguay Peso en Unidades Indexadas (URUIURUI)",
"UYU": "Uruguayan peso",
"UZS": "Uzbekistan som",
"VEF": "Venezuelan bolívar",
"VND": "Vietnamese đồng",
"VUV": "Vanuatu vatu",
"WST": "Samoan tala",
"XAF": "CFA franc BEAC",
"XAG": "Silver (one troy ounce) ",
"XAU": "Gold (one troy ounce) ",
"XBA": "European Composite Unit",
"XBB": "European Monetary Unit",
"XBC": "European Unit of Account 9",
"XBD": "European Unit of Account 17",
"XCD": "East Caribbean dollar",
"XDR": "Special drawing rights",
"XOF": "CFA franc BCEAO",
"XPD": "Palladium (one troy ounce)",
"XPF": "CFP franc (franc Pacifique)",
"XPT": "Platinum (one troy ounce)",
"XSU": "SUCRE",
"XTS": "Code reserved for testing purposes",
"XUA": "ADB Unit of Account",
"XXX": "No currency",
"YER": "Yemeni rial",
"ZAR": "South African rand",
"ZMW": "Zambian kwacha",
"ZWL": "Zimbabwean dollar A/10",

Last updated: Thu, Dec 08, 06:15 AM