Skip to Content
CpaPrograms

Add a Condition to a CPA Payment Plan

POST
/cpa-programs/{cpaProgram}/plans/{plan}/conditions

Authorization

appToken write
AuthorizationBearer <token>

App access token issued by POST /tokens (client credentials). Full-access Apps hold the read and write scopes, read-only Apps hold read only. Send it as Authorization: Bearer <token>.

In: header

Scope: write

Path Parameters

cpaProgram*string
Formatuuid
plan*string
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

A plan can hold only one condition of each type; a duplicate type returns 400.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/cpa-programs/497f6eca-6276-4993-bfeb-53cbbbba6f08/plans/497f6eca-6276-4993-bfeb-53cbbbba6f08/conditions" \  -H "Content-Type: application/json" \  -d '{    "conditionType": "registration"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "cpaPaymentPlanId": "e9e4e625-09e7-44a1-b02e-364195c7dbe3",  "conditionType": "registration",  "parameters": {    "amount": 1,    "level_index": 0,    "tiers": [      {        "threshold": 1,        "reward": 1      }    ],    "reward_type": "fixed",    "min_successful_trades": 1,    "exclude_hedged": true,    "min_position_lifetime_sec": 0,    "min_notional_usd": 1,    "lots_per_group": [      {        "group": "string",        "min_lots": 1      }    ]  }}