Trendsic Platform Service

<back to all web services

CustomerAppCardActionRequest

The following routes are available for this service:
POST/v1/c/app/cards/{Id}/{Action}
"use strict";
export class CustomerAppSessionRequest {
    /** @param {{Slug?:string,Profile?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Slug;
    /** @type {string} */
    Profile;
}
export class CourierTrackBusiness {
    /** @param {{Name?:string,Phone?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Name;
    /** @type {string} */
    Phone;
}
export class CourierBookLevel {
    /** @param {{Code?:string,Name?:string,Ready?:string,WithinMin?:number,InBy?:string,Surcharge?:number,Days?:number[],DeadlineMin?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Code;
    /** @type {string} */
    Name;
    /** @type {string} */
    Ready;
    /** @type {number} */
    WithinMin;
    /** @type {string} */
    InBy;
    /** @type {number} */
    Surcharge;
    /** @type {number[]} */
    Days = [];
    /** @type {?number} */
    DeadlineMin;
}
export class HandoffOptions {
    /** @param {{Hand?:boolean,Porch?:boolean,Desk?:boolean,SigRequired?:boolean,IdRequired?:boolean,CodeRequired?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {boolean} */
    Hand;
    /** @type {boolean} */
    Porch;
    /** @type {boolean} */
    Desk;
    /** @type {boolean} */
    SigRequired;
    /** @type {boolean} */
    IdRequired;
    /** @type {boolean} */
    CodeRequired;
}
export class CourierBookProfile {
    /** @param {{Code?:string,Name?:string,Shape?:string,Template?:string,UnitOne?:string,UnitMany?:string,UnitOneEs?:string,UnitManyEs?:string,FacilityNoun?:string,FacilityNounEs?:string,FacilityName?:string,Levels?:CourierBookLevel[],Asap?:boolean,Recurring?:boolean,PayTiming?:string,FinalAfterCount?:boolean,CancelFee?:number,MissedFee?:number,MissedWaitMin?:number,ServiceArea?:string[],Zips?:string[],Handoffs?:HandoffOptions}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Code;
    /** @type {string} */
    Name;
    /** @type {string} */
    Shape;
    /** @type {string} */
    Template;
    /** @type {string} */
    UnitOne;
    /** @type {string} */
    UnitMany;
    /** @type {string} */
    UnitOneEs;
    /** @type {string} */
    UnitManyEs;
    /** @type {string} */
    FacilityNoun;
    /** @type {string} */
    FacilityNounEs;
    /** @type {string} */
    FacilityName;
    /** @type {CourierBookLevel[]} */
    Levels = [];
    /** @type {boolean} */
    Asap;
    /** @type {boolean} */
    Recurring;
    /** @type {string} */
    PayTiming;
    /** @type {boolean} */
    FinalAfterCount;
    /** @type {number} */
    CancelFee;
    /** @type {number} */
    MissedFee;
    /** @type {number} */
    MissedWaitMin;
    /** @type {string[]} */
    ServiceArea = [];
    /** @type {string[]} */
    Zips = [];
    /** @type {HandoffOptions} */
    Handoffs;
}
export class CourierBookProfileLink {
    /** @param {{Code?:string,Name?:string,Shape?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Code;
    /** @type {string} */
    Name;
    /** @type {string} */
    Shape;
}
export class CourierBookPageView {
    /** @param {{Available?:boolean,BookingOn?:boolean,Business?:CourierTrackBusiness,Profile?:CourierBookProfile,Profiles?:CourierBookProfileLink[],CardEnabled?:boolean,PublishableKey?:string,AppUrl?:string,Today?:string,Weekday?:number,NowMin?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {boolean} */
    Available;
    /** @type {boolean} */
    BookingOn;
    /** @type {CourierTrackBusiness} */
    Business;
    /** @type {CourierBookProfile} */
    Profile;
    /** @type {CourierBookProfileLink[]} */
    Profiles = [];
    /** @type {boolean} */
    CardEnabled;
    /** @type {string} */
    PublishableKey;
    /** @type {string} */
    AppUrl;
    /** @type {string} */
    Today;
    /** @type {number} */
    Weekday;
    /** @type {number} */
    NowMin;
}
export class CustomerAppBoot {
    /** @param {{Profile?:string,Available?:boolean,Reason?:string,AuthMethod?:string,Slug?:string,Page?:CourierBookPageView,ManifestUrl?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Profile;
    /** @type {boolean} */
    Available;
    /** @type {string} */
    Reason;
    /** @type {string} */
    AuthMethod;
    /** @type {string} */
    Slug;
    /** @type {CourierBookPageView} */
    Page;
    /** @type {string} */
    ManifestUrl;
}
export class CustomerAppAddress {
    /** @param {{Id?:number,Label?:string,Street?:string,Unit?:string,City?:string,Zip?:string,Lat?:number,Lng?:number,InArea?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    Id;
    /** @type {string} */
    Label;
    /** @type {string} */
    Street;
    /** @type {string} */
    Unit;
    /** @type {string} */
    City;
    /** @type {string} */
    Zip;
    /** @type {?number} */
    Lat;
    /** @type {?number} */
    Lng;
    /** @type {boolean} */
    InArea;
}
export class CustomerAppCard {
    /** @param {{Id?:number,Label?:string,Brand?:string,Last4?:string,IsDefault?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    Id;
    /** @type {string} */
    Label;
    /** @type {string} */
    Brand;
    /** @type {string} */
    Last4;
    /** @type {boolean} */
    IsDefault;
}
export class CustomerAppNotif {
    /** @param {{Texts?:boolean,Push?:boolean,Promos?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {boolean} */
    Texts;
    /** @type {boolean} */
    Push;
    /** @type {boolean} */
    Promos;
}
export class CustomerAppStep {
    /** @param {{Key?:string,Done?:boolean,Time?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Key;
    /** @type {boolean} */
    Done;
    /** @type {string} */
    Time;
}
export class CustomerAppOrder {
    /** @param {{Id?:number,Code?:string,Status?:string,State?:string,Active?:boolean,LevelCode?:string,LevelName?:string,Units?:number,UnitsFound?:number,Address?:string,Unit?:string,Zip?:string,DropAddress?:string,RecipientName?:string,Handoff?:string,IsAsap?:boolean,DayIx?:number,DateText?:string,StartMin?:number,EndMin?:number,DriverFirstName?:string,EtaMin?:number,Promise?:string,PayMode?:string,Amount?:number,Charged?:number,Tip?:number,CardLast4?:string,RecurrenceId?:number,Steps?:CustomerAppStep[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    Id;
    /** @type {string} */
    Code;
    /** @type {string} */
    Status;
    /** @type {string} */
    State;
    /** @type {boolean} */
    Active;
    /** @type {string} */
    LevelCode;
    /** @type {string} */
    LevelName;
    /** @type {number} */
    Units;
    /** @type {?number} */
    UnitsFound;
    /** @type {string} */
    Address;
    /** @type {string} */
    Unit;
    /** @type {string} */
    Zip;
    /** @type {string} */
    DropAddress;
    /** @type {string} */
    RecipientName;
    /** @type {string} */
    Handoff;
    /** @type {boolean} */
    IsAsap;
    /** @type {number} */
    DayIx;
    /** @type {string} */
    DateText;
    /** @type {?number} */
    StartMin;
    /** @type {?number} */
    EndMin;
    /** @type {string} */
    DriverFirstName;
    /** @type {?number} */
    EtaMin;
    /** @type {string} */
    Promise;
    /** @type {string} */
    PayMode;
    /** @type {number} */
    Amount;
    /** @type {?number} */
    Charged;
    /** @type {?number} */
    Tip;
    /** @type {string} */
    CardLast4;
    /** @type {?number} */
    RecurrenceId;
    /** @type {CustomerAppStep[]} */
    Steps = [];
}
export class CustomerAppRecurrence {
    /** @param {{Id?:number,Weekday?:number,StartMin?:number,EndMin?:number,Cadence?:string,LevelCode?:string,Units?:number,Handoff?:string,Address?:string,Paused?:boolean,PayMode?:string,CardLast4?:string,NextDate?:string,SkippedDate?:string,AheadDays?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    Id;
    /** @type {number} */
    Weekday;
    /** @type {number} */
    StartMin;
    /** @type {number} */
    EndMin;
    /** @type {string} */
    Cadence;
    /** @type {string} */
    LevelCode;
    /** @type {number} */
    Units;
    /** @type {string} */
    Handoff;
    /** @type {string} */
    Address;
    /** @type {boolean} */
    Paused;
    /** @type {string} */
    PayMode;
    /** @type {string} */
    CardLast4;
    /** @type {string} */
    NextDate;
    /** @type {string} */
    SkippedDate;
    /** @type {number} */
    AheadDays;
}
export class CustomerAppInvoice {
    /** @param {{Uid?:string,Number?:string,DateText?:string,Total?:number,Balance?:number,Paid?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Uid;
    /** @type {string} */
    Number;
    /** @type {string} */
    DateText;
    /** @type {number} */
    Total;
    /** @type {number} */
    Balance;
    /** @type {boolean} */
    Paid;
}
export class CustomerAppMe {
    /** @param {{ContactId?:number,FirstName?:string,LastName?:string,Name?:string,Phone?:string,NeedsName?:boolean,BillingMode?:string,AccountCode?:string,Addresses?:CustomerAppAddress[],Cards?:CustomerAppCard[],Notif?:CustomerAppNotif,Orders?:CustomerAppOrder[],Recurring?:CustomerAppRecurrence[],Invoices?:CustomerAppInvoice[],Today?:string,NowMin?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    ContactId;
    /** @type {string} */
    FirstName;
    /** @type {string} */
    LastName;
    /** @type {string} */
    Name;
    /** @type {string} */
    Phone;
    /** @type {boolean} */
    NeedsName;
    /** @type {string} */
    BillingMode;
    /** @type {string} */
    AccountCode;
    /** @type {CustomerAppAddress[]} */
    Addresses = [];
    /** @type {CustomerAppCard[]} */
    Cards = [];
    /** @type {CustomerAppNotif} */
    Notif;
    /** @type {CustomerAppOrder[]} */
    Orders = [];
    /** @type {CustomerAppRecurrence[]} */
    Recurring = [];
    /** @type {CustomerAppInvoice[]} */
    Invoices = [];
    /** @type {string} */
    Today;
    /** @type {number} */
    NowMin;
}
export class CourierBookOrderResponse {
    /** @param {{Done?:boolean,NeedsAction?:boolean,ClientSecret?:string,SetupIntentId?:string,Code?:string,TrackUrl?:string,IcsUrl?:string,WindowText?:string,Promise?:string,Total?:number,PayTiming?:string,CardLast4?:string,Repeats?:string,LinkSentBy?:string,ReopenStep?:string,ResponseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {boolean} */
    Done;
    /** @type {boolean} */
    NeedsAction;
    /** @type {string} */
    ClientSecret;
    /** @type {string} */
    SetupIntentId;
    /** @type {string} */
    Code;
    /** @type {string} */
    TrackUrl;
    /** @type {string} */
    IcsUrl;
    /** @type {string} */
    WindowText;
    /** @type {string} */
    Promise;
    /** @type {number} */
    Total;
    /** @type {string} */
    PayTiming;
    /** @type {string} */
    CardLast4;
    /** @type {string} */
    Repeats;
    /** @type {string} */
    LinkSentBy;
    /** @type {string} */
    ReopenStep;
    /** @type {ResponseStatus} */
    ResponseStatus;
}
export class CourierCustomerRow {
    /** @param {{ContactId?:number,Name?:string,Phone?:string,BillingMode?:string,AccountCode?:string,Orders?:number,LastOrderAt?:string,Unbilled?:number,UnbilledAmount?:number,Cards?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    ContactId;
    /** @type {string} */
    Name;
    /** @type {string} */
    Phone;
    /** @type {string} */
    BillingMode;
    /** @type {string} */
    AccountCode;
    /** @type {number} */
    Orders;
    /** @type {?string} */
    LastOrderAt;
    /** @type {number} */
    Unbilled;
    /** @type {number} */
    UnbilledAmount;
    /** @type {number} */
    Cards;
}
export class RunResult {
    /** @param {{Invoices?:number,Orders?:number,Total?:number,Skipped?:string[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    Invoices;
    /** @type {number} */
    Orders;
    /** @type {number} */
    Total;
    /** @type {string[]} */
    Skipped = [];
}
export class CustomerAppResponse {
    /** @param {{Boot?:CustomerAppBoot,Customer?:CustomerAppMe,Addresses?:CustomerAppAddress[],Cards?:CustomerAppCard[],Notif?:CustomerAppNotif,Recurring?:CustomerAppRecurrence[],Booked?:CourierBookOrderResponse,Sent?:boolean,Token?:string,NeedsName?:boolean,Name?:string,Url?:string,ClientSecret?:string,PublishableKey?:string,Message?:string,ReopenStep?:string,Customers?:CourierCustomerRow[],Run?:RunResult,ResponseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {CustomerAppBoot} */
    Boot;
    /** @type {CustomerAppMe} */
    Customer;
    /** @type {CustomerAppAddress[]} */
    Addresses = [];
    /** @type {CustomerAppCard[]} */
    Cards = [];
    /** @type {CustomerAppNotif} */
    Notif;
    /** @type {CustomerAppRecurrence[]} */
    Recurring = [];
    /** @type {CourierBookOrderResponse} */
    Booked;
    /** @type {boolean} */
    Sent;
    /** @type {string} */
    Token;
    /** @type {boolean} */
    NeedsName;
    /** @type {string} */
    Name;
    /** @type {string} */
    Url;
    /** @type {string} */
    ClientSecret;
    /** @type {string} */
    PublishableKey;
    /** @type {string} */
    Message;
    /** @type {string} */
    ReopenStep;
    /** @type {CourierCustomerRow[]} */
    Customers = [];
    /** @type {RunResult} */
    Run;
    /** @type {ResponseStatus} */
    ResponseStatus;
}
export class CustomerAppCardActionRequest extends CustomerAppSessionRequest {
    /** @param {{Id?:number,Action?:string,Slug?:string,Profile?:string}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
    /** @type {number} */
    Id;
    /** @type {string} */
    Action;
}

JavaScript CustomerAppCardActionRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/c/app/cards/{Id}/{Action} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Id: 0,
	Action: String,
	Slug: String,
	Profile: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Boot: 
	{
		Profile: String,
		Available: False,
		Reason: String,
		AuthMethod: String,
		Slug: String,
		Page: 
		{
			Available: False,
			BookingOn: False,
			Business: 
			{
				Name: String,
				Phone: String
			},
			Profile: 
			{
				Code: String,
				Name: String,
				Shape: String,
				Template: String,
				UnitOne: String,
				UnitMany: String,
				UnitOneEs: String,
				UnitManyEs: String,
				FacilityNoun: String,
				FacilityNounEs: String,
				FacilityName: String,
				Levels: 
				[
					{
						Code: String,
						Name: String,
						Ready: String,
						WithinMin: 0,
						InBy: String,
						Surcharge: 0,
						Days: 
						[
							0
						],
						DeadlineMin: 0
					}
				],
				Asap: False,
				Recurring: False,
				PayTiming: String,
				FinalAfterCount: False,
				CancelFee: 0,
				MissedFee: 0,
				MissedWaitMin: 0,
				ServiceArea: 
				[
					String
				],
				Zips: 
				[
					String
				],
				Handoffs: 
				{
					Hand: False,
					Porch: False,
					Desk: False,
					SigRequired: False,
					IdRequired: False,
					CodeRequired: False
				}
			},
			Profiles: 
			[
				{
					Code: String,
					Name: String,
					Shape: String
				}
			],
			CardEnabled: False,
			PublishableKey: String,
			AppUrl: String,
			Today: String,
			Weekday: 0,
			NowMin: 0
		},
		ManifestUrl: String
	},
	Customer: 
	{
		ContactId: 0,
		FirstName: String,
		LastName: String,
		Name: String,
		Phone: String,
		NeedsName: False,
		BillingMode: String,
		AccountCode: String,
		Addresses: 
		[
			{
				Id: 0,
				Label: String,
				Street: String,
				Unit: String,
				City: String,
				Zip: String,
				Lat: 0,
				Lng: 0,
				InArea: False
			}
		],
		Cards: 
		[
			{
				Id: 0,
				Label: String,
				Brand: String,
				Last4: String,
				IsDefault: False
			}
		],
		Notif: 
		{
			Texts: False,
			Push: False,
			Promos: False
		},
		Orders: 
		[
			{
				Id: 0,
				Code: String,
				Status: String,
				State: String,
				Active: False,
				LevelCode: String,
				LevelName: String,
				Units: 0,
				UnitsFound: 0,
				Address: String,
				Unit: String,
				Zip: String,
				DropAddress: String,
				RecipientName: String,
				Handoff: String,
				IsAsap: False,
				DayIx: 0,
				DateText: String,
				StartMin: 0,
				EndMin: 0,
				DriverFirstName: String,
				EtaMin: 0,
				Promise: String,
				PayMode: String,
				Amount: 0,
				Charged: 0,
				Tip: 0,
				CardLast4: String,
				RecurrenceId: 0,
				Steps: 
				[
					{
						Key: String,
						Done: False,
						Time: String
					}
				]
			}
		],
		Recurring: 
		[
			{
				Id: 0,
				Weekday: 0,
				StartMin: 0,
				EndMin: 0,
				Cadence: String,
				LevelCode: String,
				Units: 0,
				Handoff: String,
				Address: String,
				Paused: False,
				PayMode: String,
				CardLast4: String,
				NextDate: String,
				SkippedDate: String,
				AheadDays: 0
			}
		],
		Invoices: 
		[
			{
				Uid: 00000000000000000000000000000000,
				Number: String,
				DateText: String,
				Total: 0,
				Balance: 0,
				Paid: False
			}
		],
		Today: String,
		NowMin: 0
	},
	Addresses: 
	[
		{
			Id: 0,
			Label: String,
			Street: String,
			Unit: String,
			City: String,
			Zip: String,
			Lat: 0,
			Lng: 0,
			InArea: False
		}
	],
	Cards: 
	[
		{
			Id: 0,
			Label: String,
			Brand: String,
			Last4: String,
			IsDefault: False
		}
	],
	Notif: 
	{
		Texts: False,
		Push: False,
		Promos: False
	},
	Recurring: 
	[
		{
			Id: 0,
			Weekday: 0,
			StartMin: 0,
			EndMin: 0,
			Cadence: String,
			LevelCode: String,
			Units: 0,
			Handoff: String,
			Address: String,
			Paused: False,
			PayMode: String,
			CardLast4: String,
			NextDate: String,
			SkippedDate: String,
			AheadDays: 0
		}
	],
	Booked: 
	{
		Done: False,
		NeedsAction: False,
		ClientSecret: String,
		SetupIntentId: String,
		Code: String,
		TrackUrl: String,
		IcsUrl: String,
		WindowText: String,
		Promise: String,
		Total: 0,
		PayTiming: String,
		CardLast4: String,
		Repeats: String,
		LinkSentBy: String,
		ReopenStep: String,
		ResponseStatus: 
		{
			ErrorCode: String,
			Message: String,
			StackTrace: String,
			Errors: 
			[
				{
					ErrorCode: String,
					FieldName: String,
					Message: String,
					Meta: 
					{
						String: String
					}
				}
			],
			Meta: 
			{
				String: String
			}
		}
	},
	Sent: False,
	Token: String,
	NeedsName: False,
	Name: String,
	Url: String,
	ClientSecret: String,
	PublishableKey: String,
	Message: String,
	ReopenStep: String,
	Customers: 
	[
		{
			ContactId: 0,
			Name: String,
			Phone: String,
			BillingMode: String,
			AccountCode: String,
			Orders: 0,
			LastOrderAt: 0001-01-01,
			Unbilled: 0,
			UnbilledAmount: 0,
			Cards: 0
		}
	],
	Run: 
	{
		Invoices: 0,
		Orders: 0,
		Total: 0,
		Skipped: 
		[
			String
		]
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}