Skip to content

Customer methods: activate, exempt

The Customer Verbs activate, exempt as typed SDK methods, with inputs, result, refusals and an example.

Reference for Customer, one group of Customer methods.

Customer.activate

Activate marks a Customer activated on an Offer once its declared activation Event reaches the count within the window. Verb page.

TypeScript
interface CustomerVerbs {
  activate(input: CustomerActivateInput, options?: SB.CallOptions): SB.Call<Customer>
}

Emits Customer.activated.

Inputs

InputTypeRequiredDescription
customerCustomerrequiredThe Customer who crossed the line.
offerOfferrequiredThe Offer whose activation was met.

Returns

OutputTypeRequiredDescription
customerCustomerrequiredThe activated Customer.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const customer = await $.Customer.activate({ customer: 'cus_K1BROJhqzZ', offer: 'offer_2hzYe1ERo0' })

Customer.exempt

Exempt records a Customer’s exemption or resale certificate, verifies it, and stops tax on its Orders where the certificate applies. Verb page.

TypeScript
interface CustomerVerbs {
  exempt(input: CustomerExemptInput, options?: SB.CallOptions): SB.Call<CustomerExemptOutput>
}

Emits Customer.exempted.

Inputs

InputTypeRequiredDescription
customerCustomerrequiredThe buying Customer.
certificateFilerequiredThe certificate as uploaded through the Portal or received by email.
jurisdictionsstring[]requiredWhere the certificate applies, such as US-TX.
expiresOndateWhen the certificate lapses; empty when it does not.

Returns

OutputTypeRequiredDescription
credentialCredentialrequiredThe certificate, held by the Customer’s Organization.
customerCustomerrequiredThe Customer, now exempt where the certificate applies.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const { credential, customer } = await $.Customer.exempt({ customer: 'cus_K1BROJhqzZ', certificate: 'file_V1AuhyCTsH', jurisdictions: ['US-TX'] })