> ## Documentation Index
> Fetch the complete documentation index at: https://docs.verdn.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Pledge Transaction

> Create a new pledge transaction with multiple pledges

## Overview

Creates a new pledge transaction containing one or more pledges. Each pledge represents an impact commitment tied to a specific offering.

## Examples

<CodeGroup>
  ```typescript Minimal Request theme={null}
  const response = await fetch('https://api.verdn.com/v2/pledge-transaction', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer verdn_sk_test_...',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      reference: "order_123",
      recipient: {
        email: "customer@example.com",
      },
      pledges: [{
        impact: {
          offeringId: "off_123",
          amount: 100,
        },
      }],
    })
  })
  ```

  ```json Minimal Response theme={null}
  {
    "charge": {
      "amount": "25.00",
      "currencyCode": "USD",
      "paidAt": null
    },
    "createdAt": "2024-01-25T12:00:00Z",
    "id": "ptran_01JH67QPC8R56E4DP7K4PB3MRD",
    "isLive": false,
    "notifications": [],
    "pledges": [
      {
        "detail": {
          "description": null,
          "externalId": null,
          "externalUrl": null,
          "image": null,
          "name": null,
          "nounPlural": null,
          "nounSingular": null
        },
        "id": "p_01JH67QPDG65G48KN5WE2J71Y4",
        "impact": {
          "amount": 100,
          "offeringId": "off_123"
        }
      }
    ],
    "recipient": {
      "email": "customer@example.com",  
      "firstName": null,
      "name": null
    },
    "reference": "order_123",
    "timelineUrl": "https://verdn.com/my/t/abc123xyz789?edit_key=edit_k3y_456",
    "trigger": {
      "date": null,
      "externalUrl": null,
      "phrase": null
    }
  }
  ```

  ```typescript Comprehensive Request theme={null}
  const response = await fetch('https://api.verdn.com/v2/pledge-transaction', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer verdn_sk_test_...',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      reference: "order_123",
      recipient: {
        email: "customer@example.com",
        name: "John Doe",
        firstName: "John"
      },
      trigger: {
        phrase: "Purchase completed",
        date: "2024-01-25T12:00:00Z",
        externalUrl: "https://example.com/order/123"
      },
      pledges: [{
        impact: {
          offeringId: "off_123",
          amount: 100
        },
        detail: {
          name: "Custom Tree Planting",
          description: "Plant trees in Africa",
          image: "https://example.com/tree.jpg",
          externalUrl: "https://example.com/impact/123",
          externalId: "CUST_123"
        }
      }],
      notifications: ["Email", "Klaviyo"]
    })
  })
  ```

  ```json Comprehensive Response theme={null}
  {
    "charge": {
      "amount": "25.00",
      "currencyCode": "USD",
      "paidAt": null
    },
    "createdAt": "2024-01-25T12:00:00Z",
    "id": "ptran_01JH67N6WT90W8EW7GF9QN2Y57",
    "isLive": false,
    "notifications": [
      {
        "status": "Pending",
        "type": "Email"
      },
      {
        "status": "Pending",
        "type": "Klaviyo"
      }
    ],
    "pledges": [
      {
        "detail": {
          "description": "Plant trees in Africa",
          "externalId": "CUST_123",
          "externalUrl": "https://example.com/impact/123",
          "image": "https://example.com/tree.jpg",
          "name": "Custom Tree Planting",
          "nounPlural": null,
          "nounSingular": null
        },
        "id": "p_01JH67N6Y8Z56NZK3HC3AATPJF",
        "impact": {
          "amount": 100,
          "offeringId": "off_123"
        },
      }
    ],
    "recipient": {
      "email": "customer@example.com",
      "name": "John Doe",
      "firstName": "John"
    },
    "reference": "order_123",
    "timelineUrl": "https://verdn.com/my/t/abc123xyz789?edit_key=edit_k3y_456",
    "trigger": {
      "date": "2024-01-25T12:00:00Z",
      "externalUrl": "https://example.com/order/123",
      "phrase": "Purchase completed"
    }
  }
  ```
</CodeGroup>

## API Reference


## OpenAPI

````yaml POST /v2/pledge-transaction
openapi: 3.0.0
info:
  title: Verdn API
  version: 2.0.0
  description: The Verdn API
servers:
  - url: https://api.verdn.com
    description: Production server
security:
  - bearerAuth: []
paths:
  /v2/pledge-transaction:
    post:
      description: Create a new pledge transaction with multiple pledges
      parameters:
        - schema:
            type: string
            description: An optional unit ID to provide when using a team-level key
          required: false
          description: An optional unit ID to provide when using a team-level key
          name: X-Verdn-Unit-Id
          in: header
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                reference:
                  type: string
                  description: >-
                    A unique reference for the pledge transaction (e.g. order
                    ID)
                recipient:
                  type: object
                  properties:
                    email:
                      type: string
                      format: email
                      description: Email address of the recipient
                    firstName:
                      type: string
                      description: First name of the recipient
                    name:
                      type: string
                      description: Full name of the recipient
                  required:
                    - email
                  additionalProperties: false
                pledges:
                  type: array
                  items:
                    type: object
                    properties:
                      detail:
                        type: object
                        properties:
                          name:
                            type: string
                            description: >-
                              Name for the pledge (e.g. 'Tree Planting for
                              hoodie purchase')
                          description:
                            type: string
                            description: >-
                              Description of the pledge (e.g. 'Plant 10 trees
                              for every hoodie purchased')
                          nounSingular:
                            type: string
                            description: >-
                              The noun describing the category of the item, e.g.
                              “product”, “newsletter sign-up”, “ticket”
                          nounPlural:
                            type: string
                            description: >-
                              The noun describing the category of the item, e.g.
                              “products”, “newsletter sign-ups”, “tickets”
                          image:
                            type: string
                            format: uri
                            description: >-
                              URL of the image for the pledge displayed on
                              timeline
                          externalId:
                            type: string
                            description: >-
                              External ID of the item (e.g SKU for the
                              individual line item)
                          externalUrl:
                            type: string
                            format: uri
                            description: URL of the item (e.g. individual line item URL)
                        additionalProperties: false
                      impact:
                        type: object
                        properties:
                          amount:
                            type: number
                            minimum: 0
                            exclusiveMinimum: true
                            description: >-
                              Quantity to pledge towards the offering (e.g. 10
                              trees)
                          offeringId:
                            type: string
                            description: ID of the impact offering
                        required:
                          - amount
                          - offeringId
                        additionalProperties: false
                    required:
                      - impact
                    additionalProperties: false
                  minItems: 1
                trigger:
                  type: object
                  properties:
                    date:
                      type: string
                      format: date-time
                      description: The date the action was triggered. ISO 8601 format
                    phrase:
                      type: string
                      description: The action phrase (e.g. 'placed an order')
                    externalUrl:
                      type: string
                      format: uri
                      description: >-
                        URL of the action (e.g.
                        https://store.example.com/product/123)
                  additionalProperties: false
                notifications:
                  type: array
                  items:
                    type: string
                    enum:
                      - Email
                      - Klaviyo
                      - Cordial
                      - Ometria
                  maxItems: 3
                  description: >-
                    Optional array of notification service(s) used to alert
                    recipient on pledge creation
              required:
                - reference
                - recipient
                - pledges
              additionalProperties: false
              description: Input schema for creating a new pledge transaction
            example:
              reference: order_123
              recipient:
                email: customer@example.com
              pledges:
                - impact:
                    offeringId: off_123
                    amount: 100
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  charge:
                    type: object
                    properties:
                      amount:
                        type: string
                        description: Total monetary value of the pledge transaction
                      currencyCode:
                        type: string
                        enum:
                          - USD
                          - GBP
                          - EUR
                        description: Three-letter ISO currency code (e.g. USD, EUR)
                      paidAt:
                        type: string
                        nullable: true
                        format: date-time
                  createdAt:
                    type: string
                    format: date-time
                  id:
                    type: string
                    description: Unique ID for the pledge transaction
                  isLive:
                    type: boolean
                    description: Boolean indicating production vs test pledge transaction
                  notifications:
                    type: array
                    items:
                      type: object
                      properties:
                        status:
                          type: string
                          enum:
                            - Pending
                        type:
                          type: string
                          enum:
                            - Email
                            - Klaviyo
                            - Cordial
                            - Ometria
                    description: Array of notification statuses for this pledge transaction
                  pledges:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Unique ID for the pledge
                        impact:
                          type: object
                          properties:
                            amount:
                              type: number
                              minimum: 0
                              exclusiveMinimum: true
                              description: >-
                                Quantity to pledge towards the offering (e.g. 10
                                trees)
                            offeringId:
                              type: string
                              description: ID of the impact offering
                        detail:
                          type: object
                          properties:
                            description:
                              type: string
                              nullable: true
                              description: >-
                                Description of the pledge (e.g. 'Plant 10 trees
                                for every hoodie purchased')
                            externalId:
                              type: string
                              nullable: true
                              description: >-
                                External ID of the item (e.g SKU for the
                                individual line item)
                            externalUrl:
                              type: string
                              nullable: true
                              format: uri
                              description: URL of the item (e.g. individual line item URL)
                            image:
                              type: string
                              nullable: true
                              format: uri
                              description: >-
                                URL of the image for the pledge displayed on
                                timeline
                            name:
                              type: string
                              nullable: true
                              description: >-
                                Name for the pledge (e.g. 'Tree Planting for
                                hoodie purchase')
                            nounPlural:
                              type: string
                              nullable: true
                              description: >-
                                The noun describing the category of the item,
                                e.g. “products”, “newsletter sign-ups”,
                                “tickets”
                            nounSingular:
                              type: string
                              nullable: true
                              description: >-
                                The noun describing the category of the item,
                                e.g. “product”, “newsletter sign-up”, “ticket”
                  recipient:
                    type: object
                    properties:
                      email:
                        type: string
                        format: email
                        description: Email address of the recipient
                      firstName:
                        type: string
                        nullable: true
                        description: First name of the recipient
                      name:
                        type: string
                        nullable: true
                        description: Full name of the recipient
                  reference:
                    type: string
                    description: >-
                      A unique reference for the pledge transaction (e.g. order
                      ID)
                  timelineUrl:
                    type: string
                    format: uri
                    description: >-
                      URL to the generated timeline, intended for the pledge
                      recipient (should not be made public)
                  trigger:
                    type: object
                    properties:
                      date:
                        type: string
                        nullable: true
                        format: date-time
                      externalUrl:
                        type: string
                        nullable: true
                        format: uri
                        description: >-
                          URL of the action (e.g.
                          https://store.example.com/product/123)
                      phrase:
                        type: string
                        nullable: true
                        description: The action phrase (e.g. 'placed an order')
              example:
                charge:
                  amount: '25.00'
                  currencyCode: USD
                  paidAt: null
                createdAt: '2024-01-25T12:00:00Z'
                id: ptran_01JH67QPC8R56E4DP7K4PB3MRD
                isLive: false
                notifications: []
                pledges:
                  - detail:
                      description: null
                      externalId: null
                      externalUrl: null
                      image: null
                      name: null
                      nounPlural: null
                      nounSingular: null
                    id: p_01JH67QPDG65G48KN5WE2J71Y4
                    impact:
                      amount: 100
                      offeringId: off_123
                recipient:
                  email: customer@example.com
                  firstName: null
                  name: null
                reference: order_123
                timelineUrl: https://verdn.com/my/t/abc123xyz789?edit_key=edit_k3y_456
                trigger:
                  date: null
                  externalUrl: null
                  phrase: null
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
                  - message
              example:
                error: 'true'
                message: Not authorized. Check your API key and try again.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````