CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://sandbox.api.keyper.io/admin/containers");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
headers = curl_slist_append(headers, "authorization: AUTHTOKEN auth_token="ENTER YOUR API KEY FROM STEP 2"");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"containers\":[{\"ticket\":{\"tickets\":[{\"external_ticket_id\":\"IDofTicketInYourSystem(MustNotChange)\",\"barcode\":\"123456789\",\"price\":35.9,\"currency\":\"EUR\"}],\"event\":{\"external_event_id\":\"IDofEventInYourSystem\",\"name\":\"Name of the event\",\"start_date\":\"2022-10-23T11:15:00+02:00\",\"organizer_ref\":\"ReferencesExternalOrganizerID\",\"location_ref\":\"ReferencesExternalLocationID\"},\"organizer\":{\"external_event_organizer_id\":\"IDofEventOrganizerInYourSystem(ReferencedByEvent)\",\"name\":\"Name of the event organizer\",\"country_code\":\"AT\"},\"location\":{\"external_location_id\":\"IDofEventLocationInYourSystem(ReferencedByEvent)\",\"name\":\"Name of event location\",\"country_code\":\"AT\"},\"event_ticket_data\":[{\"external_event_id\":\"ReferencesExternalEventID\",\"external_ticket_id\":\"ReferencesExternalTicketID\"}]},\"type\":\"Ticket\",\"process_info\":{\"payment_state\":\"paid\",\"send_type\":\"immediately\",\"to_user\":{\"email\":\"emailofrecipient@keyper.ws\"}},\"external_reference_id\":\"IDofOrderInYourSystem\"}]}");

CURLcode ret = curl_easy_perform(hnd);
var client = new RestClient("https://sandbox.api.keyper.io/admin/containers");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "AUTHTOKEN auth_token="ENTER YOUR API KEY FROM STEP 2"");
request.AddParameter("application/json", "{\"containers\":[{\"ticket\":{\"tickets\":[{\"external_ticket_id\":\"IDofTicketInYourSystem(MustNotChange)\",\"barcode\":\"123456789\",\"price\":35.9,\"currency\":\"EUR\"}],\"event\":{\"external_event_id\":\"IDofEventInYourSystem\",\"name\":\"Name of the event\",\"start_date\":\"2022-10-23T11:15:00+02:00\",\"organizer_ref\":\"ReferencesExternalOrganizerID\",\"location_ref\":\"ReferencesExternalLocationID\"},\"organizer\":{\"external_event_organizer_id\":\"IDofEventOrganizerInYourSystem(ReferencedByEvent)\",\"name\":\"Name of the event organizer\",\"country_code\":\"AT\"},\"location\":{\"external_location_id\":\"IDofEventLocationInYourSystem(ReferencedByEvent)\",\"name\":\"Name of event location\",\"country_code\":\"AT\"},\"event_ticket_data\":[{\"external_event_id\":\"ReferencesExternalEventID\",\"external_ticket_id\":\"ReferencesExternalTicketID\"}]},\"type\":\"Ticket\",\"process_info\":{\"payment_state\":\"paid\",\"send_type\":\"immediately\",\"to_user\":{\"email\":\"emailofrecipient@keyper.ws\"}},\"external_reference_id\":\"IDofOrderInYourSystem\"}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://sandbox.api.keyper.io/admin/containers"

	payload := strings.NewReader("{\"containers\":[{\"ticket\":{\"tickets\":[{\"external_ticket_id\":\"IDofTicketInYourSystem(MustNotChange)\",\"barcode\":\"123456789\",\"price\":35.9,\"currency\":\"EUR\"}],\"event\":{\"external_event_id\":\"IDofEventInYourSystem\",\"name\":\"Name of the event\",\"start_date\":\"2022-10-23T11:15:00+02:00\",\"organizer_ref\":\"ReferencesExternalOrganizerID\",\"location_ref\":\"ReferencesExternalLocationID\"},\"organizer\":{\"external_event_organizer_id\":\"IDofEventOrganizerInYourSystem(ReferencedByEvent)\",\"name\":\"Name of the event organizer\",\"country_code\":\"AT\"},\"location\":{\"external_location_id\":\"IDofEventLocationInYourSystem(ReferencedByEvent)\",\"name\":\"Name of event location\",\"country_code\":\"AT\"},\"event_ticket_data\":[{\"external_event_id\":\"ReferencesExternalEventID\",\"external_ticket_id\":\"ReferencesExternalTicketID\"}]},\"type\":\"Ticket\",\"process_info\":{\"payment_state\":\"paid\",\"send_type\":\"immediately\",\"to_user\":{\"email\":\"emailofrecipient@keyper.ws\"}},\"external_reference_id\":\"IDofOrderInYourSystem\"}]}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("authorization", "AUTHTOKEN auth_token="ENTER YOUR API KEY FROM STEP 2"")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"containers\":[{\"ticket\":{\"tickets\":[{\"external_ticket_id\":\"IDofTicketInYourSystem(MustNotChange)\",\"barcode\":\"123456789\",\"price\":35.9,\"currency\":\"EUR\"}],\"event\":{\"external_event_id\":\"IDofEventInYourSystem\",\"name\":\"Name of the event\",\"start_date\":\"2022-10-23T11:15:00+02:00\",\"organizer_ref\":\"ReferencesExternalOrganizerID\",\"location_ref\":\"ReferencesExternalLocationID\"},\"organizer\":{\"external_event_organizer_id\":\"IDofEventOrganizerInYourSystem(ReferencedByEvent)\",\"name\":\"Name of the event organizer\",\"country_code\":\"AT\"},\"location\":{\"external_location_id\":\"IDofEventLocationInYourSystem(ReferencedByEvent)\",\"name\":\"Name of event location\",\"country_code\":\"AT\"},\"event_ticket_data\":[{\"external_event_id\":\"ReferencesExternalEventID\",\"external_ticket_id\":\"ReferencesExternalTicketID\"}]},\"type\":\"Ticket\",\"process_info\":{\"payment_state\":\"paid\",\"send_type\":\"immediately\",\"to_user\":{\"email\":\"emailofrecipient@keyper.ws\"}},\"external_reference_id\":\"IDofOrderInYourSystem\"}]}");
Request request = new Request.Builder()
  .url("https://sandbox.api.keyper.io/admin/containers")
  .post(body)
  .addHeader("authorization", "AUTHTOKEN auth_token="ENTER YOUR API KEY FROM STEP 2"")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse<String> response = Unirest.post("https://sandbox.api.keyper.io/admin/containers")
  .header("authorization", "AUTHTOKEN auth_token="ENTER YOUR API KEY FROM STEP 2"")
  .header("content-type", "application/json")
  .body("{\"containers\":[{\"ticket\":{\"tickets\":[{\"external_ticket_id\":\"IDofTicketInYourSystem(MustNotChange)\",\"barcode\":\"123456789\",\"price\":35.9,\"currency\":\"EUR\"}],\"event\":{\"external_event_id\":\"IDofEventInYourSystem\",\"name\":\"Name of the event\",\"start_date\":\"2022-10-23T11:15:00+02:00\",\"organizer_ref\":\"ReferencesExternalOrganizerID\",\"location_ref\":\"ReferencesExternalLocationID\"},\"organizer\":{\"external_event_organizer_id\":\"IDofEventOrganizerInYourSystem(ReferencedByEvent)\",\"name\":\"Name of the event organizer\",\"country_code\":\"AT\"},\"location\":{\"external_location_id\":\"IDofEventLocationInYourSystem(ReferencedByEvent)\",\"name\":\"Name of event location\",\"country_code\":\"AT\"},\"event_ticket_data\":[{\"external_event_id\":\"ReferencesExternalEventID\",\"external_ticket_id\":\"ReferencesExternalTicketID\"}]},\"type\":\"Ticket\",\"process_info\":{\"payment_state\":\"paid\",\"send_type\":\"immediately\",\"to_user\":{\"email\":\"emailofrecipient@keyper.ws\"}},\"external_reference_id\":\"IDofOrderInYourSystem\"}]}")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://sandbox.api.keyper.io/admin/containers",
  "method": "POST",
  "headers": {
    "authorization": "AUTHTOKEN auth_token=\"ENTER YOUR API KEY FROM STEP 2\"",
    "content-type": "application/json"
  },
  "processData": false,
  "data": "{\"containers\":[{\"ticket\":{\"tickets\":[{\"external_ticket_id\":\"IDofTicketInYourSystem(MustNotChange)\",\"barcode\":\"123456789\",\"price\":35.9,\"currency\":\"EUR\"}],\"event\":{\"external_event_id\":\"IDofEventInYourSystem\",\"name\":\"Name of the event\",\"start_date\":\"2022-10-23T11:15:00+02:00\",\"organizer_ref\":\"ReferencesExternalOrganizerID\",\"location_ref\":\"ReferencesExternalLocationID\"},\"organizer\":{\"external_event_organizer_id\":\"IDofEventOrganizerInYourSystem(ReferencedByEvent)\",\"name\":\"Name of the event organizer\",\"country_code\":\"AT\"},\"location\":{\"external_location_id\":\"IDofEventLocationInYourSystem(ReferencedByEvent)\",\"name\":\"Name of event location\",\"country_code\":\"AT\"},\"event_ticket_data\":[{\"external_event_id\":\"ReferencesExternalEventID\",\"external_ticket_id\":\"ReferencesExternalTicketID\"}]},\"type\":\"Ticket\",\"process_info\":{\"payment_state\":\"paid\",\"send_type\":\"immediately\",\"to_user\":{\"email\":\"emailofrecipient@keyper.ws\"}},\"external_reference_id\":\"IDofOrderInYourSystem\"}]}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var data = JSON.stringify({
  "containers": [
    {
      "ticket": {
        "tickets": [
          {
            "external_ticket_id": "IDofTicketInYourSystem(MustNotChange)",
            "barcode": "123456789",
            "price": 35.9,
            "currency": "EUR"
          }
        ],
        "event": {
          "external_event_id": "IDofEventInYourSystem",
          "name": "Name of the event",
          "start_date": "2022-10-23T11:15:00+02:00",
          "organizer_ref": "ReferencesExternalOrganizerID",
          "location_ref": "ReferencesExternalLocationID"
        },
        "organizer": {
          "external_event_organizer_id": "IDofEventOrganizerInYourSystem(ReferencedByEvent)",
          "name": "Name of the event organizer",
          "country_code": "AT"
        },
        "location": {
          "external_location_id": "IDofEventLocationInYourSystem(ReferencedByEvent)",
          "name": "Name of event location",
          "country_code": "AT"
        },
        "event_ticket_data": [
          {
            "external_event_id": "ReferencesExternalEventID",
            "external_ticket_id": "ReferencesExternalTicketID"
          }
        ]
      },
      "type": "Ticket",
      "process_info": {
        "payment_state": "paid",
        "send_type": "immediately",
        "to_user": {
          "email": "emailofrecipient@keyper.ws"
        }
      },
      "external_reference_id": "IDofOrderInYourSystem"
    }
  ]
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://sandbox.api.keyper.io/admin/containers");
xhr.setRequestHeader("authorization", "AUTHTOKEN auth_token=\"ENTER YOUR API KEY FROM STEP 2\"");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "sandbox.api.keyper.io",
  "port": null,
  "path": "/admin/containers",
  "headers": {
    "authorization": "AUTHTOKEN auth_token=\"ENTER YOUR API KEY FROM STEP 2\"",
    "content-type": "application/json"
  }
};

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

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

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

req.write(JSON.stringify({ containers: 
   [ { ticket: 
        { tickets: 
           [ { external_ticket_id: 'IDofTicketInYourSystem(MustNotChange)',
               barcode: '123456789',
               price: 35.9,
               currency: 'EUR' } ],
          event: 
           { external_event_id: 'IDofEventInYourSystem',
             name: 'Name of the event',
             start_date: '2022-10-23T11:15:00+02:00',
             organizer_ref: 'ReferencesExternalOrganizerID',
             location_ref: 'ReferencesExternalLocationID' },
          organizer: 
           { external_event_organizer_id: 'IDofEventOrganizerInYourSystem(ReferencedByEvent)',
             name: 'Name of the event organizer',
             country_code: 'AT' },
          location: 
           { external_location_id: 'IDofEventLocationInYourSystem(ReferencedByEvent)',
             name: 'Name of event location',
             country_code: 'AT' },
          event_ticket_data: 
           [ { external_event_id: 'ReferencesExternalEventID',
               external_ticket_id: 'ReferencesExternalTicketID' } ] },
       type: 'Ticket',
       process_info: 
        { payment_state: 'paid',
          send_type: 'immediately',
          to_user: { email: 'emailofrecipient@keyper.ws' } },
       external_reference_id: 'IDofOrderInYourSystem' } ] }));
req.end();
var request = require("request");

var options = { method: 'POST',
  url: 'https://sandbox.api.keyper.io/admin/containers',
  headers: 
   { 'content-type': 'application/json',
     authorization: 'AUTHTOKEN auth_token="ENTER YOUR API KEY FROM STEP 2"' },
  body: 
   { containers: 
      [ { ticket: 
           { tickets: 
              [ { external_ticket_id: 'IDofTicketInYourSystem(MustNotChange)',
                  barcode: '123456789',
                  price: 35.9,
                  currency: 'EUR' } ],
             event: 
              { external_event_id: 'IDofEventInYourSystem',
                name: 'Name of the event',
                start_date: '2022-10-23T11:15:00+02:00',
                organizer_ref: 'ReferencesExternalOrganizerID',
                location_ref: 'ReferencesExternalLocationID' },
             organizer: 
              { external_event_organizer_id: 'IDofEventOrganizerInYourSystem(ReferencedByEvent)',
                name: 'Name of the event organizer',
                country_code: 'AT' },
             location: 
              { external_location_id: 'IDofEventLocationInYourSystem(ReferencedByEvent)',
                name: 'Name of event location',
                country_code: 'AT' },
             event_ticket_data: 
              [ { external_event_id: 'ReferencesExternalEventID',
                  external_ticket_id: 'ReferencesExternalTicketID' } ] },
          type: 'Ticket',
          process_info: 
           { payment_state: 'paid',
             send_type: 'immediately',
             to_user: { email: 'emailofrecipient@keyper.ws' } },
          external_reference_id: 'IDofOrderInYourSystem' } ] },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
var unirest = require("unirest");

var req = unirest("POST", "https://sandbox.api.keyper.io/admin/containers");

req.headers({
  "content-type": "application/json",
  "authorization": "AUTHTOKEN auth_token=\"ENTER YOUR API KEY FROM STEP 2\""
});

req.type("json");
req.send({
  "containers": [
    {
      "ticket": {
        "tickets": [
          {
            "external_ticket_id": "IDofTicketInYourSystem(MustNotChange)",
            "barcode": "123456789",
            "price": 35.9,
            "currency": "EUR"
          }
        ],
        "event": {
          "external_event_id": "IDofEventInYourSystem",
          "name": "Name of the event",
          "start_date": "2022-10-23T11:15:00+02:00",
          "organizer_ref": "ReferencesExternalOrganizerID",
          "location_ref": "ReferencesExternalLocationID"
        },
        "organizer": {
          "external_event_organizer_id": "IDofEventOrganizerInYourSystem(ReferencedByEvent)",
          "name": "Name of the event organizer",
          "country_code": "AT"
        },
        "location": {
          "external_location_id": "IDofEventLocationInYourSystem(ReferencedByEvent)",
          "name": "Name of event location",
          "country_code": "AT"
        },
        "event_ticket_data": [
          {
            "external_event_id": "ReferencesExternalEventID",
            "external_ticket_id": "ReferencesExternalTicketID"
          }
        ]
      },
      "type": "Ticket",
      "process_info": {
        "payment_state": "paid",
        "send_type": "immediately",
        "to_user": {
          "email": "emailofrecipient@keyper.ws"
        }
      },
      "external_reference_id": "IDofOrderInYourSystem"
    }
  ]
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
#import <Foundation/Foundation.h>

NSDictionary *headers = @{ @"authorization": @"AUTHTOKEN auth_token=\"ENTER YOUR API KEY FROM STEP 2\"",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"containers": @[ @{ @"ticket": @{ @"tickets": @[ @{ @"external_ticket_id": @"IDofTicketInYourSystem(MustNotChange)", @"barcode": @"123456789", @"price": @35.9, @"currency": @"EUR" } ], @"event": @{ @"external_event_id": @"IDofEventInYourSystem", @"name": @"Name of the event", @"start_date": @"2022-10-23T11:15:00+02:00", @"organizer_ref": @"ReferencesExternalOrganizerID", @"location_ref": @"ReferencesExternalLocationID" }, @"organizer": @{ @"external_event_organizer_id": @"IDofEventOrganizerInYourSystem(ReferencedByEvent)", @"name": @"Name of the event organizer", @"country_code": @"AT" }, @"location": @{ @"external_location_id": @"IDofEventLocationInYourSystem(ReferencedByEvent)", @"name": @"Name of event location", @"country_code": @"AT" }, @"event_ticket_data": @[ @{ @"external_event_id": @"ReferencesExternalEventID", @"external_ticket_id": @"ReferencesExternalTicketID" } ] }, @"type": @"Ticket", @"process_info": @{ @"payment_state": @"paid", @"send_type": @"immediately", @"to_user": @{ @"email": @"emailofrecipient@keyper.ws" } }, @"external_reference_id": @"IDofOrderInYourSystem" } ] };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://sandbox.api.keyper.io/admin/containers"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "https://sandbox.api.keyper.io/admin/containers" in
let headers = Header.add_list (Header.init ()) [
  ("authorization", "AUTHTOKEN auth_token="ENTER YOUR API KEY FROM STEP 2"");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\"containers\":[{\"ticket\":{\"tickets\":[{\"external_ticket_id\":\"IDofTicketInYourSystem(MustNotChange)\",\"barcode\":\"123456789\",\"price\":35.9,\"currency\":\"EUR\"}],\"event\":{\"external_event_id\":\"IDofEventInYourSystem\",\"name\":\"Name of the event\",\"start_date\":\"2022-10-23T11:15:00+02:00\",\"organizer_ref\":\"ReferencesExternalOrganizerID\",\"location_ref\":\"ReferencesExternalLocationID\"},\"organizer\":{\"external_event_organizer_id\":\"IDofEventOrganizerInYourSystem(ReferencedByEvent)\",\"name\":\"Name of the event organizer\",\"country_code\":\"AT\"},\"location\":{\"external_location_id\":\"IDofEventLocationInYourSystem(ReferencedByEvent)\",\"name\":\"Name of event location\",\"country_code\":\"AT\"},\"event_ticket_data\":[{\"external_event_id\":\"ReferencesExternalEventID\",\"external_ticket_id\":\"ReferencesExternalTicketID\"}]},\"type\":\"Ticket\",\"process_info\":{\"payment_state\":\"paid\",\"send_type\":\"immediately\",\"to_user\":{\"email\":\"emailofrecipient@keyper.ws\"}},\"external_reference_id\":\"IDofOrderInYourSystem\"}]}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://sandbox.api.keyper.io/admin/containers",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"containers\":[{\"ticket\":{\"tickets\":[{\"external_ticket_id\":\"IDofTicketInYourSystem(MustNotChange)\",\"barcode\":\"123456789\",\"price\":35.9,\"currency\":\"EUR\"}],\"event\":{\"external_event_id\":\"IDofEventInYourSystem\",\"name\":\"Name of the event\",\"start_date\":\"2022-10-23T11:15:00+02:00\",\"organizer_ref\":\"ReferencesExternalOrganizerID\",\"location_ref\":\"ReferencesExternalLocationID\"},\"organizer\":{\"external_event_organizer_id\":\"IDofEventOrganizerInYourSystem(ReferencedByEvent)\",\"name\":\"Name of the event organizer\",\"country_code\":\"AT\"},\"location\":{\"external_location_id\":\"IDofEventLocationInYourSystem(ReferencedByEvent)\",\"name\":\"Name of event location\",\"country_code\":\"AT\"},\"event_ticket_data\":[{\"external_event_id\":\"ReferencesExternalEventID\",\"external_ticket_id\":\"ReferencesExternalTicketID\"}]},\"type\":\"Ticket\",\"process_info\":{\"payment_state\":\"paid\",\"send_type\":\"immediately\",\"to_user\":{\"email\":\"emailofrecipient@keyper.ws\"}},\"external_reference_id\":\"IDofOrderInYourSystem\"}]}",
  CURLOPT_HTTPHEADER => array(
    "authorization: AUTHTOKEN auth_token="ENTER YOUR API KEY FROM STEP 2"",
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
<?php

$request = new HttpRequest();
$request->setUrl('https://sandbox.api.keyper.io/admin/containers');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'content-type' => 'application/json',
  'authorization' => 'AUTHTOKEN auth_token="ENTER YOUR API KEY FROM STEP 2"'
));

$request->setBody('{"containers":[{"ticket":{"tickets":[{"external_ticket_id":"IDofTicketInYourSystem(MustNotChange)","barcode":"123456789","price":35.9,"currency":"EUR"}],"event":{"external_event_id":"IDofEventInYourSystem","name":"Name of the event","start_date":"2022-10-23T11:15:00+02:00","organizer_ref":"ReferencesExternalOrganizerID","location_ref":"ReferencesExternalLocationID"},"organizer":{"external_event_organizer_id":"IDofEventOrganizerInYourSystem(ReferencedByEvent)","name":"Name of the event organizer","country_code":"AT"},"location":{"external_location_id":"IDofEventLocationInYourSystem(ReferencedByEvent)","name":"Name of event location","country_code":"AT"},"event_ticket_data":[{"external_event_id":"ReferencesExternalEventID","external_ticket_id":"ReferencesExternalTicketID"}]},"type":"Ticket","process_info":{"payment_state":"paid","send_type":"immediately","to_user":{"email":"emailofrecipient@keyper.ws"}},"external_reference_id":"IDofOrderInYourSystem"}]}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"containers":[{"ticket":{"tickets":[{"external_ticket_id":"IDofTicketInYourSystem(MustNotChange)","barcode":"123456789","price":35.9,"currency":"EUR"}],"event":{"external_event_id":"IDofEventInYourSystem","name":"Name of the event","start_date":"2022-10-23T11:15:00+02:00","organizer_ref":"ReferencesExternalOrganizerID","location_ref":"ReferencesExternalLocationID"},"organizer":{"external_event_organizer_id":"IDofEventOrganizerInYourSystem(ReferencedByEvent)","name":"Name of the event organizer","country_code":"AT"},"location":{"external_location_id":"IDofEventLocationInYourSystem(ReferencedByEvent)","name":"Name of event location","country_code":"AT"},"event_ticket_data":[{"external_event_id":"ReferencesExternalEventID","external_ticket_id":"ReferencesExternalTicketID"}]},"type":"Ticket","process_info":{"payment_state":"paid","send_type":"immediately","to_user":{"email":"emailofrecipient@keyper.ws"}},"external_reference_id":"IDofOrderInYourSystem"}]}');

$request->setRequestUrl('https://sandbox.api.keyper.io/admin/containers');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders(array(
  'content-type' => 'application/json',
  'authorization' => 'AUTHTOKEN auth_token="ENTER YOUR API KEY FROM STEP 2"'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
import http.client

conn = http.client.HTTPSConnection("sandbox.api.keyper.io")

payload = "{\"containers\":[{\"ticket\":{\"tickets\":[{\"external_ticket_id\":\"IDofTicketInYourSystem(MustNotChange)\",\"barcode\":\"123456789\",\"price\":35.9,\"currency\":\"EUR\"}],\"event\":{\"external_event_id\":\"IDofEventInYourSystem\",\"name\":\"Name of the event\",\"start_date\":\"2022-10-23T11:15:00+02:00\",\"organizer_ref\":\"ReferencesExternalOrganizerID\",\"location_ref\":\"ReferencesExternalLocationID\"},\"organizer\":{\"external_event_organizer_id\":\"IDofEventOrganizerInYourSystem(ReferencedByEvent)\",\"name\":\"Name of the event organizer\",\"country_code\":\"AT\"},\"location\":{\"external_location_id\":\"IDofEventLocationInYourSystem(ReferencedByEvent)\",\"name\":\"Name of event location\",\"country_code\":\"AT\"},\"event_ticket_data\":[{\"external_event_id\":\"ReferencesExternalEventID\",\"external_ticket_id\":\"ReferencesExternalTicketID\"}]},\"type\":\"Ticket\",\"process_info\":{\"payment_state\":\"paid\",\"send_type\":\"immediately\",\"to_user\":{\"email\":\"emailofrecipient@keyper.ws\"}},\"external_reference_id\":\"IDofOrderInYourSystem\"}]}"

headers = {
    'authorization': "AUTHTOKEN auth_token="ENTER YOUR API KEY FROM STEP 2"",
    'content-type': "application/json"
    }

conn.request("POST", "/admin/containers", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "https://sandbox.api.keyper.io/admin/containers"

payload = "{\"containers\":[{\"ticket\":{\"tickets\":[{\"external_ticket_id\":\"IDofTicketInYourSystem(MustNotChange)\",\"barcode\":\"123456789\",\"price\":35.9,\"currency\":\"EUR\"}],\"event\":{\"external_event_id\":\"IDofEventInYourSystem\",\"name\":\"Name of the event\",\"start_date\":\"2022-10-23T11:15:00+02:00\",\"organizer_ref\":\"ReferencesExternalOrganizerID\",\"location_ref\":\"ReferencesExternalLocationID\"},\"organizer\":{\"external_event_organizer_id\":\"IDofEventOrganizerInYourSystem(ReferencedByEvent)\",\"name\":\"Name of the event organizer\",\"country_code\":\"AT\"},\"location\":{\"external_location_id\":\"IDofEventLocationInYourSystem(ReferencedByEvent)\",\"name\":\"Name of event location\",\"country_code\":\"AT\"},\"event_ticket_data\":[{\"external_event_id\":\"ReferencesExternalEventID\",\"external_ticket_id\":\"ReferencesExternalTicketID\"}]},\"type\":\"Ticket\",\"process_info\":{\"payment_state\":\"paid\",\"send_type\":\"immediately\",\"to_user\":{\"email\":\"emailofrecipient@keyper.ws\"}},\"external_reference_id\":\"IDofOrderInYourSystem\"}]}"
headers = {
    'authorization': "AUTHTOKEN auth_token="ENTER YOUR API KEY FROM STEP 2"",
    'content-type': "application/json"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
require 'uri'
require 'net/http'

url = URI("https://sandbox.api.keyper.io/admin/containers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["authorization"] = 'AUTHTOKEN auth_token="ENTER YOUR API KEY FROM STEP 2"'
request["content-type"] = 'application/json'
request.body = "{\"containers\":[{\"ticket\":{\"tickets\":[{\"external_ticket_id\":\"IDofTicketInYourSystem(MustNotChange)\",\"barcode\":\"123456789\",\"price\":35.9,\"currency\":\"EUR\"}],\"event\":{\"external_event_id\":\"IDofEventInYourSystem\",\"name\":\"Name of the event\",\"start_date\":\"2022-10-23T11:15:00+02:00\",\"organizer_ref\":\"ReferencesExternalOrganizerID\",\"location_ref\":\"ReferencesExternalLocationID\"},\"organizer\":{\"external_event_organizer_id\":\"IDofEventOrganizerInYourSystem(ReferencedByEvent)\",\"name\":\"Name of the event organizer\",\"country_code\":\"AT\"},\"location\":{\"external_location_id\":\"IDofEventLocationInYourSystem(ReferencedByEvent)\",\"name\":\"Name of event location\",\"country_code\":\"AT\"},\"event_ticket_data\":[{\"external_event_id\":\"ReferencesExternalEventID\",\"external_ticket_id\":\"ReferencesExternalTicketID\"}]},\"type\":\"Ticket\",\"process_info\":{\"payment_state\":\"paid\",\"send_type\":\"immediately\",\"to_user\":{\"email\":\"emailofrecipient@keyper.ws\"}},\"external_reference_id\":\"IDofOrderInYourSystem\"}]}"

response = http.request(request)
puts response.read_body
curl --request POST \
  --url https://sandbox.api.keyper.io/admin/containers \
  --header 'authorization: AUTHTOKEN auth_token="ENTER YOUR API KEY FROM STEP 2"' \
  --header 'content-type: application/json' \
  --data '{"containers":[{"ticket":{"tickets":[{"external_ticket_id":"IDofTicketInYourSystem(MustNotChange)","barcode":"123456789","price":35.9,"currency":"EUR"}],"event":{"external_event_id":"IDofEventInYourSystem","name":"Name of the event","start_date":"2022-10-23T11:15:00+02:00","organizer_ref":"ReferencesExternalOrganizerID","location_ref":"ReferencesExternalLocationID"},"organizer":{"external_event_organizer_id":"IDofEventOrganizerInYourSystem(ReferencedByEvent)","name":"Name of the event organizer","country_code":"AT"},"location":{"external_location_id":"IDofEventLocationInYourSystem(ReferencedByEvent)","name":"Name of event location","country_code":"AT"},"event_ticket_data":[{"external_event_id":"ReferencesExternalEventID","external_ticket_id":"ReferencesExternalTicketID"}]},"type":"Ticket","process_info":{"payment_state":"paid","send_type":"immediately","to_user":{"email":"emailofrecipient@keyper.ws"}},"external_reference_id":"IDofOrderInYourSystem"}]}'
echo '{"containers":[{"ticket":{"tickets":[{"external_ticket_id":"IDofTicketInYourSystem(MustNotChange)","barcode":"123456789","price":35.9,"currency":"EUR"}],"event":{"external_event_id":"IDofEventInYourSystem","name":"Name of the event","start_date":"2022-10-23T11:15:00+02:00","organizer_ref":"ReferencesExternalOrganizerID","location_ref":"ReferencesExternalLocationID"},"organizer":{"external_event_organizer_id":"IDofEventOrganizerInYourSystem(ReferencedByEvent)","name":"Name of the event organizer","country_code":"AT"},"location":{"external_location_id":"IDofEventLocationInYourSystem(ReferencedByEvent)","name":"Name of event location","country_code":"AT"},"event_ticket_data":[{"external_event_id":"ReferencesExternalEventID","external_ticket_id":"ReferencesExternalTicketID"}]},"type":"Ticket","process_info":{"payment_state":"paid","send_type":"immediately","to_user":{"email":"emailofrecipient@keyper.ws"}},"external_reference_id":"IDofOrderInYourSystem"}]}' |  \
  http POST https://sandbox.api.keyper.io/admin/containers \
  authorization:'AUTHTOKEN auth_token="ENTER YOUR API KEY FROM STEP 2"' \
  content-type:application/json
wget --quiet \
  --method POST \
  --header 'authorization: AUTHTOKEN auth_token="ENTER YOUR API KEY FROM STEP 2"' \
  --header 'content-type: application/json' \
  --body-data '{"containers":[{"ticket":{"tickets":[{"external_ticket_id":"IDofTicketInYourSystem(MustNotChange)","barcode":"123456789","price":35.9,"currency":"EUR"}],"event":{"external_event_id":"IDofEventInYourSystem","name":"Name of the event","start_date":"2022-10-23T11:15:00+02:00","organizer_ref":"ReferencesExternalOrganizerID","location_ref":"ReferencesExternalLocationID"},"organizer":{"external_event_organizer_id":"IDofEventOrganizerInYourSystem(ReferencedByEvent)","name":"Name of the event organizer","country_code":"AT"},"location":{"external_location_id":"IDofEventLocationInYourSystem(ReferencedByEvent)","name":"Name of event location","country_code":"AT"},"event_ticket_data":[{"external_event_id":"ReferencesExternalEventID","external_ticket_id":"ReferencesExternalTicketID"}]},"type":"Ticket","process_info":{"payment_state":"paid","send_type":"immediately","to_user":{"email":"emailofrecipient@keyper.ws"}},"external_reference_id":"IDofOrderInYourSystem"}]}' \
  --output-document \
  - https://sandbox.api.keyper.io/admin/containers
import Foundation

let headers = [
  "authorization": "AUTHTOKEN auth_token=\"ENTER YOUR API KEY FROM STEP 2\"",
  "content-type": "application/json"
]
let parameters = ["containers": [
    [
      "ticket": [
        "tickets": [
          [
            "external_ticket_id": "IDofTicketInYourSystem(MustNotChange)",
            "barcode": "123456789",
            "price": 35.9,
            "currency": "EUR"
          ]
        ],
        "event": [
          "external_event_id": "IDofEventInYourSystem",
          "name": "Name of the event",
          "start_date": "2022-10-23T11:15:00+02:00",
          "organizer_ref": "ReferencesExternalOrganizerID",
          "location_ref": "ReferencesExternalLocationID"
        ],
        "organizer": [
          "external_event_organizer_id": "IDofEventOrganizerInYourSystem(ReferencedByEvent)",
          "name": "Name of the event organizer",
          "country_code": "AT"
        ],
        "location": [
          "external_location_id": "IDofEventLocationInYourSystem(ReferencedByEvent)",
          "name": "Name of event location",
          "country_code": "AT"
        ],
        "event_ticket_data": [
          [
            "external_event_id": "ReferencesExternalEventID",
            "external_ticket_id": "ReferencesExternalTicketID"
          ]
        ]
      ],
      "type": "Ticket",
      "process_info": [
        "payment_state": "paid",
        "send_type": "immediately",
        "to_user": ["email": "emailofrecipient@keyper.ws"]
      ],
      "external_reference_id": "IDofOrderInYourSystem"
    ]
  ]]

let postData = NSJSONSerialization.dataWithJSONObject(parameters, options: nil, error: nil)

var request = NSMutableURLRequest(URL: NSURL(string: "https://sandbox.api.keyper.io/admin/containers")!,
                                        cachePolicy: .UseProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.HTTPMethod = "POST"
request.allHTTPHeaderFields = headers
request.HTTPBody = postData

let session = NSURLSession.sharedSession()
let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    println(error)
  } else {
    let httpResponse = response as? NSHTTPURLResponse
    println(httpResponse)
  }
})

dataTask.resume()