Skip to main content

Documentation

List SKUs

Retrieve a list of all SKUs.

    • active

    • Determines whether the query returns active SKUs or inactive SKUs.

      true

    • starting_after

    • The ID of the SKU created before the first SKU you want to retrieve.

    • ending_before

    • The ID of the SKU created after the last SKU you want to retrieve.

    • limit

    • The maximum number of SKUs to return. Range: 1-100.

      10

Code Samples
    • .NET

      • using System;
        
        namespace RapydApiRequestSample
        {
            class Program
            {
                static void Main(string[] args)
                {
                    try
                    {
                        string result = RapydApiRequestSample.Utilities.MakeRequest("GET", "/v1/skus");
        
                        Console.WriteLine(result);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Error completing request: " + e.Message);
                    }
                }
            }
        }
        
    • JavaScript

      • const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;
        
        async function main() {
          try {
            const result = await makeRequest('GET', '/v1/skus');
        
            console.log(result);
          } catch (error) {
            console.error('Error completing request', error);
          }
        }
    • PHP

      • <?php
        $path = $_SERVER['DOCUMENT_ROOT'];
        $path .= "/<path-to-your-utility-file>/utilities.php";
        include($path);
        
        try {
            $object = make_request('get', '/v1/skus');
            var_dump($object);
        } catch(Exception $e) {
            echo "Error: $e";
        }
        ?>
    • Python

      • from pprint import pprint
        
        from utilities import make_request
        
        result = make_request(method='get', path='/v1/skus')
        pprint(result)
  • /v1/skus

  • List SKUs

  • curl -X get
    https://sandboxapi.rapyd.net/v1/skus
    -H 'access_key: your-access-key-here'
    -H 'Content-Type: application/json'
    -H 'salt: your-random-string-here'
    -H 'signature: your-calculated-signature-here'
    -H 'timestamp: your-unix-timestamp-here'
    
  • {
        "status": {
            "error_code": "",
            "status": "SUCCESS",
            "message": "",
            "response_code": "",
            "operation_id": "71f13e3f-4d43-4b0e-adfa-cfb91eeb16f7"
        },
        "data": [{
                "id": "sku_d1ce10b16cd4350d12c75232628e49bd",
                "active": true,
                "attributes": {},
                "created_at": 1535356565,
                "currency": "INR",
                "image": "",
                "inventory": {
                    "type": "finite",
                    "quantity": 1,
                    "value": ""
                },
                "metadata": {
                    "merchant_defined": true
                },
                "price": 1,
                "product": "product_b2ced935192311b058fca39ad516c38a",
                "package_dimensions": {
                    "length": 0,
                    "height": 0,
                    "weight": 0,
                    "width": 0
                },
                "updated_at": 1535356565
            }, {
                "id": "sku_7af55c245d10481ca03b75ed85ffbff0",
                "active": false,
                "attributes": {
                    "size": "12",
                    "color": "red"
                },
                "created_at": 1545140154,
                "currency": "USD",
                "image": "https://docs.rapyd.net/r1545140143.jpeg",
                "inventory": {
                    "type": "bucket",
                    "quantity": 0,
                    "value": "in_stock"
                },
                "metadata": {
                    "merchant_defined": true
                },
                "price": 575.58,
                "product": "product_1545140143",
                "package_dimensions": {
                    "length": 0,
                    "height": 0,
                    "weight": 0,
                    "width": 0
                },
                "updated_at": 1545140154
            },
        ]
    }