Experimental Create a subscription

Creates a subscription order in a billing portal.

SecurityHTTP: CustomerJWT
Request
Request Body schema: application/json

Create an order request.

billingPortalId
required
string <= 50 characters

ID of the billing portal.

required
Array of objects non-empty

Details of items in the order.

ContactObject (object) or null

Billing address details.

ContactObject (object) or null

Delivery address details.

post
/storefront/subscriptions
Request samples
application/json
{ "billingPortalId": "bill_prt_0YV7K5TYV5D1P9ZNKDT39KZC3C", "items": [ ], "billingAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "string", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "dob": "1980-04-01", "jobTitle": "CEO" }, "deliveryAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "string", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "dob": "1980-04-01", "jobTitle": "CEO" } }
Responses

201

Subscription created.

401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

404

Resource not found.

422

Invalid data sent.

Response samples
application/json
{ "id": "sub_01HRF27SATGE4Z6PBJE6PD8328", "orderType": "subscription-order", "billingStatus": "draft", "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "orderId": "ord_0YV7DES3WPC5J8JD8QTVNZBZNZ", "currency": "USD", "initialInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "recentInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "items": [ ], "deliveryAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "string", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "billingAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "string", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "activationTime": "2019-08-24T14:15:22Z", "voidTime": "2019-08-24T14:15:22Z", "abandonTime": "2019-08-24T14:15:22Z", "poNumber": "PO123456", "shipping": { "amount": 0.1, "calculator": "manual" }, "notes": "string", "status": "pending", "inTrial": true, "trial": { "enabled": true, "isTrialOnly": false, "invoiceTimeShift": null, "recurringInterval": null, "autopay": true, "startTime": null, "endTime": "2019-08-24T14:15:22Z" }, "isTrialOnly": false, "invoiceTimeShift": null, "recurringInterval": null, "autopay": true, "startTime": null, "churnTime": "2019-08-24T14:15:22Z", "renewalTime": "2019-08-24T14:15:22Z", "rebillNumber": 0, "lineItems": [ ], "lineItemSubtotal": { "currency": "USD", "amount": 49.95 }, "paymentInstrumentId": "inst_0YVB8KPKNXCBR9EDX7JHSED75N", "canceledTime": "2019-08-24T14:15:22Z", "canceledBy": "merchant", "cancelCategory": "billing-failure", "cancelDescription": "string", "billingPortalId": "bill_prt_0YV7K5TYV5D1P9ZNKDT39KZC3C", "customFields": { "foo": "bar" }, "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ ], "_embedded": { "changeItemsQuote": { }, "changeItemsInvoice": { } } }