Good Transfer

Fetching list of good transfer list.

LIST

Return a collection of good transfer.

Example of fetching good transfer list

Request

GET /goods-transfers HTTP/1.1

Response

{
	"data": [
		{
			"id": 1,
			"state": "pending",
			"external_identifier": "GT1-1",
			"origin": {
				"resource_type": "tenant-supplier",
				"resource": 4
			},
			"destination": {
				"resource_type": "production",
				"resource": 1
			},
			"creator": {
				"resource_type": "staff",
				"resource": 1
			},
			"estimated_arrival_at": "2023-01-12T00:00:00.000000Z",
			"parcels": [
				{
					"id": 1,
					"state": "pending",
					"tracking_number": "623",
					"external_identifier": "GTP1-1",
					"goods_transfer_items": [
						{
							"id": 1,
							"state": "pending",
							"resource_type": "id-tag",
							"resource": 1,
							"created_at": "2023-01-10T10:11:49+00:00",
							"updated_at": "2023-01-10T10:11:49+00:00"
						},
						{
							"id": 2,
							"state": "pending",
							"resource_type": "stock-item",
							"resource": 1,
							"created_at": "2023-01-10T10:11:49+00:00",
							"updated_at": "2023-01-10T10:11:49+00:00"
						},
						{
							"id": 3,
							"state": "pending",
							"resource_type": "production-variant",
							"resource": 10,
							"created_at": "2023-01-10T10:11:49+00:00",
							"updated_at": "2023-01-10T10:11:49+00:00"
						}
					],
					"created_at": "2023-01-10T10:11:49+00:00",
					"updated_at": "2023-01-10T10:11:49+00:00"
				}
			],
			"created_at": "2023-01-10T10:11:49+00:00",
			"updated_at": "2023-01-10T10:11:49+00:00"
		},
		{
			"id": 2,
			"state": "pending",
			"external_identifier": "GT1-2",
			"origin": {
				"resource_type": "tenant-supplier",
				"resource": 4
			},
			"destination": {
				"resource_type": "production",
				"resource": 1
			},
			"creator": {
				"resource_type": "staff",
				"resource": 1
			},
			"estimated_arrival_at": "2023-01-14T00:00:00.000000Z",
			"parcels": [
				{
					"id": 2,
					"state": "partially-received",
					"tracking_number": "932",
					"external_identifier": "GTP2-2",
					"goods_transfer_items": [
						{
							"id": 4,
							"state": "accepted",
							"resource_type": "id-tag",
							"resource": 1,
							"created_at": "2023-01-10T10:11:49+00:00",
							"updated_at": "2023-01-10T10:11:49+00:00"
						},
						{
							"id": 5,
							"state": "pending",
							"resource_type": "stock-item",
							"resource": 1,
							"created_at": "2023-01-10T10:11:49+00:00",
							"updated_at": "2023-01-10T10:11:49+00:00"
						},
						{
							"id": 6,
							"state": "rejected",
							"resource_type": "production-variant",
							"resource": 10,
							"created_at": "2023-01-10T10:11:49+00:00",
							"updated_at": "2023-01-10T10:11:49+00:00"
						}
					],
					"created_at": "2023-01-10T10:11:49+00:00",
					"updated_at": "2023-01-10T10:11:49+00:00"
				},
				{
					"id": 3,
					"state": "pending",
					"tracking_number": "173",
					"external_identifier": "GTP3-3",
					"goods_transfer_items": [
						{
							"id": 7,
							"state": "pending",
							"resource_type": "id-tag",
							"resource": 1,
							"created_at": "2023-01-10T10:11:49+00:00",
							"updated_at": "2023-01-10T10:11:49+00:00"
						}
					],
					"created_at": "2023-01-10T10:11:49+00:00",
					"updated_at": "2023-01-10T10:11:49+00:00"
				},
				{
					"id": 4,
					"state": "received",
					"tracking_number": "808",
					"external_identifier": "GTP3-4",
					"goods_transfer_items": [
						{
							"id": 8,
							"state": "accepted",
							"resource_type": "stock-item",
							"resource": 1,
							"created_at": "2023-01-10T10:11:49+00:00",
							"updated_at": "2023-01-10T10:11:49+00:00"
						},
						{
							"id": 9,
							"state": "rejected",
							"resource_type": "production-variant",
							"resource": 10,
							"created_at": "2023-01-10T10:11:49+00:00",
							"updated_at": "2023-01-10T10:11:49+00:00"
						}
					],
					"created_at": "2023-01-10T10:11:49+00:00",
					"updated_at": "2023-01-10T10:11:49+00:00"
				}
			],
			"created_at": "2023-01-10T10:11:49+00:00",
			"updated_at": "2023-01-10T10:11:49+00:00"
		},
		{
			"id": 3,
			"state": "partially-received",
			"external_identifier": "GT1-3",
			"origin": {
				"resource_type": "tenant-supplier",
				"resource": 4
			},
			"destination": {
				"resource_type": "production",
				"resource": 1
			},
			"creator": {
				"resource_type": "staff",
				"resource": 1
			},
			"estimated_arrival_at": "2023-01-11T00:00:00.000000Z",
			"parcels": [],
			"created_at": "2023-01-10T10:11:49+00:00",
			"updated_at": "2023-01-10T10:11:49+00:00"
		}
	],
	"links": {
		"first": null,
		"last": null,
		"prev": null,
		"next": null
	},
	"meta": {
		"path": "https://api.smake.io/master-administration/goods-transfers",
		"per_page": 15,
		"next_cursor": null,
		"prev_cursor": null
	}
}

GET

Return a good transfer of given id = x.

Example of fetching specified good transfer information

Request

GET /good-transfers/1 HTTP/1.1

Response

{
	"id": 1,
	"state": "pending",
	"external_identifier": "GT1-1",
	"origin": {
		"resource_type": "tenant-supplier",
		"resource": 4
	},
	"destination": {
		"resource_type": "production",
		"resource": 1
	},
	"creator": {
		"resource_type": "staff",
		"resource": 1
	},
	"estimated_arrival_at": "2023-01-12T00:00:00.000000Z",
	"parcels": [
		{
			"id": 1,
			"state": "pending",
			"tracking_number": "623",
			"external_identifier": "GTP1-1",
			"goods_transfer_items": [
				{
					"id": 1,
					"state": "pending",
					"resource_type": "id-tag",
					"resource": 1,
					"created_at": "2023-01-10T10:11:49+00:00",
					"updated_at": "2023-01-10T10:11:49+00:00"
				},
				{
					"id": 2,
					"state": "pending",
					"resource_type": "stock-item",
					"resource": 1,
					"created_at": "2023-01-10T10:11:49+00:00",
					"updated_at": "2023-01-10T10:11:49+00:00"
				},
				{
					"id": 3,
					"state": "pending",
					"resource_type": "production-variant",
					"resource": 10,
					"created_at": "2023-01-10T10:11:49+00:00",
					"updated_at": "2023-01-10T10:11:49+00:00"
				}
			],
			"created_at": "2023-01-10T10:11:49+00:00",
			"updated_at": "2023-01-10T10:11:49+00:00"
		}
	],
	"created_at": "2023-01-10T10:11:49+00:00",
	"updated_at": "2023-01-10T10:11:49+00:00"
}

CREATE

Create a new good transfer.

States

The current state of the asynchronous process is represented due following states:

State Meaning
Pending The initial state of a new good transfer data.
PartiallyReceived Partial goods are recieved recieved
Received All good are recieved.

Request

Field Type Required
origin object yes
destination object yes
creator object yes
external_identifier string yes
estimated_arrival_at date no
goods_transfer_parcels object collection no

Example of creating a new good transfer

Request

POST /good-transfers HTTP/1.1

{
  "external_identifier": "WT-123",
  "origin": {
    "resource_type": "tenant-supplier",
    "resource": 1,
    },
  "destination": {
    "resource_type": "production",
    "resource": 1,
  },
  "creator": {
    "resource_type": "client",
    "resource": 1,
  },
  "estimated_arrival_at": "2022-11-22",
  "goods_transfer_parcels": [
    {
      "tracking_number": "P-123",
      "goods_transfer_items": [
        {
          "resource_type": "id-tag",
          "resource": {
            "id": 1
          }
        }
        ...
      ]
    }
  ]
}

Response

{
	"id": 4,
	"state": "pending",
	"external_identifier": "WT-123",
	"origin": {
		"resource_type": "tenant-supplier",
		"resource": 1
	},
	"destination": {
		"resource_type": "production",
		"resource": 1
	},
	"creator": {
		"resource_type": "client",
		"resource": 1
	},
	"estimated_arrival_at": "2022-11-22T00:00:00.000000Z",
	"parcels": [
		{
			"id": 1,
			"state": "pending",
			"tracking_number": "P-123",
			"external_identifier": null,
			"goods_transfer_items": [
                {
					"id": 1,
					"state": "pending",
					"resource_type": "id-tag",
					"resource": 1,
					"created_at": "2023-01-17T10:55:09+00:00",
					"updated_at": "2023-01-17T10:55:09+00:00"
				}
            ],
			"created_at": "2023-01-22T14:50:39+00:00",
			"updated_at": "2023-01-22T14:50:39+00:00"
		}
	],
	"created_at": "2023-01-22T14:50:39+00:00",
	"updated_at": "2023-01-22T14:50:39+00:00"
}