Authentication

Signature headers
HeaderValue
KeyIdThe key’s privateKey. Its presence is what switches the route from session auth to signature checking.
TimestampThe current Unix time in milliseconds, as a string.
AlgorithmOne of sha1, sha256, sha384 or sha512.
X-SignatureThe HMAC hex digest.
# PRIVATE_KEY and SECRET_KEY hold the key’s privateKey and secretKey.
URL='/api/invoices'
BODY='{"type":"PAYME","amount":"150"}'
TIMESTAMP="$(($(date +%s) * 1000))"


SIGNATURE="$(printf '%s' "$TIMESTAMP$URL$BODY" \
  | openssl dgst -sha256 -hmac "$SECRET_KEY" -r \
  | cut -d ' ' -f 1)"


curl -X POST "https://dev-app.tedr.com$URL" \
  -H 'Content-Type: application/json' \
  -H "KeyId: $PRIVATE_KEY" \
  -H "Timestamp: $TIMESTAMP" \
  -H 'Algorithm: sha256' \
  -H "X-Signature: $SIGNATURE" \
  -d "$BODY"
Routes that accept an API key signature
RouteMethods
/invoicesGET, POST
/invoices/:idGET, DELETE
/invoices/:id/paymentsGET
/invoices/:id/cancelPOST
/invoices/:id/reactivatePOST
/merchants/meGET, PATCH
/transactionsGET