Step 3/3: Create subscription
A subscription is created with an API call where the customer handle and payment method reference from the previous step is used.
curl -X POST \ -u 'priv_12051dfac75143fc827cf63a87f46df3:' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "handle": "s-101", "plan": "gold", "signup_method": "source", "customer": "c-1", "source": "<payment method>" }' \ https://api.reepay.com/v1/subscription
For full details on the create subscription operation, see: Create subscription.
A subscription exists now for the customer. The handle for the subscription is the reference for the subscription that can be stored in your system.
Note
We recommend using a supplied handle, but it is also possible to use the argument generate_handle=true instead of handle to let Billwerk+ Payments generate a handle.