NNarya Developers
API referenceTrading enrollments

Enroll a trading in a product

POST
/integration/v1/trading-enrollments

Enrolls a trading in a product through an acquirer.

If the same trading, product, vendor and acquirer are already enrolled, the existing enrollment is returned with 200. A different acquirer adds a second enrollment beside the first.

Authorization

integrationKey
headerAuthorizationBearer <token>

Your integration key, sent as Authorization: Bearer nik_<prefix>_<secret>. Narya issues it.

Header Parameters

Idempotency-Key?string

A unique value per logical request, such as a UUID. Within 24 hours a repeat with the same key, path and body returns the first response; the same key with a different path or body is a 409.

Length1 <= length <= 255

Request Body

application/json
  1. body

Name the trading by trading_id or trading_external_ref, and the acquirer by acquirer_id or acquirer_external_ref: one of each is required, and sending both of a pair is a 400 with invalid_params[].code exclusive.

trading_id?string
Formatuuid
trading_external_ref?ExternalRef

Your own reference for a record: any format, compared exactly and case-sensitively. Leading or trailing whitespace is refused rather than trimmed, so a stored reference always matches what was sent.

Match^\S(.*\S)?$
Length1 <= length <= 128
product_code*string
Match^[a-z][a-z0-9_]{0,63}$
vendor_id?string

Required only when the product has more than one vendor.

Formatuuid
acquirer_id?string
Formatuuid
acquirer_external_ref?ExternalRef

Your own reference for a record: any format, compared exactly and case-sensitively. Leading or trailing whitespace is refused rather than trimmed, so a stored reference always matches what was sent.

Match^\S(.*\S)?$
Length1 <= length <= 128

Response Body

The same enrollment already exists; it is returned

application/json
  1. response
id*string
Formatuuid
trading_id*string
Formatuuid
product*
vendor*
acquirer?|null
status*string
Value in"active""ended"
activated_at?|
Formatdate-time
ended_at?|
Formatdate-time
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X POST 'https://api-narya-staging.pmadvisors.my/integration/v1/trading-enrollments' \  -H 'Content-Type: application/json' \  -d '{  "product_code": "string"}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "trading_id": "1697ee0a-d655-4892-9ce3-9e2a05ec9dc1",  "product": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "code": "string",    "name": "string"  },  "vendor": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string"  },  "acquirer": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "external_ref": "ACQ-MBB"  },  "status": "active",  "activated_at": "2019-08-24T14:15:22Z",  "ended_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}