For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Logo
Resources
Log inGet a demo
Get startedAPI referenceImplementation
Get startedAPI referenceImplementation
    • Overview
          • The SalesOrder object
          • GET/sales-orders
          • POST/sales-orders
          • GET/sales-orders/{id}
          • GET/sales-orders/lines/remote-field-classes
          • GET/sales-orders/meta/post
          • GET/sales-orders/remote-field-classes
          • POST/sales-orders/bulk
          • GET/sales-orders/bulk/{batch_id}
UnifiedAgent HandlerGateway
UnifiedAgent HandlerGateway
Resources
Log inGet a demo
Common ModelsSales Orders

/sales-orders

Beta
POST
/accounting/v1/sales-orders
POST
/api/accounting/v1/sales-orders
$curl -X POST https://api.merge.dev/api/accounting/v1/sales-orders \
> -H "X-Account-Token: X-Account-Token" \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "model": {}
>}'
201Created
1{
2 "model": {
3 "id": "0048ea5b-911e-4dff-9364-92070dea62ff",
4 "remote_id": "SO-12345",
5 "created_at": "2021-09-15T00:00:00Z",
6 "modified_at": "2021-10-16T00:00:00Z",
7 "customer": "3e442c5d-8f51-4103-b5c9-dcee39c30a08",
8 "currency": "USD",
9 "exchange_rate": "1.0",
10 "company": "595c8f97-2ac4-45b7-b000-41bdf43240b5",
11 "status": "DRAFT",
12 "payment_term": "89d329de-825f-4ac6-8369-3c58b4e68bee",
13 "memo": "Quarterly subscription order",
14 "shipping_address": "b0a1e9a5-8f51-4103-b5c9-dcee39c30a08",
15 "tracking_categories": [
16 "b38c59b0-a9d7-4740-b1ee-5436c6751e3d",
17 "9b840d2-686a-465a-8a8e-7b028498f8e4"
18 ],
19 "issue_date": "2020-03-31T00:00:00Z",
20 "transaction_number": "SO-12345",
21 "total": 495,
22 "lines": [
23 {
24 "remote_id": "121222",
25 "description": "Premium subscription",
26 "unit_price": "99",
27 "quantity": "5",
28 "item": "0958cbc6-6040-430a-848e-aafacbadf4ae",
29 "tax_rate": "a12e7c20-1922-9df7-s75n-edfeewnn7384",
30 "tracking_categories": [
31 "f1214c24-2702-4617-b74b-3ddecfc0d384",
32 "9b840d2-686a-465a-8a8e-7b028498f8e4"
33 ],
34 "company": "595c8f97-2ac4-45b7-b000-41bdf43240b5",
35 "remote_was_deleted": false
36 },
37 {
38 "description": "Basic subscription",
39 "unit_price": "50",
40 "quantity": "2",
41 "item": "249c9faa-3045-4a31-953b-8f22d3613301",
42 "tracking_categories": [
43 "f1214c24-2702-4617-b74b-3ddecfc0d384"
44 ]
45 }
46 ],
47 "remote_created_at": "2020-03-31T00:00:00Z",
48 "remote_updated_at": "2020-03-31T00:00:00Z",
49 "remote_was_deleted": true,
50 "field_mappings": {
51 "organization_defined_targets": {
52 "custom_key": "custom_value"
53 },
54 "linked_account_defined_targets": {
55 "custom_key": "custom_value"
56 }
57 },
58 "remote_data": [
59 {
60 "path": "/actions",
61 "data": null
62 }
63 ],
64 "remote_fields": [
65 {
66 "remote_field_class": {
67 "id": "string",
68 "display_name": "string",
69 "remote_key_name": "string",
70 "description": "string",
71 "is_custom": true,
72 "is_common_model_field": true,
73 "is_required": true,
74 "field_type": "string",
75 "field_format": "string",
76 "field_choices": [
77 "string"
78 ],
79 "item_schema": {
80 "item_type": "string",
81 "item_format": "string",
82 "item_choices": [
83 "string"
84 ]
85 }
86 },
87 "value": "string"
88 }
89 ]
90 },
91 "warnings": [
92 {
93 "title": "Unrecognized Field",
94 "detail": "An unrecognized field, age, was passed in with request data.",
95 "problem_type": "UNRECOGNIZED_FIELD",
96 "source": {
97 "pointer": "/age"
98 },
99 "block_merge_link": true,
100 "raw_error": "string",
101 "error_code": 1
102 }
103 ],
104 "errors": [
105 {
106 "title": "Missing Required Field",
107 "detail": "custom_fields is a required field on model.",
108 "problem_type": "MISSING_REQUIRED_FIELD",
109 "source": {
110 "pointer": "/model/custom_fields"
111 },
112 "block_merge_link": true,
113 "raw_error": "string",
114 "error_code": 1
115 }
116 ],
117 "logs": [
118 {
119 "log_id": "99433219-8017-4acd-bb3c-ceb23d663832",
120 "dashboard_view": "https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832",
121 "log_summary": {
122 "url": "www.exampleintegration.com/api/v1/exampleapi",
123 "method": "POST",
124 "status_code": 200
125 }
126 }
127 ]
128}

Creates a SalesOrder object with the given values.

Field support by integration

See all supported fields

Use the /linked-accounts endpoint to pull platform support information

Was this page helpful?
Previous

/sales-orders

Next

/sales-orders/{id}

Built with

Authentication

AuthorizationBearer

Token-based authentication with required prefix “Bearer”

Headers

X-Account-TokenstringRequired
Token identifying the end user.

Query parameters

is_debug_modebooleanOptional

Whether to include debug fields (such as log file links) in the response.

run_asyncbooleanOptional

Whether or not third-party updates should be run asynchronously.

Request

This endpoint expects an object.
modelobjectRequired

Description

The SalesOrder object represents a seller’s formal record and confirmation of a customer’s purchase request.

Usage Example

Fetch from the LIST SalesOrders endpoint and view a company’s sales orders.

Response

modelobject

Description

The SalesOrder object represents a seller’s formal record and confirmation of a customer’s purchase request.

Usage Example

Fetch from the LIST SalesOrders endpoint and view a company’s sales orders.

warningslist of objects
errorslist of objects
logslist of objects