Account

Create DCA Plan

POSThttps://openapi.longbridge.com/v1/dailycoins/create

Authorization

Signed mode: every request is signed with your App Key/Secret. Header set:

NameTypeRequiredDescription
Authorizationstring · headerRequiredThe account Access Token from the OpenAPI dashboard — passed as the raw token (no Bearer prefix) and included in the signature calculation.
X-Api-Keystring · headerRequiredYour App Key.
X-Timestampstring · headerRequiredRequest timestamp in seconds (Unix epoch).
X-Api-Signaturestring · headerRequiredHMAC-SHA256 signature. Format: HMAC-SHA256 SignedHeaders=authorization;x-api-key;x-timestamp, Signature=.

Longbridge HK / SG accounts only

This method is available to Longbridge HK / SG accounts only. It works with any supported symbol, including US stocks.

Create a new recurring investment plan for a security.

>_ CLI
longbridge dca create AAPL.US --amount 500 --frequency monthly --day-of-month 15
longbridge dca create TSLA.US --amount 200 --frequency weekly --day-of-week mon

Request

Request body

NameTypeRequiredDescription
symbolstringRequiredSecurity symbol, e.g. `AAPL.US`.
per_invest_amountstringRequiredRecurring investment amount per execution.
invest_frequencystringRequiredFrequency: `Daily`, `Weekly`, `Fortnightly`, `Monthly`.
allow_margin_financeintegerRequiredWhether to allow margin financing: `1` yes, `0` no.
invest_day_of_weekstringOptionalDay of week for weekly/fortnightly plans: `mon`–`fri`.
invest_day_of_monthstringOptionalDay of month for monthly plans: `1`–`28`.

Response

Response properties

NameTypeRequiredDescription
idstringRequiredID of the newly created plan

Response JSON example

{
  "code": 0,
  "message": "success",
  "data": {
    "id": "1225781523156889601"
  }
}

Error code

See the Error Codes page for the full list of error codes.