Create embed session
api reference this is the single endpoint a partner backend calls to mint the short lived, opaque embed session that the cardholder's browser then loads as a p1 hosted iframe it carries no card data { "name" "endpoint /cardmanagement/v1/cards/{id}/embed session", "method" "post", "url" "https //sandbox crbcos com/cardmanagement/v1/cards/{id}/embed session", "description" "", "tab" "examples", "examples" { "languages" \[ { "id" "hiyb6hxbzbif03ihcjxah", "language" "curl", "code" "curl x post \\\\\n \\"https //sandbox crbcos com/cardmanagement/v1/cards/{id}/embed session\\" \\\\\n h \\"authorization bearer \<jwt>\\" \\\\\n h \\"content type application/json\\" \\\\\n d '{ \\"targetorigin\\" \\"https //app acmepay io\\" }'", "customlabel" "" }, { "id" "gc3m0kxiijs1zddieg bg", "language" "nodejs", "code" "var request = require('request');\nvar options = {\n 'method' 'post',\n 'url' 'https //sandbox crbcos com/cardmanagement/v1/cards/\[insert value here]/embed session',\n 'headers' {\n 'content type' 'application/json',\n 'authorization' 'bearer eyjhbgcioijsuzi1niisimtpzci6ikyyrmi1y1jqdmzyce5knwttc25pnmtswwhibyising1dci6ikyyrmi1y1jqdmzyce5knwttc25pnmtswwhibyisinr5cci6ikpxvcj9 eyjpc3mioijodhrwczovl2lkchrlc3quy3jiy29zlmnvbsisim5izii6mtc4odcwmdi4miwiawf0ijoxnzg4nzawmjgylcjlehaioje3odg3mdm4odisimf1zci6wyjodhrwczovl2fwas5jcmjjb3muy29tlyisimh0dhbzoi8vawrwdgvzdc5jcmjjb3muy29tl3jlc291cmnlcyjdlcjzy29wzsi6wyjjb3nzyngilcjodhrwczovl2fwas5jcmjjb3muy29tlyjdlcjjbgllbnrfawqioijhmdaxodzlnzfkn2i0ytu0owzmntc0zmjlm2zhndg5ziisimp0asi6ijffmuffrdvdqjm5q0e2mjy5ota5q0yznze4nunfndfein0 snxolbjh7y8c6zczl fepeoobysqmnjpd31fortvg7g6xsp31dxrgjlwafjhlnxvwcmomxdoyuq sfvxzzc15wgnd3njnq20uugvwri1xyqsxlvcvwwo2wznj0rngxmukpx0macwy5ojc hlr gqkmwxafyax9njijjg cechjoqtefsqowee0vfhdbfzdd9vpbf8yg6sonwziweld6fywngod1j7 qjyx7 udz25tcjbtdcyyb8chxif5q9cbolkctd38puhnammccxukbwstdxl7khid97j z8gecgvoq tj5yy1p6ylhfmbbmtrrpwki12hwygy9gkmxj68yyg'\n },\n body 'curl x post \\"https //sandbox crbcos com/cardmanagement/v1/cards/{cardid}/embed session\\" \\\\\\\\\\\r\\\n h \\"authorization bearer \<jwt>\\" \\\\\\\\\\\r\\\n h \\"content type application/json\\" \\\\\\\\\\\r\\\n d \\\\'{\\\r\\\n \\"targetorigin\\" \\"\[insert target origin here]\\"\\\r\\\n }\\\\''\n\n};\nrequest(options, function (error, response) {\n if (error) throw new error(error);\n console log(response body);\n});\n" }, { "id" "8x5ho88iuduaxfgw62yux", "language" "python", "code" "import requests\nimport json\n\nurl = \\"https //sandbox crbcos com/cardmanagement/v1/cards/\[insert value here]/embed session\\"\n\npayload = \\"curl x post \\\\\\"https //sandbox crbcos com/cardmanagement/v1/cards/{cardid}/embed session\\\\\\" \\\\\\\\\\\r\\\n h \\\\\\"authorization bearer \<jwt>\\\\\\" \\\\\\\\\\\r\\\n h \\\\\\"content type application/json\\\\\\" \\\\\\\\\\\r\\\n d '{\\\r\\\n \\\\\\"targetorigin\\\\\\" \\\\\\"\[insert target origin here]\\\\\\"\\\r\\\n }'\\"\nheaders = {\n 'content type' 'application/json',\n 'authorization' 'bearer eyjhbgcioijsuzi1niisimtpzci6ikyyrmi1y1jqdmzyce5knwttc25pnmtswwhibyising1dci6ikyyrmi1y1jqdmzyce5knwttc25pnmtswwhibyisinr5cci6ikpxvcj9 eyjpc3mioijodhrwczovl2lkchrlc3quy3jiy29zlmnvbsisim5izii6mtc4odcwmdi4miwiawf0ijoxnzg4nzawmjgylcjlehaioje3odg3mdm4odisimf1zci6wyjodhrwczovl2fwas5jcmjjb3muy29tlyisimh0dhbzoi8vawrwdgvzdc5jcmjjb3muy29tl3jlc291cmnlcyjdlcjzy29wzsi6wyjjb3nzyngilcjodhrwczovl2fwas5jcmjjb3muy29tlyjdlcjjbgllbnrfawqioijhmdaxodzlnzfkn2i0ytu0owzmntc0zmjlm2zhndg5ziisimp0asi6ijffmuffrdvdqjm5q0e2mjy5ota5q0yznze4nunfndfein0 snxolbjh7y8c6zczl fepeoobysqmnjpd31fortvg7g6xsp31dxrgjlwafjhlnxvwcmomxdoyuq sfvxzzc15wgnd3njnq20uugvwri1xyqsxlvcvwwo2wznj0rngxmukpx0macwy5ojc hlr gqkmwxafyax9njijjg cechjoqtefsqowee0vfhdbfzdd9vpbf8yg6sonwziweld6fywngod1j7 qjyx7 udz25tcjbtdcyyb8chxif5q9cbolkctd38puhnammccxukbwstdxl7khid97j z8gecgvoq tj5yy1p6ylhfmbbmtrrpwki12hwygy9gkmxj68yyg'\n}\n\nresponse = requests request(\\"post\\", url, headers=headers, data=payload)\n\nprint(response text)\n" }, { "id" "04ng7ok8nmcgs35cad es", "language" "ruby", "code" "require \\"uri\\"\nrequire \\"json\\"\nrequire \\"net/http\"\n\nurl = uri(\\"https //sandbox crbcos com/cardmanagement/v1/cards/\[insert value here]/embed session\\")\n\nhttps = net http new(url host, url port)\nhttps use ssl = true\n\nrequest = net http post new(url)\nrequest\[\\"content type\\"] = \\"application/json\\"\nrequest\[\\"authorization\\"] = \\"bearer eyjhbgcioijsuzi1niisimtpzci6ikyyrmi1y1jqdmzyce5knwttc25pnmtswwhibyising1dci6ikyyrmi1y1jqdmzyce5knwttc25pnmtswwhibyisinr5cci6ikpxvcj9 eyjpc3mioijodhrwczovl2lkchrlc3quy3jiy29zlmnvbsisim5izii6mtc4odcwmdi4miwiawf0ijoxnzg4nzawmjgylcjlehaioje3odg3mdm4odisimf1zci6wyjodhrwczovl2fwas5jcmjjb3muy29tlyisimh0dhbzoi8vawrwdgvzdc5jcmjjb3muy29tl3jlc291cmnlcyjdlcjzy29wzsi6wyjjb3nzyngilcjodhrwczovl2fwas5jcmjjb3muy29tlyjdlcjjbgllbnrfawqioijhmdaxodzlnzfkn2i0ytu0owzmntc0zmjlm2zhndg5ziisimp0asi6ijffmuffrdvdqjm5q0e2mjy5ota5q0yznze4nunfndfein0 snxolbjh7y8c6zczl fepeoobysqmnjpd31fortvg7g6xsp31dxrgjlwafjhlnxvwcmomxdoyuq sfvxzzc15wgnd3njnq20uugvwri1xyqsxlvcvwwo2wznj0rngxmukpx0macwy5ojc hlr gqkmwxafyax9njijjg cechjoqtefsqowee0vfhdbfzdd9vpbf8yg6sonwziweld6fywngod1j7 qjyx7 udz25tcjbtdcyyb8chxif5q9cbolkctd38puhnammccxukbwstdxl7khid97j z8gecgvoq tj5yy1p6ylhfmbbmtrrpwki12hwygy9gkmxj68yyg\\"\nrequest body = \\"curl x post \\\\\\"https //sandbox crbcos com/cardmanagement/v1/cards/{cardid}/embed session\\\\\\" \\\\\\\\\\\r\\\n h \\\\\\"authorization bearer \<jwt>\\\\\\" \\\\\\\\\\\r\\\n h \\\\\\"content type application/json\\\\\\" \\\\\\\\\\\r\\\n d '{\\\r\\\n \\\\\\"targetorigin\\\\\\" \\\\\\"\[insert target origin here]\\\\\\"\\\r\\\n }'\\"\n\nresponse = https request(request)\nputs response read body\n" }, { "id" "tglm784c5f1rhbkpwvx9j", "language" "go", "code" "package main\n\nimport (\n \\"fmt\\"\n \\"strings\\"\n \\"net/http\"\n \\"io\\"\n)\n\nfunc main() {\n\n url = \\"https //sandbox crbcos com/cardmanagement/v1/cards/\[insert value here]/embed session\\"\n method = \\"post\\"\n\n payload = strings newreader(`curl x post \\"https //sandbox crbcos com/cardmanagement/v1/cards/{cardid}/embed session\\" \\\\`+\\"\n\\"+`\n h \\"authorization bearer \<jwt>\\" \\\\`+\\"\n\\"+`\n h \\"content type application/json\\" \\\\`+\\"\n\\"+`\n d '{`+\\"\n\\"+`\n \\"targetorigin\\" \\"\[insert target origin here]\\"`+\\"\n\\"+`\n }'`)\n\n client = \&http client {\n }\n req, err = http newrequest(method, url, payload)\n\n if err != nil {\n fmt println(err)\n return\n }\n req header add(\\"content type\\", \\"application/json\\")\n req header add(\\"authorization\\", \\"bearer eyjhbgcioijsuzi1niisimtpzci6ikyyrmi1y1jqdmzyce5knwttc25pnmtswwhibyising1dci6ikyyrmi1y1jqdmzyce5knwttc25pnmtswwhibyisinr5cci6ikpxvcj9 eyjpc3mioijodhrwczovl2lkchrlc3quy3jiy29zlmnvbsisim5izii6mtc4odcwmdi4miwiawf0ijoxnzg4nzawmjgylcjlehaioje3odg3mdm4odisimf1zci6wyjodhrwczovl2fwas5jcmjjb3muy29tlyisimh0dhbzoi8vawrwdgvzdc5jcmjjb3muy29tl3jlc291cmnlcyjdlcjzy29wzsi6wyjjb3nzyngilcjodhrwczovl2fwas5jcmjjb3muy29tlyjdlcjjbgllbnrfawqioijhmdaxodzlnzfkn2i0ytu0owzmntc0zmjlm2zhndg5ziisimp0asi6ijffmuffrdvdqjm5q0e2mjy5ota5q0yznze4nunfndfein0 snxolbjh7y8c6zczl fepeoobysqmnjpd31fortvg7g6xsp31dxrgjlwafjhlnxvwcmomxdoyuq sfvxzzc15wgnd3njnq20uugvwri1xyqsxlvcvwwo2wznj0rngxmukpx0macwy5ojc hlr gqkmwxafyax9njijjg cechjoqtefsqowee0vfhdbfzdd9vpbf8yg6sonwziweld6fywngod1j7 qjyx7 udz25tcjbtdcyyb8chxif5q9cbolkctd38puhnammccxukbwstdxl7khid97j z8gecgvoq tj5yy1p6ylhfmbbmtrrpwki12hwygy9gkmxj68yyg\\")\n\n res, err = client do(req)\n if err != nil {\n fmt println(err)\n return\n }\n defer res body close()\n\n body, err = io readall(res body)\n if err != nil {\n fmt println(err)\n return\n }\n fmt println(string(body))\n}" } ], "selectedlanguageid" "hiyb6hxbzbif03ihcjxah" }, "results" { "languages" \[ { "id" "kcrcuayhepl8dhvegmp34", "language" "200", "code" "{\n \\"token\\" \\"string\\",\n \\"embedurl\\" \\"https //api hubucsandbox aws crbcloud com/v2/embed?token=string\\"\n}", "customlabel" "" }, { "id" "8 j2 bemsk6v7akg5z7uv", "language" "400", "code" "{\n \\"errors\\" \[\n { \\"code\\" 2028, \\"message\\" \\" \\" }\n ]\n}" } ], "selectedlanguageid" "kcrcuayhepl8dhvegmp34" }, "request" { "pathparameters" \[ { "name" "id", "kind" "required", "type" "string", "description" "guid format card id in the cross river system, which is the id attribute value of the response to create a card this is not the number that appears on the card " } ], "queryparameters" \[], "headerparameters" \[], "bodydataparameters" \[ { "name" "targetorigin", "kind" "required", "type" "string", "description" "the exact web origin allowed to frame the returned embedurl (scheme + host, e g https //app acmepay io) p1 binds this value into the session and returns it as the content security policy frame ancestors of the iframe document, so the browser only renders the card/keypad when framed by this origin " } ], "formdataparameters" \[] }, "currentnewparameter" { "label" "body parameter", "value" "bodydataparameters" }, "response" \[ { "name" "token", "kind" "optional", "type" "string", "description" "short lived, opaque, single use embed session token contains no card data " }, { "name" "embedurl", "kind" "optional", "type" "string", "description" "the p1 hosted url to load in the iframe (src) the token is already embedded as a query parameter ", "children" \[] } ], "hastryitout" false, "autogeneratedanchorslug" "endpoint cardmanagementv1cardsidembed session", "legacyhash" "x sphgtvjw6sa3mdft10" }