Depot sales orders
Registers the sales-order routes on psaMux (msp only).
This page is generated from the Depot route table. Every operation carries the permission it needs and the anchor an agent can link to.
GET /api/v1/sales/orders
Section titled “GET /api/v1/sales/orders”GETcrm:readmsp facemspIdempotent
Source: [object Object]
listOrders lists sales orders, newest first by default.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
dir | query | string, one of asc, desc | No | Sort direction. |
page | query | integer | No | One-based page number. Defaults to 1. |
pageSize | query | integer | No | Rows per page, 1 to 200. Defaults to 50. |
q | query | string | No | Free-text search term. |
sort | query | string, one of number, ordered, total | No | Sort key. |
status | query | string, one of cancelled, closed, fulfilled, open, partially_fulfilled | No | Comma-separated set. An unrecognised value is refused. |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, PagedResultSoSummaryView | Success. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold crm:read. |
404 | application/problem+json, ProblemDetails | No resource matches. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state of the order. |
412 | application/problem+json, ProblemDetails | Someone else changed this since you opened it. Reload and try again. |
500 | application/problem+json, ProblemDetails | The request failed. |
200 response body
| Field | Type | Description |
|---|---|---|
itemsrequired | array of SoSummaryView | |
items[].clientIdrequired | string | |
items[].clientNamerequired | string | |
items[].invoiceModerequired | string | |
items[].orderedAtrequired | string (date-time) | |
items[].originrequired | string | |
items[].ownerName | string or null | |
items[].publicIdrequired | string | |
items[].soNumberrequired | string | |
items[].statusrequired | string | |
items[].totalCentsrequired | integer | int64. |
pagerequired | integer | |
pageSizerequired | integer | |
totalrequired | integer |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X GET 'https://depot.example.com/api/v1/sales/orders?dir=asc&page=0&pageSize=0&q=<q>&sort=number&status=cancelled' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Get ` -Uri 'https://depot.example.com/api/v1/sales/orders?dir=asc&page=0&pageSize=0&q=<q>&sort=number&status=cancelled' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/sales/orders"params = { "dir": "asc", "page": "0", "pageSize": "0", "q": "<q>", "sort": "number", "status": "cancelled",}headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.get(url, params=params, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/sales/orders?dir=asc&page=0&pageSize=0&q=<q>&sort=number&status=cancelled", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = new URL("https://depot.example.com/api/v1/sales/orders");url.searchParams.set("dir", "asc");url.searchParams.set("page", "0");url.searchParams.set("pageSize", "0");url.searchParams.set("q", "<q>");url.searchParams.set("sort", "number");url.searchParams.set("status", "cancelled");
const response = await fetch(url, { method: "GET", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/sales/orders?dir=asc&page=0&pageSize=0&q=<q>&sort=number&status=cancelled");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());POST /api/v1/sales/orders
Section titled “POST /api/v1/sales/orders”POSTcrm:writemsp facemsp
Source: [object Object]
createOrder raises a manual sales order (no quote).
The invoice mode defaults to the practice’s; a manual order carries no deposit, because there is no acceptance invoice to charge it on.
Request body
Section titled “Request body”Required, sent as application/json.
The body is any.
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
201 | application/json, SoView | Created. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold crm:write. |
404 | application/problem+json, ProblemDetails | No resource matches. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state of the order. |
412 | application/problem+json, ProblemDetails | Someone else changed this since you opened it. Reload and try again. |
500 | application/problem+json, ProblemDetails | The request failed. |
201 response body
| Field | Type | Description |
|---|---|---|
cancelReasonrequired | string | |
cancelledAt | string (date-time) or null | |
clientIdrequired | string | |
clientNamerequired | string | |
closedAt | string (date-time) or null | |
customerPorequired | string | |
depositBasisPointsrequired | integer | |
depositCentsrequired | integer | int64. |
depositInvoiceId | string or null | |
fulfilledAt | string (date-time) or null | |
invoiceModerequired | string | |
linesrequired | array of SoLineView | |
lines[].catalogItemId | string or null | |
lines[].descriptionrequired | string | |
lines[].discountBasisPointsrequired | integer | |
lines[].fulfillablerequired | boolean | |
lines[].kindrequired | string | |
lines[].positionrequired | integer | |
lines[].publicIdrequired | string | |
lines[].qtyCancelledrequired | string | |
lines[].qtyFulfilledrequired | string | |
lines[].qtyInvoicedrequired | string | |
lines[].qtyOnOrderrequired | string | |
lines[].quantityrequired | string | |
lines[].rowVersionrequired | integer | int64. |
lines[].serializedrequired | boolean | |
lines[].stockItemId | string or null | |
lines[].taxablerequired | boolean | |
lines[].unitrequired | string | |
lines[].unitCostCentsrequired | integer | int64. |
lines[].unitPriceCentsrequired | integer | int64. |
notesrequired | string | |
opportunityId | string or null | |
opportunityName | string or null | |
orderedAtrequired | string (date-time) | |
originrequired | string | |
ownerName | string or null | |
ownerUserId | string or null | |
publicIdrequired | string | |
quoteId | string or null | |
quoteNumber | string or null | |
rowVersionrequired | integer | int64. |
soNumberrequired | string | |
statusrequired | string | |
subtotalCentsrequired | integer | int64. |
taxCentsrequired | integer | int64. |
taxRateBasisPointsrequired | integer | |
totalCentsrequired | integer | int64. |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.curl -X POST 'https://depot.example.com/api/v1/sales/orders' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -b 'outpost_console=<console-session>' \ --data '"string"'# Sign in first. outpost_console is a session cookie, so send it with every request.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Content-Type' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$body = @'"string"'@
$response = Invoke-RestMethod ` -Method Post ` -Uri 'https://depot.example.com/api/v1/sales/orders' ` -Headers $headers ` -ContentType 'application/json' ` -Body $body
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.
import requests
url = "https://depot.example.com/api/v1/sales/orders"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json",}cookies = { "outpost_console": "<console-session>",}payload = "string"
response = requests.post(url, headers=headers, cookies=cookies, json=payload, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.package main
import ( "bytes" "fmt" "io" "log" "net/http")
func main() { body := []byte(`"string"`)
req, err := http.NewRequest(http.MethodPost, "https://depot.example.com/api/v1/sales/orders", bytes.NewReader(body)) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.Header.Set("Content-Type", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/sales/orders";
const response = await fetch(url, { method: "POST", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json", }, credentials: "include", body: JSON.stringify("string"),});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.
using System;using System.Net.Http;using System.Text;
using var client = new HttpClient();
const string body = """"string"""";
var request = new HttpRequestMessage(HttpMethod.Post, "https://depot.example.com/api/v1/sales/orders");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");request.Content = new StringContent(body, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());GET /api/v1/sales/orders/{id}
Section titled “GET /api/v1/sales/orders/{id}”GETcrm:readmsp facemspIdempotent
Source: [object Object]
getOrder answers one sales order with its lines.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | A uuid. |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, SoView | Success. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold crm:read. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state of the order. |
412 | application/problem+json, ProblemDetails | Someone else changed this since you opened it. Reload and try again. |
500 | application/problem+json, ProblemDetails | The request failed. |
200 response body
| Field | Type | Description |
|---|---|---|
cancelReasonrequired | string | |
cancelledAt | string (date-time) or null | |
clientIdrequired | string | |
clientNamerequired | string | |
closedAt | string (date-time) or null | |
customerPorequired | string | |
depositBasisPointsrequired | integer | |
depositCentsrequired | integer | int64. |
depositInvoiceId | string or null | |
fulfilledAt | string (date-time) or null | |
invoiceModerequired | string | |
linesrequired | array of SoLineView | |
lines[].catalogItemId | string or null | |
lines[].descriptionrequired | string | |
lines[].discountBasisPointsrequired | integer | |
lines[].fulfillablerequired | boolean | |
lines[].kindrequired | string | |
lines[].positionrequired | integer | |
lines[].publicIdrequired | string | |
lines[].qtyCancelledrequired | string | |
lines[].qtyFulfilledrequired | string | |
lines[].qtyInvoicedrequired | string | |
lines[].qtyOnOrderrequired | string | |
lines[].quantityrequired | string | |
lines[].rowVersionrequired | integer | int64. |
lines[].serializedrequired | boolean | |
lines[].stockItemId | string or null | |
lines[].taxablerequired | boolean | |
lines[].unitrequired | string | |
lines[].unitCostCentsrequired | integer | int64. |
lines[].unitPriceCentsrequired | integer | int64. |
notesrequired | string | |
opportunityId | string or null | |
opportunityName | string or null | |
orderedAtrequired | string (date-time) | |
originrequired | string | |
ownerName | string or null | |
ownerUserId | string or null | |
publicIdrequired | string | |
quoteId | string or null | |
quoteNumber | string or null | |
rowVersionrequired | integer | int64. |
soNumberrequired | string | |
statusrequired | string | |
subtotalCentsrequired | integer | int64. |
taxCentsrequired | integer | int64. |
taxRateBasisPointsrequired | integer | |
totalCentsrequired | integer | int64. |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X GET 'https://depot.example.com/api/v1/sales/orders/<id>' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Get ` -Uri 'https://depot.example.com/api/v1/sales/orders/<id>' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/sales/orders/<id>"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.get(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/sales/orders/<id>", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/sales/orders/<id>";
const response = await fetch(url, { method: "GET", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/sales/orders/<id>");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());PATCH /api/v1/sales/orders/{id}
Section titled “PATCH /api/v1/sales/orders/{id}”PATCHcrm:writemsp facemspIdempotent
Source: [object Object]
patchOrder edits the header: owner, customer PO and notes.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | A uuid. |
Request body
Section titled “Request body”Required, sent as application/json.
The body is any.
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, SoView | Success. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold crm:write. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state of the order. |
412 | application/problem+json, ProblemDetails | Someone else changed this since you opened it. Reload and try again. |
500 | application/problem+json, ProblemDetails | The request failed. |
200 response body
| Field | Type | Description |
|---|---|---|
cancelReasonrequired | string | |
cancelledAt | string (date-time) or null | |
clientIdrequired | string | |
clientNamerequired | string | |
closedAt | string (date-time) or null | |
customerPorequired | string | |
depositBasisPointsrequired | integer | |
depositCentsrequired | integer | int64. |
depositInvoiceId | string or null | |
fulfilledAt | string (date-time) or null | |
invoiceModerequired | string | |
linesrequired | array of SoLineView | |
lines[].catalogItemId | string or null | |
lines[].descriptionrequired | string | |
lines[].discountBasisPointsrequired | integer | |
lines[].fulfillablerequired | boolean | |
lines[].kindrequired | string | |
lines[].positionrequired | integer | |
lines[].publicIdrequired | string | |
lines[].qtyCancelledrequired | string | |
lines[].qtyFulfilledrequired | string | |
lines[].qtyInvoicedrequired | string | |
lines[].qtyOnOrderrequired | string | |
lines[].quantityrequired | string | |
lines[].rowVersionrequired | integer | int64. |
lines[].serializedrequired | boolean | |
lines[].stockItemId | string or null | |
lines[].taxablerequired | boolean | |
lines[].unitrequired | string | |
lines[].unitCostCentsrequired | integer | int64. |
lines[].unitPriceCentsrequired | integer | int64. |
notesrequired | string | |
opportunityId | string or null | |
opportunityName | string or null | |
orderedAtrequired | string (date-time) | |
originrequired | string | |
ownerName | string or null | |
ownerUserId | string or null | |
publicIdrequired | string | |
quoteId | string or null | |
quoteNumber | string or null | |
rowVersionrequired | integer | int64. |
soNumberrequired | string | |
statusrequired | string | |
subtotalCentsrequired | integer | int64. |
taxCentsrequired | integer | int64. |
taxRateBasisPointsrequired | integer | |
totalCentsrequired | integer | int64. |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X PATCH 'https://depot.example.com/api/v1/sales/orders/<id>' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -b 'outpost_console=<console-session>' \ --data '"string"'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Content-Type' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$body = @'"string"'@
$response = Invoke-RestMethod ` -Method Patch ` -Uri 'https://depot.example.com/api/v1/sales/orders/<id>' ` -Headers $headers ` -ContentType 'application/json' ` -Body $body
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/sales/orders/<id>"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json",}cookies = { "outpost_console": "<console-session>",}payload = "string"
response = requests.patch(url, headers=headers, cookies=cookies, json=payload, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "bytes" "fmt" "io" "log" "net/http")
func main() { body := []byte(`"string"`)
req, err := http.NewRequest(http.MethodPatch, "https://depot.example.com/api/v1/sales/orders/<id>", bytes.NewReader(body)) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.Header.Set("Content-Type", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/sales/orders/<id>";
const response = await fetch(url, { method: "PATCH", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json", }, credentials: "include", body: JSON.stringify("string"),});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;using System.Text;
using var client = new HttpClient();
const string body = """"string"""";
var request = new HttpRequestMessage(HttpMethod.Patch, "https://depot.example.com/api/v1/sales/orders/<id>");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");request.Content = new StringContent(body, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());POST /api/v1/sales/orders/{id}/cancel
Section titled “POST /api/v1/sales/orders/{id}/cancel”POSTcrm:writemsp facemspIdempotent
Source: [object Object]
cancelOrder cancels an order nothing has shipped from (409 hasFulfillments).
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | A uuid. |
Request body
Section titled “Request body”Required, sent as application/json.
| Field | Type | Description |
|---|---|---|
reasonrequired | string |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, SoView | Success. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold crm:write. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state of the order. |
412 | application/problem+json, ProblemDetails | Someone else changed this since you opened it. Reload and try again. |
500 | application/problem+json, ProblemDetails | The request failed. |
200 response body
| Field | Type | Description |
|---|---|---|
cancelReasonrequired | string | |
cancelledAt | string (date-time) or null | |
clientIdrequired | string | |
clientNamerequired | string | |
closedAt | string (date-time) or null | |
customerPorequired | string | |
depositBasisPointsrequired | integer | |
depositCentsrequired | integer | int64. |
depositInvoiceId | string or null | |
fulfilledAt | string (date-time) or null | |
invoiceModerequired | string | |
linesrequired | array of SoLineView | |
lines[].catalogItemId | string or null | |
lines[].descriptionrequired | string | |
lines[].discountBasisPointsrequired | integer | |
lines[].fulfillablerequired | boolean | |
lines[].kindrequired | string | |
lines[].positionrequired | integer | |
lines[].publicIdrequired | string | |
lines[].qtyCancelledrequired | string | |
lines[].qtyFulfilledrequired | string | |
lines[].qtyInvoicedrequired | string | |
lines[].qtyOnOrderrequired | string | |
lines[].quantityrequired | string | |
lines[].rowVersionrequired | integer | int64. |
lines[].serializedrequired | boolean | |
lines[].stockItemId | string or null | |
lines[].taxablerequired | boolean | |
lines[].unitrequired | string | |
lines[].unitCostCentsrequired | integer | int64. |
lines[].unitPriceCentsrequired | integer | int64. |
notesrequired | string | |
opportunityId | string or null | |
opportunityName | string or null | |
orderedAtrequired | string (date-time) | |
originrequired | string | |
ownerName | string or null | |
ownerUserId | string or null | |
publicIdrequired | string | |
quoteId | string or null | |
quoteNumber | string or null | |
rowVersionrequired | integer | int64. |
soNumberrequired | string | |
statusrequired | string | |
subtotalCentsrequired | integer | int64. |
taxCentsrequired | integer | int64. |
taxRateBasisPointsrequired | integer | |
totalCentsrequired | integer | int64. |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X POST 'https://depot.example.com/api/v1/sales/orders/<id>/cancel' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -b 'outpost_console=<console-session>' \ --data '{ "reason": "string"}'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Content-Type' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$body = @'{ "reason": "string"}'@
$response = Invoke-RestMethod ` -Method Post ` -Uri 'https://depot.example.com/api/v1/sales/orders/<id>/cancel' ` -Headers $headers ` -ContentType 'application/json' ` -Body $body
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/sales/orders/<id>/cancel"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json",}cookies = { "outpost_console": "<console-session>",}payload = { "reason": "string",}
response = requests.post(url, headers=headers, cookies=cookies, json=payload, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "bytes" "fmt" "io" "log" "net/http")
func main() { body := []byte(`{ "reason": "string"}`)
req, err := http.NewRequest(http.MethodPost, "https://depot.example.com/api/v1/sales/orders/<id>/cancel", bytes.NewReader(body)) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.Header.Set("Content-Type", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/sales/orders/<id>/cancel";
const response = await fetch(url, { method: "POST", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json", }, credentials: "include", body: JSON.stringify({ "reason": "string" }),});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;using System.Text;
using var client = new HttpClient();
const string body = """{ "reason": "string"}""";
var request = new HttpRequestMessage(HttpMethod.Post, "https://depot.example.com/api/v1/sales/orders/<id>/cancel");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");request.Content = new StringContent(body, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());POST /api/v1/sales/orders/{id}/close
Section titled “POST /api/v1/sales/orders/{id}/close”POSTcrm:writemsp facemspIdempotent
Source: [object Object]
closeOrder closes an order once everything has shipped or been cancelled.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | A uuid. |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, SoView | Success. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold crm:write. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state of the order. |
412 | application/problem+json, ProblemDetails | Someone else changed this since you opened it. Reload and try again. |
500 | application/problem+json, ProblemDetails | The request failed. |
200 response body
| Field | Type | Description |
|---|---|---|
cancelReasonrequired | string | |
cancelledAt | string (date-time) or null | |
clientIdrequired | string | |
clientNamerequired | string | |
closedAt | string (date-time) or null | |
customerPorequired | string | |
depositBasisPointsrequired | integer | |
depositCentsrequired | integer | int64. |
depositInvoiceId | string or null | |
fulfilledAt | string (date-time) or null | |
invoiceModerequired | string | |
linesrequired | array of SoLineView | |
lines[].catalogItemId | string or null | |
lines[].descriptionrequired | string | |
lines[].discountBasisPointsrequired | integer | |
lines[].fulfillablerequired | boolean | |
lines[].kindrequired | string | |
lines[].positionrequired | integer | |
lines[].publicIdrequired | string | |
lines[].qtyCancelledrequired | string | |
lines[].qtyFulfilledrequired | string | |
lines[].qtyInvoicedrequired | string | |
lines[].qtyOnOrderrequired | string | |
lines[].quantityrequired | string | |
lines[].rowVersionrequired | integer | int64. |
lines[].serializedrequired | boolean | |
lines[].stockItemId | string or null | |
lines[].taxablerequired | boolean | |
lines[].unitrequired | string | |
lines[].unitCostCentsrequired | integer | int64. |
lines[].unitPriceCentsrequired | integer | int64. |
notesrequired | string | |
opportunityId | string or null | |
opportunityName | string or null | |
orderedAtrequired | string (date-time) | |
originrequired | string | |
ownerName | string or null | |
ownerUserId | string or null | |
publicIdrequired | string | |
quoteId | string or null | |
quoteNumber | string or null | |
rowVersionrequired | integer | int64. |
soNumberrequired | string | |
statusrequired | string | |
subtotalCentsrequired | integer | int64. |
taxCentsrequired | integer | int64. |
taxRateBasisPointsrequired | integer | |
totalCentsrequired | integer | int64. |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X POST 'https://depot.example.com/api/v1/sales/orders/<id>/close' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Post ` -Uri 'https://depot.example.com/api/v1/sales/orders/<id>/close' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/sales/orders/<id>/close"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.post(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodPost, "https://depot.example.com/api/v1/sales/orders/<id>/close", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/sales/orders/<id>/close";
const response = await fetch(url, { method: "POST", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://depot.example.com/api/v1/sales/orders/<id>/close");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());GET /api/v1/sales/orders/{id}/events
Section titled “GET /api/v1/sales/orders/{id}/events”GETcrm:readmsp facemspIdempotent
Source: [object Object]
listOrderEvents answers the order’s timeline, newest first.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | A uuid. |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, array of SoEventView | Success. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold crm:read. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state of the order. |
412 | application/problem+json, ProblemDetails | Someone else changed this since you opened it. Reload and try again. |
500 | application/problem+json, ProblemDetails | The request failed. |
200 response body
| Field | Type | Description |
|---|---|---|
[].actorKindrequired | string | |
[].actorName | string or null | |
[].atrequired | string (date-time) | |
[].detailsrequired | any | Arbitrary JSON. |
[].kindrequired | string | |
[].publicIdrequired | string |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X GET 'https://depot.example.com/api/v1/sales/orders/<id>/events' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Get ` -Uri 'https://depot.example.com/api/v1/sales/orders/<id>/events' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/sales/orders/<id>/events"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.get(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/sales/orders/<id>/events", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/sales/orders/<id>/events";
const response = await fetch(url, { method: "GET", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/sales/orders/<id>/events");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());GET /api/v1/sales/orders/{id}/fulfillments
Section titled “GET /api/v1/sales/orders/{id}/fulfillments”GETcrm:readmsp facemspIdempotent
Source: [object Object]
listFulfillments answers the order’s delivery batches.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | A uuid. |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, array of SoFulfillmentView | Success. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold crm:read. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state of the order. |
412 | application/problem+json, ProblemDetails | Someone else changed this since you opened it. Reload and try again. |
500 | application/problem+json, ProblemDetails | The request failed. |
200 response body
| Field | Type | Description |
|---|---|---|
[].assetsMovedAt | string (date-time) or null | |
[].attemptsrequired | integer | |
[].completedAt | string (date-time) or null | |
[].createdAtrequired | string (date-time) | |
[].errorrequired | string | |
[].invoiceId | string or null | |
[].invoiceNumber | string or null | |
[].invoiceSkippedrequired | boolean | |
[].linesrequired | array of SoFulfillmentLineView | |
[].lines[].assetIdsrequired | array of string | |
[].lines[].descriptionrequired | string | |
[].lines[].publicIdrequired | string | |
[].lines[].qtyrequired | string | |
[].lines[].salesOrderLineIdrequired | string | |
[].lines[].sourceLocationId | string or null | |
[].lines[].sourceLocationName | string or null | |
[].lines[].unitCostCents | integer or null | int64. |
[].publicIdrequired | string | |
[].receiptId | string or null | |
[].requestedByName | string or null | |
[].sourceKindrequired | string | |
[].staterequired | string | |
[].stockPostedAt | string (date-time) or null |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X GET 'https://depot.example.com/api/v1/sales/orders/<id>/fulfillments' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Get ` -Uri 'https://depot.example.com/api/v1/sales/orders/<id>/fulfillments' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/sales/orders/<id>/fulfillments"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.get(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/sales/orders/<id>/fulfillments", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/sales/orders/<id>/fulfillments";
const response = await fetch(url, { method: "GET", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/sales/orders/<id>/fulfillments");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());POST /api/v1/sales/orders/{id}/fulfillments
Section titled “POST /api/v1/sales/orders/{id}/fulfillments”POSTinventory:writemsp facemspIdempotentNot fully resolved
What this page does not know
- response-status
These are parts of the route the extractor could not read from the source. Everything else on this page came straight from it.
Source: [object Object]
requestFulfillment queues a delivery batch from stock (idempotent by idempotencyKey: a repeat answers the first batch, 200).
so-fulfill posts the stock, moves the assets and raises the delivery invoice.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | A uuid. |
Request body
Section titled “Request body”Required, sent as application/json.
The body is any.
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, SoFulfillmentView | Success. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold inventory:write. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state of the order. |
412 | application/problem+json, ProblemDetails | Someone else changed this since you opened it. Reload and try again. |
500 | application/problem+json, ProblemDetails | The request failed. |
200 response body
| Field | Type | Description |
|---|---|---|
assetsMovedAt | string (date-time) or null | |
attemptsrequired | integer | |
completedAt | string (date-time) or null | |
createdAtrequired | string (date-time) | |
errorrequired | string | |
invoiceId | string or null | |
invoiceNumber | string or null | |
invoiceSkippedrequired | boolean | |
linesrequired | array of SoFulfillmentLineView | |
lines[].assetIdsrequired | array of string | |
lines[].descriptionrequired | string | |
lines[].publicIdrequired | string | |
lines[].qtyrequired | string | |
lines[].salesOrderLineIdrequired | string | |
lines[].sourceLocationId | string or null | |
lines[].sourceLocationName | string or null | |
lines[].unitCostCents | integer or null | int64. |
publicIdrequired | string | |
receiptId | string or null | |
requestedByName | string or null | |
sourceKindrequired | string | |
staterequired | string | |
stockPostedAt | string (date-time) or null |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X POST 'https://depot.example.com/api/v1/sales/orders/<id>/fulfillments' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -b 'outpost_console=<console-session>' \ --data '"string"'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Content-Type' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$body = @'"string"'@
$response = Invoke-RestMethod ` -Method Post ` -Uri 'https://depot.example.com/api/v1/sales/orders/<id>/fulfillments' ` -Headers $headers ` -ContentType 'application/json' ` -Body $body
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/sales/orders/<id>/fulfillments"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json",}cookies = { "outpost_console": "<console-session>",}payload = "string"
response = requests.post(url, headers=headers, cookies=cookies, json=payload, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "bytes" "fmt" "io" "log" "net/http")
func main() { body := []byte(`"string"`)
req, err := http.NewRequest(http.MethodPost, "https://depot.example.com/api/v1/sales/orders/<id>/fulfillments", bytes.NewReader(body)) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.Header.Set("Content-Type", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/sales/orders/<id>/fulfillments";
const response = await fetch(url, { method: "POST", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json", }, credentials: "include", body: JSON.stringify("string"),});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;using System.Text;
using var client = new HttpClient();
const string body = """"string"""";
var request = new HttpRequestMessage(HttpMethod.Post, "https://depot.example.com/api/v1/sales/orders/<id>/fulfillments");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");request.Content = new StringContent(body, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());POST /api/v1/sales/orders/{id}/fulfillments/{fid}/retry
Section titled “POST /api/v1/sales/orders/{id}/fulfillments/{fid}/retry”POSTinventory:writemsp facemspIdempotent
Source: [object Object]
retryFulfillment returns a failed batch to pending for so-fulfill.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
fid | path | string | Yes | A uuid. |
id | path | string | Yes | A uuid. |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, SoFulfillmentView | Success. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold inventory:write. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state of the order. |
412 | application/problem+json, ProblemDetails | Someone else changed this since you opened it. Reload and try again. |
500 | application/problem+json, ProblemDetails | The request failed. |
200 response body
| Field | Type | Description |
|---|---|---|
assetsMovedAt | string (date-time) or null | |
attemptsrequired | integer | |
completedAt | string (date-time) or null | |
createdAtrequired | string (date-time) | |
errorrequired | string | |
invoiceId | string or null | |
invoiceNumber | string or null | |
invoiceSkippedrequired | boolean | |
linesrequired | array of SoFulfillmentLineView | |
lines[].assetIdsrequired | array of string | |
lines[].descriptionrequired | string | |
lines[].publicIdrequired | string | |
lines[].qtyrequired | string | |
lines[].salesOrderLineIdrequired | string | |
lines[].sourceLocationId | string or null | |
lines[].sourceLocationName | string or null | |
lines[].unitCostCents | integer or null | int64. |
publicIdrequired | string | |
receiptId | string or null | |
requestedByName | string or null | |
sourceKindrequired | string | |
staterequired | string | |
stockPostedAt | string (date-time) or null |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X POST 'https://depot.example.com/api/v1/sales/orders/<id>/fulfillments/<fid>/retry' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Post ` -Uri 'https://depot.example.com/api/v1/sales/orders/<id>/fulfillments/<fid>/retry' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/sales/orders/<id>/fulfillments/<fid>/retry"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.post(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodPost, "https://depot.example.com/api/v1/sales/orders/<id>/fulfillments/<fid>/retry", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/sales/orders/<id>/fulfillments/<fid>/retry";
const response = await fetch(url, { method: "POST", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://depot.example.com/api/v1/sales/orders/<id>/fulfillments/<fid>/retry");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());GET /api/v1/sales/orders/{id}/invoices
Section titled “GET /api/v1/sales/orders/{id}/invoices”GETcrm:readmsp facemspIdempotent
Source: [object Object]
listOrderInvoices answers every invoice line billed for the order.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | A uuid. |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, array of SoInvoiceLinkView | Success. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold crm:read. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state of the order. |
412 | application/problem+json, ProblemDetails | Someone else changed this since you opened it. Reload and try again. |
500 | application/problem+json, ProblemDetails | The request failed. |
200 response body
| Field | Type | Description |
|---|---|---|
[].amountCentsrequired | integer | int64. |
[].createdAtrequired | string (date-time) | |
[].invoiceIdrequired | string | |
[].invoiceNumber | string or null | |
[].invoiceStatusrequired | string | |
[].kindrequired | string | |
[].publicIdrequired | string | |
[].qty | string or null | |
[].salesOrderLineId | string or null |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X GET 'https://depot.example.com/api/v1/sales/orders/<id>/invoices' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Get ` -Uri 'https://depot.example.com/api/v1/sales/orders/<id>/invoices' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/sales/orders/<id>/invoices"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.get(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/sales/orders/<id>/invoices", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/sales/orders/<id>/invoices";
const response = await fetch(url, { method: "GET", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/sales/orders/<id>/invoices");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());POST /api/v1/sales/orders/{id}/lines
Section titled “POST /api/v1/sales/orders/{id}/lines”POSTcrm:writemsp facemsp
Source: [object Object]
addOrderLine adds one line to an open order.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | A uuid. |
Request body
Section titled “Request body”Required, sent as application/json.
The body is any.
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
201 | application/json, SoView | Created. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold crm:write. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state of the order. |
412 | application/problem+json, ProblemDetails | Someone else changed this since you opened it. Reload and try again. |
500 | application/problem+json, ProblemDetails | The request failed. |
201 response body
| Field | Type | Description |
|---|---|---|
cancelReasonrequired | string | |
cancelledAt | string (date-time) or null | |
clientIdrequired | string | |
clientNamerequired | string | |
closedAt | string (date-time) or null | |
customerPorequired | string | |
depositBasisPointsrequired | integer | |
depositCentsrequired | integer | int64. |
depositInvoiceId | string or null | |
fulfilledAt | string (date-time) or null | |
invoiceModerequired | string | |
linesrequired | array of SoLineView | |
lines[].catalogItemId | string or null | |
lines[].descriptionrequired | string | |
lines[].discountBasisPointsrequired | integer | |
lines[].fulfillablerequired | boolean | |
lines[].kindrequired | string | |
lines[].positionrequired | integer | |
lines[].publicIdrequired | string | |
lines[].qtyCancelledrequired | string | |
lines[].qtyFulfilledrequired | string | |
lines[].qtyInvoicedrequired | string | |
lines[].qtyOnOrderrequired | string | |
lines[].quantityrequired | string | |
lines[].rowVersionrequired | integer | int64. |
lines[].serializedrequired | boolean | |
lines[].stockItemId | string or null | |
lines[].taxablerequired | boolean | |
lines[].unitrequired | string | |
lines[].unitCostCentsrequired | integer | int64. |
lines[].unitPriceCentsrequired | integer | int64. |
notesrequired | string | |
opportunityId | string or null | |
opportunityName | string or null | |
orderedAtrequired | string (date-time) | |
originrequired | string | |
ownerName | string or null | |
ownerUserId | string or null | |
publicIdrequired | string | |
quoteId | string or null | |
quoteNumber | string or null | |
rowVersionrequired | integer | int64. |
soNumberrequired | string | |
statusrequired | string | |
subtotalCentsrequired | integer | int64. |
taxCentsrequired | integer | int64. |
taxRateBasisPointsrequired | integer | |
totalCentsrequired | integer | int64. |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.curl -X POST 'https://depot.example.com/api/v1/sales/orders/<id>/lines' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -b 'outpost_console=<console-session>' \ --data '"string"'# Sign in first. outpost_console is a session cookie, so send it with every request.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Content-Type' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$body = @'"string"'@
$response = Invoke-RestMethod ` -Method Post ` -Uri 'https://depot.example.com/api/v1/sales/orders/<id>/lines' ` -Headers $headers ` -ContentType 'application/json' ` -Body $body
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.
import requests
url = "https://depot.example.com/api/v1/sales/orders/<id>/lines"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json",}cookies = { "outpost_console": "<console-session>",}payload = "string"
response = requests.post(url, headers=headers, cookies=cookies, json=payload, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.package main
import ( "bytes" "fmt" "io" "log" "net/http")
func main() { body := []byte(`"string"`)
req, err := http.NewRequest(http.MethodPost, "https://depot.example.com/api/v1/sales/orders/<id>/lines", bytes.NewReader(body)) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.Header.Set("Content-Type", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/sales/orders/<id>/lines";
const response = await fetch(url, { method: "POST", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json", }, credentials: "include", body: JSON.stringify("string"),});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.
using System;using System.Net.Http;using System.Text;
using var client = new HttpClient();
const string body = """"string"""";
var request = new HttpRequestMessage(HttpMethod.Post, "https://depot.example.com/api/v1/sales/orders/<id>/lines");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");request.Content = new StringContent(body, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());PATCH /api/v1/sales/orders/{id}/lines/{lineId}
Section titled “PATCH /api/v1/sales/orders/{id}/lines/{lineId}”PATCHcrm:writemsp facemspIdempotent
Source: [object Object]
patchOrderLine edits one line; the quantity cannot drop below what is fulfilled, cancelled, being shipped or invoiced (409 quantityBelowFulfilled).
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | A uuid. |
lineId | path | string | Yes |
Request body
Section titled “Request body”Required, sent as application/json.
The body is any.
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, SoView | Success. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold crm:write. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state of the order. |
412 | application/problem+json, ProblemDetails | Someone else changed this since you opened it. Reload and try again. |
500 | application/problem+json, ProblemDetails | The request failed. |
200 response body
| Field | Type | Description |
|---|---|---|
cancelReasonrequired | string | |
cancelledAt | string (date-time) or null | |
clientIdrequired | string | |
clientNamerequired | string | |
closedAt | string (date-time) or null | |
customerPorequired | string | |
depositBasisPointsrequired | integer | |
depositCentsrequired | integer | int64. |
depositInvoiceId | string or null | |
fulfilledAt | string (date-time) or null | |
invoiceModerequired | string | |
linesrequired | array of SoLineView | |
lines[].catalogItemId | string or null | |
lines[].descriptionrequired | string | |
lines[].discountBasisPointsrequired | integer | |
lines[].fulfillablerequired | boolean | |
lines[].kindrequired | string | |
lines[].positionrequired | integer | |
lines[].publicIdrequired | string | |
lines[].qtyCancelledrequired | string | |
lines[].qtyFulfilledrequired | string | |
lines[].qtyInvoicedrequired | string | |
lines[].qtyOnOrderrequired | string | |
lines[].quantityrequired | string | |
lines[].rowVersionrequired | integer | int64. |
lines[].serializedrequired | boolean | |
lines[].stockItemId | string or null | |
lines[].taxablerequired | boolean | |
lines[].unitrequired | string | |
lines[].unitCostCentsrequired | integer | int64. |
lines[].unitPriceCentsrequired | integer | int64. |
notesrequired | string | |
opportunityId | string or null | |
opportunityName | string or null | |
orderedAtrequired | string (date-time) | |
originrequired | string | |
ownerName | string or null | |
ownerUserId | string or null | |
publicIdrequired | string | |
quoteId | string or null | |
quoteNumber | string or null | |
rowVersionrequired | integer | int64. |
soNumberrequired | string | |
statusrequired | string | |
subtotalCentsrequired | integer | int64. |
taxCentsrequired | integer | int64. |
taxRateBasisPointsrequired | integer | |
totalCentsrequired | integer | int64. |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X PATCH 'https://depot.example.com/api/v1/sales/orders/<id>/lines/<lineId>' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -b 'outpost_console=<console-session>' \ --data '"string"'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Content-Type' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$body = @'"string"'@
$response = Invoke-RestMethod ` -Method Patch ` -Uri 'https://depot.example.com/api/v1/sales/orders/<id>/lines/<lineId>' ` -Headers $headers ` -ContentType 'application/json' ` -Body $body
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/sales/orders/<id>/lines/<lineId>"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json",}cookies = { "outpost_console": "<console-session>",}payload = "string"
response = requests.patch(url, headers=headers, cookies=cookies, json=payload, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "bytes" "fmt" "io" "log" "net/http")
func main() { body := []byte(`"string"`)
req, err := http.NewRequest(http.MethodPatch, "https://depot.example.com/api/v1/sales/orders/<id>/lines/<lineId>", bytes.NewReader(body)) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.Header.Set("Content-Type", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/sales/orders/<id>/lines/<lineId>";
const response = await fetch(url, { method: "PATCH", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json", }, credentials: "include", body: JSON.stringify("string"),});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;using System.Text;
using var client = new HttpClient();
const string body = """"string"""";
var request = new HttpRequestMessage(HttpMethod.Patch, "https://depot.example.com/api/v1/sales/orders/<id>/lines/<lineId>");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");request.Content = new StringContent(body, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());POST /api/v1/sales/orders/{id}/lines/{lineId}/cancel
Section titled “POST /api/v1/sales/orders/{id}/lines/{lineId}/cancel”POSTcrm:writemsp facemspIdempotent
Source: [object Object]
cancelOrderLine cancels part or all of a line’s open quantity.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | A uuid. |
lineId | path | string | Yes |
Request body
Section titled “Request body”Required, sent as application/json.
The body is any.
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, SoView | Success. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold crm:write. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state of the order. |
412 | application/problem+json, ProblemDetails | Someone else changed this since you opened it. Reload and try again. |
500 | application/problem+json, ProblemDetails | The request failed. |
200 response body
| Field | Type | Description |
|---|---|---|
cancelReasonrequired | string | |
cancelledAt | string (date-time) or null | |
clientIdrequired | string | |
clientNamerequired | string | |
closedAt | string (date-time) or null | |
customerPorequired | string | |
depositBasisPointsrequired | integer | |
depositCentsrequired | integer | int64. |
depositInvoiceId | string or null | |
fulfilledAt | string (date-time) or null | |
invoiceModerequired | string | |
linesrequired | array of SoLineView | |
lines[].catalogItemId | string or null | |
lines[].descriptionrequired | string | |
lines[].discountBasisPointsrequired | integer | |
lines[].fulfillablerequired | boolean | |
lines[].kindrequired | string | |
lines[].positionrequired | integer | |
lines[].publicIdrequired | string | |
lines[].qtyCancelledrequired | string | |
lines[].qtyFulfilledrequired | string | |
lines[].qtyInvoicedrequired | string | |
lines[].qtyOnOrderrequired | string | |
lines[].quantityrequired | string | |
lines[].rowVersionrequired | integer | int64. |
lines[].serializedrequired | boolean | |
lines[].stockItemId | string or null | |
lines[].taxablerequired | boolean | |
lines[].unitrequired | string | |
lines[].unitCostCentsrequired | integer | int64. |
lines[].unitPriceCentsrequired | integer | int64. |
notesrequired | string | |
opportunityId | string or null | |
opportunityName | string or null | |
orderedAtrequired | string (date-time) | |
originrequired | string | |
ownerName | string or null | |
ownerUserId | string or null | |
publicIdrequired | string | |
quoteId | string or null | |
quoteNumber | string or null | |
rowVersionrequired | integer | int64. |
soNumberrequired | string | |
statusrequired | string | |
subtotalCentsrequired | integer | int64. |
taxCentsrequired | integer | int64. |
taxRateBasisPointsrequired | integer | |
totalCentsrequired | integer | int64. |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X POST 'https://depot.example.com/api/v1/sales/orders/<id>/lines/<lineId>/cancel' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -b 'outpost_console=<console-session>' \ --data '"string"'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Content-Type' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$body = @'"string"'@
$response = Invoke-RestMethod ` -Method Post ` -Uri 'https://depot.example.com/api/v1/sales/orders/<id>/lines/<lineId>/cancel' ` -Headers $headers ` -ContentType 'application/json' ` -Body $body
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/sales/orders/<id>/lines/<lineId>/cancel"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json",}cookies = { "outpost_console": "<console-session>",}payload = "string"
response = requests.post(url, headers=headers, cookies=cookies, json=payload, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "bytes" "fmt" "io" "log" "net/http")
func main() { body := []byte(`"string"`)
req, err := http.NewRequest(http.MethodPost, "https://depot.example.com/api/v1/sales/orders/<id>/lines/<lineId>/cancel", bytes.NewReader(body)) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.Header.Set("Content-Type", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/sales/orders/<id>/lines/<lineId>/cancel";
const response = await fetch(url, { method: "POST", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json", }, credentials: "include", body: JSON.stringify("string"),});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;using System.Text;
using var client = new HttpClient();
const string body = """"string"""";
var request = new HttpRequestMessage(HttpMethod.Post, "https://depot.example.com/api/v1/sales/orders/<id>/lines/<lineId>/cancel");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");request.Content = new StringContent(body, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());GET /api/v1/sales/orders/{id}/margin
Section titled “GET /api/v1/sales/orders/{id}/margin”GETcrm:readmsp facemspIdempotent
Source: [object Object]
orderMargin computes the order’s margin at read time (ruling P3): revenue from its invoice links, cost from what was bought for it (received plus landed, else ordered), else what shipped from stock at its average, else the quoted cost.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | A uuid. |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, SoMarginView | Success. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold crm:read. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state of the order. |
412 | application/problem+json, ProblemDetails | Someone else changed this since you opened it. Reload and try again. |
500 | application/problem+json, ProblemDetails | The request failed. |
200 response body
| Field | Type | Description |
|---|---|---|
costCentsrequired | integer | int64. |
expectedCostCentsrequired | integer | int64. |
expectedMarginBasisPoints | integer or null | |
expectedMarginCentsrequired | integer | int64. |
expectedRevenueCentsrequired | integer | int64. |
linesrequired | array of SoMarginLineView | |
lines[].costBasisrequired | string | |
lines[].costCentsrequired | integer | int64. |
lines[].descriptionrequired | string | |
lines[].expectedCostCentsrequired | integer | int64. |
lines[].expectedRevenueCentsrequired | integer | int64. |
lines[].revenueCentsrequired | integer | int64. |
lines[].salesOrderLineIdrequired | string | |
marginBasisPoints | integer or null | |
marginCentsrequired | integer | int64. |
revenueCentsrequired | integer | int64. |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X GET 'https://depot.example.com/api/v1/sales/orders/<id>/margin' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Get ` -Uri 'https://depot.example.com/api/v1/sales/orders/<id>/margin' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/sales/orders/<id>/margin"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.get(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/sales/orders/<id>/margin", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/sales/orders/<id>/margin";
const response = await fetch(url, { method: "GET", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/sales/orders/<id>/margin");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());POST /api/v1/sales/orders/{id}/purchase
Section titled “POST /api/v1/sales/orders/{id}/purchase”POSTprocurement:writemsp facemsp
Source: [object Object]
purchaseForOrder raises draft purchase orders for the order’s goods, one per supplier and ship-to (our default stock location, or drop-shipped to the client).
Each PO line carries the SO and SO line it was bought for, which is what receiving, drop-ship fulfillment and margin follow.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | A uuid. |
Request body
Section titled “Request body”Required, sent as application/json.
The body is any.
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
201 | application/json, object | Created. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold procurement:write. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state of the order. |
412 | application/problem+json, ProblemDetails | Someone else changed this since you opened it. Reload and try again. |
500 | application/problem+json, ProblemDetails | The request failed. |
503 | application/problem+json, ProblemDetails | The practice database is not available. |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.curl -X POST 'https://depot.example.com/api/v1/sales/orders/<id>/purchase' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -b 'outpost_console=<console-session>' \ --data '"string"'# Sign in first. outpost_console is a session cookie, so send it with every request.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Content-Type' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$body = @'"string"'@
$response = Invoke-RestMethod ` -Method Post ` -Uri 'https://depot.example.com/api/v1/sales/orders/<id>/purchase' ` -Headers $headers ` -ContentType 'application/json' ` -Body $body
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.
import requests
url = "https://depot.example.com/api/v1/sales/orders/<id>/purchase"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json",}cookies = { "outpost_console": "<console-session>",}payload = "string"
response = requests.post(url, headers=headers, cookies=cookies, json=payload, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.package main
import ( "bytes" "fmt" "io" "log" "net/http")
func main() { body := []byte(`"string"`)
req, err := http.NewRequest(http.MethodPost, "https://depot.example.com/api/v1/sales/orders/<id>/purchase", bytes.NewReader(body)) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.Header.Set("Content-Type", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/sales/orders/<id>/purchase";
const response = await fetch(url, { method: "POST", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json", }, credentials: "include", body: JSON.stringify("string"),});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.
using System;using System.Net.Http;using System.Text;
using var client = new HttpClient();
const string body = """"string"""";
var request = new HttpRequestMessage(HttpMethod.Post, "https://depot.example.com/api/v1/sales/orders/<id>/purchase");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");request.Content = new StringContent(body, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());GET /api/v1/sales/orders/{id}/purchases
Section titled “GET /api/v1/sales/orders/{id}/purchases”GETprocurement:readmsp facemspIdempotent
Source: [object Object]
listOrderPurchases answers the purchase orders raised for this order.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | A uuid. |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, array of SoPurchaseOrderView | Success. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold procurement:read. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
409 | application/problem+json, ProblemDetails | The request conflicts with the current state of the order. |
412 | application/problem+json, ProblemDetails | Someone else changed this since you opened it. Reload and try again. |
500 | application/problem+json, ProblemDetails | The request failed. |
503 | application/problem+json, ProblemDetails | The practice database is not available. |
200 response body
| Field | Type | Description |
|---|---|---|
[].createdAtrequired | string (date-time) | |
[].dropShipClientId | string or null | |
[].dropShipClientName | string or null | |
[].expectedOn | string or null | |
[].locationId | string or null | |
[].locationName | string or null | |
[].originrequired | string | |
[].poNumberrequired | string | |
[].publicIdrequired | string | |
[].shipToKindrequired | string | |
[].statusrequired | string | |
[].submissionStaterequired | string | |
[].supplierIdrequired | string | |
[].supplierNamerequired | string | |
[].totalCentsrequired | integer | int64. |
[].updatedAtrequired | string (date-time) |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X GET 'https://depot.example.com/api/v1/sales/orders/<id>/purchases' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Get ` -Uri 'https://depot.example.com/api/v1/sales/orders/<id>/purchases' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/sales/orders/<id>/purchases"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.get(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/sales/orders/<id>/purchases", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/sales/orders/<id>/purchases";
const response = await fetch(url, { method: "GET", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/sales/orders/<id>/purchases");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());Content is licensed CC BY 4.0. Code samples are MIT. Outpost and the Outpost mark are trademarks of Outpost Business Solutions, PBC and are not covered by either license.