docs

Shopa Callback API

This document describes the Shopa callback endpoint for creating orders and logging comments as history events.

Endpoint

POST /shopa/callback

Headers

Authentication

Two layers are required:

  1. API key/secret
    • The API key is sent in x-mofavo-api-key.
    • The signature is an HMAC SHA256 of the raw request body using the API secret, then base64-encoded.
    • Send the signature in x-mofavo-signature.
  2. JWT
    • Send the JWT in Authorization: Bearer <jwt>.
    • The token must include merchantId and senderId.

Signature Example (JavaScript)

import { createHmac } from "crypto";

const body = JSON.stringify({
  ref: "shopa-1732",
  name: "Tedst Test",
  phone: "+21690909090",
  comments: [
    {
      content: "First comment",
      time: "2026-01-06T11:19:13+01:00",
    },
  ],
});

const apiSecret = process.env.SHOPA_API_SECRET;
const signature = createHmac("sha256", apiSecret)
  .update(body, "utf8")
  .digest("base64");

console.log(signature);

Request Body

{
  "ref": "shopa-1732",
  "name": "Tedst Test",
  "phone": "+21690909090",
  "comments": [
    {
      "content": "First comment",
      "time": "2026-01-06T11:19:13+01:00"
    }
  ]
}

Fields

Responses

201 Created

{
  "id": 12345
}

401 Unauthorized

Returned when:

403 Forbidden

Returned when the API key is not recognized or is inactive.

500 Internal Server Error

Returned for unexpected errors.

Behavior Notes

Example Curl

curl -X POST "https://api.mofavo.com/shopa/callback" \
  -H "Content-Type: application/json" \
  -H "x-mofavo-api-key: $SHOPA_API_KEY" \
  -H "x-mofavo-signature: $SHOPA_SIGNATURE" \
  -H "Authorization: Bearer $SHOPA_JWT" \
  -d '{
    "ref": "shopa-1732",
    "name": "Tedst Test",
    "phone": "+21690909090",
    "comments": [
      {
        "content": "First comment",
        "time": "2026-01-06T11:19:13+01:00"
      }
    ]
  }'