Owostack

Subscribe a customer to a plan

Creates or switches a subscription for a customer. Handles free plans, upgrades, downgrades, and trial flows. Returns a checkout URL if payment is required.

POST
/v1/attach

Authorization

bearerAuth

Request Body

application/json

customer*string
product*string
currency?string
Length3 <= length
channels?array<>
metadata?
callbackUrl?string
Formaturi

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.owostack.com/v1/attach" \  -H "Content-Type: application/json" \  -d '{    "customer": "string",    "product": "string"  }'
{
  "success": true,
  "requiresCheckout": true,
  "checkoutUrl": "http://example.com",
  "trial": true,
  "trial_days": 0,
  "trial_ends_at": "2019-08-24T14:15:22Z",
  "type": "new",
  "message": "string",
  "subscriptionId": "string",
  "subscription_id": "string",
  "customer_id": "string",
  "reference": "string",
  "accessCode": "string",
  "property1": null,
  "property2": null
}
{
  "success": true,
  "error": "string",
  "code": "string",
  "message": "string",
  "property1": null,
  "property2": null
}
{
  "success": true,
  "error": "string",
  "code": "string",
  "message": "string",
  "property1": null,
  "property2": null
}
{
  "success": true,
  "error": "string",
  "code": "string",
  "message": "string",
  "property1": null,
  "property2": null
}
{
  "success": true,
  "error": "string",
  "code": "string",
  "message": "string",
  "property1": null,
  "property2": null
}
{
  "success": true,
  "error": "string",
  "code": "string",
  "message": "string",
  "property1": null,
  "property2": null
}

AI Chat

Owostack docs assistant

Start a new chat below.