Page tree
Skip to end of metadata
Go to start of metadata

The CreateAutoshipTemplate method is used to create an autoship template based on provided incoming parameters.


The elements below are used in a CreateAutoshipTemplate request.

Click  for an example of this request in JSON format.

Tip:

For best results, hover the cursor over the image and click your right mouse button (or equivalent laptop button or mobile device control), then select Open link in New Window in the shortcut menu. (When prompted, select to either open the file or save the file, as preferred.)

URL:  https://<service_domain>/service/autoship/CreateAutoshipTemplate/<ProjectID>/jp.jws

Element

Description

Format

autoshipTemplate

Required.

This is the root object.



• autoshipHeader

Required.

Contains the main autoship template data
(This block is always required in a CreateAutoshipTemplate request.)


• • createDate

Required.

The creation date in ISO 8601 UTC format (YYYY-MM-DD'T'HH:mm:ss'Z')

String

• • projectId

Required.

The project identifier.

Number

• • frequency

Either frequency or schedule is Required (one or the other must be present).

The interval in days for autoship delivery.

Number

• • firstFrequency

The interval in days for first autoship delivery.

Number

• • schedule

Either frequency or schedule is Required (one or the other must be present).

Delivery schedule in CRON format.

String

• • startDate

Required.

The creation date in ISO 8601 UTC format (YYYY-MM-DD'T'HH:mm:ss'Z')

String

• • endDate

The creation date in ISO 8601 UTC format (YYYY-MM-DD'T'HH:mm:ss'Z')

(If no date is present, is set to null)

String

• • statusCode

Required.

Valid values include:
NEW, ACTIVE, DELETED, INACTIVE, EXCEPTION, CANCELLED

To cancel, autoship status must be CANCELLED and cancellation reason code must also be sent.

String

• • orderHeaderId

Optional, but, if present, there must be an existing OrderHeader in EDGE.

Then the Autoship Template is created based on the existing OrderHeader and all additional request data is ignored except frequency, schedule, startDate, endDate,  modifiedByUserId, statusCode and firstFrequency.
Number

• • member

Member information block


• • • memberId

An EDGE member identifier.


• • • username

The member's user name.

String

• • • email

The member's email address.

String

• • localeCode

Required.

The locale code in ISO 639 format.

String

• billingAddress

Billing address block


• • salutation


String

• • organization

 The organization/company name.

String

• • nameFirst

Required.

The first name associated with the billing address.

String

• • nameLast

Required.

The last name associated with the billing address.

String

• • nameMiddle

The last name associated with the billing address.

String

• • address1

Required.

The member's billing address.
(At least one line of the address is required, as well as the associated city, state, postal and country codes.)

String

• • address2


String

• • address3


String

• • city

Required.

String

• •  stateCode

Required.

String

• • postalCode

Required.

String

• • countryCode

Required.

String

• • phoneWork

The work phone number associated with the billing address.

(This is a legacy requirement.)

String

• • phoneHome

The home phone number associated with the billing address.

String

• • phoneCell

The mobile phone number associated with the billing address.

String

• • email

The email address associated with the billing address.

String

• shippingAddress

Shipping address block


• • salutation


String

• • organization

The organization/company name.

String

• • nameFirst

Required.

The first name associated with the shipping address.

String

• • nameLast

Required.

The last name associated with the shipping address.

String

• • nameMiddle

The middle name associated with the shipping address.

String

• • address1

Required.
(At least one line of the address is required, as well as the associated city, state, postal and country codes.)

String

• • address2


String

• • address3


String

• • city

Required.

String

• • stateCode

Required.

String

• • postalCode

Required.

String

• • countryCode

Required.

String

• • phoneWork

Required.

The work phone number associated with the shipping address.

(This is a legacy requirement.)

String

• • phoneHome

The home phone number associated with the shipping address.

String

• • phoneCell

The mobile phone number associated with the shipping address.

String

• • email

The email address associated with the shipping address.

String

• paymentInfo

Payment information block


• • creditCardType

Required.

Valid values include:
VI, MI, AX, DC, etc.

String

• • creditCardName

Any custom name assigned to this payment method.

String

• • creditCardExp

Required.

The credit card expiration date in ISO 8601 UTC format (YYYY-MM-DD'T'HH:mm:ss'Z')

String

• • paymentToken

Required.

The payment token for tokenized credit cards.

String

• • profileToken

The profile token for tokenized credit cards

String

shippingInfo

Shipping information/details block


• • shipMethod

Required.

The shipping method code.
(List of codes to be provided by JP.)

String

• • provider

Required.

The provider code.
(List of providers to be provided by JP.)

String

• items

An array of autoship items


• • itemObject containing autoship item details

• • • catalog

Required.

The catalog code for an item.

String

• • • inventory

Required.

The inventory code for an item.

String

• • • price

Required.

The item price.

 Number

• • • quantity

Required.

The item quantity. 
(If the quantity is zero, the item will be deleted.)

 Number

• cancellationReason

If the autoship template was cancelled, this block shows the cancellation reason


• • code

Required.

The reason code for the cancellation.
(List of codes to be provided by JP.)

String

• • description

A description of the reason for the cancellation.

String

suspensions

An array of autoship suspensions


• • suspensionObject containing suspension details

• • • suspensionId

An EDGE suspension identifier.
Should be used for any suspension modification. Requires update of an existing suspension.

Number

• • • startDate

Required.

The start date in ISO 8601 UTC format (YYYY-MM-DD'T'HH:mm:ss'Z')

String

• • • endDate

Required.

The end date in ISO 8601 UTC format (YYYY-MM-DD'T'HH:mm:ss'Z')

String

• • • description

A description, if provided.

String

• • • statusCode

Required.

Valid values include:
NEW, ACTIVE, DELETED

String

• notes

An array of notes


• • noteObject containing note content

                            

Required.

A note value.

String

The elelments below are used in a CreateAutoshipTemplate response. When successful, a response is returned with an EDGE ID for the newly created autoship template

Click  for an example of this response in JSON format.

Tip:

For best results, hover the cursor over the image and click your right mouse button (or equivalent laptop button or mobile device control), then select Open link in New Window in the shortcut menu. (When prompted, select to either open the file or save the file, as preferred.)

Element

Description

Format

value

Autoship template Id

Number

resultCode

Valid values include:
OK, FAIL

String

resultMessage

Error description, if any.

String




  • No labels

2 Comments

  1. Please update orderheaderId to orderHeaderId , I don't have rights to do that . Thank you 

    1. Done. Thanks for your help!