### OpenAPI Schema and Unauthorized Error Example Source: https://docs.verdn.com/api-reference/endpoint/create-pledge-transaction Defines a schema structure with required properties 'error' and 'message', and provides an example of an unauthorized API response. This entry details the structure of expected data and common error scenarios within the API. ```APIDOC OpenAPI Schema Definition: allOf: - type: object required: - error - message properties: error: type: string description: Indicates if an error occurred. message: type: string description: A descriptive message about the error. Examples: Unauthorized Response: value: error: 'true' message: Not authorized. Check your API key and try again. Metadata: description: Unauthorized deprecated: false type: path components: schemas: {} ``` -------------------------------- ### Get Pledge Transaction by ID Source: https://docs.verdn.com/api-reference/endpoint/get-pledge-transaction-by-id Retrieves a specific pledge transaction using its unique identifier. Supports responses for successful retrieval (200 OK), unauthorized access (401 Unauthorized), and resource not found (404 Not Found). Includes detailed schema definitions and examples for the success case. ```APIDOC GET /pledges/{id} Description: Retrieve a pledge transaction by its ID. Parameters: - id: (path parameter) The unique identifier of the pledge transaction. Responses: '200': description: Pledge transaction found content: application/json: schema: type: object properties: createdAt: { type: string, format: date-time, description: Timestamp when the transaction was created } reference: { type: string, nullable: true, description: Custom reference for the transaction } isLive: { type: boolean, description: Indicates if the transaction is live } charge: type: object properties: amount: { type: integer, description: The amount charged } currencyCode: { type: string, description: The currency code (e.g., USD) } paidAt: { type: string, format: date-time, description: Timestamp when the charge was paid } trigger: type: object properties: date: { type: string, format: date-time, description: The date associated with the trigger } externalUrl: { type: string, nullable: true, format: uri, description: An external URL related to the trigger } phrase: { type: string, nullable: true, description: A descriptive phrase for the trigger } pledges: type: array items: type: object properties: id: { type: string, description: The ID of the pledge } impact: type: object properties: offeringId: { type: string, description: The ID of the offering } amount: { type: integer, description: The impact amount } details: type: array items: type: object properties: name: { type: string, nullable: true, description: Name of the detail } description: { type: string, nullable: true, description: Description of the detail } nounSingular: { type: string, nullable: true, description: Singular noun for the detail } nounPlural: { type: string, nullable: true, description: Plural noun for the detail } image: { type: string, nullable: true, description: URL of an image for the detail } externalId: { type: string, nullable: true, description: External identifier for the detail } externalUrl: { type: string, nullable: true, format: uri, description: External URL for the detail } recipient: type: object properties: email: { type: string, description: Email address of the recipient } name: { type: string, description: Full name of the recipient } firstName: { type: string, nullable: true, description: First name of the recipient } timelineUrl: { type: string, nullable: true, description: URL to the generated timeline for the recipient } examples: example: value: createdAt: '2023-04-27T16:10:48.000Z' reference: my-custom-reference isLive: true charge: amount: 0 currencyCode: USD paidAt: '2024-10-01T00:00:00.000Z' trigger: date: '2021-03-13T00:00:00.000Z' externalUrl: null phrase: null pledges: - id: p_00000000000000000000000000 impact: offeringId: io_00000000000000000000000000 amount: 2 details: - name: null description: null nounSingular: null nounPlural: null image: null externalId: null externalUrl: null recipient: email: customer@example.com name: Customer firstName: null '401': description: Unauthorized content: application/json: schema: type: object properties: error: { type: string } message: { type: string } requiredProperties: - error - message examples: example: value: error: Authentication failed message: Check your API key and try again. '404': description: Not Found content: application/json: schema: type: object properties: error: { type: string } requiredProperties: - error examples: example: value: error: Pledge transaction not found ``` -------------------------------- ### Get Pledge Transaction by ID Source: https://docs.verdn.com/api-reference/endpoint/get-pledge-transaction-by-id Retrieves an existing pledge transaction by its unique identifier. This endpoint is used to fetch the details of a specific pledge transaction. ```APIDOC GET /pledge-transactions/{id} Description: Retrieves a specific pledge transaction by its unique identifier. Parameters: - id (string, required): The unique identifier of the pledge transaction to retrieve. Returns: - 200 OK: Successfully retrieved pledge transaction details. - Example Response Body: { "transactionId": "txn_12345", "pledgeId": "pldg_abcde", "amount": 100.50, "currency": "USD", "status": "completed", "createdAt": "2023-10-27T10:00:00Z" } - 404 Not Found: The pledge transaction with the specified ID was not found. - 500 Internal Server Error: An unexpected error occurred on the server. ``` -------------------------------- ### OpenAPI GET /v2/pledge-transaction/{id} Source: https://docs.verdn.com/api-reference/endpoint/get-pledge-transaction-by-id Retrieves details for a specific pledge transaction. This endpoint requires Bearer authentication and accepts an optional X-Verdn-Unit-Id header. The response includes transaction status, pledge details, and recipient information. ```APIDOC GET /v2/pledge-transaction/{id} path: /v2/pledge-transaction/{id} method: get servers: - url: https://api.verdn.com description: Production server request: security: - title: bearerAuth parameters: query: {} header: Authorization: type: http scheme: bearer cookie: {} parameters: path: {} query: {} header: X-Verdn-Unit-Id: schema: - type: string required: false description: An optional unit ID to provide when using a team-level key cookie: {} body: {} response: '200': application/json: schemaArray: - type: object properties: charge: allOf: - 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: allOf: - type: string format: date-time id: allOf: - type: string isLive: allOf: - type: boolean description: Boolean indicating production vs test pledge transaction notifications: allOf: - type: array items: type: object properties: status: type: string enum: - Pending - Updated - Actualized type: type: string enum: - Email - Klaviyo - LegacyKlaviyo - Cordial - Ometria description: Array of notification statuses for this pledge transaction pledges: allOf: - type: array items: type: object properties: details: type: array items: type: object properties: description: type: string nullable: true externalId: type: string nullable: true externalUrl: type: string nullable: true format: uri image: type: string nullable: true format: uri name: type: string nullable: true nounPlural: type: string nullable: true nounSingular: type: string nullable: true id: type: string description: Unique ID for the pledge impact: type: object properties: amount: type: integer minimum: 0 exclusiveMinimum: true description: >- Quantity to pledge towards the offering (e.g. 10 trees) offeringId: type: string description: ID of the impact offering recipient: allOf: - type: object properties: email: type: string format: email ``` -------------------------------- ### Verdn API Key Modes and Levels Source: https://docs.verdn.com/api-reference/authentication Details the different modes (test/live) and levels (unit-level/team-level) of Verdn API keys and their usage requirements. ```APIDOC Key Modes: - Test keys start with `verdn_sk_test`. - Production (live) keys start with `verdn_sk_live`. - All API endpoints can be used with either test or live keys. - API JSON response bodies contain an `isLive` property indicating the key's status. Key Levels: - Unit-level keys authenticate requests as the unit itself. - Team-level keys authenticate requests on behalf of a unit. - Team-level requests require an additional `X-Verdn-Unit-Id` header for unit authentication. Header for Team-Level Authentication: X-Verdn-Unit-Id: Example: X-Verdn-Unit-Id: unit_abc123def456 ``` -------------------------------- ### Verdn API Endpoints Source: https://docs.verdn.com/introduction This section details the available endpoints for interacting with the Verdn API. It covers creating and retrieving pledge transactions. ```APIDOC API Endpoints: 1. Create Pledge Transaction - Endpoint: /api-reference/endpoint/create-pledge-transaction - Description: Allows creating a new pledge transaction by attaching an impact pledge to a specific transaction. - Method: POST (assumed) - Request Body: (Details not provided in source text) - Response: (Details not provided in source text) 2. Get Pledge Transaction by ID - Endpoint: /api-reference/endpoint/get-pledge-transaction-by-id - Description: Retrieves details of a specific pledge transaction using its unique identifier. - Method: GET (assumed) - Parameters: - id: The unique identifier of the pledge transaction (string, required) - Response: (Details not provided in source text) ``` -------------------------------- ### Verdn API Key Authentication Source: https://docs.verdn.com/api-reference/authentication Explains how to authenticate requests to the Verdn API using API keys. All requests require a valid API key passed in the `Authorization` header. ```APIDOC API Key Authentication: All requests to the Verdn API must be authenticated using an API key. Authentication Header: Pass your API key as an HTTP Authorization request header prefixed with the Bearer keyword. Format: Authorization: Bearer Example: Authorization: Bearer verdn_sk_test_abcdef123456 ``` -------------------------------- ### OpenAPI: POST /v2/pledge-transaction - Pledge Transaction Source: https://docs.verdn.com/api-reference/endpoint/create-pledge-transaction This entry details the OpenAPI specification for the POST /v2/pledge-transaction endpoint. It outlines the request structure, including headers, security, and a detailed JSON schema for the request body, which defines pledge details, recipient information, and impact metrics. The endpoint is used to create a pledge transaction. ```APIDOC paths: /v2/pledge-transaction: post: servers: - url: https://api.verdn.com description: Production server request: security: - title: bearerAuth parameters: query: {} header: Authorization: type: http scheme: bearer cookie: {} parameters: path: {} query: {} header: X-Verdn-Unit-Id: schema: - type: string required: false description: An optional unit ID to provide when using a team-level key cookie: {} body: application/json: schemaArray: - type: object properties: reference: allOf: - type: string description: >- A unique reference for the pledge transaction (e.g. order ID) recipient: allOf: - 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: allOf: - 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: allOf: - type: object properties: date: type: string format: date-time ``` -------------------------------- ### APIDOC: Pledge Transaction Schema Source: https://docs.verdn.com/api-reference/endpoint/create-pledge-transaction Defines the structure for creating a new pledge transaction and the response schema for retrieved pledge transactions. Includes details on transaction references, recipient information, pledge details, impact, and notification statuses. ```APIDOC Request Schema (Create Pledge Transaction): description: Input schema for creating a new pledge transaction requiredProperties: - reference - recipient - pledges properties: reference: The unique identifier for the transaction. recipient: type: object properties: email: The email address of the recipient. pledges: type: array items: type: object properties: impact: type: object properties: offeringId: ID of the impact offering. amount: Quantity to pledge towards the offering (e.g. 10 trees). Must be a positive number. detail: type: object properties: description: Description of the pledge (e.g. 'Plant 10 trees for every hoodie purchased'). externalId: External identifier for the pledge detail. 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. additionalProperties: false Example Request: reference: order_123 recipient: email: customer@example.com pledges: - impact: offeringId: off_123 amount: 100 Response Schema (Pledge Transaction): type: object properties: charge: type: object properties: amount: Total monetary value of the pledge transaction. currencyCode: Three-letter ISO currency code (e.g. USD, EUR). paidAt: The date the action was triggered. ISO 8601 format. createdAt: The timestamp when the pledge transaction was created. id: Unique ID for the pledge transaction. isLive: Boolean indicating production vs test pledge transaction. notifications: type: array items: type: object properties: status: Status of the notification. type: Type of notification service. pledges: type: array items: type: object properties: id: Unique ID for the pledge. impact: type: object properties: amount: Quantity to pledge towards the offering (e.g. 10 trees). offeringId: ID of the impact offering. detail: type: object properties: description: Description of the pledge (e.g. 'Plant 10 trees for every hoodie purchased'). externalId: External identifier for the pledge detail. additionalProperties: false ``` -------------------------------- ### Pledge Object Schema and API Responses Source: https://docs.verdn.com/api-reference/endpoint/create-pledge-transaction Defines the structure of a pledge object, including properties like external ID, URLs, names, recipient details, and transaction references. It also details the schema for successful (200) and unauthorized (401) API responses. ```APIDOC Pledge Object Schema: type: object properties: charge: type: object properties: amount: type: string description: The amount charged for the pledge. currencyCode: type: string description: The currency code for the charge (e.g., USD). paidAt: type: string format: date-time nullable: true description: Timestamp when the charge was paid. createdAt: type: string format: date-time description: Timestamp when the pledge was created. id: type: string description: Unique identifier for the pledge transaction. isLive: type: boolean description: Indicates if the transaction is live or in a test environment. notifications: type: array items: type: object description: Details about notifications sent for the pledge. pledges: type: array items: type: object properties: detail: type: object properties: description: type: string nullable: true 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”. nounSingular: type: string nullable: true description: The noun describing the category of the item, e.g. “product”. id: type: string description: Unique identifier for the pledge item. impact: type: object properties: amount: type: integer description: The impact amount. offeringId: type: string description: Identifier for the impact offering. 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. 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'). API Response Examples: 200 OK: application/json: schema: type: object properties: charge: type: object properties: amount: type: string example: '25.00' currencyCode: type: string example: USD paidAt: type: string format: date-time nullable: true example: null createdAt: type: string format: date-time example: '2024-01-25T12:00:00Z' id: type: string example: ptran_01JH67QPC8R56E4DP7K4PB3MRD isLive: type: boolean example: false notifications: type: array items: type: object example: [] pledges: type: array items: type: object properties: detail: type: object properties: description: type: string nullable: true example: null externalId: type: string nullable: true example: null externalUrl: type: string nullable: true format: uri example: null image: type: string nullable: true format: uri example: null name: type: string nullable: true example: null nounPlural: type: string nullable: true example: null nounSingular: type: string nullable: true example: null id: type: string example: p_01JH67QPDG65G48KN5WE2J71Y4 impact: type: object properties: amount: type: integer example: 100 offeringId: type: string example: off_123 recipient: type: object properties: email: type: string format: email example: customer@example.com firstName: type: string nullable: true example: null name: type: string nullable: true example: null reference: type: string example: order_123 timelineUrl: type: string format: uri example: 'https://verdn.com/my/t/abc123xyz789?edit_key=edit_k3y_456' trigger: type: object properties: date: type: string nullable: true format: date-time example: null externalUrl: type: string nullable: true format: uri example: null phrase: type: string nullable: true example: null 401 Unauthorized: application/json: schema: type: object properties: error: type: string example: 'unauthorized' message: type: string example: 'Authentication failed' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.