🔓Authentication
Here we describe how to authenticate with our partners API.
Last updated
TOKEN=HTTP_VERB+URL+STRING_PAYLOAD+TIMESTAMPecho -ne $TOKEN | openssl dgst -sha256 -mac HMAC -macopt hexkey:$SHARED_KEY{
"errors": [
{
"code": "gift_card_not_found",
"message": "Gift card not found with code 'IKEA-FR'"
}
],
"status": "not_found"
}{
"errors": [
{
"code": "not_enough_funds",
"message": "Your balance account is not high enough"
}
],
"status": "unprocessable_entity"
}{
"errors": [
{
"code": "out_of_stock",
"message": "Out of stock gift card 'IKEA-FR'"
}
],
"status": "unprocessable_entity"
}{
"errors": [
{
"code": "invalid_amount",
"message": "Amount must be one of 15, 30 or 100."
}
],
"status": "unprocessable_entity"
}{
"errors": [
{
"code": "invalid_amount",
"message": "Amount must be within range from 20 to 500 with steps of 10."
}
],
"status": "unprocessable_entity"
}{
"errors": [
{
"code": "unauthorized",
"message": "Not authorized"
}
],
"status": "unauthorized"
}{
"errors": [
{
"code": "invalid_signature",
"message": "Your request does not match your signature"
}
],
"status": "unauthorized"
}{
"card": {
"id": "4fe88e46-eb22-436c-91ec-6bf874fcf2ae",
"code": "345454545451154154",
"expire_at": "2022-06-24T00:00:00.000+02:00",
"pin_code": "1234",
"amount": 50,
"gift_card_code": "IKEAFR",
"pdf_url": "https://url.pdf"
}
}#!/bin/bash
TOKEN='POST+http://www.example.com/partners/v1/cards+{"card":{"amount":50,"gift_card_code":"E-ca"}}+b5245bbc-8ee7-4e55-92e0-b97e81085154+1648559273'#!/bin/bash
echo -ne $TOKEN | openssl dgst -sha256 -mac HMAC -macopt hexkey:6F2CE47010CF4F79B9767042BAFB1EB4
# > 434f3dd367edbe5c82a68f5b5a771a50d602c2868e10a4b132ae807df6982867OpenSSL::HMAC.hexdigest("SHA256", [key.to_s].pack('H*'), token)hash_hmac("sha256", $token, pack("H*", $key))#!/bin/bash
curl -X POST http://www.example.com/partners/v1/cards
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization: Bearer rKc1oJFfEzf0HRbNzLjcvEKijkAFfSL5BYhI-Usidd5PARuHZaSRAL_2eSPOZrT-, Id=b5245bbc-8ee7-4e55-92e0-b97e81085154, Timestamp=1648559273'
-d '{ "card": { "gift_card_code": "IKEAFR", "amount": 50 } }'