Create a manual subscription
Create a manual subscription
Overview
Create a manual subscription, like importing from another platform. You cannot create a recurring subscription with this endpoint, or save payment information. Creates the subscriber (or matches an existing one by email), and full subscription record, including copies. Requires a read-write API key.
Request parameters
No parameters.
Request body
sourcestringRequiredSource ID from GET /v1/sources/. Must be an active connected shop or import source (not Subsail checkout).
start_issuenumberRequiredThe issue number of the first issue in this subscription.
lengthnumberRequiredNumber of issues in this subscription.
emailstringSubscriber email. If omitted, a placeholder address is created. Matching an existing email attaches this subscription to that subscriber.
first_namestringlast_namestringcompanystringCompany name. Required if first_name is omitted.
address1stringFirst line of the shipping address.
address2stringSecond line of the shipping address.
citystringCity of the shipping address.
statestringState of the shipping address.
postcodestringPostcode of the shipping address.
countrystringRequiredISO country code of the shipping address (e.g. 'GB', 'US').
phonestringPhone number with country code, e.g. +44 7700 900123.
notesstringorder_idstringRequiredUnique order ID from the original platform. If the order was not from a shop, any unique value is fine.
order_datedateRequiredOrder date in YYYY-MM-DD format.
transaction_idstringOptional payment-system transaction ID.
pricestringRequiredAmount paid. Use 0 for complimentary subscriptions.
currencystringISO currency code. Defaults to the account selling currency.
is_recurringbooleanTrue if this imported subscription has a recurring payment.
is_compbooleanTrue if this is a complimentary subscription.
mediumPrint | Digital | Print + digitalpromo_codestringOptional promo code applied to this order.
discount_amountstringDiscount amount applied to this order.
send_welcome_emailbooleanSend the account's default welcome email to the subscriber after creation.
Example
{
"source": "<string>",
"start_issue": "<number>",
"length": "<number>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"state": "<string>",
"postcode": "<string>",
"country": "<string>",
"phone": "<string>",
"notes": "<string>",
"order_id": "<string>",
"order_date": "<date>",
"transaction_id": "<string>",
"price": "<string>",
"currency": "<string>",
"is_recurring": "<boolean>",
"is_comp": "<boolean>",
"medium": "<Print | Digital | Print + digital>",
"promo_code": "<string>",
"discount_amount": "<string>",
"send_welcome_email": "<boolean>"
}Request examples
curl -X POST https://api.subsail.com/v1/subscriptions/ \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"source": "<string>",
"start_issue": "<number>",
"length": "<number>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"state": "<string>",
"postcode": "<string>",
"country": "<string>",
"phone": "<string>",
"notes": "<string>",
"order_id": "<string>",
"order_date": "<date>",
"transaction_id": "<string>",
"price": "<string>",
"currency": "<string>",
"is_recurring": "<boolean>",
"is_comp": "<boolean>",
"medium": "<Print | Digital | Print + digital>",
"promo_code": "<string>",
"discount_amount": "<string>",
"send_welcome_email": "<boolean>"
}'const response = await fetch('https://api.subsail.com/v1/subscriptions/', {
method: 'POST',
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"source": "<string>",
"start_issue": "<number>",
"length": "<number>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"state": "<string>",
"postcode": "<string>",
"country": "<string>",
"phone": "<string>",
"notes": "<string>",
"order_id": "<string>",
"order_date": "<date>",
"transaction_id": "<string>",
"price": "<string>",
"currency": "<string>",
"is_recurring": "<boolean>",
"is_comp": "<boolean>",
"medium": "<Print | Digital | Print + digital>",
"promo_code": "<string>",
"discount_amount": "<string>",
"send_welcome_email": "<boolean>"
}),
});
const data = await response.json();Responses
idstringSubscription ID.
statusSubscriptionStatusvalues
- Active
- Active - Renewals stopped
- Complete
- Cancelled
- Past due
mediumPrint | Digital | Print + digitalfirst_namestringlast_namestringshipping_addressShippingAddressObject (ShippingAddress):
companystringaddress1stringaddress2stringcitystringstatestringpostcodestringcountrystringcountry_namestringphonestringlengthnumberHow many issues have been purchased during the subscription.
notesstringOptional internalnotes about the subscription.
is_recurringbooleanis_compbooleanTrue if the subscription is a complimentary subscription (no purchase made).
is_giftbooleangifterGifterRefDetails of the person who gifted the subscription (when is_gift is true).
Object (GifterRef):
full_namestringemailstringpromo_codestringdiscount_amountstringrefundedstringcurrencystringpricestringorder_datedatestart_issueIssueRefObject (IssueRef):
idstringnumbernumbernamestringissue_listnumber[]Issue numbers included in this subscription.
periodsSubscriptionPeriod[]Array (SubscriptionPeriod):
idnumberorder_datedateis_completebooleanlengthnumberHow many issues this period contains.
issue_listnumber[]Issue numbers included in this period.
subscriberSubscriberRefObject (SubscriberRef):
idstringfull_namestringemailstringsourceSourceRefObject (SourceRef):
idstringnamestringExample
{
"id": "<string>",
"status": "Active",
"medium": "<Print | Digital | Print + digital>",
"first_name": "<string>",
"last_name": "<string>",
"shipping_address": {
"company": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"state": "<string>",
"postcode": "<string>",
"country": "<string>",
"country_name": "<string>",
"phone": "<string>"
},
"length": "<number>",
"notes": "<string>",
"is_recurring": "<boolean>",
"is_comp": "<boolean>",
"is_gift": "<boolean>",
"gifter": {
"full_name": "<string>",
"email": "<string>"
},
"promo_code": "<string>",
"discount_amount": "<string>",
"refunded": "<string>",
"currency": "<string>",
"price": "<string>",
"order_date": "<date>",
"start_issue": {
"id": "<string>",
"number": "<number>",
"name": "<string>"
},
"issue_list": [
"<number>"
],
"periods": [
{
"id": "<number>",
"order_date": "<date>",
"is_complete": "<boolean>",
"length": "<number>",
"issue_list": [
"<number>"
]
}
],
"subscriber": {
"id": "<string>",
"full_name": "<string>",
"email": "<string>"
},
"source": {
"id": "<string>",
"name": "<string>"
}
}errorbooleanRequiredmessagestringRequiredcodestringMachine-readable code, e.g. read_only_key for read-only key write attempts.
Example
{
"error": "<boolean>",
"message": "<string>",
"code": "<string>"
}errorbooleanRequiredmessagestringRequiredcodestringMachine-readable code, e.g. read_only_key for read-only key write attempts.
Example
{
"error": true,
"message": "This API key is read-only. Create a read-write key in Subsail settings to perform write operations.",
"code": "read_only_key"
}