Skip to main content

Documentation

Retrieve SKU

Retrieve the details of an SKU.

    • sku

    • ID of the sku object. String starting with sku_.

Code Samples
    • .NET

      • using System;
        
        namespace RapydApiRequestSample
        {
            class Program
            {
                static void Main(string[] args)
                {
                    try
                    {
                        string sku = "sku_a6d86bdc6f3a7ef6cb51de5a5678493f";
        
                        string result = RapydApiRequestSample.Utilities.MakeRequest("GET", $"/v1/skus/{sku}");
        
                        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/sku_a6d86bdc6f3a7ef6cb51de5a5678493f');
        
            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/sku_a6d86bdc6f3a7ef6cb51de5a5678493f');
            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/sku_a6d86bdc6f3a7ef6cb51de5a5678493f')
        pprint(result)
        
  • /v1/skus/:sku

  • Retrieve SKU

  • curl -X get
    https://sandboxapi.rapyd.net/v1/skus/sku_a6d86bdc6f3a7ef6cb51de5a5678493f
    -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": "a5f938a8-3086-445a-bf9a-f1c9d97adde2"
        },
        "data": {
            "id": "sku_a6d86bdc6f3a7ef6cb51de5a5678493f",
            "active": true,
            "attributes": {
                "color": "green"
            },
            "created_at": 1546353713,
            "currency": "USD",
            "image": "",
            "inventory": {
                "type": "finite",
                "quantity": 1,
                "value": ""
            },
            "metadata": {
          		"merchant_defined": true
        		},
            "price": 10.99,
            "product": "product_f383d03c34fb499eb3ada4e3c574002a",
            "package_dimensions": {
                "length": 2,
                "height": 1,
                "weight": 3,
                "width": 4
            },
            "updated_at": 1546354288
        }
    }