mayarin
POST
/v1/subscriptions

Puts a customer on a recurring plan. Send-to-pay: every cycle Mayarin issues the subscriber an invoice and emails its pay link; they pay it on any rail. Payments on a cycle carry metadata.subscriptionId into the payment.* webhooks. The merchant's customer with the given email is reused, or created. Needs catalog:manage.

Authorization

secretKey
AuthorizationBearer <token>

Server-side sk_ key. Grants a subset of the merchant's permissions.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/subscriptions" \  -H "Content-Type: application/json" \  -d '{    "customer": {      "name": "string",      "email": "[email protected]"    },    "description": "string",    "amount": {      "amount": "string",      "asset": "IDR"    },    "interval": "week"  }'
{  "id": "string",  "subscriber": {    "customerId": "string",    "name": "string",    "email": "string"  },  "description": "string",  "amount": {    "amount": "string",    "asset": "string",    "formatted": "string",    "display": "string"  },  "interval": "week",  "state": "active",  "billedCycles": 0,  "daysUntilDue": 0,  "anchorAt": "string",  "nextBillingAt": "string",  "createdAt": "string",  "cancelledAt": "string"}