{
"swagger": "2.0",
"info": {
"title": "Customers",
"version": "1.0",
"description": "Provides methods for working with customer objects and data."
},
"host": "dsapi.directscale.com",
"basePath": "/v1/customers",
"schemes": [
"https"
],
"securityDefinitions": {
"apiKeyHeader": {
"type": "apiKey",
"name": "Ocp-Apim-Subscription-Key",
"in": "header"
},
"apiKeyQuery": {
"type": "apiKey",
"name": "subscription-key",
"in": "query"
}
},
"security": [
{
"apiKeyHeader": []
},
{
"apiKeyQuery": []
}
],
"paths": {
"/{customerId}/reward-points": {
"post": {
"description": "This API adds Reward Points to a given Customer's Reward Point ledger. Please read below for important functionality constraints:\r\n- The \"Source\" of the Reward Points will display as \"Public API\".\r\n- The Reward Points will become immediately available.\r\n- The Expiration Date of the Reward Points created using this API is 365 days.",
"operationId": "add-customer-reward-points",
"summary": "Add Customer Reward Points",
"tags": [
"RewardPoints",
"Customers"
],
"parameters": [
{
"name": "customerId",
"in": "path",
"description": "The ID of the Customer to whom the reward points are to be added",
"required": true,
"type": "number"
},
{
"name": "addCustomerRewardPointsRequest",
"in": "body",
"schema": {
"$ref": "#/definitions/AddCustomerRewardPointsRequest"
}
}
],
"consumes": [
"application/json"
],
"responses": {
"201": {
"description": "The operation was executed successfully"
},
"400": {
"description": "Returns one of an array of different error possibilities. Please refer to the error description in the `x-directscale-message` header for greater detail."
}
}
},
"delete": {
"description": "This API deducts Reward Points from a given Customer's Reward Point ledger. Please read below for important functionality constraints:\r\n- The amount of Reward Points may be positive or negative. Regardless, the absolute value of the number provided will be deducted from the Customer's Reward Point ledger.\r\n- The \"Source\" of the Reward Points will display as \"Public API\".\r\n- __IMPORTANT__: There is no safeguard against a negative reward point ledger balance. Deductions larger than the remaining ledger balance can go negative. Please verify you are using this API in accordance with desired business workflows.",
"operationId": "60884498ddcd7c8eeb0ab3e7",
"summary": "Deduct Customer Reward Points",
"tags": [
"RewardPoints",
"Customers"
],
"parameters": [
{
"name": "customerId",
"in": "path",
"description": "The ID of the Customer to whom the reward points are to be deducted",
"required": true,
"type": "number"
},
{
"name": "deductCustomerRewardPointsRequest",
"in": "body",
"schema": {
"$ref": "#/definitions/DeductCustomerRewardPointsRequest"
}
}
],
"consumes": [
"application/json"
],
"responses": {
"200": {
"description": "The Reward Points were successfully deducted from the Customer's Reward Point ledger."
},
"400": {
"description": "Returns one of an array of different error possibilities. Please refer to the error description in the `x-directscale-message` header for greater detail."
}
}
},
"get": {
"description": "This API retrieves the total amount of Reward Points for a given Customer.",
"operationId": "get-customer-rewards-points",
"summary": "Get Customer Reward Points",
"tags": [
"RewardPoints",
"Customers"
],
"parameters": [
{
"name": "customerId",
"in": "path",
"description": "The ID of the Customer whose reward points are to be retrieved",
"required": true,
"type": "number"
}
],
"responses": {
"200": {
"description": "The operation was executed successfully"
},
"400": {
"description": "Returns one of an array of different error possibilities. Please refer to the error description in the `x-directscale-message` header for greater detail."
}
}
}
},
"/{customerId}/orders/calculate": {
"post": {
"description": "Calculates a Customer Order Total based on a valid Customer Order object.
\r\n\r\nYou can get the **Request Parameter** at these calls:\r\n\r\n**customerId**\r\n- Get Customer IDs\r\n- Get Customer IDs by Filter",
"operationId": "58e3a27d370f72f9d8cc2bdf",
"summary": "Calculate Customer Order Total",
"tags": [
"Customers"
],
"parameters": [
{
"name": "customerId",
"in": "path",
"description": "The ID of the Customer whose Order Total is to be calculated.",
"required": true,
"type": "string"
},
{
"name": "calculateCustomerOrderRequest",
"in": "body",
"schema": {
"$ref": "#/definitions/CalculateCustomerOrderRequest"
},
"description": "Required Fields:\r\n- CurrencyCode\r\n - **Get Regions** displays the country/state codes of the warehouses. If you are concerned about having the proper **CurrencyCode**, then this will allow you to know what region warehouse support team to call to get the confirmed **CurrencyCode**.\r\n- ShipMethodId\r\n - Get ShippingMethod(s)\r\n- ShippingAddress\r\n - Get Customer\r\n- ItemId\r\n - Products: Get Item by ID\r\n - Products: Get Item by Filter\r\n- Quantity\r\n - Amount of the item wanted to be purchased"
}
],
"consumes": [
"application/json (full)",
"application/json (minimal)"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Returns a calculated Order Total.",
"schema": {
"$ref": "#/definitions/CalculateCustomerOrderResponse"
},
"examples": {
"application/json": {
"CouponResults": [
{
"Code": "TST_CPN_1",
"IsValid": true,
"Message": null,
"Discount": 5.0
},
{
"Code": "TST_CPN_2",
"IsValid": false,
"Message": "This is an invalid coupon",
"Discount": 0
}
],
"CurrencyCode": "usd",
"DiscountTotal": 5.0,
"Items": [
{
"ItemId": 1,
"Bonus": 0,
"ChargeShipping": false,
"CurrencyCode": "usd",
"Cv": 5,
"Description": "Test Item (desc)",
"ExtendedBonus": 0,
"ExtendedCv": 5,
"ExtendedPrice": 10,
"ExtendedQv": 4,
"LanguageCode": "en",
"OriginalPrice": 10,
"Price": 10,
"ProductName": "Test Item",
"Sku": "DRTSCL",
"Specifications": "Test Item (specs)",
"Quantity": 1,
"Qv": 4
}
],
"ShippingMethods": [
{
"ShipMethodId": 1,
"Description": "Standard Shipping",
"ShippingAmount": 5.0
},
{
"ShipMethodId": 12,
"Description": "Universal Flat Rate Method",
"ShippingAmount": 12.0
}
],
"ShippingTotal": 5.0,
"SubTotal": 15.0,
"TaxableSubtotal": 0,
"TaxTotal": 0,
"Total": 10.0
}
}
},
"404": {
"description": "A Customer with the given Customer ID was not found."
},
"500": {
"description": "Something went wrong... Here are some possible reasons for this error:\r\n- Is the model being sent to the API incorrect?\r\n- Did you forget a required field?\r\n- Is the API marked as deprecated, and the date has expired?\r\n\r\nIf the answer is \"No\" to all of these questions, DirectScale could be experiencing technical difficulties. Please contact your DirectScale representative if the issue persists."
}
}
}
},
"/": {
"post": {
"description": "Creates a new Customer based on a valid Customer object.
\r\n\r\n**Date + Time format**\r\n\r\nYear-Month-Day'T'MilitaryTimeHour:Minute:Second\r\n- Ex. 2018-10-30T15:47:52",
"operationId": "57fe7e33cb00f20ae896cc6b",
"summary": "Create Customer",
"tags": [
"Customers"
],
"parameters": [
{
"name": "createCustomer",
"in": "body",
"schema": {
"$ref": "#/definitions/CreateCustomer"
},
"description": "**Required Fields (based on customerType):**\r\n- BirthDate (1)\r\n - Get Customer\r\n- CustomerType (1, 2, 3)\r\n - Get Customer\r\n- DefaultShippingAddress (1)\r\n - street1\r\n - PostalCode\r\n - City\r\n - CountryCode\r\n- EmailAddress (1, 2, 3)\r\n - Get Customer\r\n- FirstName (1, 2, 3)\r\n - Get Customer\r\n- LastName (1, 2, 3)\r\n - Get Customer\r\n- Password (1, 2)\r\n- PrimaryAddress (1, 2, 3)\r\n - street1\r\n - Region\r\n - CountryCode\r\n- SponsorId (1, 2, 3)\r\n - Get Customer\r\n- TaxId (1)\r\n - Get Customer\r\n- TermsAccepted (1)\r\n- Username (1, 2, 3)\r\n - Get Customer\r\n\r\nUniqueness Required:\r\n- BackOfficeId\r\n- EmailAddress\r\n- TaxId\r\n- Username\r\n- WebAlias\r\n\r\n**NOTE:** Unique variables can be validated with our **Validate** API calls.\r\n\r\n
\r\nNote: Many of the property's behaviors can be changed by the implementation of the commission plan to allow the property to be optional or have different uniqueness characteristics. Please contact your support representative for specific details.
\r\n"
}
],
"consumes": [
"application/json (full)",
"application/json (customerType: 1)",
"application/json (customerType: 2)",
"application/json (customerType: 3)"
],
"responses": {
"201": {
"description": "Signifies that the Customer was created successfully."
},
"500": {
"description": "Something went wrong... Here are some possible reasons for this error:\r\n- Is the model being sent to the API incorrect?\r\n- Did you forget a required field?\r\n- Is the API marked as deprecated, and the date has expired?\r\n\r\nIf the answer is \"No\" to all of these questions, DirectScale could be experiencing technical difficulties. Please contact your DirectScale representative if the issue persists."
}
}
},
"get": {
"description": "Retrieves an array of Customers based on a valid parameter of choice.
\r\nNote: This API allows for multiple parameters, however only one parameter should be passed to the API at any given time, as only one will be honored.
\r\n\r\nYou can get the **Request Parameters** at this call:\r\n- Get Customer\r\n\r\n**NOTE:** Do not include spaces between words.\r\n - Format: FirstnameLastname\r\n - Ex. SamSpace",
"operationId": "57fe681ecb00f20ae896cc69",
"summary": "Get Customers By Parameter",
"tags": [
"Customers"
],
"parameters": [
{
"name": "backofficeid",
"in": "query",
"description": "The Back Office ID of the Customer(s) to retrieve. ",
"type": "string"
},
{
"name": "externalreferenceid",
"in": "query",
"description": "The External Reference ID of the Customer(s) to retrieve. ",
"type": "string"
},
{
"name": "email",
"in": "query",
"description": "The Email Address of the Customer(s) to retrieve. ",
"type": "string"
},
{
"name": "username",
"in": "query",
"description": "The Username of the Customer(s) to retrieve. ",
"type": "string"
},
{
"name": "webalias",
"in": "query",
"description": "The Web Alias of the Customer(s) to retrieve. ",
"type": "string"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Returns an array of valid Customer objects.",
"examples": {
"application/json": [
{
"CustomerId": 2,
"BackOfficeId": "ABC123",
"BirthDate": "1988-04-01T00:00:00+00:00",
"CompanyName": "Test Company Name",
"CustomerStatus": 1,
"CustomerType": 1,
"DefaultShippingAddress": {
"AddressId": 15714,
"Street1": "7432 Maytown Road",
"Street2": "",
"Street3": "",
"City": "Springfield",
"Region": "NT",
"PostalCode": "49007",
"CountryCode": "US"
},
"EmailAddress": "testing@testing.directscale.com",
"EnrollerId": 2,
"ExternalReferenceId": "TEST123",
"FirstName": "TestFirst",
"InactiveDate": "1900-01-01T00:00:00+00:00",
"LanguageCode": "EN",
"LastName": "TestLast",
"PrimaryAddress": {
"AddressId": 15714,
"Street1": "7432 Maytown Road",
"Street2": "",
"Street3": "",
"City": "Springfield",
"Region": "NT",
"PostalCode": "49007",
"CountryCode": "US"
},
"PrimaryPhone": "+1 555 555 1111",
"SecondaryPhone": "+1 555 555 2222",
"SendEmails": false,
"SignupDate": "2014-10-30T00:00:00+00:00",
"SponsorId": 1,
"TaxExemptId": "11-ASDF-1234",
"TaxId": "152-55-6765",
"TermsAccepted": true,
"TextPhone": "+1 555 555 1111",
"Username": "myUsername",
"WebAlias": "hello-world-web-alias"
}
]
}
},
"404": {
"description": "No Customers with the given parameter were found."
},
"500": {
"description": "Something went wrong... Here are some possible reasons for this error:\r\n- Is the model being sent to the API incorrect?\r\n- Did you forget a required field?\r\n- Is the API marked as deprecated, and the date has expired?\r\n\r\nIf the answer is \"No\" to all of these questions, DirectScale could be experiencing technical difficulties. Please contact your DirectScale representative if the issue persists."
}
}
}
},
"/{customerId}/autoship": {
"post": {
"description": "Creates an Autoship Order for the given Customer ID.
\r\nIf the ShippingAddress is not included in the json or set to null then the default shipping address for the customer will be used.
\r\n\r\nYou can get the **Request Parameter** at these calls:\r\n\r\n**customerId**\r\n- Get Customer IDs\r\n- Get Customer IDs by Filter",
"operationId": "58fba8ab322c2752fd451a8f",
"summary": "Create Customer Autoship Order",
"tags": [
"Orders",
"Autoships",
"Customers"
],
"parameters": [
{
"name": "customerId",
"in": "path",
"description": "The ID of the Customer for whom an Autoship Order will be created.",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"schema": {
"example": {
"StartDate": "2020-03-13T19:40:51.597+00:00",
"ShipMethodId": 1,
"Items": [
{
"ItemId": 17901
}
],
"ShipAddress": {
"Street1": "350 S 400 W",
"City": "Lindon",
"Region": "UT",
"PostalCode": "84042",
"CountryCode": "us"
}
}
},
"description": "Creates an autoship for the CustomerID provided in the URL.\r\n\r\n**Required Fields:**\r\n- StartDate\r\n- ShipMethodId\r\n- Items\r\n - ItemId\r\n- ShipAddress\r\n - Street1\r\n - City\r\n - Region\r\n - PostalCode\r\n - CountryCode"
}
],
"consumes": [
"application/json (full)",
"application/json (minimal)"
],
"responses": {
"201": {
"description": "Signifies that the Autoship Order was created successfully."
},
"404": {
"description": "A Customer with the given Customer ID was not found."
},
"500": {
"description": "Something went wrong... Here are some possible reasons for this error:\r\n- Is the model being sent to the API incorrect?\r\n- Did you forget a required field?\r\n- Is the API marked as deprecated, and the date has expired?\r\n\r\nIf the answer is \"No\" to all of these questions, DirectScale could be experiencing technical difficulties. Please contact your DirectScale representative if the issue persists."
}
}
}
},
"/{customerId}/orders": {
"post": {
"description": "Creates an Order for the given Customer Id.
\r\n\r\nYou can get the **Request Parameter** at these calls:\r\n\r\n**customerId**\r\n- Get Customer IDs\r\n- Get Customer IDs by Filter",
"operationId": "58995107b3ac881388ae1037",
"summary": "Create Customer Order",
"tags": [
"Orders",
"Customers"
],
"parameters": [
{
"name": "customerId",
"in": "path",
"description": "The Id of the customer for whom an order will be created.",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"schema": {
"example": "{\r\n \"Attention\": \"ATTN: Bob McFerrin\",\r\n \"CouponCodes\": [\r\n \"Coupon123\"\r\n ],\r\n \"CurrencyCode\": \"usd\",\r\n \"FirstName\": \"Samuel\",\r\n \"Items\": [\r\n {\r\n \"ItemId\": 4,\r\n \"Quantity\": 1,\r\n \"IsReward\": false\r\n }\r\n ],\r\n \"LastName\": \"Spacey\",\r\n \"OrderType\": 1,\r\n \"PartyId\": 1,\r\n \"Payments\": [\r\n {\r\n \"Amount\": 10,\r\n \"SavePaymentMethodId\": 1,\r\n \"OnFileCard\": \"DoNotSave\",\r\n \"CurrencyCode\": \"usd\",\r\n \"MerchantId\": 99, // Test Merchant\r\n \"SavePayment\": true,\r\n \"OrderRewardPoints\": {\r\n \"Amount\": 0\r\n },\r\n \"OrderCreditCard\": {\r\n \"CardToken\": \"abc123456\",\r\n \"NameOnCard\": \"Sammy Spacey\",\r\n \"Last4\": \"1234\",\r\n \"CardType\": \"Visa\",\r\n \"ExpirationMonth\": 12,\r\n \"ExpirationYear\": 2022\r\n }\r\n }\r\n ],\r\n \"Phone\": \"801-555-5555\",\r\n \"PriceGroup\": 1,\r\n \"ShipMethodId\": 1,\r\n \"ShippingAddress\": {\r\n \"Line1\": \"555 W Center St\",\r\n \"Line2\": \"Apt 5b\",\r\n \"City\": \"Lindon\",\r\n \"State\": \"UT\",\r\n \"Zip\": \"81234\",\r\n \"CountryCode\": \"us\"\r\n },\r\n \"SpecialInstructions\": \"Leave it on the porch, please\",\r\n \"StoreId\": 1,\r\n \"WarehouseId\": 1,\r\n \"CountryCode\": \"us\",\r\n \"Custom\": {\r\n \"Field1\": \"Custom Field 1\",\r\n \"Field2\": \"string\",\r\n \"Field3\": \"string\",\r\n \"Field4\": \"string\",\r\n \"Field5\": \"Custom Field 5\"\r\n }\r\n}"
},
"description": "Required Fields:\r\n- CurrencyCode\r\n - **Get Regions** displays the country/state codes of the warehouses. If you are concerned about having the proper **CurrencyCode**, then this will allow you to know what region warehouse support team to call to get the confirmed **CurrencyCode**.\r\n- Items*\r\n - Products: Get Item by Filter\r\n - Products: Get Item by SKU\r\n - Products: Get Item by Id\r\n- Payments*\r\n- ShipMethodId\r\n - Orders: Get Shipping Methods\r\n- ShippingAddress\r\n - Get Customer\r\n- StoreId\r\n - Products: Get Stores\r\n\r\nOnFileCard Options:\r\n- Unknown\r\n- DoNotSave\r\n- Primary\r\n- Secondary\r\n- OneTimeUse\r\n\r\nOrder Types:\r\n- Standard (1) - This refers to any order that is not created from an autoship template, and is not the first order created for a user from enrollment.\r\n- Autoship (2) - This refers to orders created from an autoship template.\r\n- Enrollment (3) - This refers to the very first order placed by a user, usually from an enrollment form.\r\n