Chilkat Online Tools

PureBasic / Razorpay APIs / Delete an Offer Linked to a Subscription

Back to Collection Items

IncludeFile "CkHttp.pb"
IncludeFile "CkHttpResponse.pb"

Procedure ChilkatExample()

    ; This example assumes the Chilkat API to have been previously unlocked.
    ; See Global Unlock Sample for sample code.

    http.i = CkHttp::ckCreate()
    If http.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    success.i

    CkHttp::setCkBasicAuth(http, 1)
    CkHttp::setCkLogin(http, "username")
    CkHttp::setCkPassword(http, "password")

    resp.i = CkHttp::ckQuickRequest(http,"DELETE","https:///subscriptions/{sub_id}/{offer_id}")
    If CkHttp::ckLastMethodSuccess(http) = 0
        Debug CkHttp::ckLastErrorText(http)
        CkHttp::ckDispose(http)
        ProcedureReturn
    EndIf

    Debug Str(CkHttpResponse::ckStatusCode(resp))
    Debug CkHttpResponse::ckBodyStr(resp)
    CkHttpResponse::ckDispose(resp)



    CkHttp::ckDispose(http)


    ProcedureReturn
EndProcedure

Curl Command

curl -X DELETE
	-u 'username:password'
https:///subscriptions/{sub_id}/{offer_id}

Postman Collection Item JSON

{
  "name": "Delete an Offer Linked to a Subscription",
  "request": {
    "method": "DELETE",
    "header": [
    ],
    "url": {
      "raw": "/subscriptions/{sub_id}/{offer_id}",
      "path": [
        "subscriptions",
        "{sub_id}",
        "{offer_id}"
      ]
    },
    "description": "You can delete an offer linked to a subscription using the <a href=\"https://razorpay.com/docs/subscriptions/offers/link-offer-subscription/#delete-an-offer-linked-to-a-subscription\" target=\"_blank\">Delete an offer linked to a Subscription API</a>."
  },
  "response": [
  ]
}