Methods


Entity Properties


A delivery is an inbound shipment of your product to RSF. It could be an “ASN” (Advanced Shipment Notification), an “RMA” (Return Merchandise Authorization) or an “Other Delivery” (anything other than an ASN or RMA). They are all processed similarly regardless of which type of delivery is specified. Processing involves the general stages of “Accepting” the container from the carrier and weighing it, “Processing” the containers to align what was expected with what was actually received, “Putting Away” the processed inventory and “Committing” the put-away inventory to the available inventory. “Accepting” stage results with “Accepted” or “Ready To Process” delivery status. If the delivery has items on it before it is accepted, “Ready To Process” status is set and “Accepted” status skipped. Most of these steps happen automatically depending on the merchant’s configuration and whether or not there are any exceptions (discrepancies between expected and received).

delivery.search (null|object $filters, array $options = [])

Retrieve list of deliveries. Filtration could be applied.

Parameters

orderdescription
0
  • null - Retrieve list of all deliveries.
  • object - Retrieve list of deliveries using specified filters.
1
  • null - No options will be applied.
  • object - Apply specified options.

Return Value

An array of objects. Each object will contain “Delivery Properties”.

Example Request

Get delivery for one delivery id:

{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "method" : "call",
    "params" : [
        "be1c13ed4e03f0ed7f1e4053dfff9658",
        "delivery.search",
        [
            {
                "delivery_id" : {
                    "eq" : 1
                }
            },
            []
        ]
    ]
}

Example Response

{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "error" : null,
    "result" : {
        "results" : [
            {
                "delivery_id" : 1,
                "warehouse_id" : 1,
                "increment_id" : "1000036",
                "delivery_type" : "asn",
                "state" : "complete",
                "status" : "put_away",
                "before_hold_state" : null,
                "before_hold_status" : null,
                "progress" : 100,
                "total_skus" : 2,
                "sender_name" : "Microsoft",
                "carrier_name" : "FedEx",
                "expected_delivery" : "2014-06-26",
                "delivered_at" : "2014-07-21 08:52:56",
                "completed_at" : null,
                "comments" : null,
                "merchant_ref" : null,
                "merchant_status" : null,
                "sender_ref" : null,
                "sender_ref_alt" : null,
                "num_containers" : 2,
                "num_labels" : 1,
                "total_container_weight" : null,
                "total_product_weight" : null,
                "special_requirements" : null,
                "auto_commit" : null,
                "created_at" : "2014-06-26 13:47:47",
                "updated_at" : "2014-06-26 14:09:30",
                "items" : [
                    {
                        "delivery_item_id" : 1,
                        "delivery_id" : 1,
                        "product_id" : 214,
                        "qty_expected" : 1,
                        "qty_received" : 1,
                        "qty_shortage" : 0,
                        "qty_overage" : 5,
                        "qty_processed" : 1,
                        "qty_putaway" : 1,
                        "qty_committed" : 0,
                        "sku" : "product2"
                    },
                    {
                        "delivery_item_id" : 2,
                        "delivery_id" : 1,
                        "product_id" : 213,
                        "qty_expected" : 1,
                        "qty_received" : 1,
                        "qty_shortage" : 0,
                        "qty_overage" : 0,
                        "qty_processed" : 1,
                        "qty_putaway" : 1,
                        "qty_committed" : 0,
                        "sku" : "product1"
                    }
                ],
                "containers" : [
                    {
                        "container_id" : 1,
                        "delivery_id" : 1,
                        "container_type_id" : 1,
                        "damage_type" : "none",
                        "weight_discrepancy" : "none",
                        "tare_weight" : 1,
                        "weight" : 8,
                        "weighed_at" : "2014-06-26 13:49:04",
                        "weighed_by" : 1,
                        "contents" : ..., //serialized array of "Container Content" objects
                        "notes" : null
                    },
                    {
                        "container_id" : 2,
                        "delivery_id" : 1,
                        "container_type_id" : 1,
                        "damage_type" : "none",
                        "weight_discrepancy" : "none",
                        "tare_weight" : 1,
                        "weight" : 3,
                        "weighed_at" : "2014-06-26 13:49:15",
                        "weighed_by" : 1,
                        "contents" : ..., // serialized array of "Container Content" objects
                        "notes" : null
                    }
                ],
                "exceptions" : [
                    {
                        "delivery_exception_id" : 1,
                        "delivery_id" : 1,
                        "delivery_item_id" : 1,
                        "container_id" : 2,
                        "status" : "pending",
                        "sign" : 1,
                        "reason" : "overage_counted",
                        "comment" : null,
                        "qty" : 5
                    }
                ]
            }
        ],
        "totalCount" : 1,
        "numPages" : 1
    }
}

Error Codes

code message
101 Invalid filters given. Details in error message.

delivery.create (number $deliveryType, object $data, null|array $items = null)

Create delivery.

Parameters

orderdescription
0 string - Delivery type. Allowed: "asn", "rma", "other".
1 object - Delivery data. See Delivery Properties.
2
  • null - Create delivery without items.
  • array - Array of objects where the key - product SKU and the value - expected quantity.

Return Value

Delivery information.

Example Request

{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "method" : "call",
    "params" : [
        "be1c13ed4e03f0ed7f1e4053dfff9658",
        "delivery.create",
        [
            "asn",
            {
                "warehouse_id" : 1,
                "auto_commit" : true,
                "sender_name" : "Bill Gates",
                "carrier_name" : "FedEx",
                "expected_delivery" : "2014-07-31",
                "merchant_ref" : "Inv 12345"
            },
            [
                {
                    "sku" : "product1",
                    "qty_expected" : 5
                },
                {
                    "sku" : "product2",
                    "qty_expected" : 1
                }
            ]
        ]
    ]
}

Example Response

{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "error" : null,
    "result" : {
        "delivery_id" : 4,
        "warehouse_id" : 1,
        "delivery_type" : "asn",
        "increment_id" : "1000039",
        "sender_name" : "Bill Gates",
        "carrier_name" : "FedEx",
        "expected_delivery" : "2014-07-31",
        "merchant_ref" : 12345,
        "state" : "new",
        "status" : "new",
        "total_skus" : 2,
        "progress" : 0,
        "created_at" : "2014-07-31 14:10:00",
        "updated_at" : "2014-07-31 14:10:00"
    }
}

Error Codes

code message
107 Error creating the delivery. Details in error message.

delivery.update (TBD)

Update delivery.


Entity Properties

Delivery Properties

Property Translations: API to UI

API ASN RMA Cancellation Other Work Order Output
sender_name Supplier Customer Name Customer Name Sender Assembly Completed By
sender_ref Supplier Invoice Ref Carrier Tracking # Order # Sender Ref 1 Work Order #
sender_ref_alt Supplier Order Ref Merchant Order # Shipment # Sender Ref 2 Not Supported
tracking_numbers Tracking Numbers Tracking Numbers Not Supported Tracking Numbers Not Supported
merchant_ref Merchant Ref Merchant RMA # Order Ref # Merchant Ref Work Order Ref
merchant_status Merchant Status Merchant Status Merchant Status Merchant Status Merchant Status
expected_delivery Expected Delivery Date Authorization Date Cancellation Date Expected Delivery Date Assembly Completed Date
delivery_id
{ "delivery_id" : 5 }
The internal delivery ID.
warehouse_id
{ "warehouse_id" : 1 }
The internal warehouse ID.
increment_id
{ "increment_id" : 1000036 }
The "Increment ID" property.
delivery_type
{ "delivery_type" : "asn" }
The "Delivery Type" property. Allowed: "asn", "rma", "other".
state
{ "state" : "complete" }
The "State" property. Allowed: "new", "processing", "putting_away", "pending_commit", "complete", "canceled", "holded".
status
{ "status" : "putting_away" }
The "Status" property. Allowed: "new", "accepted", "ready_to_process", "processing", "processing_exception", "processed", "putting_away", "put_away", "complete", "canceled", "holded".
before_hold_state
{ "before_hold_state" : "complete" }
The "Before Hold State" property.
before_hold_status
{ "before_hold_status" : "complete" }
The "Before Hold Status" property.
progress
{ "progress" : 85 }
The "Progress" property. Number from 0 to 100.
total_skus
{ "total_skus" : 2 }
Total amount of SKUs.
sender_name
{ "sender_name" : "RSF" }
The "Sender Name" property.
carrier_name
{ "carrier_name" : "FedEx" }
The "Carrier Name" property.
expected_delivery
{ "expected_delivery" : "2014-07-21" }
The "Expected Delivery" property.
delivered_at
{ "delivered_at" : "2014-07-21 08:52:56" }
The "Delivered At" property.
completed_at
{ "completed_at" : "2014-07-21 08:52:56" }
The "Completed At" property.
comments
{ "comments" : "This is test delivery." }
The "Comments" property.
merchant_ref
{ "merchant_ref" : 12345 }
The "Merchant Reference" property. Uniqueness based on this field is enforced so an error will be given if a delivery with the same merchant_ref already exists.
merchant_status
{ "merchant_status" : "complete" }
The "Merchant Status" property.
sender_ref
{ "sender_ref" : 12345 }
The "Sender Reference" property.
sender_ref_alt
{ "sender_ref_alt" : "abc" }
The "Sender Reference Alt" property.
num_containers
{ "num_containers" : 2 }
Number of containers.
num_labels
{ "num_labels" : 1 }
Number of labels.
total_container_weight
{ "total_container_weight" : 15.75 }
The "Total Container Weight" property.
total_product_weight
{ "total_product_weight" : 13.5 }
The "Total Product Weight" property.
special_requirements
{ "special_requirements" : "Please ship ASAP." }
The "Special Requirements" property.
auto_commit
{ "auto_commit" : 1 }
Flag whether inventory can be commited automatically.
created_at
{ "created_at" : "2014-06-26 13:47:47" }
The "Created At" property.
updated_at
{ "updated_at" : "2014-06-26 13:47:47" }
The "Updated At" property.
items Array of delivery items. See "Delivery Item Properties".
containers Array of containers. See "Container Properties".
exceptions Array of exceptions. See "Exception Properties".

Delivery Item Properties

delivery_item_id
{ "delivery_item_id" : 3 }
The internal delivery item ID.
delivery_id
{ "delivery_id" : 5 }
The internal delivery ID.
product_id
{ "product_id" : 4 }
The internal product ID.
qty_expected
{ "qty_expected" : 2 }
The "Expected" quantity.
qty_received
{ "qty_received" : 1 }
The "Received" quantity.
qty_shortage
{ "qty_shortage" : 0 }
The "Shortage" quantity.
qty_overage
{ "qty_overage" : 0 }
The "Overage" quantity.
qty_processed
{ "qty_processed" : 3 }
The "Processed" quantity.
qty_putaway
{ "qty_putaway" : 1 }
The "Put-Away" quantity.
qty_committed
{ "qty_committed" : 1 }
The "Committed" quantity.
sku
{ "sku" : "product1" }
The "SKU" property.

Container Properties

container_id
{ "container_id" : 1 }
The internal container ID.
delivery_id
{ "delivery_id" : 5 }
The internal delivery ID.
container_type_id
{ "container_type_id" : 1 }
The "Container Type ID" property.
container_type_id
{ "container_type_id" : 1 }
The "Container Type ID" property.
damage_type
{ "damage_type" : "none" }
The "Damage Type" property. Allowed: "none", "noted", "unnoted".
weight_discrepancy
{ "weight_discrepancy" : "none" }
The "Weight Discrepancy" property. Allowed: "none", "shortage_noted", "shortage_unnoted", "overage", "unknown".
tare_weight
{ "tare_weight" : 1.75 }
The "Tare Weight" property.
weight
{ "weight" : 3.5 }
The "Weight" property.
weighed_at
{ "weighed_at" : "2014-06-26 13:49:15" }
The "Weighed At" property.
weighed_by
{ "weighed_by" : 1 }
The "Weighed By" property.
contents Array of "content" objects. See "Container Content Properties".
notes
{ "notes" : "Note text." }
The "Notes" property.

Container Content Properties

delivery_item_id
{ "delivery_item_id" : 1 }
The internal delivery item ID.
qty_counted
{ "qty_counted" : 5 }
The "Quantity Counted" property.
qty_shortage
{ "qty_shortage" : 2 }
The "Quantity Shortage" property.

Exception Properties

delivery_exception_id
{ "delivery_exception_id" : 2 }
The internal delivery exception ID.
delivery_id
{ "delivery_id" : 3 }
The internal delivery ID.
delivery_item_id
{ "delivery_item_id" : 4 }
The internal delivery item ID.
container_id
{ "container_id" : 5 }
The internal container ID.
status
{ "status" : "pending" }
The "Status" property. Allowed: "new", "pending", "approved", "rejected", "void".
sign
{ "sign" : 1 }
The "Sign" property. Allowed: "-1" - shortage, "1" - overage.
reason
{ "reason" : "overage_counted" }
The "Reason" property. Allowed: "overage_counted", "overage_unexpected", "shortage_damaged", "shortage_missing".
comment
{ "comment" : "Comment text here." }
The "Comment" property.
qty
{ "qty" : 1 }
The "Quantity" property.