Skip to content

Create subscription

Request

Creates a new subscription with specified configuration

Security
oauth2ClientCredentials(Required scopes: subscriptions:write)
Headers
org_wallet_refstring

Organization wallet reference, defaults to "1" if not provided

business_idstringrequired

Business identifier for the request

Bodyapplication/jsonrequired
namestringrequired

Merchant/subscription name

Example:"DIGITALOCEAN.COM"
limitobjectrequired

Spending limit

Example:"10"
cardsArray of stringsrequired

Array of card IDs

Example:
[ "683ee0b950009c749ba23312" ]
assigneestringrequired

Employee ID to assign the subscription to

Example:"67befe9f17f57a814696e291"
statusstringrequired

Subscription status

Example:"DRAFT"
frequency_period_unitstringrequired

Frequency period unit (MONTH, YEAR, etc.)

Example:"MONTH"
wallet_namestringrequired

Wallet display name

Example:"xyz - MAIN"
wallet_currencystringrequired

Wallet currency code

Example:"KES"
wallet_idstringrequired

Wallet identifier

Example:"1271"
web_urlstring

Merchant website URL

Example:"https://www.digitalocean.com"
create_new_merchantboolean

Flag to create new merchant

Example:false
teamobject(CreateSubscriptionTeamDto)required

Team assignment

subcategoryobject(CreateSubscriptionSubcategoryDto)required

Expense category

is_requestboolean

Flag indicating if this is a request

Example:false
org_wallet_refnumberrequired

Organization wallet reference

Example:1
business_idstringrequired

Organization business ID

Example:"E74490ACDCAF716DC722"
notesstring

Additional notes

Example:"Brian Ryb is requesting creation of a DIGITALOCEAN.COM subscription"
curl -i -X POST \
  https://developer.boyahq.com/_mock/v2/openapi/subscriptions/create \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'business_id: string' \
  -H 'org_wallet_ref: string' \
  -d '{
    "name": "DIGITALOCEAN.COM",
    "limit": "10",
    "cards": [
      "683ee0b950009c749ba23312"
    ],
    "assignee": "67befe9f17f57a814696e291",
    "status": "DRAFT",
    "frequency_period_unit": "MONTH",
    "wallet_name": "xyz - MAIN",
    "wallet_currency": "KES",
    "wallet_id": "1271",
    "web_url": "https://www.digitalocean.com",
    "create_new_merchant": false,
    "team": {
      "_id": "688877881b49af84b1aa11d9",
      "code": "74CAAEEA",
      "name": "AAR Bamburi"
    },
    "subcategory": {
      "_id": "64f04ea40aac0abfb44b3bb7",
      "code": "P003",
      "name": "General Materials"
    },
    "is_request": false,
    "org_wallet_ref": 1,
    "business_id": "E74490ACDCAF716DC722",
    "notes": "Brian Ryb is requesting creation of a DIGITALOCEAN.COM subscription"
  }'

Responses

Subscription created successfully

Bodyapplication/json
_idstring

Subscription ID

businessobject(SubscriptionBusinessDto)

Business information

namestring

Subscription name

limitnumber

Subscription limit

cardsArray of objects(SubscriptionCardDto)

Associated cards

assigneeobject(SubscriptionAssigneeDto)

Subscription assignee

statusstring

Subscription status

Enum:"DRAFT""ACTIVE""PAUSED""REJECTED""DELETED""PENDING"
Example:"ACTIVE"
wallet_idstring

Wallet ID

wallet_currencystring

Wallet currency

frequency_period_unitstring

Frequency period unit

frequencynumber

Frequency

iconstring

Subscription icon URL

merchant_category_codestring

Merchant category code

merchant_receiver_namestring

Merchant receiver name

amount_spentnumber

Amount spent

last_transacted_amountnumber

Last transacted amount

scorenumber

Score

next_invoice_datestring

Next invoice date

createdAtstring

Created date

updatedAtstring

Updated date

subcategoryobject(SubscriptionSubcategoryDto)

Subcategory information

teamobject(SubscriptionTeamDto)

Subcategory information

Response
{ "_id": "string", "business": { "_id": "string", "name": "string", "email": "string", "phone": "string", "country": "string" }, "name": "string", "limit": 0, "cards": [ {} ], "assignee": { "_id": "string", "name": "string", "employee_id": "string", "team_code": "string" }, "status": "ACTIVE", "wallet_id": "string", "wallet_currency": "string", "frequency_period_unit": "string", "frequency": 0, "icon": "string", "merchant_category_code": "string", "merchant_receiver_name": "string", "amount_spent": 0, "last_transacted_amount": 0, "score": 0, "next_invoice_date": "string", "createdAt": "string", "updatedAt": "string", "subcategory": { "_id": "string", "code": "string", "name": "string" }, "team": { "code": "string", "name": "string" } }