Order .place
POST /{namespace}/orders/place
Place commits a Customer to buy an Offer once and records the Offer Version and price at that moment.
- Noun
- Order
- Mode
do- Event
Order.placed
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
offer | Offer | required | The Offer to buy. |
quantity | integer | Units. Defaults to 1. | |
promotionCode | string | A promotion code the buyer typed; applies its Coupon when the Coupon covers the Offer. |
Outputs
| Output | Type | Required | Description |
|---|---|---|---|
order | Order | required | The placed Order. |
Effects
- Emits
Order.placed. - Performed by the Founder.
- Two-way: it runs at once, in the
try,sendanddomodes. - Makes the party a Customer when it is not one yet.
- Says before charging whether the Startup can deliver.
- Computes tax through Stripe Tax on the Startup’s own account, as seller of record, and records it on the Order before payment.
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The input does not match the schema of the operation. | invalid-input | Read the schema of the operation, then send every required field with the right type. | Order.place |
| The operation is part of an Offer the caller has not accepted or paid for. | payment-required | Accept the Offer named in the response, then retry the call. | Offer.accept |
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | Order.place |
| The record is not in a state that allows this Verb, so the call is refused. | refused | Read the record, run the Verb that moves it to an allowed state, then retry. | Order.place |
When it waits
| Gate | Default |
|---|---|
| Decision class | Low: two-way, nothing at stake |
| Delay window | None: it runs once review passes. |
| Limit | The call Limit of the Permission it runs under. |
| Over the Limit | It waits pending for an Approval from the Founder. Approved, it runs; refused, it ends refused with limit-exceeded; unanswered by its deadline, it ends canceled. |