curl --request POST \
--url https://checkout.dintero.com/v1/examples/discount_code_callback_url \
--header 'Content-Type: application/json' \
--data '
{
"url": {
"return_url": "https://example.com/accept",
"callback_url": "https://example.com/callback?method=GET",
"merchant_terms_url": "https://example.com/terms.html"
},
"order": {
"amount": 72200,
"currency": "NOK",
"merchant_reference": "<string>",
"vat_amount": 13660,
"merchant_reference_2": "<string>",
"event_reference": "<string>",
"shipping_address": {
"first_name": "John",
"last_name": "Doe",
"address_line": "<string>",
"address_line_2": "<string>",
"co_address": "Land Lord",
"business_name": "<string>",
"postal_code": "0349",
"postal_place": "Oslo",
"country": "NO",
"phone_number": "<string>",
"email": "<string>",
"latitude": 123,
"longitude": 123,
"comment": "<string>",
"organization_number": "<string>",
"organization_type": "<string>",
"customer_reference": "<string>",
"cost_center": "<string>"
},
"billing_address": {
"first_name": "John",
"last_name": "Doe",
"address_line": "<string>",
"address_line_2": "<string>",
"co_address": "Land Lord",
"business_name": "<string>",
"postal_code": "0349",
"postal_place": "Oslo",
"country": "NO",
"phone_number": "<string>",
"email": "<string>",
"latitude": 123,
"longitude": 123,
"comment": "<string>",
"organization_number": "<string>",
"organization_type": "<string>",
"customer_reference": "<string>",
"cost_center": "<string>"
},
"partial_payment": false,
"items": [
{
"amount": 2000,
"quantity": 2,
"line_id": "1",
"description": "Forsvinnignspølse",
"vat": 20,
"id": "10"
},
{
"amount": 6600,
"quantity": 2,
"line_id": "2",
"description": "Vissvossafår på neppebrød",
"vat": 20,
"id": "6",
"eligible_for_discount": true,
"is_changed": true,
"gross_amount": 10000,
"discount_lines": [
{
"amount": 4400,
"discount_type": "customer",
"discount_id": "ed960ace-eb16-4e2e-ae52-b27647ccae8d",
"description": "Vossafestpris",
"line_id": 1
}
]
},
{
"amount": 59700,
"quantity": 3,
"line_id": "3",
"description": "Luftboller",
"vat": 20,
"id": "1"
}
],
"discount_lines": [
{
"amount": 4400,
"percentage": 44,
"discount_id": "766da0ef-9283-42bd-b012-0582344ec53c",
"description": "<string>",
"line_id": 1
}
],
"discount_codes": [
"SUMMER20"
],
"gift_cards": [
{
"type": "dintero.wallets",
"card_id": "<string>",
"amount": 123,
"masked_card_token": "<string>"
}
],
"emd": {
"event": [
{
"event_name": "Michael Jackson",
"event_company": "Diamond Events",
"genre_of_event": "Pop",
"start_time": "2023-08-16T15:00:00Z",
"end_time": "2023-08-16T16:00:00Z",
"ticket_delivery_method": "email",
"ticket_delivery_recipient": "recipient@mail.com",
"arena_name": "Oslo Spektrum",
"access_controlled_venue": true,
"affiliate_name": "Klarna affiliate"
}
],
"travel": {}
},
"payout_destination_id": "<string>"
},
"configuration": {
"auto_capture": true,
"channel": "ecommerce",
"publish": [
{}
],
"active_payment_types": {
"enabled": true
},
"bambora": {
"type": "payment_type"
},
"dintero": {
"type": "payment_type"
},
"dintero_psp": {
"type": "payment_type"
},
"instabank": {},
"netaxept": {
"type": "payment_type"
},
"payex": {
"dynamic_descriptor": "<string>"
},
"collector": {
"type": "payment_type",
"dynamic_descriptor": "<string>"
},
"klarna": {
"type": "payment_type"
},
"kravia": {
"type": "payment_type"
},
"two": {
"type": "payment_type"
},
"santander": {
"type": "payment_type"
},
"seitatech": {
"type": "payment_type"
},
"swish": {
"type": "payment_type"
},
"payout": {
"dynamic_payout_destination_ids": [
{
"order_store_id": "STORE_123",
"order_payout_destination_id": "PD_123",
"overwrite_payout_destination_id": false
}
]
},
"allow_express_wallet_payment": false,
"discounts": {},
"theme": {
"backdrop": "<string>",
"primary": "<string>",
"cardRadius": "<string>",
"buttonRadius": "<string>"
},
"countries": {
"preferred_country": "<string>",
"allow_countries": [
"<string>"
],
"deny_countries": [
"<string>"
]
},
"allow_different_billing_shipping_address": [],
"merchant": {
"id": null,
"logo_url": "<string>",
"name": "TKP tech AS",
"country": "NO"
}
},
"id": "<string>"
}
'import requests
url = "https://checkout.dintero.com/v1/examples/discount_code_callback_url"
payload = {
"url": {
"return_url": "https://example.com/accept",
"callback_url": "https://example.com/callback?method=GET",
"merchant_terms_url": "https://example.com/terms.html"
},
"order": {
"amount": 72200,
"currency": "NOK",
"merchant_reference": "<string>",
"vat_amount": 13660,
"merchant_reference_2": "<string>",
"event_reference": "<string>",
"shipping_address": {
"first_name": "John",
"last_name": "Doe",
"address_line": "<string>",
"address_line_2": "<string>",
"co_address": "Land Lord",
"business_name": "<string>",
"postal_code": "0349",
"postal_place": "Oslo",
"country": "NO",
"phone_number": "<string>",
"email": "<string>",
"latitude": 123,
"longitude": 123,
"comment": "<string>",
"organization_number": "<string>",
"organization_type": "<string>",
"customer_reference": "<string>",
"cost_center": "<string>"
},
"billing_address": {
"first_name": "John",
"last_name": "Doe",
"address_line": "<string>",
"address_line_2": "<string>",
"co_address": "Land Lord",
"business_name": "<string>",
"postal_code": "0349",
"postal_place": "Oslo",
"country": "NO",
"phone_number": "<string>",
"email": "<string>",
"latitude": 123,
"longitude": 123,
"comment": "<string>",
"organization_number": "<string>",
"organization_type": "<string>",
"customer_reference": "<string>",
"cost_center": "<string>"
},
"partial_payment": False,
"items": [
{
"amount": 2000,
"quantity": 2,
"line_id": "1",
"description": "Forsvinnignspølse",
"vat": 20,
"id": "10"
},
{
"amount": 6600,
"quantity": 2,
"line_id": "2",
"description": "Vissvossafår på neppebrød",
"vat": 20,
"id": "6",
"eligible_for_discount": True,
"is_changed": True,
"gross_amount": 10000,
"discount_lines": [
{
"amount": 4400,
"discount_type": "customer",
"discount_id": "ed960ace-eb16-4e2e-ae52-b27647ccae8d",
"description": "Vossafestpris",
"line_id": 1
}
]
},
{
"amount": 59700,
"quantity": 3,
"line_id": "3",
"description": "Luftboller",
"vat": 20,
"id": "1"
}
],
"discount_lines": [
{
"amount": 4400,
"percentage": 44,
"discount_id": "766da0ef-9283-42bd-b012-0582344ec53c",
"description": "<string>",
"line_id": 1
}
],
"discount_codes": ["SUMMER20"],
"gift_cards": [
{
"type": "dintero.wallets",
"card_id": "<string>",
"amount": 123,
"masked_card_token": "<string>"
}
],
"emd": {
"event": [
{
"event_name": "Michael Jackson",
"event_company": "Diamond Events",
"genre_of_event": "Pop",
"start_time": "2023-08-16T15:00:00Z",
"end_time": "2023-08-16T16:00:00Z",
"ticket_delivery_method": "email",
"ticket_delivery_recipient": "recipient@mail.com",
"arena_name": "Oslo Spektrum",
"access_controlled_venue": True,
"affiliate_name": "Klarna affiliate"
}
],
"travel": {}
},
"payout_destination_id": "<string>"
},
"configuration": {
"auto_capture": True,
"channel": "ecommerce",
"publish": [{}],
"active_payment_types": { "enabled": True },
"bambora": { "type": "payment_type" },
"dintero": { "type": "payment_type" },
"dintero_psp": { "type": "payment_type" },
"instabank": {},
"netaxept": { "type": "payment_type" },
"payex": { "dynamic_descriptor": "<string>" },
"collector": {
"type": "payment_type",
"dynamic_descriptor": "<string>"
},
"klarna": { "type": "payment_type" },
"kravia": { "type": "payment_type" },
"two": { "type": "payment_type" },
"santander": { "type": "payment_type" },
"seitatech": { "type": "payment_type" },
"swish": { "type": "payment_type" },
"payout": { "dynamic_payout_destination_ids": [
{
"order_store_id": "STORE_123",
"order_payout_destination_id": "PD_123",
"overwrite_payout_destination_id": False
}
] },
"allow_express_wallet_payment": False,
"discounts": {},
"theme": {
"backdrop": "<string>",
"primary": "<string>",
"cardRadius": "<string>",
"buttonRadius": "<string>"
},
"countries": {
"preferred_country": "<string>",
"allow_countries": ["<string>"],
"deny_countries": ["<string>"]
},
"allow_different_billing_shipping_address": [],
"merchant": {
"id": None,
"logo_url": "<string>",
"name": "TKP tech AS",
"country": "NO"
}
},
"id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
url: {
return_url: 'https://example.com/accept',
callback_url: 'https://example.com/callback?method=GET',
merchant_terms_url: 'https://example.com/terms.html'
},
order: {
amount: 72200,
currency: 'NOK',
merchant_reference: '<string>',
vat_amount: 13660,
merchant_reference_2: '<string>',
event_reference: '<string>',
shipping_address: {
first_name: 'John',
last_name: 'Doe',
address_line: '<string>',
address_line_2: '<string>',
co_address: 'Land Lord',
business_name: '<string>',
postal_code: '0349',
postal_place: 'Oslo',
country: 'NO',
phone_number: '<string>',
email: '<string>',
latitude: 123,
longitude: 123,
comment: '<string>',
organization_number: '<string>',
organization_type: '<string>',
customer_reference: '<string>',
cost_center: '<string>'
},
billing_address: {
first_name: 'John',
last_name: 'Doe',
address_line: '<string>',
address_line_2: '<string>',
co_address: 'Land Lord',
business_name: '<string>',
postal_code: '0349',
postal_place: 'Oslo',
country: 'NO',
phone_number: '<string>',
email: '<string>',
latitude: 123,
longitude: 123,
comment: '<string>',
organization_number: '<string>',
organization_type: '<string>',
customer_reference: '<string>',
cost_center: '<string>'
},
partial_payment: false,
items: [
{
amount: 2000,
quantity: 2,
line_id: '1',
description: 'Forsvinnignspølse',
vat: 20,
id: '10'
},
{
amount: 6600,
quantity: 2,
line_id: '2',
description: 'Vissvossafår på neppebrød',
vat: 20,
id: '6',
eligible_for_discount: true,
is_changed: true,
gross_amount: 10000,
discount_lines: [
{
amount: 4400,
discount_type: 'customer',
discount_id: 'ed960ace-eb16-4e2e-ae52-b27647ccae8d',
description: 'Vossafestpris',
line_id: 1
}
]
},
{
amount: 59700,
quantity: 3,
line_id: '3',
description: 'Luftboller',
vat: 20,
id: '1'
}
],
discount_lines: [
{
amount: 4400,
percentage: 44,
discount_id: '766da0ef-9283-42bd-b012-0582344ec53c',
description: '<string>',
line_id: 1
}
],
discount_codes: ['SUMMER20'],
gift_cards: [
{
type: 'dintero.wallets',
card_id: '<string>',
amount: 123,
masked_card_token: '<string>'
}
],
emd: {
event: [
{
event_name: 'Michael Jackson',
event_company: 'Diamond Events',
genre_of_event: 'Pop',
start_time: '2023-08-16T15:00:00Z',
end_time: '2023-08-16T16:00:00Z',
ticket_delivery_method: 'email',
ticket_delivery_recipient: 'recipient@mail.com',
arena_name: 'Oslo Spektrum',
access_controlled_venue: true,
affiliate_name: 'Klarna affiliate'
}
],
travel: {}
},
payout_destination_id: '<string>'
},
configuration: {
auto_capture: true,
channel: 'ecommerce',
publish: [{}],
active_payment_types: {enabled: true},
bambora: {type: 'payment_type'},
dintero: {type: 'payment_type'},
dintero_psp: {type: 'payment_type'},
instabank: {},
netaxept: {type: 'payment_type'},
payex: {dynamic_descriptor: '<string>'},
collector: {type: 'payment_type', dynamic_descriptor: '<string>'},
klarna: {type: 'payment_type'},
kravia: {type: 'payment_type'},
two: {type: 'payment_type'},
santander: {type: 'payment_type'},
seitatech: {type: 'payment_type'},
swish: {type: 'payment_type'},
payout: {
dynamic_payout_destination_ids: [
{
order_store_id: 'STORE_123',
order_payout_destination_id: 'PD_123',
overwrite_payout_destination_id: false
}
]
},
allow_express_wallet_payment: false,
discounts: {},
theme: {
backdrop: '<string>',
primary: '<string>',
cardRadius: '<string>',
buttonRadius: '<string>'
},
countries: {
preferred_country: '<string>',
allow_countries: ['<string>'],
deny_countries: ['<string>']
},
allow_different_billing_shipping_address: [],
merchant: {id: null, logo_url: '<string>', name: 'TKP tech AS', country: 'NO'}
},
id: '<string>'
})
};
fetch('https://checkout.dintero.com/v1/examples/discount_code_callback_url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://checkout.dintero.com/v1/examples/discount_code_callback_url"
payload := strings.NewReader("{\n \"url\": {\n \"return_url\": \"https://example.com/accept\",\n \"callback_url\": \"https://example.com/callback?method=GET\",\n \"merchant_terms_url\": \"https://example.com/terms.html\"\n },\n \"order\": {\n \"amount\": 72200,\n \"currency\": \"NOK\",\n \"merchant_reference\": \"<string>\",\n \"vat_amount\": 13660,\n \"merchant_reference_2\": \"<string>\",\n \"event_reference\": \"<string>\",\n \"shipping_address\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"address_line\": \"<string>\",\n \"address_line_2\": \"<string>\",\n \"co_address\": \"Land Lord\",\n \"business_name\": \"<string>\",\n \"postal_code\": \"0349\",\n \"postal_place\": \"Oslo\",\n \"country\": \"NO\",\n \"phone_number\": \"<string>\",\n \"email\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"comment\": \"<string>\",\n \"organization_number\": \"<string>\",\n \"organization_type\": \"<string>\",\n \"customer_reference\": \"<string>\",\n \"cost_center\": \"<string>\"\n },\n \"billing_address\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"address_line\": \"<string>\",\n \"address_line_2\": \"<string>\",\n \"co_address\": \"Land Lord\",\n \"business_name\": \"<string>\",\n \"postal_code\": \"0349\",\n \"postal_place\": \"Oslo\",\n \"country\": \"NO\",\n \"phone_number\": \"<string>\",\n \"email\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"comment\": \"<string>\",\n \"organization_number\": \"<string>\",\n \"organization_type\": \"<string>\",\n \"customer_reference\": \"<string>\",\n \"cost_center\": \"<string>\"\n },\n \"partial_payment\": false,\n \"items\": [\n {\n \"amount\": 2000,\n \"quantity\": 2,\n \"line_id\": \"1\",\n \"description\": \"Forsvinnignspølse\",\n \"vat\": 20,\n \"id\": \"10\"\n },\n {\n \"amount\": 6600,\n \"quantity\": 2,\n \"line_id\": \"2\",\n \"description\": \"Vissvossafår på neppebrød\",\n \"vat\": 20,\n \"id\": \"6\",\n \"eligible_for_discount\": true,\n \"is_changed\": true,\n \"gross_amount\": 10000,\n \"discount_lines\": [\n {\n \"amount\": 4400,\n \"discount_type\": \"customer\",\n \"discount_id\": \"ed960ace-eb16-4e2e-ae52-b27647ccae8d\",\n \"description\": \"Vossafestpris\",\n \"line_id\": 1\n }\n ]\n },\n {\n \"amount\": 59700,\n \"quantity\": 3,\n \"line_id\": \"3\",\n \"description\": \"Luftboller\",\n \"vat\": 20,\n \"id\": \"1\"\n }\n ],\n \"discount_lines\": [\n {\n \"amount\": 4400,\n \"percentage\": 44,\n \"discount_id\": \"766da0ef-9283-42bd-b012-0582344ec53c\",\n \"description\": \"<string>\",\n \"line_id\": 1\n }\n ],\n \"discount_codes\": [\n \"SUMMER20\"\n ],\n \"gift_cards\": [\n {\n \"type\": \"dintero.wallets\",\n \"card_id\": \"<string>\",\n \"amount\": 123,\n \"masked_card_token\": \"<string>\"\n }\n ],\n \"emd\": {\n \"event\": [\n {\n \"event_name\": \"Michael Jackson\",\n \"event_company\": \"Diamond Events\",\n \"genre_of_event\": \"Pop\",\n \"start_time\": \"2023-08-16T15:00:00Z\",\n \"end_time\": \"2023-08-16T16:00:00Z\",\n \"ticket_delivery_method\": \"email\",\n \"ticket_delivery_recipient\": \"recipient@mail.com\",\n \"arena_name\": \"Oslo Spektrum\",\n \"access_controlled_venue\": true,\n \"affiliate_name\": \"Klarna affiliate\"\n }\n ],\n \"travel\": {}\n },\n \"payout_destination_id\": \"<string>\"\n },\n \"configuration\": {\n \"auto_capture\": true,\n \"channel\": \"ecommerce\",\n \"publish\": [\n {}\n ],\n \"active_payment_types\": {\n \"enabled\": true\n },\n \"bambora\": {\n \"type\": \"payment_type\"\n },\n \"dintero\": {\n \"type\": \"payment_type\"\n },\n \"dintero_psp\": {\n \"type\": \"payment_type\"\n },\n \"instabank\": {},\n \"netaxept\": {\n \"type\": \"payment_type\"\n },\n \"payex\": {\n \"dynamic_descriptor\": \"<string>\"\n },\n \"collector\": {\n \"type\": \"payment_type\",\n \"dynamic_descriptor\": \"<string>\"\n },\n \"klarna\": {\n \"type\": \"payment_type\"\n },\n \"kravia\": {\n \"type\": \"payment_type\"\n },\n \"two\": {\n \"type\": \"payment_type\"\n },\n \"santander\": {\n \"type\": \"payment_type\"\n },\n \"seitatech\": {\n \"type\": \"payment_type\"\n },\n \"swish\": {\n \"type\": \"payment_type\"\n },\n \"payout\": {\n \"dynamic_payout_destination_ids\": [\n {\n \"order_store_id\": \"STORE_123\",\n \"order_payout_destination_id\": \"PD_123\",\n \"overwrite_payout_destination_id\": false\n }\n ]\n },\n \"allow_express_wallet_payment\": false,\n \"discounts\": {},\n \"theme\": {\n \"backdrop\": \"<string>\",\n \"primary\": \"<string>\",\n \"cardRadius\": \"<string>\",\n \"buttonRadius\": \"<string>\"\n },\n \"countries\": {\n \"preferred_country\": \"<string>\",\n \"allow_countries\": [\n \"<string>\"\n ],\n \"deny_countries\": [\n \"<string>\"\n ]\n },\n \"allow_different_billing_shipping_address\": [],\n \"merchant\": {\n \"id\": null,\n \"logo_url\": \"<string>\",\n \"name\": \"TKP tech AS\",\n \"country\": \"NO\"\n }\n },\n \"id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://checkout.dintero.com/v1/examples/discount_code_callback_url")
.header("Content-Type", "application/json")
.body("{\n \"url\": {\n \"return_url\": \"https://example.com/accept\",\n \"callback_url\": \"https://example.com/callback?method=GET\",\n \"merchant_terms_url\": \"https://example.com/terms.html\"\n },\n \"order\": {\n \"amount\": 72200,\n \"currency\": \"NOK\",\n \"merchant_reference\": \"<string>\",\n \"vat_amount\": 13660,\n \"merchant_reference_2\": \"<string>\",\n \"event_reference\": \"<string>\",\n \"shipping_address\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"address_line\": \"<string>\",\n \"address_line_2\": \"<string>\",\n \"co_address\": \"Land Lord\",\n \"business_name\": \"<string>\",\n \"postal_code\": \"0349\",\n \"postal_place\": \"Oslo\",\n \"country\": \"NO\",\n \"phone_number\": \"<string>\",\n \"email\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"comment\": \"<string>\",\n \"organization_number\": \"<string>\",\n \"organization_type\": \"<string>\",\n \"customer_reference\": \"<string>\",\n \"cost_center\": \"<string>\"\n },\n \"billing_address\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"address_line\": \"<string>\",\n \"address_line_2\": \"<string>\",\n \"co_address\": \"Land Lord\",\n \"business_name\": \"<string>\",\n \"postal_code\": \"0349\",\n \"postal_place\": \"Oslo\",\n \"country\": \"NO\",\n \"phone_number\": \"<string>\",\n \"email\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"comment\": \"<string>\",\n \"organization_number\": \"<string>\",\n \"organization_type\": \"<string>\",\n \"customer_reference\": \"<string>\",\n \"cost_center\": \"<string>\"\n },\n \"partial_payment\": false,\n \"items\": [\n {\n \"amount\": 2000,\n \"quantity\": 2,\n \"line_id\": \"1\",\n \"description\": \"Forsvinnignspølse\",\n \"vat\": 20,\n \"id\": \"10\"\n },\n {\n \"amount\": 6600,\n \"quantity\": 2,\n \"line_id\": \"2\",\n \"description\": \"Vissvossafår på neppebrød\",\n \"vat\": 20,\n \"id\": \"6\",\n \"eligible_for_discount\": true,\n \"is_changed\": true,\n \"gross_amount\": 10000,\n \"discount_lines\": [\n {\n \"amount\": 4400,\n \"discount_type\": \"customer\",\n \"discount_id\": \"ed960ace-eb16-4e2e-ae52-b27647ccae8d\",\n \"description\": \"Vossafestpris\",\n \"line_id\": 1\n }\n ]\n },\n {\n \"amount\": 59700,\n \"quantity\": 3,\n \"line_id\": \"3\",\n \"description\": \"Luftboller\",\n \"vat\": 20,\n \"id\": \"1\"\n }\n ],\n \"discount_lines\": [\n {\n \"amount\": 4400,\n \"percentage\": 44,\n \"discount_id\": \"766da0ef-9283-42bd-b012-0582344ec53c\",\n \"description\": \"<string>\",\n \"line_id\": 1\n }\n ],\n \"discount_codes\": [\n \"SUMMER20\"\n ],\n \"gift_cards\": [\n {\n \"type\": \"dintero.wallets\",\n \"card_id\": \"<string>\",\n \"amount\": 123,\n \"masked_card_token\": \"<string>\"\n }\n ],\n \"emd\": {\n \"event\": [\n {\n \"event_name\": \"Michael Jackson\",\n \"event_company\": \"Diamond Events\",\n \"genre_of_event\": \"Pop\",\n \"start_time\": \"2023-08-16T15:00:00Z\",\n \"end_time\": \"2023-08-16T16:00:00Z\",\n \"ticket_delivery_method\": \"email\",\n \"ticket_delivery_recipient\": \"recipient@mail.com\",\n \"arena_name\": \"Oslo Spektrum\",\n \"access_controlled_venue\": true,\n \"affiliate_name\": \"Klarna affiliate\"\n }\n ],\n \"travel\": {}\n },\n \"payout_destination_id\": \"<string>\"\n },\n \"configuration\": {\n \"auto_capture\": true,\n \"channel\": \"ecommerce\",\n \"publish\": [\n {}\n ],\n \"active_payment_types\": {\n \"enabled\": true\n },\n \"bambora\": {\n \"type\": \"payment_type\"\n },\n \"dintero\": {\n \"type\": \"payment_type\"\n },\n \"dintero_psp\": {\n \"type\": \"payment_type\"\n },\n \"instabank\": {},\n \"netaxept\": {\n \"type\": \"payment_type\"\n },\n \"payex\": {\n \"dynamic_descriptor\": \"<string>\"\n },\n \"collector\": {\n \"type\": \"payment_type\",\n \"dynamic_descriptor\": \"<string>\"\n },\n \"klarna\": {\n \"type\": \"payment_type\"\n },\n \"kravia\": {\n \"type\": \"payment_type\"\n },\n \"two\": {\n \"type\": \"payment_type\"\n },\n \"santander\": {\n \"type\": \"payment_type\"\n },\n \"seitatech\": {\n \"type\": \"payment_type\"\n },\n \"swish\": {\n \"type\": \"payment_type\"\n },\n \"payout\": {\n \"dynamic_payout_destination_ids\": [\n {\n \"order_store_id\": \"STORE_123\",\n \"order_payout_destination_id\": \"PD_123\",\n \"overwrite_payout_destination_id\": false\n }\n ]\n },\n \"allow_express_wallet_payment\": false,\n \"discounts\": {},\n \"theme\": {\n \"backdrop\": \"<string>\",\n \"primary\": \"<string>\",\n \"cardRadius\": \"<string>\",\n \"buttonRadius\": \"<string>\"\n },\n \"countries\": {\n \"preferred_country\": \"<string>\",\n \"allow_countries\": [\n \"<string>\"\n ],\n \"deny_countries\": [\n \"<string>\"\n ]\n },\n \"allow_different_billing_shipping_address\": [],\n \"merchant\": {\n \"id\": null,\n \"logo_url\": \"<string>\",\n \"name\": \"TKP tech AS\",\n \"country\": \"NO\"\n }\n },\n \"id\": \"<string>\"\n}")
.asString();{
"shipping_options": [
{
"id": "bring-pick-up-00001",
"line_id": "bring-pick-up-00001-location-0a1f6b",
"amount": 3900,
"title": "Standard",
"operator": "Bring",
"countries": [
"NO"
],
"vat_amount": 975,
"vat": 25,
"description": "Pick up at your nearest postal office",
"delivery_method": "pick_up",
"operator_product_id": "pick-up-00001-location-0a1f6b",
"eta": {
"working_days": [
1,
2
],
"shipping_day_of_week": 3,
"arrival_day_of_week": 3,
"starts_at": "2020-10-14T19:00:00Z",
"ends_at": "2020-10-14T20:00:00Z"
},
"time_slot": {
"starts_at": "2020-10-14T19:00:00Z",
"ends_at": "2020-10-14T20:00:00Z"
},
"pick_up_address": {
"first_name": "John",
"last_name": "Doe",
"address_line": "<string>",
"address_line_2": "<string>",
"co_address": "Land Lord",
"business_name": "<string>",
"postal_code": "0349",
"postal_place": "Oslo",
"country": "NO",
"phone_number": "<string>",
"email": "<string>",
"latitude": 123,
"longitude": 123,
"comment": "<string>",
"organization_number": "<string>",
"organization_type": "<string>",
"customer_reference": "<string>",
"cost_center": "<string>",
"website_url": "<string>",
"opening_hours": {
"open_now": true,
"periods": [
{
"opens_at": "08:00",
"closes_at": "16:00",
"day_of_week": 1
}
],
"timezone": "Europe/Oslo"
},
"distance": 123
},
"metadata": {
"operator_dest": "XAB1239",
"number_x": 1921
},
"environmental_data": {
"description": "Fossil free",
"details": [
{
"label": "Carbon offset",
"value": "1KG CO2"
}
]
},
"thumbnail_url": "<string>",
"pay_in_store": {
"type": "full"
},
"fee_split": {
"type": "proportional",
"destinations": [
"<string>"
]
},
"splits": [
{
"payout_destination_id": "seller-1",
"amount": 29700
}
],
"shipment_id": "<string>",
"shipment_items": [
{
"line_id": "line-id-1",
"quantity": 123
}
]
}
],
"order": {
"amount": 72200,
"discount_codes": [
"<string>"
],
"items": [
{
"amount": 2000,
"quantity": 2,
"line_id": "1",
"description": "Forsvinnignspølse",
"vat": 20,
"id": "10"
},
{
"amount": 6600,
"quantity": 2,
"line_id": "2",
"description": "Vissvossafår på neppebrød",
"vat": 20,
"id": "6",
"eligible_for_discount": true,
"is_changed": true,
"gross_amount": 10000,
"discount_lines": [
{
"amount": 4400,
"discount_type": "external",
"discount_id": "ed960ace-eb16-4e2e-ae52-b27647ccae8d",
"description": "Vossafestpris",
"line_id": 1
}
]
},
{
"amount": 59700,
"quantity": 3,
"line_id": "3",
"description": "Luftboller",
"vat": 20,
"id": "1"
}
]
}
}Discount codes Update
This API endpoint on the merchant side allows Dintero to get
shipping_options and order with discounts based on the provided
session that had its order.discount_codes updated.
curl --request POST \
--url https://checkout.dintero.com/v1/examples/discount_code_callback_url \
--header 'Content-Type: application/json' \
--data '
{
"url": {
"return_url": "https://example.com/accept",
"callback_url": "https://example.com/callback?method=GET",
"merchant_terms_url": "https://example.com/terms.html"
},
"order": {
"amount": 72200,
"currency": "NOK",
"merchant_reference": "<string>",
"vat_amount": 13660,
"merchant_reference_2": "<string>",
"event_reference": "<string>",
"shipping_address": {
"first_name": "John",
"last_name": "Doe",
"address_line": "<string>",
"address_line_2": "<string>",
"co_address": "Land Lord",
"business_name": "<string>",
"postal_code": "0349",
"postal_place": "Oslo",
"country": "NO",
"phone_number": "<string>",
"email": "<string>",
"latitude": 123,
"longitude": 123,
"comment": "<string>",
"organization_number": "<string>",
"organization_type": "<string>",
"customer_reference": "<string>",
"cost_center": "<string>"
},
"billing_address": {
"first_name": "John",
"last_name": "Doe",
"address_line": "<string>",
"address_line_2": "<string>",
"co_address": "Land Lord",
"business_name": "<string>",
"postal_code": "0349",
"postal_place": "Oslo",
"country": "NO",
"phone_number": "<string>",
"email": "<string>",
"latitude": 123,
"longitude": 123,
"comment": "<string>",
"organization_number": "<string>",
"organization_type": "<string>",
"customer_reference": "<string>",
"cost_center": "<string>"
},
"partial_payment": false,
"items": [
{
"amount": 2000,
"quantity": 2,
"line_id": "1",
"description": "Forsvinnignspølse",
"vat": 20,
"id": "10"
},
{
"amount": 6600,
"quantity": 2,
"line_id": "2",
"description": "Vissvossafår på neppebrød",
"vat": 20,
"id": "6",
"eligible_for_discount": true,
"is_changed": true,
"gross_amount": 10000,
"discount_lines": [
{
"amount": 4400,
"discount_type": "customer",
"discount_id": "ed960ace-eb16-4e2e-ae52-b27647ccae8d",
"description": "Vossafestpris",
"line_id": 1
}
]
},
{
"amount": 59700,
"quantity": 3,
"line_id": "3",
"description": "Luftboller",
"vat": 20,
"id": "1"
}
],
"discount_lines": [
{
"amount": 4400,
"percentage": 44,
"discount_id": "766da0ef-9283-42bd-b012-0582344ec53c",
"description": "<string>",
"line_id": 1
}
],
"discount_codes": [
"SUMMER20"
],
"gift_cards": [
{
"type": "dintero.wallets",
"card_id": "<string>",
"amount": 123,
"masked_card_token": "<string>"
}
],
"emd": {
"event": [
{
"event_name": "Michael Jackson",
"event_company": "Diamond Events",
"genre_of_event": "Pop",
"start_time": "2023-08-16T15:00:00Z",
"end_time": "2023-08-16T16:00:00Z",
"ticket_delivery_method": "email",
"ticket_delivery_recipient": "recipient@mail.com",
"arena_name": "Oslo Spektrum",
"access_controlled_venue": true,
"affiliate_name": "Klarna affiliate"
}
],
"travel": {}
},
"payout_destination_id": "<string>"
},
"configuration": {
"auto_capture": true,
"channel": "ecommerce",
"publish": [
{}
],
"active_payment_types": {
"enabled": true
},
"bambora": {
"type": "payment_type"
},
"dintero": {
"type": "payment_type"
},
"dintero_psp": {
"type": "payment_type"
},
"instabank": {},
"netaxept": {
"type": "payment_type"
},
"payex": {
"dynamic_descriptor": "<string>"
},
"collector": {
"type": "payment_type",
"dynamic_descriptor": "<string>"
},
"klarna": {
"type": "payment_type"
},
"kravia": {
"type": "payment_type"
},
"two": {
"type": "payment_type"
},
"santander": {
"type": "payment_type"
},
"seitatech": {
"type": "payment_type"
},
"swish": {
"type": "payment_type"
},
"payout": {
"dynamic_payout_destination_ids": [
{
"order_store_id": "STORE_123",
"order_payout_destination_id": "PD_123",
"overwrite_payout_destination_id": false
}
]
},
"allow_express_wallet_payment": false,
"discounts": {},
"theme": {
"backdrop": "<string>",
"primary": "<string>",
"cardRadius": "<string>",
"buttonRadius": "<string>"
},
"countries": {
"preferred_country": "<string>",
"allow_countries": [
"<string>"
],
"deny_countries": [
"<string>"
]
},
"allow_different_billing_shipping_address": [],
"merchant": {
"id": null,
"logo_url": "<string>",
"name": "TKP tech AS",
"country": "NO"
}
},
"id": "<string>"
}
'import requests
url = "https://checkout.dintero.com/v1/examples/discount_code_callback_url"
payload = {
"url": {
"return_url": "https://example.com/accept",
"callback_url": "https://example.com/callback?method=GET",
"merchant_terms_url": "https://example.com/terms.html"
},
"order": {
"amount": 72200,
"currency": "NOK",
"merchant_reference": "<string>",
"vat_amount": 13660,
"merchant_reference_2": "<string>",
"event_reference": "<string>",
"shipping_address": {
"first_name": "John",
"last_name": "Doe",
"address_line": "<string>",
"address_line_2": "<string>",
"co_address": "Land Lord",
"business_name": "<string>",
"postal_code": "0349",
"postal_place": "Oslo",
"country": "NO",
"phone_number": "<string>",
"email": "<string>",
"latitude": 123,
"longitude": 123,
"comment": "<string>",
"organization_number": "<string>",
"organization_type": "<string>",
"customer_reference": "<string>",
"cost_center": "<string>"
},
"billing_address": {
"first_name": "John",
"last_name": "Doe",
"address_line": "<string>",
"address_line_2": "<string>",
"co_address": "Land Lord",
"business_name": "<string>",
"postal_code": "0349",
"postal_place": "Oslo",
"country": "NO",
"phone_number": "<string>",
"email": "<string>",
"latitude": 123,
"longitude": 123,
"comment": "<string>",
"organization_number": "<string>",
"organization_type": "<string>",
"customer_reference": "<string>",
"cost_center": "<string>"
},
"partial_payment": False,
"items": [
{
"amount": 2000,
"quantity": 2,
"line_id": "1",
"description": "Forsvinnignspølse",
"vat": 20,
"id": "10"
},
{
"amount": 6600,
"quantity": 2,
"line_id": "2",
"description": "Vissvossafår på neppebrød",
"vat": 20,
"id": "6",
"eligible_for_discount": True,
"is_changed": True,
"gross_amount": 10000,
"discount_lines": [
{
"amount": 4400,
"discount_type": "customer",
"discount_id": "ed960ace-eb16-4e2e-ae52-b27647ccae8d",
"description": "Vossafestpris",
"line_id": 1
}
]
},
{
"amount": 59700,
"quantity": 3,
"line_id": "3",
"description": "Luftboller",
"vat": 20,
"id": "1"
}
],
"discount_lines": [
{
"amount": 4400,
"percentage": 44,
"discount_id": "766da0ef-9283-42bd-b012-0582344ec53c",
"description": "<string>",
"line_id": 1
}
],
"discount_codes": ["SUMMER20"],
"gift_cards": [
{
"type": "dintero.wallets",
"card_id": "<string>",
"amount": 123,
"masked_card_token": "<string>"
}
],
"emd": {
"event": [
{
"event_name": "Michael Jackson",
"event_company": "Diamond Events",
"genre_of_event": "Pop",
"start_time": "2023-08-16T15:00:00Z",
"end_time": "2023-08-16T16:00:00Z",
"ticket_delivery_method": "email",
"ticket_delivery_recipient": "recipient@mail.com",
"arena_name": "Oslo Spektrum",
"access_controlled_venue": True,
"affiliate_name": "Klarna affiliate"
}
],
"travel": {}
},
"payout_destination_id": "<string>"
},
"configuration": {
"auto_capture": True,
"channel": "ecommerce",
"publish": [{}],
"active_payment_types": { "enabled": True },
"bambora": { "type": "payment_type" },
"dintero": { "type": "payment_type" },
"dintero_psp": { "type": "payment_type" },
"instabank": {},
"netaxept": { "type": "payment_type" },
"payex": { "dynamic_descriptor": "<string>" },
"collector": {
"type": "payment_type",
"dynamic_descriptor": "<string>"
},
"klarna": { "type": "payment_type" },
"kravia": { "type": "payment_type" },
"two": { "type": "payment_type" },
"santander": { "type": "payment_type" },
"seitatech": { "type": "payment_type" },
"swish": { "type": "payment_type" },
"payout": { "dynamic_payout_destination_ids": [
{
"order_store_id": "STORE_123",
"order_payout_destination_id": "PD_123",
"overwrite_payout_destination_id": False
}
] },
"allow_express_wallet_payment": False,
"discounts": {},
"theme": {
"backdrop": "<string>",
"primary": "<string>",
"cardRadius": "<string>",
"buttonRadius": "<string>"
},
"countries": {
"preferred_country": "<string>",
"allow_countries": ["<string>"],
"deny_countries": ["<string>"]
},
"allow_different_billing_shipping_address": [],
"merchant": {
"id": None,
"logo_url": "<string>",
"name": "TKP tech AS",
"country": "NO"
}
},
"id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
url: {
return_url: 'https://example.com/accept',
callback_url: 'https://example.com/callback?method=GET',
merchant_terms_url: 'https://example.com/terms.html'
},
order: {
amount: 72200,
currency: 'NOK',
merchant_reference: '<string>',
vat_amount: 13660,
merchant_reference_2: '<string>',
event_reference: '<string>',
shipping_address: {
first_name: 'John',
last_name: 'Doe',
address_line: '<string>',
address_line_2: '<string>',
co_address: 'Land Lord',
business_name: '<string>',
postal_code: '0349',
postal_place: 'Oslo',
country: 'NO',
phone_number: '<string>',
email: '<string>',
latitude: 123,
longitude: 123,
comment: '<string>',
organization_number: '<string>',
organization_type: '<string>',
customer_reference: '<string>',
cost_center: '<string>'
},
billing_address: {
first_name: 'John',
last_name: 'Doe',
address_line: '<string>',
address_line_2: '<string>',
co_address: 'Land Lord',
business_name: '<string>',
postal_code: '0349',
postal_place: 'Oslo',
country: 'NO',
phone_number: '<string>',
email: '<string>',
latitude: 123,
longitude: 123,
comment: '<string>',
organization_number: '<string>',
organization_type: '<string>',
customer_reference: '<string>',
cost_center: '<string>'
},
partial_payment: false,
items: [
{
amount: 2000,
quantity: 2,
line_id: '1',
description: 'Forsvinnignspølse',
vat: 20,
id: '10'
},
{
amount: 6600,
quantity: 2,
line_id: '2',
description: 'Vissvossafår på neppebrød',
vat: 20,
id: '6',
eligible_for_discount: true,
is_changed: true,
gross_amount: 10000,
discount_lines: [
{
amount: 4400,
discount_type: 'customer',
discount_id: 'ed960ace-eb16-4e2e-ae52-b27647ccae8d',
description: 'Vossafestpris',
line_id: 1
}
]
},
{
amount: 59700,
quantity: 3,
line_id: '3',
description: 'Luftboller',
vat: 20,
id: '1'
}
],
discount_lines: [
{
amount: 4400,
percentage: 44,
discount_id: '766da0ef-9283-42bd-b012-0582344ec53c',
description: '<string>',
line_id: 1
}
],
discount_codes: ['SUMMER20'],
gift_cards: [
{
type: 'dintero.wallets',
card_id: '<string>',
amount: 123,
masked_card_token: '<string>'
}
],
emd: {
event: [
{
event_name: 'Michael Jackson',
event_company: 'Diamond Events',
genre_of_event: 'Pop',
start_time: '2023-08-16T15:00:00Z',
end_time: '2023-08-16T16:00:00Z',
ticket_delivery_method: 'email',
ticket_delivery_recipient: 'recipient@mail.com',
arena_name: 'Oslo Spektrum',
access_controlled_venue: true,
affiliate_name: 'Klarna affiliate'
}
],
travel: {}
},
payout_destination_id: '<string>'
},
configuration: {
auto_capture: true,
channel: 'ecommerce',
publish: [{}],
active_payment_types: {enabled: true},
bambora: {type: 'payment_type'},
dintero: {type: 'payment_type'},
dintero_psp: {type: 'payment_type'},
instabank: {},
netaxept: {type: 'payment_type'},
payex: {dynamic_descriptor: '<string>'},
collector: {type: 'payment_type', dynamic_descriptor: '<string>'},
klarna: {type: 'payment_type'},
kravia: {type: 'payment_type'},
two: {type: 'payment_type'},
santander: {type: 'payment_type'},
seitatech: {type: 'payment_type'},
swish: {type: 'payment_type'},
payout: {
dynamic_payout_destination_ids: [
{
order_store_id: 'STORE_123',
order_payout_destination_id: 'PD_123',
overwrite_payout_destination_id: false
}
]
},
allow_express_wallet_payment: false,
discounts: {},
theme: {
backdrop: '<string>',
primary: '<string>',
cardRadius: '<string>',
buttonRadius: '<string>'
},
countries: {
preferred_country: '<string>',
allow_countries: ['<string>'],
deny_countries: ['<string>']
},
allow_different_billing_shipping_address: [],
merchant: {id: null, logo_url: '<string>', name: 'TKP tech AS', country: 'NO'}
},
id: '<string>'
})
};
fetch('https://checkout.dintero.com/v1/examples/discount_code_callback_url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://checkout.dintero.com/v1/examples/discount_code_callback_url"
payload := strings.NewReader("{\n \"url\": {\n \"return_url\": \"https://example.com/accept\",\n \"callback_url\": \"https://example.com/callback?method=GET\",\n \"merchant_terms_url\": \"https://example.com/terms.html\"\n },\n \"order\": {\n \"amount\": 72200,\n \"currency\": \"NOK\",\n \"merchant_reference\": \"<string>\",\n \"vat_amount\": 13660,\n \"merchant_reference_2\": \"<string>\",\n \"event_reference\": \"<string>\",\n \"shipping_address\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"address_line\": \"<string>\",\n \"address_line_2\": \"<string>\",\n \"co_address\": \"Land Lord\",\n \"business_name\": \"<string>\",\n \"postal_code\": \"0349\",\n \"postal_place\": \"Oslo\",\n \"country\": \"NO\",\n \"phone_number\": \"<string>\",\n \"email\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"comment\": \"<string>\",\n \"organization_number\": \"<string>\",\n \"organization_type\": \"<string>\",\n \"customer_reference\": \"<string>\",\n \"cost_center\": \"<string>\"\n },\n \"billing_address\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"address_line\": \"<string>\",\n \"address_line_2\": \"<string>\",\n \"co_address\": \"Land Lord\",\n \"business_name\": \"<string>\",\n \"postal_code\": \"0349\",\n \"postal_place\": \"Oslo\",\n \"country\": \"NO\",\n \"phone_number\": \"<string>\",\n \"email\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"comment\": \"<string>\",\n \"organization_number\": \"<string>\",\n \"organization_type\": \"<string>\",\n \"customer_reference\": \"<string>\",\n \"cost_center\": \"<string>\"\n },\n \"partial_payment\": false,\n \"items\": [\n {\n \"amount\": 2000,\n \"quantity\": 2,\n \"line_id\": \"1\",\n \"description\": \"Forsvinnignspølse\",\n \"vat\": 20,\n \"id\": \"10\"\n },\n {\n \"amount\": 6600,\n \"quantity\": 2,\n \"line_id\": \"2\",\n \"description\": \"Vissvossafår på neppebrød\",\n \"vat\": 20,\n \"id\": \"6\",\n \"eligible_for_discount\": true,\n \"is_changed\": true,\n \"gross_amount\": 10000,\n \"discount_lines\": [\n {\n \"amount\": 4400,\n \"discount_type\": \"customer\",\n \"discount_id\": \"ed960ace-eb16-4e2e-ae52-b27647ccae8d\",\n \"description\": \"Vossafestpris\",\n \"line_id\": 1\n }\n ]\n },\n {\n \"amount\": 59700,\n \"quantity\": 3,\n \"line_id\": \"3\",\n \"description\": \"Luftboller\",\n \"vat\": 20,\n \"id\": \"1\"\n }\n ],\n \"discount_lines\": [\n {\n \"amount\": 4400,\n \"percentage\": 44,\n \"discount_id\": \"766da0ef-9283-42bd-b012-0582344ec53c\",\n \"description\": \"<string>\",\n \"line_id\": 1\n }\n ],\n \"discount_codes\": [\n \"SUMMER20\"\n ],\n \"gift_cards\": [\n {\n \"type\": \"dintero.wallets\",\n \"card_id\": \"<string>\",\n \"amount\": 123,\n \"masked_card_token\": \"<string>\"\n }\n ],\n \"emd\": {\n \"event\": [\n {\n \"event_name\": \"Michael Jackson\",\n \"event_company\": \"Diamond Events\",\n \"genre_of_event\": \"Pop\",\n \"start_time\": \"2023-08-16T15:00:00Z\",\n \"end_time\": \"2023-08-16T16:00:00Z\",\n \"ticket_delivery_method\": \"email\",\n \"ticket_delivery_recipient\": \"recipient@mail.com\",\n \"arena_name\": \"Oslo Spektrum\",\n \"access_controlled_venue\": true,\n \"affiliate_name\": \"Klarna affiliate\"\n }\n ],\n \"travel\": {}\n },\n \"payout_destination_id\": \"<string>\"\n },\n \"configuration\": {\n \"auto_capture\": true,\n \"channel\": \"ecommerce\",\n \"publish\": [\n {}\n ],\n \"active_payment_types\": {\n \"enabled\": true\n },\n \"bambora\": {\n \"type\": \"payment_type\"\n },\n \"dintero\": {\n \"type\": \"payment_type\"\n },\n \"dintero_psp\": {\n \"type\": \"payment_type\"\n },\n \"instabank\": {},\n \"netaxept\": {\n \"type\": \"payment_type\"\n },\n \"payex\": {\n \"dynamic_descriptor\": \"<string>\"\n },\n \"collector\": {\n \"type\": \"payment_type\",\n \"dynamic_descriptor\": \"<string>\"\n },\n \"klarna\": {\n \"type\": \"payment_type\"\n },\n \"kravia\": {\n \"type\": \"payment_type\"\n },\n \"two\": {\n \"type\": \"payment_type\"\n },\n \"santander\": {\n \"type\": \"payment_type\"\n },\n \"seitatech\": {\n \"type\": \"payment_type\"\n },\n \"swish\": {\n \"type\": \"payment_type\"\n },\n \"payout\": {\n \"dynamic_payout_destination_ids\": [\n {\n \"order_store_id\": \"STORE_123\",\n \"order_payout_destination_id\": \"PD_123\",\n \"overwrite_payout_destination_id\": false\n }\n ]\n },\n \"allow_express_wallet_payment\": false,\n \"discounts\": {},\n \"theme\": {\n \"backdrop\": \"<string>\",\n \"primary\": \"<string>\",\n \"cardRadius\": \"<string>\",\n \"buttonRadius\": \"<string>\"\n },\n \"countries\": {\n \"preferred_country\": \"<string>\",\n \"allow_countries\": [\n \"<string>\"\n ],\n \"deny_countries\": [\n \"<string>\"\n ]\n },\n \"allow_different_billing_shipping_address\": [],\n \"merchant\": {\n \"id\": null,\n \"logo_url\": \"<string>\",\n \"name\": \"TKP tech AS\",\n \"country\": \"NO\"\n }\n },\n \"id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://checkout.dintero.com/v1/examples/discount_code_callback_url")
.header("Content-Type", "application/json")
.body("{\n \"url\": {\n \"return_url\": \"https://example.com/accept\",\n \"callback_url\": \"https://example.com/callback?method=GET\",\n \"merchant_terms_url\": \"https://example.com/terms.html\"\n },\n \"order\": {\n \"amount\": 72200,\n \"currency\": \"NOK\",\n \"merchant_reference\": \"<string>\",\n \"vat_amount\": 13660,\n \"merchant_reference_2\": \"<string>\",\n \"event_reference\": \"<string>\",\n \"shipping_address\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"address_line\": \"<string>\",\n \"address_line_2\": \"<string>\",\n \"co_address\": \"Land Lord\",\n \"business_name\": \"<string>\",\n \"postal_code\": \"0349\",\n \"postal_place\": \"Oslo\",\n \"country\": \"NO\",\n \"phone_number\": \"<string>\",\n \"email\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"comment\": \"<string>\",\n \"organization_number\": \"<string>\",\n \"organization_type\": \"<string>\",\n \"customer_reference\": \"<string>\",\n \"cost_center\": \"<string>\"\n },\n \"billing_address\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"address_line\": \"<string>\",\n \"address_line_2\": \"<string>\",\n \"co_address\": \"Land Lord\",\n \"business_name\": \"<string>\",\n \"postal_code\": \"0349\",\n \"postal_place\": \"Oslo\",\n \"country\": \"NO\",\n \"phone_number\": \"<string>\",\n \"email\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123,\n \"comment\": \"<string>\",\n \"organization_number\": \"<string>\",\n \"organization_type\": \"<string>\",\n \"customer_reference\": \"<string>\",\n \"cost_center\": \"<string>\"\n },\n \"partial_payment\": false,\n \"items\": [\n {\n \"amount\": 2000,\n \"quantity\": 2,\n \"line_id\": \"1\",\n \"description\": \"Forsvinnignspølse\",\n \"vat\": 20,\n \"id\": \"10\"\n },\n {\n \"amount\": 6600,\n \"quantity\": 2,\n \"line_id\": \"2\",\n \"description\": \"Vissvossafår på neppebrød\",\n \"vat\": 20,\n \"id\": \"6\",\n \"eligible_for_discount\": true,\n \"is_changed\": true,\n \"gross_amount\": 10000,\n \"discount_lines\": [\n {\n \"amount\": 4400,\n \"discount_type\": \"customer\",\n \"discount_id\": \"ed960ace-eb16-4e2e-ae52-b27647ccae8d\",\n \"description\": \"Vossafestpris\",\n \"line_id\": 1\n }\n ]\n },\n {\n \"amount\": 59700,\n \"quantity\": 3,\n \"line_id\": \"3\",\n \"description\": \"Luftboller\",\n \"vat\": 20,\n \"id\": \"1\"\n }\n ],\n \"discount_lines\": [\n {\n \"amount\": 4400,\n \"percentage\": 44,\n \"discount_id\": \"766da0ef-9283-42bd-b012-0582344ec53c\",\n \"description\": \"<string>\",\n \"line_id\": 1\n }\n ],\n \"discount_codes\": [\n \"SUMMER20\"\n ],\n \"gift_cards\": [\n {\n \"type\": \"dintero.wallets\",\n \"card_id\": \"<string>\",\n \"amount\": 123,\n \"masked_card_token\": \"<string>\"\n }\n ],\n \"emd\": {\n \"event\": [\n {\n \"event_name\": \"Michael Jackson\",\n \"event_company\": \"Diamond Events\",\n \"genre_of_event\": \"Pop\",\n \"start_time\": \"2023-08-16T15:00:00Z\",\n \"end_time\": \"2023-08-16T16:00:00Z\",\n \"ticket_delivery_method\": \"email\",\n \"ticket_delivery_recipient\": \"recipient@mail.com\",\n \"arena_name\": \"Oslo Spektrum\",\n \"access_controlled_venue\": true,\n \"affiliate_name\": \"Klarna affiliate\"\n }\n ],\n \"travel\": {}\n },\n \"payout_destination_id\": \"<string>\"\n },\n \"configuration\": {\n \"auto_capture\": true,\n \"channel\": \"ecommerce\",\n \"publish\": [\n {}\n ],\n \"active_payment_types\": {\n \"enabled\": true\n },\n \"bambora\": {\n \"type\": \"payment_type\"\n },\n \"dintero\": {\n \"type\": \"payment_type\"\n },\n \"dintero_psp\": {\n \"type\": \"payment_type\"\n },\n \"instabank\": {},\n \"netaxept\": {\n \"type\": \"payment_type\"\n },\n \"payex\": {\n \"dynamic_descriptor\": \"<string>\"\n },\n \"collector\": {\n \"type\": \"payment_type\",\n \"dynamic_descriptor\": \"<string>\"\n },\n \"klarna\": {\n \"type\": \"payment_type\"\n },\n \"kravia\": {\n \"type\": \"payment_type\"\n },\n \"two\": {\n \"type\": \"payment_type\"\n },\n \"santander\": {\n \"type\": \"payment_type\"\n },\n \"seitatech\": {\n \"type\": \"payment_type\"\n },\n \"swish\": {\n \"type\": \"payment_type\"\n },\n \"payout\": {\n \"dynamic_payout_destination_ids\": [\n {\n \"order_store_id\": \"STORE_123\",\n \"order_payout_destination_id\": \"PD_123\",\n \"overwrite_payout_destination_id\": false\n }\n ]\n },\n \"allow_express_wallet_payment\": false,\n \"discounts\": {},\n \"theme\": {\n \"backdrop\": \"<string>\",\n \"primary\": \"<string>\",\n \"cardRadius\": \"<string>\",\n \"buttonRadius\": \"<string>\"\n },\n \"countries\": {\n \"preferred_country\": \"<string>\",\n \"allow_countries\": [\n \"<string>\"\n ],\n \"deny_countries\": [\n \"<string>\"\n ]\n },\n \"allow_different_billing_shipping_address\": [],\n \"merchant\": {\n \"id\": null,\n \"logo_url\": \"<string>\",\n \"name\": \"TKP tech AS\",\n \"country\": \"NO\"\n }\n },\n \"id\": \"<string>\"\n}")
.asString();{
"shipping_options": [
{
"id": "bring-pick-up-00001",
"line_id": "bring-pick-up-00001-location-0a1f6b",
"amount": 3900,
"title": "Standard",
"operator": "Bring",
"countries": [
"NO"
],
"vat_amount": 975,
"vat": 25,
"description": "Pick up at your nearest postal office",
"delivery_method": "pick_up",
"operator_product_id": "pick-up-00001-location-0a1f6b",
"eta": {
"working_days": [
1,
2
],
"shipping_day_of_week": 3,
"arrival_day_of_week": 3,
"starts_at": "2020-10-14T19:00:00Z",
"ends_at": "2020-10-14T20:00:00Z"
},
"time_slot": {
"starts_at": "2020-10-14T19:00:00Z",
"ends_at": "2020-10-14T20:00:00Z"
},
"pick_up_address": {
"first_name": "John",
"last_name": "Doe",
"address_line": "<string>",
"address_line_2": "<string>",
"co_address": "Land Lord",
"business_name": "<string>",
"postal_code": "0349",
"postal_place": "Oslo",
"country": "NO",
"phone_number": "<string>",
"email": "<string>",
"latitude": 123,
"longitude": 123,
"comment": "<string>",
"organization_number": "<string>",
"organization_type": "<string>",
"customer_reference": "<string>",
"cost_center": "<string>",
"website_url": "<string>",
"opening_hours": {
"open_now": true,
"periods": [
{
"opens_at": "08:00",
"closes_at": "16:00",
"day_of_week": 1
}
],
"timezone": "Europe/Oslo"
},
"distance": 123
},
"metadata": {
"operator_dest": "XAB1239",
"number_x": 1921
},
"environmental_data": {
"description": "Fossil free",
"details": [
{
"label": "Carbon offset",
"value": "1KG CO2"
}
]
},
"thumbnail_url": "<string>",
"pay_in_store": {
"type": "full"
},
"fee_split": {
"type": "proportional",
"destinations": [
"<string>"
]
},
"splits": [
{
"payout_destination_id": "seller-1",
"amount": 29700
}
],
"shipment_id": "<string>",
"shipment_items": [
{
"line_id": "line-id-1",
"quantity": 123
}
]
}
],
"order": {
"amount": 72200,
"discount_codes": [
"<string>"
],
"items": [
{
"amount": 2000,
"quantity": 2,
"line_id": "1",
"description": "Forsvinnignspølse",
"vat": 20,
"id": "10"
},
{
"amount": 6600,
"quantity": 2,
"line_id": "2",
"description": "Vissvossafår på neppebrød",
"vat": 20,
"id": "6",
"eligible_for_discount": true,
"is_changed": true,
"gross_amount": 10000,
"discount_lines": [
{
"amount": 4400,
"discount_type": "external",
"discount_id": "ed960ace-eb16-4e2e-ae52-b27647ccae8d",
"description": "Vossafestpris",
"line_id": 1
}
]
},
{
"amount": 59700,
"quantity": 3,
"line_id": "3",
"description": "Luftboller",
"vat": 20,
"id": "1"
}
]
}
}Body
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The ID of the Checkout
Time when the Checkout was created
Show child attributes
Show child attributes
The session expiration time after which the Checkout page wouldn't be available
Configuration for checkboxes that should be part of the checkout
2Show child attributes
Show child attributes
Present only for Express Checkout sessions.
An Express Checkout session is a session where the end user will submit a shipping address and then select a shipping option before the before a payment method is selected and the payment is initiated.
Endpoints used in the Express Checkout flow.
Show child attributes
Show child attributes
Last time when the Checkout was updated
The IP of the customer upon visiting the page. If the page is visited multiple times, the field is always updated with the last known value.
The full user agent of the device the customer used when visiting the checkout page
Show child attributes
Show child attributes
Initiated by the merchant or used to generate a token
unscheduled_purchase, recurring_purchase, generate_payment_token Checkout process events
Show child attributes
Show child attributes
[
{
"id": "769952fe-86c9-4185-a1ce-aeb46da3509c",
"name": "INITIATED",
"created_at": "2019-05-09T09:13:40.306Z",
"request_id": "b97b6312-f8b3-11ed-be56-0242ac120002"
},
{
"name": "VISITED",
"created_at": "2019-05-09T09:13:50.548Z"
},
{
"name": "PAY_FAILED",
"created_at": "2019-05-09T09:14:10.548Z",
"details": {
"error": "Rejected",
"payment_product_type": "instabank.finance"
}
},
{
"name": "FAILED",
"created_at": "2019-05-09T09:16:11.786Z"
}
]
Transaction which has been created using the checkout.
metadata about the session
Show child attributes
Show child attributes
Response
Session Discount update
Shipping options that will be presented to the end user after the callback
- If the merchant is not able to ship the order to the end users shipping address, use an empty array.
- If there is only one option, a free delivery, the order still
has to contain one option with a
price.amountof 0.
Show child attributes
Show child attributes
Order updated with discount given by discount_code.
Show child attributes
Show child attributes