# Cancel Payment Link

Use this API to Cancel a Payment Link.

## Environment

Use our UAT environment endpoint for testing and for integration utilize our production endpoint.

| Environment                    | Endpoints                                                                        |
| :----------------------------- | :------------------------------------------------------------------------------- |
| User Acceptance Testing \[UAT] | `https://pluraluat.v2.pinepg.in/api/pay/v1/paymentlink/{payment_link_id}/cancel` |
| Production \[PROD]             | `https://api.pluralpay.in/api/pay/v1/paymentlink/{payment_link_id}/cancel`       |

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "order",
    "version": "3.0"
  },
  "servers": [
    {
      "url": "https://pluraluat.v2.pinepg.in/api"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header",
        "x-bearer-format": "bearer",
        "x-default": ""
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/pay/v1/paymentlink/{payment_link_id}/cancel": {
      "put": {
        "summary": "Cancel Payment Link",
        "description": "Use this API to Cancel a Payment Link.",
        "operationId": "payment-link-cancel",
        "parameters": [
          {
            "name": "payment_link_id",
            "in": "path",
            "description": "Unique identifier of the payment link request in the Plural database.<ul><li>Maximum length: `50` characters.<br><br>Example: `pl-v1-5757575757-aa-hU1rUd`",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "Content-Type",
            "in": "header",
            "description": "The type of content included in the HTTP message body.<br><br>Possible value: `application/json`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "description": "The HTTP header where you can include your secret token for authentication.<br><br>Example: `Bearer <access_token>`<br><br>**Note**: Use the access token generated using our <a href=\"https://developer.pluralonline.com/v3.0/reference/generate-token\" target=\"_blank\">Generate Token API</a>.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "Bearer"
            }
          },
          {
            "name": "Request-Timestamp",
            "in": "header",
            "description": "Use ISO 8601 UTC Timestamp, to create a timestamp when the generate token is requested.<br><br>Example: `2024-07-09T07:57:08.022Z`",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Request-ID",
            "in": "header",
            "description": "Use a global unique identifier [GUID] for the request.<ul><li>Minimum: 1 characters.</li><li>Maximum: 50 characters</ul></li>Example: `c17ce30f-f88e-4f81-ada1-c3b4909ed235`",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"payment_link\": \"https://shortener.v2.pinepg.in/PLUTUS/3rh4jtd\",\n  \"payment_link_id\": \"pl-v1-250306082755-aa-uT0noy\",\n  \"status\": \"CANCELLED\",\n  \"amount\": {\n    \"value\": 100,\n    \"currency\": \"INR\"\n  },\n  \"amount_due\": {\n    \"value\": 100,\n    \"currency\": \"INR\"\n  },\n  \"order_id\": \"v1-250131113650-aa-TUzeRY\",\n  \"merchant_payment_link_reference\": \"link_ref\",\n  \"description\": \"Payment for order #12345\",\n  \"expire_by\": \"2025-03-21T08:29Z\",\n  \"merchant_order_reference\": \"link_ref\",\n  \"allowed_payment_methods\": [\n    \"NETBANKING\"\n  ],\n  \"customer\": {\n    \"email_id\": \"kevin.bob@example.com\",\n    \"first_name\": \"Kevin\",\n    \"last_name\": \"Bob\",\n    \"customer_id\": \"123456\",\n    \"mobile_number\": \"9876543210\",\n    \"country_code\": \"91\",\n    \"billing_address\": {\n        \t\"address1\": \"10 Downing Street Westminster London\",\n        \t\"address2\": \"Oxford Street Westminster London\",\n        \t\"address3\": \"Baker Street Westminster London\",\n        \t\"pincode\": \"51524036\",\n        \t\"city\": \"Westminster\",\n        \t\"state\": \"Westminster\",\n        \t\"country\": \"London\",\n\t\t\t\t\t\"full_name\": \"Kevin Bob\",\n\t\t\t\t\t\"adddress_type\": \"Home\",\n\t\t\t\t\t\"address_category\": \"billing\"\n      \t},\n     \"shipping_address\": {\n        \t\"address1\": \"10 Downing Street Westminster London\",\n        \t\"address2\": \"Oxford Street Westminster London\",\n        \t\"address3\": \"Baker Street Westminster London\",\n        \t\"pincode\": \"51524036\",\n        \t\"city\": \"Westminster\",\n        \t\"state\": \"Westminster\",\n        \t\"country\": \"London\",\n\t\t\t\t\t\"full_name\": \"Kevin Bob\",\n\t\t\t\t\t\"adddress_type\": \"Home\",\n\t\t\t\t\t\"address_category\": \"shipping\"\n      \t}\n  },\n  \"product_details\": [\n    {\n      \"product_code\": \"xyz\",\n      \"product_amount\": {\n        \"currency\": \"INR\",\n        \"value\": 1200000\n      },\n      \"product_coupon_discount_amount\": {\n        \"currency\": \"INR\",\n        \"value\": 0\n      }\n    }\n  ],\n  \"cart_coupon_discount_amount\": {\n    \"currency\": \"INR\",\n    \"value\": 0\n  },\n  \"merchant_metadata\": {\n    \"clientId\": \"DD\",\n    \"transactionReferenceNo\": \"pine-1223\",\n    \"merchantId\": \"1234\",\n    \"tid\": \"9000990\",\n    \"acquirerName\": \"HDFC_FSS\",\n    \"isOfferDisplayRequired\": \"true\",\n    \"OfferData\": \"UHJvZHVjdF9Db2RlPSIgIiZQcm9kdWN0X05hbWU9IiImUGF5bWVudF9Nb2RlPUJhbmsgRU1JJkNhcmRfVHlwZT1EZWJpdCBDYXJkJkJhbmtfTmFtZT1IREZDIERlYml0JkVNSV9UZW51cmU9NiZJbnRlcmVzdF9SYXRlPTkuMCZJbnRlcmVzdF9BbW91bnQ9MTM4MTQwJk1vbnRobHlfSW5zdGFsbWVudD04OTQ2OTAmQXV0aG9yaXphdGlvbl9BbW91bnQ9MTAwJkxvYW5fYm9va2luZ19BbW91bnQ9NTIzMDAwMCZJbnRlcmVzdF9DYXNoYmFja19BbW91bnQ9MCZJbnRlcmVzdF9DYXNoYmFja19UeXBlPURlZmVycmVkJkFkZGl0aW9uYWxfQ2FzaGJhY2s9IiImQWRkaXRpb25hbF9DYXNoYmFja19UeXBlPSIiJkRlc2NyaXB0aW9uPUJhbmsgRU1JJlByb2R1Y3RfVmFsdWU9NTIzMDAwMA\",\n    \"tenant_id\": \"PGATPOS\",\n    \"is_offer_validation_required\": \"true\"\n  },\n  \"created_at\": \"2025-03-06T08:27:55.881Z\",\n  \"updated_at\": \"2025-03-06T08:27:55.881Z\",\n  \"cancelled_at\": \"2025-03-06T08:27:55.881Z\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "payment_link": {
                      "type": "string",
                      "example": "https://shortener.v2.pinepg.in/PLUTUS/3rh4jtd"
                    },
                    "payment_link_id": {
                      "type": "string",
                      "example": "pl-v1-250306082755-aa-uT0noy"
                    },
                    "status": {
                      "type": "string",
                      "example": "CANCELLED"
                    },
                    "amount": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "integer",
                          "example": 100,
                          "default": 0
                        },
                        "currency": {
                          "type": "string",
                          "example": "INR"
                        }
                      }
                    },
                    "amount_due": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "integer",
                          "example": 100,
                          "default": 0
                        },
                        "currency": {
                          "type": "string",
                          "example": "INR"
                        }
                      }
                    },
                    "order_id": {
                      "type": "string",
                      "example": "v1-250131113650-aa-TUzeRY"
                    },
                    "merchant_payment_link_reference": {
                      "type": "string",
                      "example": "link_ref"
                    },
                    "description": {
                      "type": "string",
                      "example": "Payment for order #12345"
                    },
                    "expire_by": {
                      "type": "string",
                      "example": "2025-03-21T08:29Z"
                    },
                    "merchant_order_reference": {
                      "type": "string",
                      "example": "link_ref"
                    },
                    "allowed_payment_methods": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "example": "NETBANKING"
                      }
                    },
                    "customer": {
                      "type": "object",
                      "properties": {
                        "email_id": {
                          "type": "string",
                          "example": "kevin.bob@example.com"
                        },
                        "first_name": {
                          "type": "string",
                          "example": "Kevin"
                        },
                        "last_name": {
                          "type": "string",
                          "example": "Bob"
                        },
                        "customer_id": {
                          "type": "string",
                          "example": "123456"
                        },
                        "mobile_number": {
                          "type": "string",
                          "example": "9876543210"
                        },
                        "country_code": {
                          "type": "string",
                          "example": "91"
                        },
                        "billing_address": {
                          "type": "object",
                          "properties": {
                            "address1": {
                              "type": "string",
                              "example": "10 Downing Street Westminster London"
                            },
                            "address2": {
                              "type": "string",
                              "example": "Oxford Street Westminster London"
                            },
                            "address3": {
                              "type": "string",
                              "example": "Baker Street Westminster London"
                            },
                            "pincode": {
                              "type": "string",
                              "example": "51524036"
                            },
                            "city": {
                              "type": "string",
                              "example": "Westminster"
                            },
                            "state": {
                              "type": "string",
                              "example": "Westminster"
                            },
                            "country": {
                              "type": "string",
                              "example": "London"
                            },
                            "full_name": {
                              "type": "string",
                              "example": "Kevin Bob"
                            },
                            "adddress_type": {
                              "type": "string",
                              "example": "Home"
                            },
                            "address_category": {
                              "type": "string",
                              "example": "billing"
                            }
                          }
                        },
                        "shipping_address": {
                          "type": "object",
                          "properties": {
                            "address1": {
                              "type": "string",
                              "example": "10 Downing Street Westminster London"
                            },
                            "address2": {
                              "type": "string",
                              "example": "Oxford Street Westminster London"
                            },
                            "address3": {
                              "type": "string",
                              "example": "Baker Street Westminster London"
                            },
                            "pincode": {
                              "type": "string",
                              "example": "51524036"
                            },
                            "city": {
                              "type": "string",
                              "example": "Westminster"
                            },
                            "state": {
                              "type": "string",
                              "example": "Westminster"
                            },
                            "country": {
                              "type": "string",
                              "example": "London"
                            },
                            "full_name": {
                              "type": "string",
                              "example": "Kevin Bob"
                            },
                            "adddress_type": {
                              "type": "string",
                              "example": "Home"
                            },
                            "address_category": {
                              "type": "string",
                              "example": "shipping"
                            }
                          }
                        }
                      }
                    },
                    "product_details": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "product_code": {
                            "type": "string",
                            "example": "xyz"
                          },
                          "product_amount": {
                            "type": "object",
                            "properties": {
                              "currency": {
                                "type": "string",
                                "example": "INR"
                              },
                              "value": {
                                "type": "integer",
                                "example": 1200000,
                                "default": 0
                              }
                            }
                          },
                          "product_coupon_discount_amount": {
                            "type": "object",
                            "properties": {
                              "currency": {
                                "type": "string",
                                "example": "INR"
                              },
                              "value": {
                                "type": "integer",
                                "example": 0,
                                "default": 0
                              }
                            }
                          }
                        }
                      }
                    },
                    "cart_coupon_discount_amount": {
                      "type": "object",
                      "properties": {
                        "currency": {
                          "type": "string",
                          "example": "INR"
                        },
                        "value": {
                          "type": "integer",
                          "example": 0,
                          "default": 0
                        }
                      }
                    },
                    "merchant_metadata": {
                      "type": "object",
                      "properties": {
                        "clientId": {
                          "type": "string",
                          "example": "DD"
                        },
                        "transactionReferenceNo": {
                          "type": "string",
                          "example": "pine-1223"
                        },
                        "merchantId": {
                          "type": "string",
                          "example": "1234"
                        },
                        "tid": {
                          "type": "string",
                          "example": "9000990"
                        },
                        "acquirerName": {
                          "type": "string",
                          "example": "HDFC_FSS"
                        },
                        "isOfferDisplayRequired": {
                          "type": "string",
                          "example": "true"
                        },
                        "OfferData": {
                          "type": "string",
                          "example": "UHJvZHVjdF9Db2RlPSIgIiZQcm9kdWN0X05hbWU9IiImUGF5bWVudF9Nb2RlPUJhbmsgRU1JJkNhcmRfVHlwZT1EZWJpdCBDYXJkJkJhbmtfTmFtZT1IREZDIERlYml0JkVNSV9UZW51cmU9NiZJbnRlcmVzdF9SYXRlPTkuMCZJbnRlcmVzdF9BbW91bnQ9MTM4MTQwJk1vbnRobHlfSW5zdGFsbWVudD04OTQ2OTAmQXV0aG9yaXphdGlvbl9BbW91bnQ9MTAwJkxvYW5fYm9va2luZ19BbW91bnQ9NTIzMDAwMCZJbnRlcmVzdF9DYXNoYmFja19BbW91bnQ9MCZJbnRlcmVzdF9DYXNoYmFja19UeXBlPURlZmVycmVkJkFkZGl0aW9uYWxfQ2FzaGJhY2s9IiImQWRkaXRpb25hbF9DYXNoYmFja19UeXBlPSIiJkRlc2NyaXB0aW9uPUJhbmsgRU1JJlByb2R1Y3RfVmFsdWU9NTIzMDAwMA"
                        },
                        "tenant_id": {
                          "type": "string",
                          "example": "PGATPOS"
                        },
                        "is_offer_validation_required": {
                          "type": "string",
                          "example": "true"
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "example": "2025-03-06T08:27:55.881Z"
                    },
                    "updated_at": {
                      "type": "string",
                      "example": "2025-03-06T08:27:55.881Z"
                    },
                    "cancelled_at": {
                      "type": "string",
                      "example": "2025-03-06T08:27:55.881Z"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "500",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"code\":\"INTERNAL_ERROR\",\n  \"message\":\"failed to process because...\",\n  \"additionalErrorPayload\":{\n    \"source\":\"OMS\",\n    \"step\":\"PAYMENT_CREATION\"\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "INTERNAL_ERROR"
                    },
                    "message": {
                      "type": "string",
                      "example": "failed to process because..."
                    },
                    "additionalErrorPayload": {
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "string",
                          "example": "OMS"
                        },
                        "step": {
                          "type": "string",
                          "example": "PAYMENT_CREATION"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```