Purchases

POST /purchases

Create a new purchase. This endpoint is near real time, the purchase will be enqueued to be processed.

Important: only one of the customers identifier (email, document, service_uid) is required so the API can relate the purchase to an user. Using hard identifiers is highly recommended.

Maximum size of data sent is 256KB

The json with the purchase should be valid with the following json-schema

Request content format

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "A representation of a purchase",
    "type": "object",
    "anyOf": [
        {"required": ["service_uid", "invoice_number", "purchase_detail", "prices"]},
        {"required": ["email", "invoice_number", "purchase_detail", "prices"]},
        {"required": ["document", "invoice_number", "purchase_detail", "prices"]},
        {"required": ["telephone", "invoice_number", "purchase_detail", "prices"]}
    ],
    "properties": {
        "service_uid": { "type": "string" },
        "email": { "type": "string" },
        "document": { "type": "string" },
        "telephone": { "type": "string" },
        "points": { "type": "number", "multipleOf": 1 },
        "invoice_number": { "type": ["string", "integer"] },
        "channel":{"type": "string",
                    "enum": ["web","telephone", "in-store", "corporate", "direct", "other"]
                },
        "purchase_detail": {
            "type": "array",
            "items": {
                "type": "object",
                "required": ["sku", "quantity", "unit_price"],
                "properties": {
                    "sku": {
                        "type": "string",
                        "minLength": 1,
                        "pattern": "^[^-][a-zA-Z0-9_%-]+$"
                    },
                    "base_name": {"type": "string"},
                    "product_name": {"type": "string"},
                    "category": {
                        "type": "array",
                        "items": {
                            "oneOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "object",
                                    "required": ["id", "name" ],
                                    "properties": {
                                        "id": { "type": "string" },
                                        "name": { "type": "string" },
                                        "url": { "type": "string" },
                                        "image_url": { "type": "string" }
                                    }
                                }
                            ]
                        }
                    },
                    "quantity": { "type": "integer" },
                    "unit_price": { "type": "number" },
                    "variations": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "required": ["name", "value"],
                            "properties": {
                                "name": {"type": "string"},
                                "value": {"type": "string"}
                            }
                        }
                    },
                    "specifications": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "required": ["name", "value"],
                            "properties": {
                                "name": { "type": "string" },
                                "value": { "type": "string" }
                            }
                        }
                    },
                    "brand": {"type": "string"},
                    "description": {"type": "string"},
                    "url": {"type": "string"},
                    "image_url": {"type": "string"},
                    "thumbnail_url": {"type": "string"},
                    "stock": {"type": "number"},
                    "available": {"type": "boolean"},
                    "manufacturer_warranty_date": {"type": "date"},
                    "extension_warranty_date": {"type": "date"},
                    "with_extension_warranty": {"type": "boolean"},
                    "custom_attributes": { "type": "object" }
                }
            }
        },
        "prices": {
            "type": "object",
            "required": ["total"],
            "properties": {
                "cost": { "type": "number" },
                "shipping": { "type": "number" },
                "gross": { "type": "number" },
                "tax": { "type": "number" },
                "discount": { "type": "number" },
                "total": { "type": "number" }
            }
        },
        "payment": {
            "oneOf": [
                {
                    "type": "object",
                    "required": ["type"],
                    "properties": {
                        "type":  { "type": "string",
                        "enum": ['credit', 'debit', 'cash', 'mercadopago', 'other']
                        },
                        "brand": { "type": "string" },
                        "bank":  { "type": "string" },
                        "total":  { "type": "float" },
                        "installments":  { "type": "integer" },
                        "card_first_digits":  { "type": "string", "pattern": "^[0-9]{6}$" }
                    }
                },
                {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "required": ["type","total"],
                        "properties": {
                            "type":  { "type": "string",
                            "enum": ['credit', 'debit', 'cash', 'mercadopago', 'other']
                            },
                            "brand": { "type": "string" },
                            "bank":  { "type": "string" },
                            "total":  { "type": "float" },
                            "installments":  { "type": "integer" },
                            "card_first_digits":  { "type": "string", "pattern": "^[0-9]{6}$" }
                        }
                    }
                }
            ]
        },
        "branch_name": { "type": "string" },
        "seller": {
            "type": "object",
            "required": ["name", "email"],
            "properties": {
                "name": { "type": "string"},
                "email": { "type": "string", "format": "email" },
                "external_id": { "type": "string" }
            }
        },
        "createtime": { "type": "string" },
        "approvedtime": { "type": "string" },
        "metadata": { "type": "object" },
        "custom_attributes": { "type": "object" }
    }
}

Example

This is a valid purchase according to the previous json-schema:

{
  "document": "123456789",
  "points": 24,
  "invoice_number": "FAC-000085643",
  "channel": "web",
  "purchase_detail": [
    {
      "sku": "2907362",
      "product_name": "Heladera Patrick",
      "base_name": "Heladera Patrick",
      "category": [
        { "id": "a", "name": "Electrodomésticos"},
        { "id": "a-b", "name": "Linea blanca"},
        { "id": "a-b-c", "name": "Heladeras"}
      ],
      "quantity": 1,
      "unit_price": 1999.00,
      "variations": [
        {
          "name": "Volumen",
          "value": "100 lts"
        }
      ],
      "brand": "Patrick",
      "description": "Su capacidad total de almacenamiento es de 280 litros. El espacio para refrigerador cuenta con 204 litros para ordenar alimentos y bebidas y el freezer tiene un total de 76 litros para congelados.",
      "url": "http://www.example.com/example",
      "image_url": "http://www.example.com/example",
      "thumbnail_url": "http://www.example.com/example",
      "stock": 10,
      "available": true,
      "specifications": [
        {"name": "Garantia del Fabricante", "value": "12 meses"},
        {"name": "Alto", "value": "143.3 cm"},
        {"name": "Ancho", "value": "60.9 cm"}
      ],
      "manufacturer_warranty_date": "2018-12-31 23:59:59",
      "extension_warranty_date": "2020-12-31 23:59:59",
      "with_extension_warranty": true,
      "custom_attributes": { 
        "millas_aerolineas_plus": 300,
        "codigo_dto": "2354XFD45" 
      }
    }
  ],
  "prices": {
    "cost": 800.00,
    "shipping": 120.00,
    "gross": 1800.00,
    "tax": 199.00,
    "discount": 100.00,
    "total": 1899.00
  },
  "payment":{
    "type":"credit",
    "brand":"Visa",
    "bank": "Example Bank",
    "total": 1899.00,
    "installments": 12,
    "card_first_digits": "123456"
  },
  "branch_name": "Palermo I",
  "seller":{
    "name": "Seller Relles",
    "email": "seller@email.com",
    "external_id": "0001"
  },
  "createtime": "2017-03-23 14:35:22",
  "approvedtime": "2017-03-23 14:35:22",
  "custom_attributes": { 
    "fecha_max_cambio": "2017-03-26"
  }
}

This is an example:

curl -X POST \
  https://api.woowup.com/apiv3/purchases \
  -H 'accept: application/json' \
  -H 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'cache-control: no-cache' \
  -d '{
  "document": "123456789",
  "points": 24,
  "invoice_number": "FAC-000085643",
  "channel": "web",
  "purchase_detail": [
    {
      "sku": "2907362",
      "product_name": "Heladera Patrick",
      "base_name": "Heladera Patrick",
      "category": [
        { "id": "a", "name": "Electrodomésticos"},
        { "id": "a-b", "name": "Linea blanca"},
        { "id": "a-b-c", "name": "Heladeras"}
      ],
      "quantity": 1,
      "unit_price": 1999.00,
      "variations": [
        {
          "name": "Volumen",
          "value": "100 lts"
        }
      ],
      "brand": "Patrick",
      "description": "Su capacidad total de almacenamiento es de 280 litros. El espacio para refrigerador cuenta con 204 litros para ordenar alimentos y bebidas y el freezer tiene un total de 76 litros para congelados.",
      "url": "http://www.example.com/example",
      "image_url": "http://www.example.com/example",
      "thumbnail_url": "http://www.example.com/example",
      "stock": 10,
      "available": true,
      "specifications": [
        {"name": "Garantia del Fabricante", "value": "12 meses"},
        {"name": "Alto", "value": "143.3 cm"},
        {"name": "Ancho", "value": "60.9 cm"}
      ],
      "manufacturer_warranty_date": "2018-12-31 23:59:59",
      "extension_warranty_date": "2020-12-31 23:59:59",
      "with_extension_warranty": true,
      "custom_attributes": { 
        "millas_aerolineas_plus": 300,
        "codigo_dto": "2354XFD45" 
      }
    }
  ],
  "prices": {
    "cost": 800.00,
    "shipping": 120.00,
    "gross": 1800.00,
    "tax": 199.00,
    "discount": 100.00,
    "total": 1899.00
  },
  "payment":{
    "type":"credit",
    "brand":"Visa",
    "bank": "Example Bank",
    "total": 1899.00,
    "installments": 12,
    "card_first_digits": "123456"
  },
  "branch_name": "Palermo I",
  "seller":{
    "name": "Seller Relles",
    "email": "seller@email.com",
    "external_id": "0001"
  },
  "createtime": "2017-03-23 14:35:22",
  "approvedtime": "2017-03-23 14:35:22",
  "custom_attributes": { 
    "fecha_max_cambio": "2017-03-26"
  }
}'

Errors

HttpCode

HttpCode Name

Code

Description

200

ok

ok

Purchase successfully saved

400

bad request

bad_request

Invalid parameters, view message for more details

429

too many requests

too_many_requests

API's requests-per-second limit exceeded

500

internal error

user_not_found

User not found

500

internal error

duplicated_purchase_number

Duplicated purchase number

500

internal error

internal_error

Unexpected error

POST /purchases/bulk

Create multiple purchases in one request. This endpoint is equal to /purchases but accept an array of purchases. This is an example with 2 purchases in one request:

Maximum size per purchase sent is 256KB

curl -X POST \
  https://api.woowup.com/apiv3/purchases \
  -H 'accept: application/json' \
  -H 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'cache-control: no-cache' \
  -d '[{
  "document": "123456789",
  "points": 24,
  "invoice_number": "FAC-000085643",
  "channel": "web",
  "purchase_detail": [
    {
      "sku": "2907362",
      "product_name": "Heladera Patrick",
      "base_name": "Heladera Patrick",
      "category": [
        { "id": "a", "name": "Electrodomésticos"},
        { "id": "a-b", "name": "Linea blanca"},
        { "id": "a-b-c", "name": "Heladeras"}
      ],
      "quantity": 1,
      "unit_price": 1999.00,
      "variations": [
        {
          "name": "Volumen",
          "value": "100 lts"
        }
      ],
      "brand": "Patrick",
      "description": "Su capacidad total de almacenamiento es de 280 litros. El espacio para refrigerador cuenta con 204 litros para ordenar alimentos y bebidas y el freezer tiene un total de 76 litros para congelados.",
      "url": "http://www.example.com/example",
      "image_url": "http://www.example.com/example",
      "thumbnail_url": "http://www.example.com/example",
      "stock": 10,
      "available": true,
      "specifications": [
        {"name": "Garantia del Fabricante", "value": "12 meses"},
        {"name": "Alto", "value": "143.3 cm"},
        {"name": "Ancho", "value": "60.9 cm"}
      ],
      "custom_attributes": { 
      	"millas_aerolineas_plus": 300,
      	"codigo_dto": "2354XFD45" 
      }
    }
  ],
  "prices": {
    "cost": 800.00,
    "shipping": 120.00,
    "gross": 1800.00,
    "tax": 199.00,
    "discount": 100.00,
    "total": 1899.00
  },
  "payment":{
    "type":"debit",
    "brand":"Amex",
    "bank": "Example Bank"
  },
  "branch_name": "Palermo I",
  "createtime": "2017-03-23 14:35:22",
  "custom_attributes": { 
  	"fecha_max_cambio": "2017-03-26"
  }
},
{
  "document": "987654321",
  "points": 24,
  "invoice_number": "FAC-000085644",
  "purchase_detail": [
    {
      "sku": "2907362",
      "product_name": "TV Samsung",
      "base_name": "TV Samsung",
      "category": [
        { "id": "x", "name": "Electrodomésticos"},
        { "id": "x-y", "name": "Hogar"},
        { "id": "x-y-z", "name": "TV"}
      ],
      "quantity": 1,
      "unit_price": 3500.00,
      "variations": [
        {
          "name": "Tamaño",
          "value": "42 pulgadas"
        }
      ],
      "brand": "Samsung",
      "description": "Pasá videos, música y fotos desde tu móvil o PC a tu TV mediante una conexión sencilla gracias a la aplicación Samsung View.",
      "url": "http://www.example.com/example",
      "image_url": "http://www.example.com/example",
      "thumbnail_url": "http://www.example.com/example",
      "stock": 20,
      "available": true,
      "specifications": [
        {"name": "Profundidad (con base)", "value": "29.4 cm"},
        {"name": "Alto", "value": "71 cm"},
        {"name": "Ancho", "value": "110 cm"}
      ]
    }
  ],
  "prices": {
    "cost": 800.00,
    "shipping": 120.00,
    "gross": 3300.00,
    "tax": 200.00,
    "discount": 100.00,
    "total": 3400.00
  },
  "payment":{
    "type":"credit",
    "brand":"Visa",
    "bank": "Another Bank"
  },
  "branch_name": "Palermo I",
  "seller":{
    "name": "Seller Relles",
    "email": "seller@email.com",
    "external_id": "0001"
  },
  "createtime": "2017-03-23 14:35:22"
}]'

Errors

HttpCode

HttpCode Name

Code

Description

200

ok

ok

Purchases successfully saved

400

bad request

bad_request

Invalid parameters, view message for more details

429

too many requests

too_many_requests

API's requests-per-second limit exceeded

500

internal error

user_not_found

User not found

500

internal error

duplicated_purchase_number

Duplicated purchase number

500

internal error

internal_error

Unexpected error

PUT /purchases

Update a purchase. This endpoint is near real time, the purchase will be enqueued to be processed.

Maximum size of data sent is 256KB

Example

This is a valid purchase according to the previous json-schema:

{
  "document": "1234567890",
  "points": 24,
  "invoice_number": "FAC-000085643",
  "channel": "web",
  "purchase_detail": [
    {
      "sku": "2907362",
      "product_name": "Heladera Patrick",
      "base_name": "Heladera Patrick",
      "category": [
        { "id": "a", "name": "Electrodomésticos"},
        { "id": "a-b", "name": "Linea blanca"},
        { "id": "a-b-c", "name": "Heladeras"}
      ],
      "quantity": 1,
      "unit_price": 1999.00,
      "variations": [
        {
          "name": "Volumen",
          "value": "100 lts"
        }
      ],
      "brand": "Patrick",
      "description": "Su capacidad total de almacenamiento es de 280 litros. El espacio para refrigerador cuenta con 204 litros para ordenar alimentos y bebidas y el freezer tiene un total de 76 litros para congelados.",
      "url": "http://www.example.com/example",
      "image_url": "http://www.example.com/example",
      "thumbnail_url": "http://www.example.com/example",
      "stock": 10,
      "available": true,
      "specifications": [
        {"name": "Garantia del Fabricante", "value": "12 meses"},
        {"name": "Alto", "value": "143.3 cm"},
        {"name": "Ancho", "value": "60.9 cm"}
      ],
      "custom_attributes": { 
      	"millas_aerolineas_plus": 500,
      	"codigo_dto": "20054XFD46" 
      }
    }
  ],
  "prices": {
    "cost": 800.00,
    "shipping": 120.00,
    "gross": 1800.00,
    "tax": 199.00,
    "discount": 100.00,
    "total": 1899.00
  },
  "payment":{
    "type":"credit",
    "brand":"Visa",
    "bank": "Example Bank"
  },
  "branch_name": "Palermo I",
  "seller":{
    "name": "Seller Relles",
    "email": "seller@email.com",
    "external_id": "0001"
  },
  "createtime": "2017-03-23 14:35:22",
  "approvedtime": "2017-03-23 14:35:22",
  "custom_attributes": { 
	"fecha_max_cambio": "2017-03-30"
  }
}

This is an example:

curl -X PUT \
  https://api.woowup.com/apiv3/purchases \
  -H 'accept: application/json' \
  -H 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'cache-control: no-cache' \
  -d '{
  "document": "1234567890",
  "points": 24,
  "invoice_number": "FAC-000085643",
  "channel": "web",
  "purchase_detail": [
    {
      "sku": "2907362",
      "product_name": "Heladera Patrick",
      "base_name": "Heladera Patrick",
      "category": [
        { "id": "a", "name": "Electrodomésticos"},
        { "id": "a-b", "name": "Linea blanca"},
        { "id": "a-b-c", "name": "Heladeras"}
      ],
      "quantity": 1,
      "unit_price": 1999.00,
      "variations": [
        {
          "name": "Volumen",
          "value": "100 lts"
        }
      ],
      "brand": "Patrick",
      "description": "Su capacidad total de almacenamiento es de 280 litros. El espacio para refrigerador cuenta con 204 litros para ordenar alimentos y bebidas y el freezer tiene un total de 76 litros para congelados.",
      "url": "http://www.example.com/example",
      "image_url": "http://www.example.com/example",
      "thumbnail_url": "http://www.example.com/example",
      "stock": 10,
      "available": true,
      "specifications": [
        {"name": "Garantia del Fabricante", "value": "12 meses"},
        {"name": "Alto", "value": "143.3 cm"},
        {"name": "Ancho", "value": "60.9 cm"}
      ],
      "custom_attributes": { 
      	"millas_aerolineas_plus": 500,
      	"codigo_dto": "20054XFD46" 
      }
    }
  ],
  "prices": {
    "cost": 800.00,
    "shipping": 120.00,
    "gross": 1800.00,
    "tax": 199.00,
    "discount": 100.00,
    "total": 1899.00
  },
  "payment":{
    "type":"credit",
    "brand":"Visa",
    "bank": "Example Bank"
  },
  "branch_name": "Palermo I",
  "seller":{
    "name": "Seller Relles",
    "email": "seller@email.com",
    "external_id": "0001"
  },
  "createtime": "2017-03-23 14:35:22",
  "approvedtime": "2017-03-23 14:35:22",
  "custom_attributes": { 
	"fecha_max_cambio": "2017-03-30"
  }
}'

Errors

HttpCode

HttpCode Name

Code

Description

200

ok

ok

Purchase successfully updated

400

bad request

bad_request

Invalid parameters, view message for more details

429

too many requests

too_many_request

API's requests-per-second limit exceeded

500

internal error

user_not_found

User not found

500

internal error

inexistent_purchase_number

Purchase number inexistent

500

internal error

internal_error

Unexpected error

GET /purchases

Search a purchase.

Parameter

Type

Required

Description

invoice_number

query

No

service_uid

query

No

branch_name

query

No

branch_id

query

No

Is only used together invoice_number

Query by invoice_number returns only the first purchase created.

Example

curl -X GET \
  -H 'accept: application/json' \
  -H 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'cache-control: no-cache' \
  "https://api.woowup.com/apiv3/purchases?service_uid=12345"

Response

{
    "payload": [
        {
            "service_uid": "12345",
            "document": "23456789",
            "email" "email@example.com",
            "invoice_number": "00001",
            "channel": null,
            "purchase_detail": {
                "items": [
                    {
                        "product_id": "543V",
                        "product_name": "Manta Panal",
                        "quantity": 1,
                        "price": 1999,
                        "custom_attributes": {
                            "codigo_dto": "2354XFD45",
                            "millas_aerolineas_plus": 300
                        }
                    }
                ]
            },
            "prices": {
                "total": 1999,
                "gross": 1999,
                "discount": 0,
                "shipping": 0,
                "tax": 0,
                "cost": 0
            },
            "points": 0,
            "downloadtime": "2018-05-10 23:30:49",
            "createtime": "2018-05-10 23:30:49",
            "custom_attributes": {
                "fecha_max_cambio": "2017-03-26 00:00:00"
            },
            "cancel_transaction_id": null,
            "branch": null,
            "payment": {
                "type": "other",
                "brand": null,
                "name": null
            },
            "purchase_operator": null,
            "pickup_store": "SHOPPING LOCAL 1",
            "promotions": null
        },
        {
            "service_uid": "12345",
            "document": "23456789",
            "email" "email@example.com",
            "invoice_number": "00002",
            "channel": null,
            "purchase_detail": {
                "items": [
                    {
                        "product_id": "123V",
                        "product_name": "Botas Color Rosa",
                        "quantity": 1,
                        "price": 1999
                    }
                ]
            },
            "prices": {
                "total": 1999,
                "gross": 1999,
                "discount": 0,
                "shipping": 0,
                "tax": 0,
                "cost": 0
            },
            "points": 0,
            "downloadtime": "2018-05-10 23:30:49",
            "createtime": "2018-05-10 23:30:49",
            "cancel_transaction_id": null,
            "branch": null,
            "payment": {
                "type": "other",
                "brand": null,
                "name": null
            },
            "purchase_operator": null,
            "pickup_store": "SHOPPING LOCAL 1",
            "promotions": null
        }
    ],
    "message": "ok",
    "code": "ok",
    "time": "62ms"
}

Errors

HttpCode

HttpCode Name

Code

Description

200

ok

ok

Request successful

400

bad request

bad_request

Invalid parameters, view message for more details

404

not found

not_found

Purchase not found

429

too many requests

too_many_requests

API's requests-per-second limit exceeded

500

internal error

internal_error

Unexpected error

GET /purchases/iin/{firstSixDigits}

Retrieve information about bank by first six digits of credit/debit card

Parameter

Type

Required

Description

firstSixDigits

url

Yes

First six digit of credit/debit card

Example

curl -X GET \
  -H 'accept: application/json' \
  -H 'authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
  -H 'cache-control: no-cache' \
  "https://api.woowup.com/apiv3/purchases/iin/123456"

Response

{
    "payload": {
        "scheme": "visa",
        "brand": "Visa/Dankort",
        "type": "debit",
        "prepaid": "",
        "country": "DK",
        "bank": {
            "name": "Spar Nord",
            "logo": "",
            "url": "www.sparnord.dk",
            "phone": "",
            "city": ""
        }
    },
    "message": "ok",
    "code": "ok",
    "time": "109ms"
}

Errors

HTTP Code

HTTP Code Name

Decription

200

Ok

Succesful request

404

Not Found

IIN not found

429

Too Many Requests

Too Many Requests

500

Internal Error

Unexpected error

Delete purchase

DELETE https://api.woowup.com/apiv3/purchases

Delete a purchase

Request Body

NameTypeDescription

invoice_number

string

branch_name

string

{
    "payload": [],
    "message": "ok",
    "code": "ok",
    "time": "98ms"
}

Example

curl -X DELETE \
  https://api.woowup.com/apiv3/purchases \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXX' \
  -H 'Content-Type: application/json' \
  -d '{
	"invoice_number": "987654321"
}'

Response

{
    "payload": [],
    "message": "ok",
    "code": "ok",
    "time": "98ms"
}

Delete purchases (bulk)

DELETE https://api.woowup.com/apiv3/purchases/bulk

Request Body

NameTypeDescription

branch_name

string

from

string

date format YYYY-MM-DD hh:mm:ss (in UTC time)

to

string

date format YYYY-MM-DD hh:mm:ss (in UTC-time)

notify_to

string

email to receive the confirmation

{
    "payload": {
        "request_id": "XXX"
    },
    "message": "ok",
    "code": "ok",
    "time": "111ms"
}