Agencies

Create a subscription for a client

A subscription on your agency's own payment account, with the client project in the metadata: the payer pays the first period through checkout_url, which also sets up the mandate; after that the payment provider charges every month or year. Not every payment account supports this yet; a 409 says so. Events: client_subscription.active, client_subscription.payment_paid, client_subscription.payment_failed and client_subscription.canceled.

post/clients/{id}/subscriptions

Request

  • Base URL: https://api.hypamoon.com/api/v1
  • URL: https://api.hypamoon.com/api/v1/clients/{id}/subscriptions
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://app.hypamoon.com/oauth/authorize, token URL https://api.hypamoon.com/oauth/token, scopes: clients:write)

Path parameters

idstring uuid required

The id of the client project.

Request body

amount_centsinteger required
currencystring
descriptionstring required
redirect_urlstring uri required
idempotency_keystring
interval'month' | 'year' required
emailstring email required
namestring

Response

The subscription made earlier with this idempotency_key.

object'client_payment_link' | 'client_subscription' required
idstring uuid required
client_project_idstring uuid required
status'open' | 'paid' | 'failed' | 'expired' | 'active' | 'canceled' required
amount_centsinteger required
fee_centsinteger required
currencystring required
descriptionstring required
interval'month' | 'year' | 'null' nullable
paid_untilstring nullable
canceled_atstring nullable
testboolean required
checkout_urlstring nullable required
paid_atstring nullable required
created_atstring required

Changes

No recorded changes to this operation across all 1 revision of this API.