Twitter RestAPI Documentation
SANDBOX
API URL: `api.netuniversecorp.com`
API SANDBOX PORT: `3002`
Features
Authentication
All requests must contain the API Key provided in the Authorization header. Sample call:
curl --request GET 'api.netuniversecorp.com:3002/api/salesorders/16555/tracking' \
--header 'Authorization: API-KEY-123'
Create sales order
ENDPOINT
/api/salesorders
METHOD
POST
HEADERS
This endpoint requires an additional header to be provided alongside the Authorization header.
--header 'Content-Type: application/json'
--header 'Authorization: API-KEY-123'
REQUEST BODY
Request body should be a JSON with the following format and data types:
{
"it_ticket": "IT-111111",
"twitter-region": "1",
"shipping": {
"first_name": "Sponge",
"last_name": "Bob",
"address_1": "Pineapple under the sea",
"address_2": "",
"city": "Bikini Bottom",
"state": "CA",
"postcode": "94103",
"country": "US",
"shipping_email": "spongebob@gmail.com",
"shipping_mobile": "555 11122233"
},
"line_items": [
{
"sku": "5060408462331",
"quantity": "2"
},
{
"sku": "AVC002BTBK",
"quantity": "1"
}
]
}
IMPORTANT: twitter-region must be either “1”, “2” or “3”
"1": "North America- Latam"
"2": "EMEA"
"3": "APAC"
SUCCESS RESPONSES
STATUS CODE: 200
When order is created, the response is a JSON with the created order
{ id : integer, billing: {...}, shipping: {...}, line_items: [...] }
When request was successful but no product was found with given sku, the response will be a JSON describing the problem
`{ "error": "No product found with sku 1234ABC" }`
FAILURE RESPONSES
STATUS CODE: 400
– If request body could not be validated, the response will be a JSON describing the problem:
`{ "error" : "line_items must be an array/list" }`
SAMPLE CALL
curl \
--request POST 'api.netuniversecorp.com:3002/api/salesorders' \
--header 'Content-Type: application/json' \
--header 'Authorization: API-KEY-123' \
--data-raw '{
"it_ticket": "IT-111111",
"twitter-region": "2",
"shipping": {
"first_name": "Sponge",
"last_name": "Bob",
"address_1": "Pineapple under the sea",
"address_2": "",
"city": "Bikini Bottom",
"state": "CA",
"postcode": "94103",
"country": "US",
"shipping_email": "spongebob@gmail.com",
"shipping_mobile": "555 11122233"
},
"line_items": [
{
"sku": "5060408462331",
"quantity": "2"
},
{
"sku": "AVC002BTBK",
"quantity": "1"
}
]
}'
Get tracking number by order number
Retrieves tracking number/s of a given sales order
ENDPOINT
/api/salesorders/:id/tracking
METHOD
GET
SUCCESS RESPONSES
STATUS CODE: 200
When order has tracking number/s the response is:
[
{
"tracking_number": "string",
"status": "string"
}
]
If no order was found with given sales order number or if order has no tracking numbers associated it returns empty array/list: [ ]
FAILURE RESPONSES
STATUS CODE: 400
– If request body could not be validated, the response will be a JSON describing the problem:
SAMPLE CALL
curl --request GET 'api.netuniversecorp.com:3002/api/salesorders/16555/tracking' \
--header 'Authorization: API-KEY-123'
Get product variations with parent product sku
Some products in our store contain variations. This endpoint retrieves the SKUs of these variations, given the parent product SKU.
ENDPOINT
/api/products/:sku/variations
METHOD
GET
SUCCESS RESPONSES
STATUS CODE: 200
When product has variations the response is:
[
{
"sku": "LPTCOLLBXNC-1",
"name": "Return Label",
"option": "NO"
},
{
"sku": "LPTCOLLBXWC-1",
"name": "Return Label",
"option": "Yes"
}
]
If the sku given has no variations, it returns empty array/list –> [ ]
SAMPLE CALL
curl --request GET 'api.netuniversecorp.com:3002/api/products/EXSKU123/variations'`
--header 'Authorization: API-KEY-123'