24/7 Support: 800.608.6482

Navigation


Subscription_Insert

This function creates a new subscription in Miva

Request Parameters

store_code Type:
String
Title:
Store Code
Store code to run the function against. Found in the Miva Admin under Settings > Store Details
function Type:
String
Title:
Subscription Insert
The name of the function being executed
customer_id Type:
Number
Title:
Customer ID
The id number of the customer
paymentcard_id Type:
Number
Title:
Payment Card ID
the id of the saved payment card linked to the subscription
product_id Type:
Number
Title:
Product ID
The id number of the product
productsubscriptionterm_id Type:
Number
Title:
Product Subscription Term ID
subscription term id for the product
address_id Type:
Number
Title:
Address ID
address id for the subscription
ship_id Type:
Number
Title:
Shipping ID
shipping id for the subscription
ship_data Type:
String
Title:
Shipping Data
The name of the shipping option for the subscription
quantity Type:
Number
Title:
Quantity
product quantity for the subscription
nextdate Type:
Number
Title:
Next Date
Datetime string for the next subscription fulfillment date
template_codes Type:
String
Title:
Template Codes
Template codes for product
attribute_codes Type:
String
Title:
Attribute Codes
Attribute codes for product
values Type:
String
Title:
Values
Product values

Response Parameters

The data structure of the `firstdate` object below is repeated in `lastdate`, `nextdate`, `cncldate`, `lastafail`.
success Type:
Boolean
Title:
Status Response
Boolean value indicating if the api request was successful
id Type:
Number
Title:
Subscription ID
the subscription id
order_id Type:
Number
Title:
Order ID
order id associated with the customer subscription
line_id Type:
Number
Title:
Line ID
line id of the subscription
cust_id Type:
Number
Title:
Customer ID
customer id for the subscription
custpc_id Type:
Number
Title:
Customer Payment Card ID
the id of the payment card linked to the subscription
product_id Type:
Number
Title:
Product ID
product id for the subscription item
subterm_id Type:
Number
Title:
Subscription Term ID
Id number for the subscription term
addr_id Type:
Number
Title:
Address ID
address id of the subscription
ship_id Type:
Number
Title:
Line ID
line id of the subscription
ship_data Type:
String
Title:
Shipping Data
The name of the shipping option for the subscription
quantity Type:
Number
Title:
Quantity
product quantity for the subscription
termrem Type:
Number
Title:
Terms Remaining
Number of terms remaining for the subscription
termproc Type:
Number
Title:
Terms Processed
Number of terms processed on the subscription
firstdate
+ Show Properties
Type:
Object
Title:
firstdate
Subscription first fulfillment date
time_t Type:
Number
Title:
Time_t
Unix timestamp for the first subscription fulfillment date
year Type:
Number
Title:
Year
Year of the fullfillment date
month Type:
Number
Title:
Month
Month of the fullfillment date
day Type:
Number
Title:
Day
Day of the fullfillment date
hour Type:
Number
Title:
Hour
Hour of the fullfillment date
minute Type:
Number
Title:
Minute
Minute of the fullfillment date
second Type:
Number
Title:
Second
Second of the fullfillment date
timezone Type:
Number
Title:
Time Zone
Time zone of the fullfillment date
status Type:
String
Title:
Status
Subscription status
message Type:
String
Title:
Message
Subscription status message
tax Type:
Number
Title:
Tax
Tax for the subscription
formatted_tax Type:
String
Title:
Currency Formatted Tax
Currency formatted subscription tax
shipping Type:
Number
Title:
Shipping
Shipping total for the subscription
formatted_shipping Type:
String
Title:
Currency Formatted Subscription Shipping
Currency formatted shipping total
subtotal Type:
Number
Title:
Subtotal
Subscription subtotal
formatted_subtotal Type:
String
Title:
Currency Formatted Subtotal
Currency formatted subtotal
total Type:
Number
Title:
Subscription Total
Subscription total price
formatted_total Type:
String
Title:
Currency Formatted Subscription Total
Currency formatted subscription total price
authfails Type:
Number
Title:
Authorization Failures
Number of times payment authorizaton has failed
options Type:
Object
Title:
Options
Array of objects containing options. See usage here: List Load Query Overview

Example Request

Example Response

Error Responses

error code:
MER-SUB-JSN-00060
error message:
Subscription not found
description:
Subscription not found

This website uses cookies to identify visitors, track visitors to our website, store login session information and to remember your user preferences. By continuing to use this site you agree to our use of cookies. Learn More.

This website uses cookies. By continuing to use this site you agree to our use of cookies. Learn More.

Accept

Copyright © 1997 – 2023 Miva©, Miva Merchant©, MivaPay©, MivaCon©, Camp Miva ℠, Miva, Inc. All Rights Reserved.