Products · Dash API

Payments

Take a payment in Dash's own payment sheet, by linked account, card or mobile money, and read it back later.

dash.payments.request

TypeScript
dash.payments.request(options: PaymentOptions, callOptions?: PaymentCallOptions): DashRequest<PaymentResult>

Opens Dash's payment sheet, where the person pays for order with one of methods. The money goes to the Space that owns the dot.

Before the person picks a method, it can reject with:

  • invalid: Monime won't take the order, such as one below its smallest amount.
  • denied: the dot or its Space can't take payments now, or this dot's payment sheet is already open. The open sheet carries on.
  • failed: Dash couldn't reach Monime.
  • cancelled: the person closed the sheet.
  • timeout: the sheet waited as long as Dash allows.

Once they pick a method, it resolves with the payment's status: completed, pending, expired, or cancelled if they closed the sheet. If a method fails, the sheet stays open for them to try again. From then on, cancel() only stops your code waiting; the payment goes on. Read it again later with get.

Permission in dot.json: payments.

Types: PaymentOptions, PaymentCallOptions, PaymentResult

dash.payments.get

TypeScript
dash.payments.get(reference: string, callOptions?: CallOptions): DashRequest<PaymentResult | undefined>

The payment for the order with this reference, to check a pending one later or after the dot opens again. Undefined if this dot never asked for it, or the person never picked a method.

Permission in dot.json: payments.

Types: PaymentResult

Types

Money

FieldTypeWhat it is
currency'SLE' | 'USD'
valuenumberIn minor units, as in Monime's API: SLE 75.00 is 7500.

OrderLineItem

FieldTypeWhat it is
namestring
unitPriceMoney
quantity (optional)number1 to 100,000. Default: 1.
imageUrl (optional)stringAn https picture Dash shows beside the item. Its host must be in network.hosts in dot.json.

Order

FieldTypeWhat it is
namestringWhat the person is paying for, such as "Jazz Night tickets". 3 to 64 characters.
referencestringThe dot's own ID for the order, up to 64 characters. The same reference never pays twice: asking again gives back the first payment.
description (optional)string
lineItemsOrderLineItem[]1 to 16 items, all in one currency. Dash adds them up for the total.
metadata (optional)Record<string, string>Up to 64 pairs, with keys up to 48 characters and values up to 100. They stay with the payment and its webhooks. Keys can't start with "@", "_" or "monime", which Monime keeps for itself.

MomoProvider

Monime's IDs for the mobile money providers: m17 is Orange Money and m18 is Africell Money.

TypeScript
type MomoProvider = 'm17' | 'm18';

LinkProvider

Monime's IDs for the banks a linked account can be at.

TypeScript
type LinkProvider = 'slb001' | 'slb004' | 'slb007' | 'slb009' | 'slb013';

LinkMethod

FieldTypeWhat it is
type'link'
providers (optional)LinkProvider[]The only banks that can pay. Empty or left out means any.

CardMethod

FieldTypeWhat it is
type'card'

MomoMethod

FieldTypeWhat it is
type'momo'
providers (optional)MomoProvider[]The only providers that can pay. Empty or left out means both.
phoneNumber (optional)stringOnly this number can pay, such as "+23276123456".

PaymentMethod

TypeScript
type PaymentMethod = LinkMethod | CardMethod | MomoMethod;

Types: LinkMethod, CardMethod, MomoMethod

PaymentOptions

FieldTypeWhat it is
orderOrder
methods (optional)PaymentMethod[]The methods to offer, in order, each with its own settings. Leave it out for all three with no limits.
financialAccountId (optional)stringThe financial account the money goes to, such as "fac-k6VgVTfSmLruHpiQgMg4DUeySZx". It must belong to the Space that owns the dot and hold the order's currency. Leave it out for the Space's main account.

PaymentStatus

failed comes only from get, for a pending payment that failed later.

TypeScript
type PaymentStatus = 'pending' | 'completed' | 'failed' | 'expired' | 'cancelled';

CardPaymentResult

Also has the fields of PaymentResultBase.

FieldTypeWhat it is
method'card'
checkoutSessionIdstringThe Monime checkout session the card paid through.

MomoPaymentResult

Also has the fields of PaymentResultBase.

FieldTypeWhat it is
method'momo'
paymentCodeIdstringThe Monime payment code the mobile money paid through.

LinkPaymentResult

Also has the fields of PaymentResultBase.

FieldTypeWhat it is
method'link'
paymentIdstringThe Monime payment the linked account made.

PaymentResult

TypeScript
type PaymentResult = CardPaymentResult | MomoPaymentResult | LinkPaymentResult;

Types: CardPaymentResult, MomoPaymentResult, LinkPaymentResult

PaymentCallOptions

No timeout: Dash decides how long the sheet waits.

TypeScript
type PaymentCallOptions = Omit<CallOptions, 'timeout'>;

Types: CallOptions

PaymentResultBase

FieldTypeWhat it is
referencestringThe order's reference.
requestIdstringDash's ID for the payment request. Give it to Monime's support when asking about a payment.
statusPaymentStatusHow the payment stands now.
amountMoneyThe order's total.
paymentId (optional)stringMonime's payment, such as "pay-…", once there is one.
orderNumber (optional)stringMonime's number for the order, for the person's receipt and for support. Only once the payment has completed.

Keep reading