Welcome to Smile’s GraphQL API documentation!¶
Overview¶
What is GraphQL?¶
GraphQL is a specification for an expressive data query language for APIs. It allows you to describe your data, request what you want from your data and receive a response back in the same shape as your request - only the fields you requested with the same field names. GraphQL is a strongly typed server-side runtime allowing you to traverse from the entry point to related data, following relationships defined in the schema, in a single request.
Many options for implementation on the server and client side are available.
GraphQL was internally developed by Facebook. It was publicly released in 2015.
For more information about the history of GraphQL see GraphQL.org.
Why is Inomial using GraphQL?¶
Inomial chose GraphQL because..
Our GraphQL API is accessed by a GraphiQL console. GraphiQL is an interactive in-browser Integrated Development Environment (IDE) for interacting with GraphQL API calls, enabling the means to query data and perform mutations.
Endpoint¶
Smile GraphQL is available at the following endpoint:
https://showcase.inomial.net/live/api/ql
Query¶
Smile’s GraphQL Query type
type Query {
# Returns the account for the given UID.
#
# Arguments
# uid: [Not documented]
# uuid: [Not documented]
# usn: [Not documented]
account(uid: Int, uuid: UUID, usn: String): Account
# Returns the subscription for the given UID.
#
# Arguments
# uid: [Not documented]
# uuid: [Not documented]
# usn: [Not documented]
subscription(uid: Int, uuid: UUID, usn: String): Subscription
# Returns (possibly draft) transaction details.
#
# Arguments
# uuid: [Not documented]
# number: [Not documented]
txDetail(uuid: UUID, number: String): TxDetail
# Returns transaction.
#
# Arguments
# uuid: [Not documented]
# number: [Not documented]
# tx: [Not documented]
tx(uuid: UUID, number: String, tx: String): Tx
# Performs the equivalent of a UI search
#
# Arguments
# q: The query string
# limit: The number of results to return, up to 200
search(q: String, limit: Int): [SearchResult]
# Returns UCDRs.
#
# Arguments
# uuid: [Not documented]
ucdr(uuid: UUID): Ucdr
# Returns the ticket for the given ID.
#
# Arguments
# id: [Not documented]
# uuid: [Not documented]
# number: [Not documented]
ticket(id: Int, uuid: UUID, number: String): Ticket
# Returns the draft invoice for the given ID.
#
# Arguments
# uuid: [Not documented]
# number: [Not documented]
draftInvoice(uuid: UUID, number: String): DraftInvoice
# Returns all unbilled charge summary.
unbilledChargeSummary: [UnbilledChargeSummary]
# Returns all draft invoices.
#
# Arguments
# filter: [Not documented]
allDraftInvoices(filter: [DraftInvoiceFilter]): AllDraftInvoiceCursor
# Returns all tickets.
#
# Arguments
# filter: [Not documented]
allTickets(filter: [TicketFilter]): AllTicketCursor
# Returns all accounts.
#
# Arguments
# filter: [Not documented]
allAccounts(filter: [AccountFilter]): AllAccountCursor
# Returns all subscriptions.
#
# Arguments
# filter: [Not documented]
allSubscriptions(filter: [SubscriptionFilter]): AllSubscriptionCursor
# Returns all plans.
#
# Arguments
# filter: [Not documented]
allPlans(filter: [PlanFilter]): AllPlanCursor
# Returns all invoice items.
#
# Arguments
# filter: [Not documented]
allInvoiceItems(filter: [ItemSpecificationFilter]): AllInvoiceItemCursor
}
Required by¶
This element is not required
BigDecimal¶
Built-in java.math.BigDecimal
scalar BigDecimal
Required by¶
- Cdr
- Charge Data Record (CDR). In Smile, a CDR is a record of a single element of a billable event.
- CdrFilter
- null
- DraftInvoice
- Draft invoice
- DraftInvoiceFilter
- DraftInvoiceFilter
- ItemSpecification
- Item Description
- ItemSpecificationFilter
- null
- Tx
- Information about a credit or debit that has been applied to an Account
- TxDetail
- Detailed information about a (possibly draft) transaction
- TxDetailFilter
- null
- TxFilter
- null
- TxItem
- Transaction line item
- TxItemFilter
- null
- UnbilledChargeSummary
- Charge view summary
Boolean¶
Built-in Boolean
scalar Boolean
Required by¶
- Account
- A debtor record containing transactions
- AccountFilter
- null
- Binding
- Account’s binding
- BindingFilter
- null
- ItemSpecification
- Item description
- ItemSpecificationFilter
- null
- PaymentMethod
- Saved payment details for an account
- PaymentMethodFilter
- null
- Plan
- Plan
- PlanFilter
- Plan filter
- Subscription
- A subscription to a service
- SubscriptionBinding
- Subscription’s binding
- SubscriptionBindingFilter
- null
- SubscriptionFilter
- null
- Ticket
- Tickets (work orders)
- TicketFilter
- null
- TxItem
- Transaction line item
- TxItemFilter
- null
- __Directive
- null
- __EnumValue
- null
- __Field
- null
- __Type
- null
Int¶
Built-in Int
scalar Int
Required by¶
- Account
- A debtor record containing transactions
- AccountAddress
- A debtor record containing transactions
- AccountAddressFilter
- null
- AccountContact
- Contact details for an account
- AccountContactFilter
- null
- AccountCostCentre
- Account cost centre
- AccountCostCentreFilter
- null
- AccountFilter
- null
- AllAccountCursor
- AllAccountCursor
- AllDraftInvoiceCursor
- AllDraftInvoiceCursor
- AllInvoiceItemCursor
- AllInvoiceItemCursor
- AllPlanCursor
- AllPlanCursor
- AllSubscriptionCursor
- AllSubscriptionCursor
- AllTicketCursor
- AllTicketCursor
- Binding
- Account’s binding
- BindingCursor
- null
- BindingFilter
- null
- Cdr
- Charge Data Record (CDR). In Smile, a CDR is a record of a single element of a billable event.
- CdrCursor
- null
- CdrError
- CDR processing errors. These are deleted once a CDR has been successfully processed.
- CdrErrorFilter
- null
- CdrFilter
- null
- DraftInvoice
- Draft invoice
- DraftInvoiceFilter
- DraftInvoiceFilter
- ItemSpecification
- Item Description
- ItemSpecificationFilter
- null
- PaymentMethod
- Saved payment details for an account
- PaymentMethodFilter
- null
- Plan
- Plan
- PlanFilter
- Plan filter
- Query
- Smile’s GraphQL Query type
- SearchResult
- A single result from a search query
- Service
- Service
- ServiceFilter
- null
- Subscription
- A subscription to a service
- SubscriptionBinding
- Subscription’s binding
- SubscriptionBindingCursor
- null
- SubscriptionBindingFilter
- null
- SubscriptionCursor
- null
- SubscriptionFilter
- null
- TariffType
- Tariff type
- TariffTypeFilter
- null
- Ticket
- Tickets (work orders)
- TicketCursor
- null
- TicketFilter
- null
- Tx
- Information about a credit or debit that has been applied to an Account
- TxDetail
- Detailed information about a (possibly draft) transaction
- TxDetailFilter
- null
- TxFilter
- null
- TxItem
- Transaction line item
- TxItemCursor
- null
- TxItemFilter
- null
- Ucdr
- Unmediated CDR
Long¶
Long type
scalar Long
Required by¶
- Account
- A debtor record containing transactions
- AccountContact
- Contact details for an account
- AccountContactFilter
- null
- AccountFilter
- null
- Cdr
- Charge Data Record (CDR). In Smile, a CDR is a record of a single element of a billable event.
- CdrError
- CDR processing errors. These are deleted once a CDR has been successfully processed.
- CdrErrorFilter
- null
- CdrFilter
- null
- Subscription
- A subscription to a service
- SubscriptionFilter
- null
- TariffType
- Tariff type
- TariffTypeFilter
- null
- Tx
- Information about a credit or debit that has been applied to an Account
- TxDetail
- Detailed information about a (possibly draft) transaction
- TxDetailFilter
- null
- TxFilter
- null
- TxItem
- Transaction line item
- TxItemFilter
- null
- UnbilledChargeSummary
- Charge view summary
Milliseconds¶
Milliseconds since 1970
scalar Milliseconds
Required by¶
- Account
- A debtor record containing transactions
- AccountFilter
- null
- Binding
- Account’s binding
- BindingFilter
- null
- Cdr
- Charge Data Record (CDR). In Smile, a CDR is a record of a single element of a billable event.
- CdrError
- CDR processing errors. These are deleted once a CDR has been successfully processed.
- CdrErrorFilter
- null
- CdrFilter
- null
- DraftInvoice
- Draft invoice
- DraftInvoiceFilter
- DraftInvoiceFilter
- Subscription
- A subscription to a service
- SubscriptionBinding
- Subscription’s binding
- SubscriptionBindingFilter
- null
- SubscriptionFilter
- null
- Ticket
- Tickets (work orders)
- TicketFilter
- null
- Tx
- Information about a credit or debit that has been applied to an Account
- TxDetail
- Detailed information about a (possibly draft) transaction
- TxDetailFilter
- null
- TxFilter
- null
- Ucdr
- Unmediated CDR
String¶
Built-in String
scalar String
Required by¶
- Account
- A debtor record containing transactions
- AccountAddress
- A debtor record containing transactions
- AccountAddressFilter
- null
- AccountContact
- Contact details for an account
- AccountContactFilter
- null
- AccountCostCentre
- Account cost centre
- AccountCostCentreFilter
- null
- AccountFilter
- null
- Binding
- Account’s binding
- BindingFilter
- null
- Cdr
- Charge Data Record (CDR). In Smile, a CDR is a record of a single element of a billable event.
- CdrError
- CDR processing errors. These are deleted once a CDR has been successfully processed.
- CdrErrorFilter
- null
- CdrFilter
- null
- DraftInvoice
- Draft invoice
- DraftInvoiceFilter
- DraftInvoiceFilter
- ItemSpecification
- Item Description
- ItemSpecificationFilter
- null
- PaymentMethod
- Saved payment details for an account
- PaymentMethodFilter
- null
- Plan
- Plan
- PlanFilter
- Plan filter
- Query
- Smile’s GraphQL Query type
- Service
- Service
- ServiceFilter
- null
- Subscription
- A subscription to a service
- SubscriptionBinding
- Subscription’s binding
- SubscriptionFilter
- null
- TariffType
- Tariff type
- TariffTypeFilter
- null
- Ticket
- Tickets (work orders)
- TicketFilter
- null
- Tx
- Information about a credit or debit that has been applied to an Account
- TxDetail
- Detailed information about a (possibly draft) transaction
- TxDetailFilter
- null
- TxFilter
- null
- TxItem
- Transaction line item
- TxItemFilter
- null
- Ucdr
- Unmediated CDR
- __Directive
- null
- __EnumValue
- null
- __Field
- null
- __InputValue
- null
- __Type
- null
UUID¶
UUID
scalar UUID
Required by¶
- Account
- A debtor record containing transactions
- Account
- A debtor record containing transactions
- Binding
- Account’s binding
- BindingFilter
- null
- Cdr
- Charge Data Record (CDR). In Smile, a CDR is a record of a single element of a billable event.
- CdrError
- CDR processing errors. These are deleted once a CDR has been successfully processed.
- CdrErrorFilter
- null
- CdrFilter
- null
- DraftInvoice
- Draft invoice
- DraftInvoiceFilter
- DraftInvoiceFilter
- PaymentMethod
- Saved payment details for an account
- PaymentMethodFilter
- null
- Query
- Smile’s GraphQL Query type
- Subscription
- A subscription to a service
- SubscriptionBinding
- Subscription’s binding
- SubscriptionBindingFilter
- null
- SubscriptionFilter
- null
- TariffType
- Tariff type
- TariffTypeFilter
- null
- Ticket
- Tickets (work orders)
- TicketFilter
- null
- Tx
- Information about a credit or debit that has been applied to an Account
- TxDetail
- Detailed information about a (possibly draft) transaction
- TxDetailFilter
- null
- TxFilter
- null
- TxItem
- Transaction line item
- TxItemFilter
- null
- Ucdr
- Unmediated CDR
__DirectiveLocation¶
An enum describing valid locations where a directive can be placed.
enum __DirectiveLocation {
# Indicates the directive is valid on queries.
QUERY
# Indicates the directive is valid on mutations.
MUTATION
# Indicates the directive is valid on fields.
FIELD
# Indicates the directive is valid on fragment definitions.
FRAGMENT_DEFINITION
# Indicates the directive is valid on fragment spreads.
FRAGMENT_SPREAD
# Indicates the directive is valid on inline fragments.
INLINE_FRAGMENT
# Indicates the directive is valid on a schema IDL definition.
SCHEMA
# Indicates the directive is valid on a scalar IDL definition.
SCALAR
# Indicates the directive is valid on an object IDL definition.
OBJECT
# Indicates the directive is valid on a field IDL definition.
FIELD_DEFINITION
# Indicates the directive is valid on a field argument IDL definition.
ARGUMENT_DEFINITION
# Indicates the directive is valid on an interface IDL definition.
INTERFACE
# Indicates the directive is valid on an union IDL definition.
UNION
# Indicates the directive is valid on an enum IDL definition.
ENUM
# Indicates the directive is valid on an input object IDL definition.
INPUT_OBJECT
# Indicates the directive is valid on an input object field IDL definition.
INPUT_FIELD_DEFINITION
}
Required by¶
- __Directive
- null
__TypeKind¶
enum __TypeKind {
# Indicates this type is a scalar.
SCALAR
# Indicates this type is an object. `fields` and `interfaces` are valid fields.
OBJECT
# Indicates this type is an interface. `fields` and `possibleTypes` are valid
# fields.
INTERFACE
# Indicates this type is a union. `possibleTypes` is a valid field.
UNION
# Indicates this type is an enum. `enumValues` is a valid field.
ENUM
# Indicates this type is an input object. `inputFields` is a valid field.
INPUT_OBJECT
# Indicates this type is a list. `ofType` is a valid field.
LIST
# Indicates this type is a non-null. `ofType` is a valid field.
NON_NULL
}
Account¶
A debtor record containing transactions.
type Account {
account: Long
accountUuid: UUID
usn: String
alternateAccountNumber: String
accountType: Int
accountTerms: Int
accountDisposition: Int
discount: Int
creationTime_iso: String
creationTime: Milliseconds
accountCostCentre: Int
description: String
taxable: Boolean
taxSchedule: Int
currency: String
timezone: Int
uoobject: Int
custom: String
# Arguments
# filter: [Not documented]
Subscriptions(filter: [SubscriptionFilter]): SubscriptionCursor
# Arguments
# filter: [Not documented]
Txs(filter: [TxFilter]): [Tx]
# Arguments
# filter: [Not documented]
Contact(filter: [AccountContactFilter]): [AccountContact]
# Arguments
# filter: [Not documented]
Address(filter: [AccountAddressFilter]): [AccountAddress]
# Arguments
# filter: [Not documented]
CostCentre(filter: [AccountCostCentreFilter]): AccountCostCentre
# Arguments
# filter: [Not documented]
Tickets(filter: [TicketFilter]): TicketCursor
# Arguments
# filter: [Not documented]
Bindings(filter: [BindingFilter]): BindingCursor
# Arguments
# filter: [Not documented]
PaymentMethods(filter: [PaymentMethodFilter]): [PaymentMethod]
}
Required by¶
- AllAccountCursor
- AllAccountCursor
- DraftInvoice
- Draft invoice
- Query
- Smile’s GraphQL Query type
- SearchResult
- A single result from a search query
- Subscription
- A subscription to a service
- Ticket
- Tickets (work orders)
- Tx
- Information about a credit or debit that has been applied to an Account
- TxDetail
- Detailed information about a (possibly draft) transaction
AccountAddress¶
A debtor record containing transactions.
type AccountAddress {
account: Int
addressType: Int
addressName: String
companyName: String
addressDetail: String
buildingName: String
subUnit: String
floor: String
lot: String
postalDeliveryType: String
streetNumber: String
streetName: String
streetType: String
suburb: String
state: String
postcode: String
country: String
}
AccountContact¶
Contact details for an account
type AccountContact {
account: Long
contactType: Int
contactName: String
companyName: String
tradingName: String
abn: String
contactTitle: String
familyName: String
givenName: String
dateOfBirth: String
gender: String
position: String
phoneHome: String
phoneWork: String
phoneMobile: String
fax: String
}
AccountCostCentre¶
Account cost centre
type AccountCostCentre {
accountCostCentre: Int
account: Int
name: String
}
Required by¶
- Account
- A debtor record containing transactions
- Subscription
- A subscription to a service
- TxItem
- Transaction line item
AllAccountCursor¶
AllAccountCursor
type AllAccountCursor {
count: Int
# Arguments
# offset: [Not documented]
# limit: [Not documented]
objects(offset: Int, limit: Int): [Account]
}
AllDraftInvoiceCursor¶
AllDraftInvoiceCursor
type AllDraftInvoiceCursor {
count: Int
# Arguments
# offset: [Not documented]
# limit: [Not documented]
objects(offset: Int, limit: Int): [DraftInvoice]
}
AllInvoiceItemCursor¶
AllInvoiceItemCursor
type AllInvoiceItemCursor {
count: Int
# Arguments
# offset: [Not documented]
# limit: [Not documented]
objects(offset: Int, limit: Int): [ItemSpecification]
}
AllPlanCursor¶
AllPlanCursor
type AllPlanCursor {
count: Int
# Arguments
# offset: [Not documented]
# limit: [Not documented]
objects(offset: Int, limit: Int): [Plan]
}
AllSubscriptionCursor¶
AllSubscriptionCursor
type AllSubscriptionCursor {
count: Int
# Arguments
# offset: [Not documented]
# limit: [Not documented]
objects(offset: Int, limit: Int): [Subscription]
}
AllTicketCursor¶
AllTicketCursor
type AllTicketCursor {
count: Int
# Arguments
# offset: [Not documented]
# limit: [Not documented]
objects(offset: Int, limit: Int): [Ticket]
}
Binding¶
Account’s binding
type Binding {
tid: Int
bindingUuid: UUID
accountUuid: UUID
planUuid: UUID
planName: String
planCode: String
startTime_iso: String
startTime: Milliseconds
endTime_iso: String
endTime: Milliseconds
cancelled: Boolean
issueCycle: Int
issueFrequency: Int
chargeCycle: Int
chargeFrequency: Int
timezone: Int
active: Boolean
# Arguments
# filter: [Not documented]
SubscriptionBindings(filter: [SubscriptionBindingFilter]): SubscriptionBindingCursor
}
Required by¶
- BindingCursor
- null
- SubscriptionBinding
- Subscription’s binding
- TxItem
- Transaction line item
BindingCursor¶
type BindingCursor {
count: Int
# Arguments
# offset: [Not documented]
# limit: [Not documented]
objects(offset: Int, limit: Int): [Binding]
}
Cdr¶
Charge Data Record (CDR). In Smile, a CDR is a record of a single element of a billable event.
type Cdr {
tid: Int
ucdrUuid: UUID
cdrUuid: UUID
version: Int
modified_iso: String
modified: Milliseconds
subscriptionUuid: UUID
stid: Long
bindingUuid: UUID
aggregateUuid: UUID
effective_iso: String
effective: Milliseconds
duration: Long
cdrType: String
src: Long
dst: Long
tariffCode: String
quantity: Long
cost: BigDecimal
tariffType: Long
chargeAmount: BigDecimal
# Arguments
# filter: [Not documented]
Subscription(filter: [SubscriptionFilter]): Subscription
# Arguments
# filter: [Not documented]
Errors(filter: [CdrErrorFilter]): [CdrError]
# Arguments
# filter: [Not documented]
TariffType(filter: [TariffTypeFilter]): TariffType
}
CdrCursor¶
type CdrCursor {
count: Int
# Arguments
# offset: [Not documented]
# limit: [Not documented]
objects(offset: Int, limit: Int): [Cdr]
}
Required by¶
- Subscription
- A subscription to a service
CdrError¶
CDR processing errors. These are deleted once a CDR has been successfully processed.
type CdrError {
error: Long
logTime_iso: String
logTime: Milliseconds
tid: Int
ucdrUuid: UUID
cdrUuid: UUID
errorSource: String
errorType: String
errorLevel: String
args: [String]
}
DraftInvoice¶
Draft invoice
type DraftInvoice {
txdetailUuid: UUID
txDetail: Int
number: String
account: Int
ledgerTime_iso: String
ledgerTime: Milliseconds
creationTime_iso: String
creationTime: Milliseconds
closedDate_iso: String
closedDate: Milliseconds
dueDate_iso: String
dueDate: Milliseconds
amount: BigDecimal
taxAmount: BigDecimal
reportingAccount: Int
comments: String
version: Int
discount: BigDecimal
lateFeeTxItem: Int
# Arguments
# filter: [Not documented]
TxItems(filter: [TxItemFilter]): TxItemCursor
# Arguments
# filter: [Not documented]
Account(filter: [AccountFilter]): Account
}
Required by¶
- AllDraftInvoiceCursor
- AllDraftInvoiceCursor
- Query
- Smile’s GraphQL Query type
ItemSpecification¶
Item Description
type ItemSpecification {
itemSpecification: Int
itemCode: String
name: String
reportingAccount: Int
quantityDivisor: Int
quantityFormat: String
displayRate: String
displayOrder: Int
taxable: Boolean
taxSummaryItem: Boolean
quantityType: Int
defaultRate: BigDecimal
currency: String
taxTreatment: Int
custom: String
}
Required by¶
- AllInvoiceItemCursor
- AllInvoiceItemCursor
- TxItem
- Transaction line item
PaymentMethod¶
Saved payment details for an account
type PaymentMethod {
tid: Int
accountId: UUID
paymentMethod: UUID
hint: String
expiryDate: String
isDefault: Boolean
}
Plan¶
Plan
type Plan {
plan: String
service: Int
name: String
userDescription: String
operatorDescription: String
isSuspensionPlan: Boolean
firstAvailableDate: String
lastAvailableDate: String
custom: String
}
Required by¶
- AllPlanCursor
- AllPlanCursor
SearchResult¶
A single result from a search query.
type SearchResult {
# Highest ranking match for this account.
accountRank: Int!
# Rank of this result within the account.
resultRank: Int!
# The type of this result.
resultType: Int!
# Debtor item ID for this result, if any
debtorItem: Int
# Account associated with this result
account: Account!
# Subscription associated with this result, if any
sub: Subscription
}
Service¶
Service
type Service {
service: Int
name: String
realm: String
description: String
usernameLabel: String
}
Required by¶
- Subscription
- A subscription to a service
Subscription¶
A subscription to a service
type Subscription {
subscription: Long
subscriptionUuid: UUID
usn: String
username: String
account: Int
masterSubscription: Int
service: Int
ratingCycle: String
ratingCycleDay: Int
discount: Int
created_iso: String
created: Milliseconds
accountCostCentre: Int
description: String
taxable: Boolean
currency: String
timezone: Int
provisioned_iso: String
provisioned: Milliseconds
activated_iso: String
activated: Milliseconds
ordered_iso: String
ordered: Milliseconds
enabled_iso: String
enabled: Milliseconds
uoobject: Int
subscriptionStatus: String
purchaseOrder: UUID
custom: String
# Arguments
# filter: [Not documented]
Account(filter: [AccountFilter]): Account
# Arguments
# filter: [Not documented]
CostCentre(filter: [AccountCostCentreFilter]): AccountCostCentre
# Arguments
# filter: [Not documented]
Service(filter: [ServiceFilter]): Service
# Arguments
# filter: [Not documented]
Cdrs(filter: [CdrFilter]): CdrCursor
# Arguments
# filter: [Not documented]
SubscriptionBindings(filter: [SubscriptionBindingFilter]): SubscriptionBindingCursor
}
Required by¶
- AllSubscriptionCursor
- AllSubscriptionCursor
- Cdr
- Charge Data Record (CDR). In Smile, a CDR is a record of a single element of a billable event.
- Query
- Smile’s GraphQL Query type
- SearchResult
- A single result from a search query
- SubscriptionCursor
- null
- Ticket
- Tickets (work orders)
- TxItem
- Transaction line item
SubscriptionBinding¶
Subscription’s binding
type SubscriptionBinding {
tid: Int
subscriptionUuid: UUID
bindingUuid: UUID
startTime_iso: String
startTime: Milliseconds
endTime_iso: String
endTime: Milliseconds
timezone: Int
active: Boolean
# Arguments
# filter: [Not documented]
Binding(filter: [BindingFilter]): Binding
}
Required by¶
SubscriptionBindingCursor¶
type SubscriptionBindingCursor {
count: Int
# Arguments
# offset: [Not documented]
# limit: [Not documented]
objects(offset: Int, limit: Int): [SubscriptionBinding]
}
Required by¶
- Binding
- Account’s binding
- Subscription
- A subscription to a service
SubscriptionCursor¶
type SubscriptionCursor {
count: Int
# Arguments
# offset: [Not documented]
# limit: [Not documented]
objects(offset: Int, limit: Int): [Subscription]
}
TariffType¶
Tariff type
type TariffType {
tid: Int
tariffType: Long
rateType: String
path: [Long]
name: String
tariffTypeUuid: UUID
}
Ticket¶
Tickets (work orders)
type Ticket {
ticket: Int
number: String
ticketType: Int
ticketTypeName: String
ticketPriority: Int
ticketPriorityName: String
ticketStatus: Int
ticketStatusName: String
ticketGroup: Int
account: Int
targetSubscription: Int
targetTx: Int
submittingSubscription: Int
assignedOperator: Int
creationTime_iso: String
creationTime: Milliseconds
closedTime_iso: String
closedTime: Milliseconds
heldUntil_iso: String
heldUntil: Milliseconds
seconds: Int
summary: String
statusText: String
unread: Boolean
description: String
ticketUuid: UUID
# Arguments
# filter: [Not documented]
Account(filter: [AccountFilter]): Account
# Arguments
# filter: [Not documented]
AssignedOperator(filter: [SubscriptionFilter]): Subscription
}
Required by¶
- AllTicketCursor
- AllTicketCursor
- Query
- Smile’s GraphQL Query type
- TicketCursor
- null
TicketCursor¶
type TicketCursor {
count: Int
# Arguments
# offset: [Not documented]
# limit: [Not documented]
objects(offset: Int, limit: Int): [Ticket]
}
Tx¶
Information about a credit or debit that has been applied to an Account
type Tx {
tx: Long
txUuid: UUID
txDetail: Long
account: Long
txType: Int
txNumber: String
ledgerDate: String
ledgerTime_iso: String
ledgerTime: Milliseconds
currency: String
amount: BigDecimal
taxAmount: BigDecimal
unallocatedAmount: BigDecimal
creatingOperator: Int
creationTime_iso: String
creationTime: Milliseconds
comments: String
reportingAccount: Int
paymentPlan: Int
txDisposition: Int
referencedTx: Int
documentType: Int
stationery: Int
# Arguments
# filter: [Not documented]
TxDetail(filter: [TxDetailFilter]): TxDetail
# Arguments
# filter: [Not documented]
Account(filter: [AccountFilter]): Account
# Arguments
# filter: [Not documented]
TxItems(filter: [TxItemFilter]): TxItemCursor
}
TxDetail¶
Detailed information about a (possibly draft) transaction
type TxDetail {
txdetailUuid: UUID
txDetail: Long
number: String
account: Long
ledgerTime_iso: String
ledgerTime: Milliseconds
creationTime_iso: String
creationTime: Milliseconds
closedDate_iso: String
closedDate: Milliseconds
dueDate_iso: String
dueDate: Milliseconds
amount: BigDecimal
taxAmount: BigDecimal
reportingAccount: Int
comments: String
version: Int
discount: BigDecimal
lateFeeTxItem: Int
# Arguments
# filter: [Not documented]
TxItems(filter: [TxItemFilter]): TxItemCursor
# Arguments
# filter: [Not documented]
Account(filter: [AccountFilter]): Account
}
TxItem¶
Transaction line item
type TxItem {
txItem: Long
txDetail: Long
itemCode: String
lineNumber: Int
ratingPeriod: Int
itemSpecification: Int
taxDate: String
taxDurationDays: Int
description: String
quantity: BigDecimal
eventCount: Int
displayRate: String
generated: Boolean
amount: BigDecimal
subtotalAmount: BigDecimal
subscriptionUuid: UUID
taxSummaryItem: Boolean
taxSchedule: Int
tax: BigDecimal
taxable: Boolean
discount: Int
discountAmount: BigDecimal
purchaseOrder: UUID
rollupTxItem: Int
bindingUuid: UUID
costCentre: Int
# Arguments
# filter: [Not documented]
Subscription(filter: [SubscriptionFilter]): Subscription
# Arguments
# filter: [Not documented]
Binding(filter: [BindingFilter]): Binding
# Arguments
# filter: [Not documented]
CostCentre(filter: [AccountCostCentreFilter]): AccountCostCentre
# Arguments
# filter: [Not documented]
ItemSpecification(filter: [ItemSpecificationFilter]): ItemSpecification
}
Required by¶
- TxItemCursor
- null
TxItemCursor¶
type TxItemCursor {
count: Int
# Arguments
# offset: [Not documented]
# limit: [Not documented]
objects(offset: Int, limit: Int): [TxItem]
}
Required by¶
- DraftInvoice
- Draft invoice
- Tx
- Information about a credit or debit that has been applied to an Account
- TxDetail
- Detailed information about a (possibly draft) transaction
Ucdr¶
Unmediated CDR
type Ucdr {
tid: Int
ucdrUuid: UUID
created_iso: String
created: Milliseconds
cdr: String
source: Int
# Arguments
# filter: [Not documented]
Cdrs(filter: [CdrFilter]): [Cdr]
}
UnbilledChargeSummary¶
Charge view summary
type UnbilledChargeSummary {
count: Long
sum: BigDecimal
issuePeriodEnd: Long
}
__Directive¶
type __Directive {
name: String
description: String
locations: [__DirectiveLocation!]
args: [__InputValue!]!
onOperation: Boolean @deprecated( reason: "Use `locations`." )
onFragment: Boolean @deprecated( reason: "Use `locations`." )
onField: Boolean @deprecated( reason: "Use `locations`." )
}
__EnumValue¶
type __EnumValue {
name: String!
description: String
isDeprecated: Boolean!
deprecationReason: String
}
__Field¶
type __Field {
name: String!
description: String
args: [__InputValue!]!
type: __Type!
isDeprecated: Boolean!
deprecationReason: String
}
__InputValue¶
type __InputValue {
name: String!
description: String
type: __Type!
defaultValue: String
}
Require by¶
- __Directive
- null
- __Field
- null
- __Type
- null
__Schema¶
A GraphQL Introspection defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, the entry points for query, mutation, and subscription operations.
type __Schema {
# A list of all types supported by this server.
types: [__Type!]!
# The type that query operations will be rooted at.
queryType: __Type!
# If this server supports mutation, the type that mutation operations will be
# rooted at.
mutationType: __Type
# 'A list of all directives supported by this server.
directives: [__Directive!]!
# 'If this server support subscription, the type that subscription operations will
# be rooted at.
subscriptionType: __Type
}
Required by¶
This element is not required
__Type¶
type __Type {
kind: __TypeKind!
name: String
description: String
# Arguments
# includeDeprecated: [Not documented]
fields(includeDeprecated: Boolean): [__Field!]
interfaces: [__Type!]
possibleTypes: [__Type!]
# Arguments
# includeDeprecated: [Not documented]
enumValues(includeDeprecated: Boolean): [__EnumValue!]
inputFields: [__InputValue!]
ofType: __Type
}
Required by¶
- __Field
- null
- __InputValue
- null
- __Schema
- A GraphQL Introspection defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, the entry points for query, mutation, and subscription operations.
- __Type
- null
AccountAddressFilter¶
input AccountAddressFilter {
account: Int
addressType: Int
addressName: String
companyName: String
addressDetail: String
buildingName: String
subUnit: String
floor: String
lot: String
postalDeliveryType: String
streetNumber: String
streetName: String
streetType: String
suburb: String
state: String
postcode: String
country: String
}
AccountContactFilter¶
input AccountContactFilter {
account: Long
contactType: Int
contactName: String
companyName: String
tradingName: String
abn: String
contactTitle: String
familyName: String
givenName: String
dateOfBirth: String
gender: String
position: String
phoneHome: String
phoneWork: String
phoneMobile: String
fax: String
}
AccountCostCentreFilter¶
input AccountCostCentreFilter {
accountCostCentre: Int
account: Int
name: String
}
Required by¶
- Account
- A debtor record containing transactions
- Subscription
- A subscription to a service
- TxItem
- Transaction line item
AccountFilter¶
input AccountFilter {
account: Long
accountUuid: UUID
usn: String
alternateAccountNumber: String
accountType: Int
accountTerms: Int
accountDisposition: Int
discount: Int
creationTime: Milliseconds
accountCostCentre: Int
description: String
taxable: Boolean
taxSchedule: Int
currency: String
timezone: Int
uoobject: Int
custom: String
}
Required by¶
- DraftInvoice
- Draft invoice
- Query
- Smile’s GraphQL Query type
- Subscription
- A subscription to a service
- Ticket
- Tickets (work orders)
- Tx
- Information about a credit or debit that has been applied to an Account
- TxDetail
- Detailed information about a (possibly draft) transaction
BindingFilter¶
input BindingFilter {
tid: Int
bindingUuid: UUID
accountUuid: UUID
planUuid: UUID
planName: String
planCode: String
startTime: Milliseconds
endTime: Milliseconds
cancelled: Boolean
issueCycle: Int
issueFrequency: Int
chargeCycle: Int
chargeFrequency: Int
timezone: Int
active: Boolean
}
Required by¶
- Account
- A debtor record containing transactions
- SubscriptionBinding
- Subscription’s binding
- TxItem
- Transaction line item
CdrErrorFilter¶
input CdrErrorFilter {
error: Long
logTime: Milliseconds
tid: Int
ucdrUuid: UUID
cdrUuid: UUID
errorSource: String
errorType: String
errorLevel: String
args: [String]
}
CdrFilter¶
input CdrFilter {
tid: Int
ucdrUuid: UUID
cdrUuid: UUID
version: Int
modified: Milliseconds
subscriptionUuid: UUID
stid: Long
bindingUuid: UUID
aggregateUuid: UUID
effective: Milliseconds
duration: Long
cdrType: String
src: Long
dst: Long
tariffCode: String
quantity: Long
cost: BigDecimal
tariffType: Long
chargeAmount: BigDecimal
}
Required by¶
- Subscription
- A subscription to a service
- Ucdr
- Unmediated CDR
DraftInvoiceFilter¶
DraftInvoiceFilter
input DraftInvoiceFilter {
txdetailUuid: UUID
txDetail: Int
number: String
account: Int
ledgerTime: Milliseconds
creationTime: Milliseconds
closedDate: Milliseconds
dueDate: Milliseconds
amount: BigDecimal
taxAmount: BigDecimal
reportingAccount: Int
comments: String
version: Int
discount: BigDecimal
lateFeeTxItem: Int
}
ItemSpecificationFilter¶
input ItemSpecificationFilter {
itemSpecification: Int
itemCode: String
name: String
reportingAccount: Int
quantityDivisor: Int
quantityFormat: String
displayRate: String
displayOrder: Int
taxable: Boolean
taxSummaryItem: Boolean
quantityType: Int
defaultRate: BigDecimal
currency: String
taxTreatment: Int
custom: String
}
PaymentMethodFilter¶
input PaymentMethodFilter {
tid: Int
accountId: UUID
paymentMethod: UUID
hint: String
expiryDate: String
isDefault: Boolean
}
PlanFilter¶
PlanFilter
input PlanFilter {
plan: String
service: Int
name: String
userDescription: String
operatorDescription: String
isSuspensionPlan: Boolean
firstAvailableDate: String
lastAvailableDate: String
custom: String
}
ServiceFilter¶
input ServiceFilter {
service: Int
name: String
realm: String
description: String
usernameLabel: String
}
Required by¶
- Subscription
- A subscription to a service
SubscriptionBindingFilter¶
input SubscriptionBindingFilter {
tid: Int
subscriptionUuid: UUID
bindingUuid: UUID
startTime: Milliseconds
endTime: Milliseconds
timezone: Int
active: Boolean
}
Required by¶
- Binding
- Account’s binding
- Subscription
- A subscription to a service
SubscriptionFilter¶
input SubscriptionFilter {
subscription: Long
subscriptionUuid: UUID
usn: String
username: String
account: Int
masterSubscription: Int
service: Int
ratingCycle: String
ratingCycleDay: Int
discount: Int
created: Milliseconds
accountCostCentre: Int
description: String
taxable: Boolean
currency: String
timezone: Int
provisioned: Milliseconds
activated: Milliseconds
ordered: Milliseconds
enabled: Milliseconds
uoobject: Int
subscriptionStatus: String
purchaseOrder: UUID
custom: String
}
TariffTypeFilter¶
input TariffTypeFilter {
tid: Int
tariffType: Long
rateType: String
path: [Long]
name: String
tariffTypeUuid: UUID
}
TicketFilter¶
input TicketFilter {
ticket: Int
number: String
ticketType: Int
ticketTypeName: String
ticketPriority: Int
ticketPriorityName: String
ticketStatus: Int
ticketStatusName: String
ticketGroup: Int
account: Int
targetSubscription: Int
targetTx: Int
submittingSubscription: Int
assignedOperator: Int
creationTime: Milliseconds
closedTime: Milliseconds
heldUntil: Milliseconds
seconds: Int
summary: String
statusText: String
unread: Boolean
description: String
ticketUuid: UUID
}
TxDetailFilter¶
input TxDetailFilter {
txdetailUuid: UUID
txDetail: Long
number: String
account: Long
ledgerTime: Milliseconds
creationTime: Milliseconds
closedDate: Milliseconds
dueDate: Milliseconds
amount: BigDecimal
taxAmount: BigDecimal
reportingAccount: Int
comments: String
version: Int
discount: BigDecimal
lateFeeTxItem: Int
}
TxFilter¶
input TxFilter {
tx: Long
txUuid: UUID
txDetail: Long
account: Long
txType: Int
txNumber: String
ledgerDate: String
ledgerTime: Milliseconds
currency: String
amount: BigDecimal
taxAmount: BigDecimal
unallocatedAmount: BigDecimal
creatingOperator: Int
creationTime: Milliseconds
comments: String
reportingAccount: Int
paymentPlan: Int
txDisposition: Int
referencedTx: Int
documentType: Int
stationery: Int
}
TxItemFilter¶
input TxItemFilter {
txItem: Long
txDetail: Long
itemCode: String
lineNumber: Int
ratingPeriod: Int
itemSpecification: Int
taxDate: String
taxDurationDays: Int
description: String
quantity: BigDecimal
eventCount: Int
displayRate: String
generated: Boolean
amount: BigDecimal
subtotalAmount: BigDecimal
subscriptionUuid: UUID
taxSummaryItem: Boolean
taxSchedule: Int
tax: BigDecimal
taxable: Boolean
discount: Int
discountAmount: BigDecimal
purchaseOrder: UUID
rollupTxItem: Int
bindingUuid: UUID
costCentre: Int
}
Required by¶
- DraftInvoice
- Draft invoice
- Tx
- Information about a credit or debit that has been applied to an Account
- TxDetail
- Detailed information about a (possibly draft) transaction
create¶
The create REST API posts a structured JSON document to create accounts and services.
URL¶
https://smile.example.com/stage/api/orders
Method¶
POST
URL Params¶
No URL params exist for this request.
Document Format¶
Example:
{
"accounts" : [
{
"taxable" : true,
"packageId" : 27,
"comments" : "Comments",
"fax" : "(03) 9663 3555",
"ratingCycleDay" : 31,
"invoicingCycleDay" : 31,
"phoneContact" : {
"work" : "(03) 9663 3554",
"home" : "(03) 9663 3554",
"mobile" : "0411 888 000"
},
"releaseDelay" : 0,
"contactTitle" : "MR",
"givenName" : "John",
"familyName" : "Smith",
"abn" : "94 088 172 301",
"serviceAddress" : {
"country" : "Australia",
"postcode" : "3000",
"suburb" : "Melbourne",
"streetNumber" : "120",
"streetType" : "Road",
"streetName" : "Main",
"addressDetail" : "Main Building",
"state" : "Victoria"
},
"companyName" : "Example Telecom",
"billAddress" : {
"streetNumber" : "620",
"streetType" : "Street",
"streetName" : "Bourke",
"country" : "Australia",
"suburb" : "Melbourne",
"state" : "Victoria",
"postcode" : "3000"
},
"timezone" : "Australia/Victoria",
"alternateAccountNumber" : "abc111115",
"currency" : "AUD",
"tradingName" : "Example Telco",
"emailAddress" : "john.smith@example.com",
"dob":"1995-12-08"
"custom" : {
"sms_subscribe" : false,
"referrer" : "Acme Telecoms"
}
}
],
"subscriptions" : [
{
"releaseDelay" : 0,
"startTime" : 1514725200000,
"description" : "The A2 Start D Plan",
"plan" : "a2startd",
"username" : "john.adsl@example.com",
"currency" : "AUD",
"ratingCycleDay" : 31,
"invoicingCycleDay" : 31,
"timezone" : "Australia/Victoria",
"serviceId" : 382,
"custom" : {
"newsletter_subscribe" : true,
"productDescription" : "3G Wireless Modem",
"productCode" : "3gwifi",
"colour" : "Purple"
}
}
]
}
Account attributes¶
Field name | Data type | Description | Required? |
---|---|---|---|
USN | String | ||
alternateAccountNumber | String | AccountID from old system. Will be searchable in Smile and can be used for linking to the other import files. |
|
ratingCycleDay | Number | Default is the service’s period day or the company’s period day if there is no service’s period day. Default is 31 when there is no service’s period day or company’s period day. |
|
invoicingCycleDay | Number | Default is the service’s invoicing day or the company’s invoicing day if there is no service’s invoicing day. Default is 31 when there is no service’s invoicing day or company’s invoicing day. |
|
releaseDelay | Number | Default is company’s release delay | |
currency | String | Currency from Smile. The three letter ISO 4217 currency code of the payment amount. For example: AUD, USD, FJD. Default is package’s currency. |
|
accountTerms | Number | Acterms ID from Smile. Default is package’s account terms. |
|
taxable | Boolean | Default is True | |
packageId | Number | Package ID from Smile | Yes |
comments | String | ||
tradingName | String | ||
abn | String | ||
companyName | String | ||
contactTitle | String | ||
givenName | String | ||
familyName | String | ||
emailAddress | String | ||
serviceAddress | Json object | For more information, see serviceAddress attributes. | |
billAddress | Json object | For more information, see billAddress attributes. | |
phoneContact | Json object | For more information, see phoneContact attributes. | |
fax | String | ||
timezone | String | Full time zone name. For example: Australia/Adelaide. Timezone’s default will be company’s timezone |
|
dob | String | Format: yyyy-MM-dd For example: 2017-11-16 |
|
custom | Json object | Data is in code/value pairs. For example: {“test_text”:”value”,”is_bool”:true,”test_date”: “2018-12-08”, “test_number”:123.45} Note: Date must be in yyyy-MM-dd format. If there is no matching custom field from provided code in Smile, a new one will be created. |
serviceAddress attributes¶
Field name | Data type | Description | Required? |
---|---|---|---|
addressDetail | String | ||
streetNumber | String | ||
streetName | String | ||
streetType | String | Allowed values: “select code,name from addressLookup where lookupType = 0;”. Can be code or name. |
|
suburb | String | ||
postcode | String | ||
state | String | Allowed values: “select code,name from addressLookup where lookupType = 1;”. Can be code or name. |
|
country | String |
billAddress attributes¶
Field name | Data type | Description | Required? |
---|---|---|---|
addressDetail | String | ||
streetNumber | String | ||
streetName | String | ||
streetType | String | Allowable values: “select code,name from addressLookup where lookupType = 0;”. Can be code or name. |
|
suburb | String | ||
postcode | String | ||
state | String | Allowed values: “select code,name from addressLookup where lookupType = 1;”. Can be code or name. |
|
country | String |
phoneContact attributes¶
Field name | Data type | Description | Required? |
---|---|---|---|
work | String | ||
home | String | ||
mobile | String |
Subscription attributes¶
Field name | Data type | Description | Required? |
---|---|---|---|
accountId | Account UUID from Smile | Yes (if has no account in request) | |
serviceId | Service ID from Smile | Yes | |
username | String | ||
plan | String | Plan ID from Smile | |
startTime Number | Time in | milliseconds since the UNIX epoch (January 1, 1970 00:00:00 UTC) For example: 1514725200000 |
|
timezone | String | Full time zone name. For example: Australia/Adelaide. Default is inherited from account. |
|
description | String | ||
ratingCycleDay | Number | Default is inherited from account | |
invoicingCycleDay | Number | Default is inherited from account | |
releaseDelay | Number | Default is inherited from account | |
currency | String | Currency from Smile. The three letter ISO 4217 currency code of the payment amount. For example: AUD, USD, FJD. Default is inherited from account. |
|
custom | Json object | Data is in code/value pairs. For example: {“test_text”:”value”,”is_bool”:true,”test_date”: “2018-12-08”,”test_number”:123.45} Note: Date must be in yyyy-MM-dd format. If there is no matching custom field from provided code in Smile, a new one will be created. |
Success Response¶
This request returns a list of account UUID created and a list of subscription UUID created.
Note: Only 1 account create is supported.
Example:¶
Code: 200 (OK)
Content:
{
"accounts" : {
"0" : {
"uuid" : "25f17058-35dd-4647-a00b-536c915c83cf"
}
},
"subscriptions" : {
"0" : {
"uuid" : "dc120f6c-8c29-4e18-9944-c3b082ee1daa"
},
"1" : {
"uuid" : "e0d540b7-5f3c-4c4f-a022-8447dfcba5df"
}
}
}
Error Response¶
Example:¶
Code: 500 (Internal Server Error)
Description: Returned if an import of more than one account or more than 100 subscriptions is attempted.
Content: Not applicable.
Example:¶
Code: 200
CURRENCY_NOT_AVAILABLE
CURRENCY_NOT_FOUND
PACKAGE_NOT_PUBLISHED
PACKAGE_NOT_FOUND
PACKAGE_MISSING
NO_PACKAGE_FOR_CURRENCY
SERVICE_NOT_PUBLISHED
SERVICE_NOT_FOUND
SERVICE_NOT_VALID
SERVICE_MISSING
PLAN_NOT_FOUND
PLAN_NOT_PUBLISHED
PLAN_NOT_VALID
NO_PLAN_FOR_SERVICE
NO_PLAN_FOR_ACCOUNT
NOT_ACCOUNT
ACCOUNT_MISSING
TIMEZONE_NOT_FOUND
DUPLICATE_USERNAME
DUPLICATE_LEGACY_ACCOUNT_NUMBER
INTERNAL_ERROR
Content:
{
"accounts" : {
"0" : {
"errors" : [
"CURRENCY_NOT_FOUND",
"PACKAGE_NOT_FOUND"
]
}
},
"subscriptions" : {
"0" : {
"errors" : [
"NOT_ACCOUNT",
"CURRENCY_NOT_FOUND",
"SERVICE_NOT_FOUND",
"PLAN_NOT_FOUND"
]
},
"1" : {
"errors" : [
"NOT_ACCOUNT",
"CURRENCY_NOT_FOUND",
"SERVICE_NOT_FOUND",
"PLAN_NOT_FOUND"
]
}
}
}
Sample Call¶
POST /api/orders HTTP/1.1
URL: https://smile.example.com/test/api/orders
Content-Type:application/json
Accept:application/json
{
"accounts" : [
{
"taxable" : true,
"packageId" : 27,
"comments" : "Comments",
"fax" : "(03) 9663 3555",
"ratingCycleDay" : 31,
"invoicingCycleDay" : 31,
"phoneContact" : {
"work" : "(03) 9663 3554",
"home" : "(03) 9663 3554",
"mobile" : "0411 888 000"
},
"releaseDelay" : 0,
"contactTitle" : "MR",
"givenName" : "John",
"familyName" : "Smith",
"abn" : "94 088 172 301",
"serviceAddress" : {
"country" : "Australia",
"postcode" : "3000",
"suburb" : "Melbourne",
"streetNumber" : "120",
"streetType" : "Road",
"streetName" : "Main",
"addressDetail" : "Main Building",
"state" : "Victoria"
},
"companyName" : "Example Telecom",
"billAddress" : {
"streetNumber" : "620",
"streetType" : "Street",
"streetName" : "Bourke",
"country" : "Australia",
"suburb" : "Melbourne",
"state" : "Victoria",
"postcode" : "3000"
},
"timezone" : "Australia/Victoria",
"alternateAccountNumber" : "abc111115",
"currency" : "AUD",
"tradingName" : "Example Telco",
"emailAddress" : "john.smith@example.com",
"dob":"1995-12-08"
"custom" : {
"sms_subscribe" : false,
"referrer" : "Acme Telecoms"
}
}
],
"subscriptions" : [
{
"releaseDelay" : 0,
"startTime" : 1514725200000,
"description" : "The A2 Start D Plan",
"plan" : "a2startd",
"username" : "john.adsl@example.com",
"currency" : "AUD",
"ratingCycleDay" : 31,
"invoicingCycleDay" : 31,
"timezone" : "Australia/Victoria",
"serviceId" : 382,
"custom" : {
"newsletter_subscribe" : true,
"productDescription" : "3G Wireless Modem",
"productCode" : "3gwifi",
"colour" : "Purple"
}
}
]
account¶
The account REST API posts a structured JSON document to update an account.
URL¶
https://smile.example.com/stage/api/account/{id}/update
Method¶
POST
Document Format¶
Example:
{
"taxable" : true,
"releaseDelay" : 0,
"comments" : "Comments",
"contactTitle" : "MR",
"givenName" : "Alfred",
"familyName" : "Sample",
"abn" : "94 088 172 301",
"serviceAddress" : {
"addressDetail" : "Main Building",
"streetNumber" : "120",
"streetType" : "Road",
"streetName" : "Main",
"suburb" : "Melbourne",
"country" : "Australia",
"postcode" : "3000"
},
"companyName" : "Example Telecom",
"tradingName" : "Example Telco",
"billAddress" : {
"streetNumber" : "620",
"streetType" : "Street",
"streetName" : "Bourke",
"suburb" : "Melbourne",
"state" : "Victoria",
"country" : "Australia",
"postcode" : "3000"
},
"phoneContact" : {
"work" : "(03) 9663 3554",
"home" : "(03) 9663 3554",
"mobile" : "0411 888 000"
},
"fax" : "(03) 9663 3555",
"emailAddress" : "alfred.sample@example.com",
"dob" : "1995-12-08",
"accountType" : 1,
"accountTerms" : 1,
"custom" : {
"sms_subscribe" : false,
"referrer" : "Acme Telecoms"
}
}
Account attributes¶
Field name | Data type | Description | Required? |
---|---|---|---|
accountTerms | Number | Acterms ID from Smile. | |
releaseDelay | Number | ||
taxable | Boolean | ||
comments | String | ||
tradingName | String | ||
abn | String | ||
companyName | String | ||
contactTitle | String | ||
givenName | String | ||
familyName | String | ||
emailAddress | String | ||
serviceAddress | Json object | For more information, see serviceAddress attributes. | |
billAddress | Json object | For more information, see billAddress attributes. | |
phoneContact | Json object | For more information, see phoneContact attributes. | |
fax | String | ||
dob | String | Format: yyyy-MM-dd For example: 2017-11-16 |
|
accountType | Number | Account type from Smile. | |
custom | Json object | Data is in code/value pairs. Value can be an object or array. For example: {“test_text”:”value”,”is_bool”:true,”test_date”: “2018-12-08”,”test_number”: 123.45, “note”: [“Important note1”, “Important note2”]} Note: Date must be in yyyy-MM-dd format. If there is no matching custom field from provided code in Smile, a new one will be created. |
serviceAddress attributes¶
Field name | Data type | Description | Required? |
---|---|---|---|
addressDetail | String | ||
streetNumber | String | ||
streetName | String | ||
streetType | String | Allowed values: “select code,name from addressLookup where lookupType = 0;”. Can be code or name. |
|
suburb | String | ||
postcode | String | ||
state | String | Allowed values: “select code,name from addressLookup where lookupType = 1;”. Can be code or name. |
|
country | String |
billAddress attributes¶
Field name | Data type | Description | Required? |
---|---|---|---|
addressDetail | String | ||
streetNumber | String | ||
streetName | String | ||
streetType | String | Allowable values: “select code,name from addressLookup where lookupType = 0;”. Can be code or name. |
|
suburb | String | ||
postcode | String | ||
state | String | Allowed values: “select code,name from addressLookup where lookupType = 1;”. Can be code or name. |
|
country | String |
phoneContact attributes¶
Field name | Data type | Description | Required? |
---|---|---|---|
work | String | ||
home | String | ||
mobile | String |
Success Response¶
This request returns an account ID updated and status.
Example:¶
Code: 200 (OK)
Content:
{
“accountId”:"e5f946bb-6b31-4bbd-ae6c-247c54a57b4b",
“status":"UPDATED"
}
Error Response¶
Example:¶
Code: 500 (Internal Server Error)
Description: Returned if something fails during an update. You can find more details from the server’s log.
Content:
{
“accountId":"e5f946bb-6b31-4bbd-ae6c-247c54a57b4b",
“status":"INTERNAL_ERROR"
}
Example:¶
Code: 200
NOT_ACCOUNT
ACCOUNT_MISSING
TIMEZONE_NOT_FOUND
ACCOUNT_TYPE_NOT_FOUND
Content:
{
“accountId":"e5f946bb-6b31-4bbd-ae6c-247c54a57b4b",
“status":"ERROR",
“errors":[
“NOT_ACCOUNT",
"TIMEZONE_NOT_FOUND"
]
}
Sample Call¶
POST /api/account HTTP/1.1
URL: https://smile.example.com/test/api/account/e5f946bb-6b31-4bbd-ae6c-247c54a57b4b/update
Content-Type:application/json
Accept:application/json
{
"taxable" : true,
"releaseDelay" : 0,
"comments" : "Comments",
"contactTitle" : "MR",
"givenName" : "Alfred",
"familyName" : "Sample",
"abn" : "94 088 172 301",
"serviceAddress" : {
"addressDetail" : "Main Building",
"streetNumber" : "120",
"streetType" : "Road",
"streetName" : "Main",
"suburb" : "Melbourne",
"country" : "Australia",
"postcode" : "3000"
},
"companyName" : "Example Telecom",
"tradingName" : "Example Telco",
"billAddress" : {
"streetNumber" : "620",
"streetType" : "Street",
"streetName" : "Bourke",
"suburb" : "Melbourne",
"state" : "Victoria",
"country" : "Australia",
"postcode" : "3000"
},
"phoneContact" : {
"work" : "(03) 9663 3554",
"home" : "(03) 9663 3554",
"mobile" : "0411 888 000"
},
"fax" : "(03) 9663 3555",
"emailAddress" : "alfred.sample@example.com",
"dob" : "1995-12-08",
"accountType" : 1,
"accountTerms" : 1,
"custom" : {
"sms_subscribe" : false,
"referrer" : "Acme Telecoms"
}
}
subscription¶
The subscription REST API posts a structured JSON document to update a subscription.
URL¶
https://smile.example.com/stage/api/subscription/{id}/update
Method¶
POST
Document Format¶
Example:
{
"releaseDelay" : 0,
"timezone" : "Australia/Victoria",
"username" : "john.adsl@example.com",
"description" : "The A2 Start D Plan",
"custom" : {
"newsletter_subscribe" : true,
"productDescription" : "3G Wireless Modem"
}
}
Subscription attributes¶
Field name | Data type | Description | Required? |
---|---|---|---|
username | String | ||
description | String | ||
releaseDelay | Number | Default is inherited from account | |
timezone | String | Full time zone name. For example: Australia/Adelaide. |
|
custom | Json object | Data is in code/value pairs. Value can be an object or array. For example: {“test_text”:”value”,”is_bool”:true,”test_date”: “2018-12-08”,”test_number”:123.45, “note”: [“Important note1”, “Important note2”]} Note: Date must be in yyyy-MM-dd format. If there is no matching custom field from provided code in Smile, a new one will be created. |
Success Response¶
This request returns a subscription ID updated and status
Example:¶
Code: 200 (OK)
Content:
{
"subscriptionId":"e5f946bb-6b31-4bbd-ae6c-247c54a57b4b",
"status":"UPDATED"
}
Error Response¶
Example:¶
Code: 500 (Internal Server Error)
Description: Returned if something fails during an update. You can find more details from the server’s log.
Content:
{
"subscriptionId":"e5f946bb-6b31-4bbd-ae6c-247c54a57b4b",
"status":"INTERNAL_ERROR"
}
Example:¶
Code: 200
NOT_SUBSCRIPTION
SUBSCRIPTION_MISSING
TIMEZONE_NOT_FOUND
DUPLICATE_USERNAME
Content:
{
"subscriptionId":"e5f946bb-6b31-4bbd-ae6c-247c54a57b4b",
"status":"ERROR",
"errors":[
"NOT_SUBSCRIPTION",
"TIMEZONE_NOT_FOUND"
]
}
Sample Call¶
POST /api/subscription HTTP/1.1
URL: https://smile.example.com/test/api/subscription/e5f946bb-6b31-4bbd-ae6c-247c54a57b4b/update
Content-Type:application/json
Accept:application/json
{
"releaseDelay" : 0,
"timezone" : "Australia/Victoria",
"username" : "john.adsl@example.com",
"description" : "The A2 Start D Plan",
"custom" : {
"newsletter_subscribe" : true,
"productDescription" : "3G Wireless Modem"
}
}