{
    "additionalProperties": true,
    "definitions": {},
    "description": "order_pull_v1",
    "links": [
        {
            "description": "order_pull_v1",
            "href": "/order_pull_v1",
            "method": "post",
            "rel": "instances",
            "schema": {
                "allOf": [
                    {
                        "properties": {
                            "action": {
                                "description": "Action Name name",
                                "example": "catalog_get_config",
                                "type": "string"
                            },
                            "channel_info": {
                                "properties": {
                                    "id": {
                                        "description": "channel id",
                                        "example": 21,
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            },
                            "client_id": {
                                "description": "RetailOPS client id",
                                "example": 497,
                                "type": "integer"
                            },
                            "integration_auth_token": {
                                "description": "Randomly generated authorization token, for authenticating genuine RetailOps- originated requests.",
                                "example": "2KuxqV9rsAtAM78i47CITMvtnflUapNmgGJAvWiHqgUrk1xkeDNWlM3EsrmJEtmV",
                                "type": "string"
                            },
                            "version": {
                                "description": "Action Version",
                                "example": 1,
                                "type": "integer"
                            }
                        },
                        "required": [
                            "action",
                            "version",
                            "client_id",
                            "channel_info"
                        ],
                        "type": "object"
                    },
                    {
                        "properties": {
                            "page_token": {
                                "description": "Initially blank, subsequent calls will specifiy the value returned from next_page_token. Your implementation should encode any state information required for order retrieval into this value. If your channel order retrival implementation requires the data which is encoded in page_token, it MUST handle a blank page_token gracefully, and respond with a valid and appropriate next_page_token",
                                "type": "string"
                            },
                            "specific_orders": {
                                "description": "RetailOps may occasionally wish to re-fetch a specific order, or small group of orders. When specified, any next_page_token which is provided will be ignored.",
                                "items": {
                                    "description": "List of specific orders which are desired to be fetched or re-fetched. Any filtering of acknolwedged orders should be disabled for this function",
                                    "properties": {
                                        "channel_refnum": {
                                            "description": "Channel reference number for one of the desired orders",
                                            "example": "141",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                },
                                "type": "array"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "targetSchema": {
                "properties": {
                    "next_page_token": {
                        "description": "In order to affect retieval of large numbers of orders, pagination is generally required. Your implementation should construct a next_page_token value which contains sufficient state information to retrieve the next 'page' of orders. This value will be passed in to a subsequent order_pull call using the page_token field. Return an empty string if there are no additional pages",
                        "type": "string"
                    },
                    "orders": {
                        "description": "List of orders retrieved from the channel. Cannot exceed 100 orders per request. Your implementation MUST NOT consider the order as having been imported until such time as order_acknolwledge is called with the specific order reference numbers.",
                        "items": {
                            "properties": {
                                "attributes": {
                                    "description": "Attributes which pertain to the order",
                                    "items": {
                                        "properties": {
                                            "attribute_type": {
                                                "description": "Type of attribute being specified",
                                                "enum": [
                                                    "text",
                                                    "number",
                                                    "select",
                                                    "multiselect"
                                                ],
                                                "example": "text",
                                                "type": "string"
                                            },
                                            "handle": {
                                                "description": "Unique identifier",
                                                "example": "customer_rewards_number",
                                                "maxLength": 100,
                                                "minLength": 2,
                                                "type": "string"
                                            },
                                            "value": {
                                                "description": "value of attribute",
                                                "example": "XXX_XXXXXX_XXX",
                                                "maxLength": 100,
                                                "minLength": 2,
                                                "type": "string"
                                            }
                                        },
                                        "type": "object"
                                    },
                                    "type": [
                                        "array",
                                        "null"
                                    ]
                                },
                                "billing_address": {
                                    "properties": {
                                        "address1": {
                                            "description": "Address line one",
                                            "example": "123 Main St",
                                            "type": "string"
                                        },
                                        "address2": {
                                            "description": "Address second line",
                                            "example": "suite 100",
                                            "type": "string"
                                        },
                                        "city": {
                                            "description": "City",
                                            "example": "San Diego",
                                            "type": "string"
                                        },
                                        "company": {
                                            "description": "Company name",
                                            "example": "gudTECH",
                                            "type": "string"
                                        },
                                        "country_match": {
                                            "description": "Country",
                                            "example": "'US' or 'United States'",
                                            "type": "string"
                                        },
                                        "first_name": {
                                            "description": "First Name",
                                            "example": "John",
                                            "type": "string"
                                        },
                                        "last_name": {
                                            "description": "Last Name",
                                            "example": "Smith",
                                            "type": "string"
                                        },
                                        "phone_number": {
                                            "description": "contact phone number for address",
                                            "example": "(555) 867-5309",
                                            "type": "string"
                                        },
                                        "postal_code": {
                                            "description": "Postal Code",
                                            "example": "92101",
                                            "type": "string"
                                        },
                                        "state_match": {
                                            "description": "state",
                                            "example": "CA",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                },
                                "cancel": {
                                    "description": "Indicates that the order has been cancelled by the channel. Used for cancelling orders in in Retailops that are in 'channel incomplete' status. Default is 'false'",
                                    "example": false,
                                    "type": "boolean"
                                },
                                "channel_date_created": {
                                    "description": "Date the order was created in the channel in ISO8610 format. Don't just use the present time, if it can be avoided.",
                                    "example": "2016-01-01T00:42:42Z",
                                    "format": "date-time",
                                    "type": "string"
                                },
                                "channel_order_refnum": {
                                    "description": "Channel's identifier for this order. This value will be used for acknowledgement, completion, and other interactions",
                                    "example": "X123",
                                    "type": "string"
                                },
                                "currency_code": {
                                    "description": "ISO4217 Currency code for the counterparty (transaction) currency",
                                    "enum": [
                                        "AUD",
                                        "CAD",
                                        "CHF",
                                        "EUR",
                                        "GBP",
                                        "HKD",
                                        "JPY",
                                        "MXN",
                                        "NZD",
                                        "PLN",
                                        "SGD",
                                        "USD"
                                    ],
                                    "type": "string"
                                },
                                "currency_values": {
                                    "description": "Currency values which pertain to the whole order, but are not included in the respective item values. EG: if the item shipping is $1 for each of 10 items, for a total of $10, the shipping_amt here should be $0, and the per-item shipping_amt should be $1; If the order shipping is $10 none of which is directly attributable to specific items, then shipping_amt here should be $10",
                                    "properties": {
                                        "discount_amt": {
                                            "description": "Discount Amount",
                                            "example": 0,
                                            "type": "number"
                                        },
                                        "shipping_amt": {
                                            "description": "Shipping",
                                            "example": 5.75,
                                            "type": "number"
                                        },
                                        "tax_amt": {
                                            "description": "Tax Amount",
                                            "example": 4.47,
                                            "type": "number"
                                        }
                                    },
                                    "type": "object"
                                },
                                "customer_info": {
                                    "description": "customer",
                                    "properties": {
                                        "email_address": {
                                            "description": "Customer email address",
                                            "example": "john@gudtech.com",
                                            "type": "string"
                                        },
                                        "full_name": {
                                            "description": "Customer's full name",
                                            "example": "John Smith",
                                            "type": "string"
                                        },
                                        "phone_number": {
                                            "description": "customer phone",
                                            "example": "(619)555-5555",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                },
                                "gift_message": {
                                    "description": "Gift message for this order",
                                    "example": "Happy Birthday Kiddo!",
                                    "type": "string"
                                },
                                "ip_address": {
                                    "description": "IP address used to place order",
                                    "example": "61.2.7.122",
                                    "type": "string"
                                },
                                "order_items": {
                                    "items": {
                                        "properties": {
                                            "channel_item_refnum": {
                                                "description": "Channel reference number for this order line item",
                                                "example": "496",
                                                "type": "string"
                                            },
                                            "currency_values": {
                                                "properties": {
                                                    "discount_amt": {
                                                        "type": "number"
                                                    },
                                                    "discount_pct": {
                                                        "type": "number"
                                                    },
                                                    "recycling_amt": {
                                                        "type": "number"
                                                    },
                                                    "ship_amt": {
                                                        "type": "number"
                                                    },
                                                    "shiptax_amt": {
                                                        "type": "number"
                                                    },
                                                    "unit_price": {
                                                        "type": "number"
                                                    },
                                                    "unit_tax": {
                                                        "type": "number"
                                                    },
                                                    "unit_tax_pct": {
                                                        "type": "number"
                                                    },
                                                    "vat_pct": {
                                                        "type": "number"
                                                    }
                                                },
                                                "type": "object"
                                            },
                                            "item_type": {
                                                "description": "Item type determines the behavior of the RetailOps order routing system. Use 'ship' for items you wish to be shipped by RetailOps. Use 'advisory' for items which are non-shippable or have already been shipped. Use 'instore' for items which have been purchased in a physical store",
                                                "enum": [
                                                    "ship",
                                                    "advisory",
                                                    "instore"
                                                ],
                                                "type": "string"
                                            },
                                            "options": {
                                                "items": {
                                                    "properties": {
                                                        "code": {
                                                            "description": "option code, up to 255 characters. Will be displayed in UI if name is empty",
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "description": "Free form display name (up to 255 characters). If name is blank, RetailOps UI will display the option code",
                                                            "type": "string"
                                                        },
                                                        "type": {
                                                            "description": "Type of option, acceptable values are bool, text, and image.  If type is image, you must pass an image url. If type is bool,  pass a string representation of a boolen \"true\" or \"false\"",
                                                            "enum": [
                                                                "text",
                                                                "bool",
                                                                "image"
                                                            ],
                                                            "type": "string"
                                                        },
                                                        "value": {
                                                            "description": "string value of the option, free form up to 255 characters",
                                                            "type": "string"
                                                        }
                                                    },
                                                    "type": "object"
                                                },
                                                "type": [
                                                    "array",
                                                    "null"
                                                ]
                                            },
                                            "quantity": {
                                                "description": "SKU Quantity for this item",
                                                "example": 1,
                                                "type": "integer"
                                            },
                                            "sku": {
                                                "description": "SKU number to which this order line item is associated",
                                                "example": "S1234",
                                                "type": "string"
                                            },
                                            "sku_description": {
                                                "description": "Used to describe the item in the case where RetailOps does not have a matching SKU",
                                                "example": "Men's Shaving Kit",
                                                "type": "string"
                                            }
                                        },
                                        "type": "object"
                                    },
                                    "type": [
                                        "array",
                                        "null"
                                    ]
                                },
                                "payment_transactions": {
                                    "items": {
                                        "properties": {
                                            "amount": {
                                                "description": "Transaction amount",
                                                "example": 100.32,
                                                "type": "number"
                                            },
                                            "message": {
                                                "description": "Optional message to record info regarding transaction.",
                                                "example": "Gift card purchase for promotion XYZ",
                                                "type": "string"
                                            },
                                            "payment_processing_type": {
                                                "description": "Indicates what type of payment RetailOps should record in its payment system. types beginning with channel_ are delegated to the channel for processing. Other types may be handled directly with the payment processor, if the account is on file",
                                                "enum": [
                                                    "channel_payment",
                                                    "channel_storecredit",
                                                    "channel_giftcert",
                                                    "authorize.net"
                                                ],
                                                "type": "string"
                                            },
                                            "payment_type": {
                                                "description": "Payment type for this transaction. Free-form",
                                                "example": "Visa (or MasterCard, giftcard, etc...)",
                                                "type": "string"
                                            },
                                            "transaction_type": {
                                                "description": "",
                                                "enum": [
                                                    "auth",
                                                    "charge",
                                                    "capture",
                                                    "giftcard"
                                                ],
                                                "type": "string"
                                            }
                                        },
                                        "type": "object"
                                    },
                                    "type": [
                                        "array",
                                        "null"
                                    ]
                                },
                                "ship_service_code": {
                                    "description": "Code identifying the level of service. Could be generic 'Slow' / 'Fast' or Specific 'Fedex Ground'",
                                    "example": "Ground (5-7 days)",
                                    "minLength": 1,
                                    "type": "string"
                                },
                                "shipping_address": {
                                    "properties": {
                                        "address1": {
                                            "description": "Address line one",
                                            "example": "123 Main St",
                                            "type": "string"
                                        },
                                        "address2": {
                                            "description": "Address second line",
                                            "example": "suite 100",
                                            "type": "string"
                                        },
                                        "city": {
                                            "description": "City",
                                            "example": "San Diego",
                                            "type": "string"
                                        },
                                        "company": {
                                            "description": "Company name",
                                            "example": "gudTECH",
                                            "type": "string"
                                        },
                                        "country_match": {
                                            "description": "Country",
                                            "example": "'US' or 'United States'",
                                            "type": "string"
                                        },
                                        "first_name": {
                                            "description": "First Name",
                                            "example": "John",
                                            "type": "string"
                                        },
                                        "last_name": {
                                            "description": "Last Name",
                                            "example": "Smith",
                                            "type": "string"
                                        },
                                        "phone_number": {
                                            "description": "contact phone number for address",
                                            "example": "(555) 867-5309",
                                            "type": "string"
                                        },
                                        "postal_code": {
                                            "description": "Postal Code",
                                            "example": "92101",
                                            "type": "string"
                                        },
                                        "state_match": {
                                            "description": "state",
                                            "example": "CA",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                },
                                "tags": {
                                    "description": "List of text order tags that can be applied to this order (array of strings)",
                                    "example": "['example tag','test']",
                                    "items": {
                                        "type": "string"
                                    },
                                    "maxItems": 100,
                                    "type": [
                                        "array",
                                        "null"
                                    ]
                                }
                            },
                            "type": "object"
                        },
                        "maxItems": 100,
                        "type": [
                            "array",
                            "null"
                        ]
                    }
                },
                "type": "object"
            },
            "title": "/order_pull_v1"
        }
    ],
    "properties": {},
    "stability": "draft",
    "title": "/order_pull_v1",
    "type": "object"
}