Cashfree Payments CreateCashgram API

The CreateCashgram API from Cashfree Payments — 1 operation(s) for createcashgram.

OpenAPI Specification

cashfree-createcashgram-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: '2025-01-01'
  title: Cashfree Payment Gateway APIs Authorize CreateCashgram API
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  contact:
    email: developers@cashfree.com
    name: API Support
    url: https://discord.com/invite/QdZkNSxXsB
  description: Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.
servers:
- url: https://sandbox.cashfree.com/pg
  description: Sandbox server
- url: https://api.cashfree.com/pg
  description: Production server
tags:
- name: CreateCashgram
paths:
  /v1/createCashgram:
    post:
      summary: Create Cashgram
      x-mcp:
        enabled: true
        config:
          elicitation:
            $ref: '#/components/x-elicitationConfig/createCashgram'
      description: Use this API to create a Cashgram.
      operationId: create-cashgram1
      parameters:
      - name: Authorization
        in: header
        description: Bearer auth token
        required: true
        style: simple
        explode: false
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1_createCashgram_body'
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200_8'
        '409':
          description: '409'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_409_1'
      deprecated: false
      security: []
      x-readme:
        code-samples:
        - language: curl
          code: "curl -X POST \\\n  'http://{{Host%20Url}}/payout/v1/createCashgram' \\\n  -H 'Content-Type: application/json' \\\n  -H 'Authorization: Bearer {{Token}}'\n  -d '{\n            \"cashgramId\": \"JOHaN10\",\n            \"amount\": \"1.00\",\n            \"name\": \"John Doe\",\n            \"email\": \"johndoe@cashfree.com\",\n            \"phone\": \"9876543210\",\n            \"linkExpiry\": \"2020/04/01\",\n            \"remarks\": \"sample cashgram\",\n            \"notifyCustomer\": 1\n}'"
        - language: text
          code: "const cfSdk = require('cashfree-sdk');\nconst {Cashgram} = cfSdk.Payouts;\n\nconst response = await Cashgram.CreateCashgram({\n            cashgramId: \"JOHaN10\",\n            amount: \"1.00\",\n            name: \"John Doe\",\n            email: \"johndoe@cashfree.com\",\n            phone: \"9876543210\",\n            linkExpiry: \"2020/04/01\",\n            remarks: \"sample cashgram\",\n            notifyCustomer: 1\n        });"
          name: Node
        - language: java
          code: "import com.cashfree.lib.clients.Payouts;\nimport com.cashfree.lib.clients.Cashgram;\nimport com.cashfree.lib.domains.CashgramDetails\n\nPayouts payouts = Payouts.getInstance(\n    Environment.PRODUCTION, \"<client_id>\", \"<client_secret>\");\npayouts.init();\nCashgram cashgram = new Cashgram(payouts);\n\nCashgramDetails cashgramDetails = new CashgramDetails()\n        .setCashgramId(\"JOHaN10\")\n        .setAmount(new BigDecimal(\"1.00\"))\n        .setName(\"John Doe\")\n        .setEmail(\"johndoe@cashfree.com\")\n        .setPhone(\"9876543210\")\n        .setLinkExpiry(LocalDateTime.now().plusMinutes(0))\n        .setRemarks(\"sample cashgram\")\n        .setNotifyCustomer(1);\ncashgram.createCashgram(cashgramDetails);\n}"
        - language: python
          code: "from cashfree_sdk.payouts import Payouts\nfrom cashfree_sdk.payouts.cashgram import Cashgram\nc = Cashgram.create_cashgram(cashgramId=\"JOHaN10\", amount=\"1.1\", name=\"john doe\", email=\"johndoe@cashfree.com\", phone=\"9876543210\", \nlinkExpiry=\"2020/04/01\", remarks=\"sample cashgram\", notifyCustomer=1)  "
        samples-languages:
        - curl
        - text
        - java
        - python
      tags:
      - CreateCashgram
components:
  schemas:
    inline_response_200_8_data:
      type: object
      properties:
        referenceId:
          type: integer
          example: 123456
          default: 0
        cashgramLink:
          type: string
          example: http://csgr.am/abcdefg
    v1_createCashgram_body:
      required:
      - amount
      - cashgramId
      - linkExpiry
      - name
      - phone
      type: object
      properties:
        cashgramId:
          type: string
          description: Unique Id of the Cashgram. Alphanumeric, underscore (_), and hyphen (-) allowed (35 character limit)
        amount:
          type: number
          description: Amount to be transferred, >= 1.00
          format: float
        name:
          type: string
          description: Name of the contact
        email:
          type: string
          description: Email of the contact
        phone:
          type: string
          description: Phone number of the contact
        linkExpiry:
          type: string
          description: Date to expire the cashgram link, Date format YYYY/MM/DD, maximum 30 days from the date of creation.
        remarks:
          type: string
          description: Specify remarks, if any.
        notifyCustomer:
          type: integer
          description: If value is 1, a link is sent to customers phone and email.
    inline_response_200_8:
      type: object
      properties:
        status:
          type: string
          example: SUCCESS
        subCode:
          type: string
          example: '200'
        message:
          type: string
          example: Cashgram Created
        data:
          $ref: '#/components/schemas/inline_response_200_8_data'
    inline_response_409_1:
      type: object
      properties:
        status:
          type: string
          example: ERROR
        subCode:
          type: string
          example: '409'
        message:
          type: string
          example: Cashgram with id JOHaN10 already exists
  x-elicitationConfig:
    createCashgram:
      enabled: true
      fields:
        amount:
          required: true
          message: Please provide the amount for Cashgram
          schema:
            type: number
            title: Cashgram Amount
            description: Amount for Cashgram (minimum 1 INR)
            minimum: 1
          mapping:
            target: body.amount
            transform: number
        phone:
          required: true
          message: Please provide the beneficiary's phone number
          schema:
            type: string
            title: Phone Number
            description: Beneficiary's phone number in E.164 format
          mapping:
            target: body.phone
            transform: string
  securitySchemes:
    XClientID:
      type: apiKey
      in: header
      name: x-client-id
      description: Client app ID. You can find your app id in the [merchant dashboard](https://merchant.cashfree.com/merchants/pg/developers/api-keys?env=prod").
    XClientSecret:
      type: apiKey
      in: header
      name: x-client-secret
      description: Client secret key. You can find your secret in the [merchant dashboard](https://merchant.cashfree.com/merchants/pg/developers/api-keys?env=prod").
    XClientSignatureHeader:
      type: apiKey
      in: header
      name: x-client-signature
      description: Use this if you do not want to pass the secret key and instead want to use the signature.
    XPartnerAPIKey:
      type: apiKey
      in: header
      name: x-partner-apikey
      description: If you are partner and you are making an api call on behalf of a merchant
    XPartnerMerchantID:
      type: apiKey
      in: header
      name: x-partner-merchantid
      description: If you are partner use this to specify the merchant id if you don't have the merchant client app id
externalDocs:
  url: https://api.cashfree.com/pg
  description: This url will have the information of all the APIs.
x-readme:
  explorer-enabled: true
  proxy-enabled: true
  samples-enabled: true
  samples-languages:
  - shell