Skip to main content

Search Orders

Look up your own orders by the partner-defined correlation values you sent at order creation (custom_field_1, custom_field_2, custom_field_3 — see Create order). Useful for reconciling a Swyft order against your own internal records, or for checking whether an order already exists before retrying a create call.

GET {baseUrl}/orders/search
Authorization: Bearer {token}

Query parameters — at least one is required:

FieldRequiredDescription
custom_field_1One of the three requiredMatch against the custom_field_1 value stored on the order.
custom_field_2One of the three requiredMatch against the custom_field_2 value stored on the order.
custom_field_3One of the three requiredMatch against the custom_field_3 value stored on the order.

Only your own orders are searched (scoped to your partner account). If you send more than one field, an order must match all of them (AND, not OR).

GET {baseUrl}/orders/search?custom_field_1=PO-12345
Authorization: Bearer {token}

Response — 200 OK

Each matching order is shaped exactly like Get order information. An empty array is returned when nothing matches — this is not an error.

{
"success": true,
"data": [
{
"id": 1,
"uuid": "99ff4d16-4e61-499d-8e97-769de1bcca6b",
"service": "incorporation-package",
"status": "In Progress",
"business_data": {
"name": "Acme Holdings LLC",
"type": "LLC",
"formation_state": "DE"
},
"custom_field_1": "PO-12345",
"custom_field_2": "cust-98765",
"custom_field_3": null
}
]
}

No match:

{
"success": true,
"data": []
}

Idempotent order creation​

You can optionally designate one of custom_field_1/2/3 as your idempotency key. Once configured for your account (contact your Swyft representative to enable this), submitting Create order again with the same value in that slot, for the same service and business_data.formation_state, is rejected with 422 instead of creating a duplicate order — see the "Duplicate order" example on that page. This makes it safe to retry a create call after a timeout without checking first.

Idempotency is off by default — until a slot is designated for your account, repeated custom_field_1/2/3 values do not block order creation, they are simply stored and searchable as described above.