Skip to content

MUSAFFA B2B Demo API (1.0.0)

Musaffa’s API is one of the most comprehensive Shariah-Compliant Stock Screener organized around REST. Our API has predictable resource-oriented URLs, accepts JSON request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

All Demo API requests are made to endpoints beginning: https://b2b.musaffa.us/b2b/api/demo.

This specification is generated from the MUSAFFA B2B Demo APIs Postman collection and the B2B UAT environment. Try it prefills clientId, time, and token from that environment. time and token are bound to the sample request body of each endpoint.

Authentication

Musaffa provides a secret key and a client ID to every B2B client.

secretKey = <B2B UAT clientSecretKey>
clientId  = AX6kFk5ywERyXobt
TimeZone  = UTC
DateTimeFormatter = yyyyMMddHHmmss

Token generation (must match the JSON body you send):

time  = current UTC time formatted as yyyyMMddHHmmss
token = Base64(SHA512(secretKey + time + jsonBody))

For GET requests with a path {symbol}, the token body is the symbol string instead of a JSON body. For GET requests with no body, the token is SHA512(secretKey + time).

Redocly must treat clientId, time, and token as header parameters, not as a security scheme. A security scheme named MusaffaAuth makes Redocly emit -H 'token: {$inputs.MusaffaAuth}' and drop clientId/time, which the API rejects.

Use the cURL sample on each operation (all three headers + matching body).

B2B UAT environment

VariableValue used in Try it
hosthttps://b2b.musaffa.us/b2b/api/
clientIdAX6kFk5ywERyXobt
timegenerated at spec build (UTC yyyyMMddHHmmss)
tokengenerated at spec build for each endpoint body
symbolAAPL

clientSecretKey is used only to compute token and is never sent.

Rate Limits

Depending on the B2B subscription plan, usage can be up to 100 000 API calls per month and 1 API call per second. If your limit is exceeded you receive HTTP 429.

By using Musaffa’s API, you agree to our Terms of Use.

Download OpenAPI description
Languages
Servers
Mock server
https://docs.musaffa.us/_mock/apis
https://b2b.musaffa.us/b2b/api