Retrieve an order factory
How to fetch a specific order factory via API
To fetch a single order factory, send a GET request to the /api/order_factories/:id endpoint, where id is the ID of the resource that you want to retrieve.
Request
GET https://yourdomain.commercelayer.io/api/order_factories/:id
Example
The following request fetches the order factory identified by the ID "XAyRWNUzyN":
curl -g -X GET \
'https://yourdomain.commercelayer.io/api/order_factories/XAyRWNUzyN' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer your-access-token'On success, the API responds with a 200 OK status code, returning a single resource object:
{
"data": {
"id": "XAyRWNUzyN",
"type": "order_factories",
"links": {
"self": "https://yourdomain.commercelayer.io/api/order_factories/XAyRWNUzyN"
},
"attributes": {
"type": "recurring_order_copies",
"status": "in_progress",
"started_at": "2018-01-01T12:00:00.000Z",
"completed_at": "2018-01-01T12:00:00.000Z",
"failed_at": "2018-01-01T12:00:00.000Z",
"errors_log": {
"status": [
"cannot transition from draft to placed"
]
},
"errors_count": 2,
"place_target_order": true,
"reuse_wallet": true,
"created_at": "2018-01-01T12:00:00.000Z",
"updated_at": "2018-01-01T12:00:00.000Z",
"reference": "ANY-EXTERNAL-REFEFERNCE",
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
"metadata": {
"foo": "bar"
}
},
"relationships": {
"source_order": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/order_factories/XAyRWNUzyN/relationships/source_order",
"related": "https://yourdomain.commercelayer.io/api/order_factories/XAyRWNUzyN/source_order"
}
},
"target_order": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/order_factories/XAyRWNUzyN/relationships/target_order",
"related": "https://yourdomain.commercelayer.io/api/order_factories/XAyRWNUzyN/target_order"
}
},
"events": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/order_factories/XAyRWNUzyN/relationships/events",
"related": "https://yourdomain.commercelayer.io/api/order_factories/XAyRWNUzyN/events"
}
},
"event_stores": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/order_factories/XAyRWNUzyN/relationships/event_stores",
"related": "https://yourdomain.commercelayer.io/api/order_factories/XAyRWNUzyN/event_stores"
}
}
},
"meta": {
"mode": "test",
"organization_id": "xRRkjDFafe",
"trace_id": "69abaa3545913c78132e5578bd26208d44aa9043647d78698fd0021f3958cd74"
}
}
}Last updated

