Skip to main content

Documentation

Delete SKU

Delete an SKU from the Rapyd platform.

This method triggers the SKU Deleted webhook. This webhook contains the same information as the response.

    • sku

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

    • deleted

    • Indicates whether the SKU was deleted.

    • id

    • ID of the SKU.

Code Samples
    • .NET

      • using System;
        
        namespace RapydApiRequestSample
        {
            class Program
            {
                static void Main(string[] args)
                {
                    try
                    {
                        string sku = "sku_a35c8e4fe80cf3f780f137d465809898";
        
                        string result = RapydApiRequestSample.Utilities.MakeRequest("DELETE", $"/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('DELETE', '/v1/skus/sku_a35c8e4fe80cf3f780f137d465809898');
        
            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('delete', '/v1/skus/sku_a35c8e4fe80cf3f780f137d465809898');
            var_dump($object);
        } catch(Exception $e) {
            echo "Error: $e";
        }
        ?>
    • Python

      • from pprint import pprint
        
        from utilities import make_request
        
        result = make_request(method='delete', path='/v1/skus/sku_a35c8e4fe80cf3f780f137d465809898')
        pprint(result)
  • /v1/skus/:sku

  • Delete SKU

  • curl -X delete
    https://sandboxapi.rapyd.net/v1/skus/sku_a35c8e4fe80cf3f780f137d465809898
    -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": "5a2887d9-fb6f-4e93-9afd-8418267730dd"
        },
        "data": {
            "deleted": true,
            "id": "sku_a35c8e4fe80cf3f780f137d465809898"
        }
    }