Shop Inventory

Inventory of each webshop can be managed by API note that inventory is shared between the quickshop and the webshop of a specific brand.


GET/shops/:identifier/inventory

List all inventory

This endpoint allows you to fetch the current inventory of a shop.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    shops.inventory.get
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string
    Description

    The identifier of the shop.

Request

GET
/shops/:identifier/inventory
curl -X GET https://api.walletapp.co/shops/:identifier/inventory
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"

Response

{
    "message": "Request successful",
    "products": [
        {
            "brand_id": "<shop_identifier>",
            "product_id": "<product_id>",
            "price": 0,
            "points": 0,
            "order": 1,
            "title": "<product_title>",
            "stock": 0,
            "use_stock": 0
        }
        ...
    ],
    "coupons": [],
    "online_offers": []
}

POST/shops/:identifier/inventory

Add an inventory item

This endpoint allows you to add items to the current inventory.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    shops.inventory.store
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string|Required
    Description

    The identifier of the brand.

Body parameters

  • Name
    product_type
    Type
    string|Required
    Description

    The type of the product that you are about to add. Possible values are: sponsor_offer, product, coupon.

  • Name
    product_id
    Type
    string|Required
    Description

    The identifier of the product.

  • Name
    order
    Type
    integer
    Description

    The order in which the product is displayed in the shop. works with integers, example if you want it in the first position provide: 1.

  • Name
    price
    Type
    float
    Description

    The specific price you want to sell the product for in this shop. Does not apply to sponsor offers.

  • Name
    points
    Type
    integer
    Description

    The specific amount of points you want to sell the product for. Does not apply to sponsor offers.

Request

POST
/shops/:identifier/inventory
curl -X POST https://api.walletapp.co/shops/:identifier/inventory
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"
- d '{
    "product_type": "sponsor_offer",
    "product_id": "<UUID>",
    "order": 1,
    "price": 0,
    "points": 0
}'

Response

{
    "message": "Request successful",
    "data": "Product added to the shops inventory"
}

PUT/shops/:identifier/inventory

Update an inventory item

This endpoint allows you to update items that are in the current inventory.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    shops.inventory.update
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string|Required
    Description

    The identifier of the brand.

Body parameters

  • Name
    product_type
    Type
    string|Required
    Description

    The type of the product that you are about to add. Possible values are: sponsor_offer, product, coupon.

  • Name
    product_id
    Type
    string|Required
    Description

    The identifier of the product.

  • Name
    order
    Type
    integer
    Description

    The order in which the product is displayed in the shop. works with integers, example if you want it in the first position provide: 1.

  • Name
    price
    Type
    float
    Description

    The specific price you want to sell the product for in this shop. Does not apply to sponsor offers.

  • Name
    points
    Type
    integer
    Description

    The specific amount of points you want to sell the product for. Does not apply to sponsor offers.

Request

PUT
/shops/:identifier/inventory
curl -X PUT https://api.walletapp.co/shops/:identifier/inventory
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"
- d '{
    "product_type": "sponsor_offer",
    "product_id": "<UUID>",
    "order": 1,
    "price": 0,
    "points": 0
}'

Response

{
    "message": "Request successful",
    "data": "Product inventory item updated"
}

DELETE/shops/:identifier/inventory

Remove an inventory item

This endpoint allows you to remove items that are in the current inventory.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    The token itself as a bearer token.

Abilities

  • Name
    shops.inventory.delete
    Type
    string
    Description

    The scope required to access this endpoint.

Route parameters

  • Name
    identifier
    Type
    string|Required
    Description

    The identifier of the brand.

Body parameters

  • Name
    product_type
    Type
    string|Required
    Description

    The type of the product that you are about to add. Possible values are: sponsor_offer, product, coupon.

  • Name
    product_id
    Type
    string|Required
    Description

    The identifier of the product.

Request

DELETE
/shops/:identifier/inventory
curl -X DELETE https://api.walletapp.co/shops/:identifier/inventory
-H "Content-Type: application/json"
-H "Accept: application/json"
-H "Authorization: Bearer <your_token>"
- d '{
    "product_type": "sponsor_offer",
    "product_id": "<UUID>"
}'

Response

{
    "message": "Request successful",
    "data": "Product removed from inventory"
}