Allocation service (2.0.0)

Download OpenAPI specification:Download

fabric V2 allocation APIs for multi-tenant service help identify the nearest warehouse to ship items in the order by reserving the inventory.

Allocation

Endpoints to perform allocation operations

Generate allocation

Generates allocation for each item in the order. The response includes fabric-generated allocationID, which is required for GET /allocation/{allocationId}.

SecurityAuthorization
Request
header Parameters
required
object (XSiteContext)

x-site-context value

Request Body schema: application/json
detailType
required
string

Event type

Enum: "ORDER_CREATED" "SHIPMENT_CREATED" "PICKUP_CREATED" "PICKUP_COMPLETED" "BOPIS_REMINDER_EMAIL" "BACKORDER_CREATE" "BACKORDER_30_DAYS_CONSENT_TO_DELAY_EMAIL" "BACKORDER_53_DAYS_CONSENT_TO_DELAY_EMAIL" "BACKORDER_CANCEL" "BACKORDER_AUTH_DECLINE" "ORDER_CANCELLATION_EMAIL_WEBCSC_ORDER_ITEM_CANCEL" "ORDER_CANCELLATION_EMAIL_WEBCSC_ORDER_CANCEL" "ORDER_CANCELLATION_EMAIL_LOCATE_ORDER_ITEM_CANCEL" "RETURN_NOTIFICATION_EMAIL" "REFUND_NOTIFICATION_EMAIL" "APPEASEMENT_NOTIFICATION_EMAIL" "BACKORDER_AUTH_DECLINE_EMAIL" "INVOICE_POSTING"
object (AllocationEventDetail)
Responses
200

Allocation Assigned

206

Partial Content

400

Bad Request

404

Order/item/Details Not Found/Valid

500

Internal Server Error

post/allocation/
Request samples
application/json
{
  • "detailType": "ORDER_CREATE",
  • "detail": {
    }
}
Response samples
application/json
[
  • {
    }
]

Get allocation

Gets allocation details by allocation ID

SecurityAuthorization
Request
path Parameters
allocationId
required
string

24-character system-generated allocation ID

Example: 633f216c68f1b4456659161c
header Parameters
required
object (XSiteContext)

x-site-context value

Responses
200

Allocation Details

400

AllocationId not found/valid

500

Internal Server Error

get/allocation/{allocationId}
Response samples
application/json
{
  • "allocationId": "62ff5c0bec0aed3c86202c32",
  • "version": 2,
  • "allocationRequestId": "62ff5c0bec0aed3c86202c32",
  • "allocationNum": "xxyyzz12345",
  • "parentAllocationId": "62ff5c0bec0aed3c86202c32",
  • "sentToPPSDate": "2022-08-01T18:03:28.483971941Z",
  • "allocationDate": "2022-08-01T18:03:28.483971941Z",
  • "updatedAt": "2022-08-01T20:03:28.483971941Z",
  • "type": "ALLOCATED",
  • "previousAllocationLocationNum": 410,
  • "poNumber": "1125",
  • "itemsType": "WEB_SHIP",
  • "orderSubType": "BORDERFREE",
  • "vendorId": "56",
  • "shipDate": null,
  • "shipType": "SHIP_TO_ADDRESS",
  • "shipMethod": "Overnight Delivery",
  • "shipToId": "98ff5c0bec0aed3c86202c32",
  • "statusCode": "PENDING_PICK",
  • "locationNum": "1234B",
  • "locationType": "1234B",
  • "shipToAddress": { },
  • "recipient": [
    ],
  • "items": [
    ],
  • "auditLogs": [
    ]
}

Update allocation

Updates allocation for the given order or item. Primary use cases are to update location number (related to warehouse), allocation number (external use), item details, etc. To specifically update Location Number, the PUT /allocation/reallocate endpoint is recommended

SecurityAuthorization
Request
path Parameters
allocationId
required
string
header Parameters
required
object (XSiteContext)

x-site-context value

Request Body schema: application/json
allocationId
required
string

Unique ID for an allocation document

version
integer <int64>

Current version of allocation document

allocationRequestId
string

Allocation request ID used for tracking internal communication. Required to update allocation details.

allocationNum
string

Allocation number for client tracking

parentAllocationId
required
string

Same as previous allocation document while creating new allocation

sentToPPSDate
string <date-time>

Time of sending allocation event to PPS

allocationDate
string <date-time>

Time of allocation creation and when it was stored in database

updatedAt
string <date-time>

Time of allocation update

type
string

Allocation type

Enum: "ALLOCATED" "SCRATCHED" "RETURNED"
previousAllocationLocationNum
number

In reallocation scenarios, keeps track of the previously allocation location numbers

poNumber
string or null

Purchase order number (generally, vendor-generated)

itemsType
string

Items type

Enum: "WEB_SHIP" "POS" "WEB"
orderSubType
string

Sub-type of order

Enum: "IOS" "Android" "International" "Borderfree"
vendorId
string or null

Vendor ID

shipDate
string <date-time>

Estimated ship date

shipType
string <date-time>

Optional field for shipment type

shipMethod
string <date-time>

Optional field for shipment method

shipToId
string

Unique Id for delivery address

statusCode
string

Allocation status code

Enum: "ALLOCATED" "PENDING_DROP" "PENDING_PICK" "SHIPPED" "PARTIALLY_SHIPPED" "REALLOCATED" "CANCELLED" "PARTIALLY_CANCELLED"
locationNum
required
string

Tenant's ship-from location ID

locationType
string

Tenant's ship-from location type

shipToAddress
object
Array of objects (OrderPickup)

Recipient details such as phone number, email, and name

required
Array of objects (AllocationItem)

List of items to be shipped

Array of objects (OrderAuditLog)

Logs with updated fields

Responses
200

Allocation Updated

400

Order/item/Details Not Found/Valid

500

Internal Server Error

put/allocation/{allocationId}
Request samples
application/json
{
  • "allocationId": "62ff5c0bec0aed3c86202c32",
  • "version": 2,
  • "allocationRequestId": "62ff5c0bec0aed3c86202c32",
  • "allocationNum": "xxyyzz12345",
  • "parentAllocationId": "62ff5c0bec0aed3c86202c32",
  • "sentToPPSDate": "2022-08-01T18:03:28.483971941Z",
  • "allocationDate": "2022-08-01T18:03:28.483971941Z",
  • "updatedAt": "2022-08-01T20:03:28.483971941Z",
  • "type": "ALLOCATED",
  • "previousAllocationLocationNum": 410,
  • "poNumber": "1125",
  • "itemsType": "WEB_SHIP",
  • "orderSubType": "BORDERFREE",
  • "vendorId": "56",
  • "shipDate": null,
  • "shipType": "SHIP_TO_ADDRESS",
  • "shipMethod": "Overnight Delivery",
  • "shipToId": "98ff5c0bec0aed3c86202c32",
  • "statusCode": "PENDING_PICK",
  • "locationNum": "1234B",
  • "locationType": "1234B",
  • "shipToAddress": { },
  • "recipient": [
    ],
  • "items": [
    ],
  • "auditLogs": [
    ]
}
Response samples
application/json
{
  • "allocationId": "62ff5c0bec0aed3c86202c32",
  • "version": 2,
  • "allocationRequestId": "62ff5c0bec0aed3c86202c32",
  • "allocationNum": "xxyyzz12345",
  • "parentAllocationId": "62ff5c0bec0aed3c86202c32",
  • "sentToPPSDate": "2022-08-01T18:03:28.483971941Z",
  • "allocationDate": "2022-08-01T18:03:28.483971941Z",
  • "updatedAt": "2022-08-01T20:03:28.483971941Z",
  • "type": "ALLOCATED",
  • "previousAllocationLocationNum": 410,
  • "poNumber": "1125",
  • "itemsType": "WEB_SHIP",
  • "orderSubType": "BORDERFREE",
  • "vendorId": "56",
  • "shipDate": null,
  • "shipType": "SHIP_TO_ADDRESS",
  • "shipMethod": "Overnight Delivery",
  • "shipToId": "98ff5c0bec0aed3c86202c32",
  • "statusCode": "PENDING_PICK",
  • "locationNum": "1234B",
  • "locationType": "1234B",
  • "shipToAddress": { },
  • "recipient": [
    ],
  • "items": [
    ],
  • "auditLogs": [
    ]
}

Get allocation by query

Finds allocation details based on filter criteria

SecurityAuthorization
Request
header Parameters
required
object (XSiteContext)

x-site-context value

Request Body schema: application/json
limit
integer <int32>
Default: 10

Numbers of records to be returned

offset
integer <int64>
Default: 0

Number of records to skipped

sortBy
string
Default: "updatedAt"

Sorting criteria based on attributes

sortDirection
string
Default: "desc"

Sorting direction such as ascending or descending

Enum: "asc" "desc"
required
object
Default: {}

Filter criteria.
Note: To filter records, the json structure should be similar to target entity structure. That is, order, shipment, etc.

Responses
200

Matched Allocations

404

Data Not Found/Valid

500

Internal Server Error

post/allocation/query
Request samples
application/json
{
  • "limit": 10,
  • "offset": 0,
  • "sortBy": "updatedAt",
  • "sortDirection": "desc",
  • "filters": {
    }
}
Response samples
application/json
[
  • {
    }
]

Reallocate location

Updates location number of the existing allocation. To update other details, PUT /allocation/{allocationId} endpoint is recommended.

SecurityAuthorization
Request
header Parameters
required
object (XSiteContext)

x-site-context value

Request Body schema: application/json
orderNumber
string

Id of the given document

channel
required
string

Channel

tenant
required
string

Tenant ID

id
required
Array of strings

Unique ID of the document

documentType
required
string

Document type

Enum: "ALLOCATION" "ORDER" "SHIPMENT" "ALLOCATION ORDER"
Array of objects (Item)

Optional item list needs to be allocated

Responses
200

Location reallocated

400

AllocationId not found/valid

500

Internal Server Error

put/allocation/reallocate
Request samples
application/json
{
  • "orderNumber": "ship1233234555g",
  • "channel": "ship1233234555g",
  • "tenant": "ship1233234555g",
  • "id": "98ff5c0bec0aed3c86202c32",
  • "documentType": "ALLOCATION",
  • "items": [
    ]
}
Response samples
application/json
{
  • "message": "Reallocation process completed Successfully with !! allocation Ids [6315dec507025b003f20ed3c]"
}

Cancel allocation

Cancels allocation by allocation ID

SecurityAuthorization
Request
path Parameters
allocationIds
required
Array of strings
header Parameters
required
object (XSiteContext)

x-site-context value

Responses
200

Cancel Allocation

404

AllocationRequestId Not Found/Valid

500

Internal Server Error

put/allocation/cancel/{allocationIds}
Response samples
application/json
[
  • {
    }
]