Payment API (v1.0)

Download OpenAPI specification:

Payment processing endpoints via Demeter payment system

Payment

Payment processing operations

Process a new payment

Process a payment transaction via Demeter payment system.

Required Headers:

  • X-Demeter-Base-Url: Demeter API base URL
  • X-Demeter-Username: Demeter API username
  • X-Demeter-Api-Key: Demeter API key
  • X-Merchant-Account-Global-Id: Merchant account GUID
authorizer-scopes: ["payment:payments:Write"]
Authorizations:
authorizer-lambdaapi_key
header Parameters
X-Demeter-Base-Url
required
string
Example: https://demeter-api.bonterra.network

Demeter API base URL

X-Demeter-Username
required
string

Demeter API username

X-Demeter-Api-Key
required
string

Demeter API key

X-Merchant-Account-Global-Id
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}...

Demeter merchant account GUID

Request Body schema: application/json
required
confirmationTokenId
required
string

Stripe ConfirmationToken ID from PaymentElement

amount
required
number <double> >= 0.01

Payment amount in specified currency

currency
required
string
Value: "USD"

ISO 4217 currency code

paymentMethodType
string
Default: "card"
Enum: "card" "apple_pay" "google_pay" "us_bank_account"

Type of payment method

required
object

Donor information. Supports two address formats:

Format 1 (Flat): Address fields at donor level

{ "firstName": "John", "email": "john.doe@example.com", "address": "123 Main St", "city": "Springfield", "state": "IL", "zip": "62701" }

Format 2 (Nested - Preferred): Address as nested object

{ "firstName": "John", "email": "john.doe@example.com", "address": { "line1": "123 Main St", "city": "SF", "state": "CA", "postalCode": "94105" } }
sourceId
string <= 100 characters

Source system identifier

source
string <= 100 characters

Alternative to sourceId - source system identifier

invoiceNumber
string <= 100 characters

Invoice or reference number

merchantAccountId
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}...

Demeter merchant account GUID (optional, uses header value if not provided)

Responses

Response Schema: application/json
paymentId
string

Payment transaction identifier

gatewayTransactionId
string

Stripe PaymentIntent ID

status
string
Enum: "completed" "pending" "failed" "cancelled" "Authorized"

Payment status

amount
number <double>

Payment amount

currency
string

Currency code

object
object
invoiceNumber
string
source
string
createdAt
string <date-time>
demeterData
object

Raw response from Demeter system

Request samples

Content type
application/json
{
  • "confirmationTokenId": "ctoken_1QaybcGgJgpo8mZyToken123456",
  • "amount": 25,
  • "currency": "USD",
  • "paymentMethodType": "card",
  • "donor": {
    },
  • "sourceId": "cybergrants",
  • "invoiceNumber": "CG-2024-001234"
}

Response samples

Content type
application/json
{
  • "paymentId": "txn_demeter_12345",
  • "gatewayTransactionId": "pi_1QaybcGgJgpo8mZyPayment123",
  • "status": "completed",
  • "amount": 25,
  • "currency": "USD",
  • "paymentMethod": {
    },
  • "donor": {
    },
  • "invoiceNumber": "string",
  • "source": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "demeterData": { }
}

List payment transactions

Retrieve a list of payment transactions

authorizer-scopes: ["payment:payments:Read"]
Authorizations:
authorizer-lambdaapi_key
query Parameters
status
string
Enum: "completed" "pending" "failed" "cancelled"

Filter by payment status

limit
integer [ 1 .. 100 ]
Default: 50

Number of items to return

offset
integer >= 0
Default: 0

Number of items to skip

Responses

Response Schema: application/json
Array
paymentId
string

Payment transaction identifier

gatewayTransactionId
string

Stripe PaymentIntent ID

status
string
Enum: "completed" "pending" "failed" "cancelled" "Authorized"

Payment status

amount
number <double>

Payment amount

currency
string

Currency code

object
object
invoiceNumber
string
source
string
createdAt
string <date-time>
demeterData
object

Raw response from Demeter system

Response samples

Content type
application/json
[
  • {
    }
]

Get merchant account configuration

Retrieve merchant account details from Demeter system.

Required Headers:

  • X-Demeter-Base-Url: Demeter API base URL
  • X-Demeter-Username: Demeter API username
  • X-Demeter-Api-Key: Demeter API key
  • X-Merchant-Account-Global-Id: Merchant account GUID
authorizer-scopes: ["payment:payments:Read"]
Authorizations:
authorizer-lambdaapi_key
header Parameters
X-Demeter-Base-Url
required
string
X-Demeter-Username
required
string
X-Demeter-Api-Key
required
string
X-Merchant-Account-Global-Id
required
string

Responses

Response Schema: application/json
merchantAccountId
string
merchantAccountName
string
status
string
supportedPaymentMethods
Array of strings
configuration
object

Response samples

Content type
application/json
{
  • "merchantAccountId": "string",
  • "merchantAccountName": "string",
  • "status": "string",
  • "supportedPaymentMethods": [
    ],
  • "configuration": { }
}

Get transaction status

Retrieve the status and details of a specific transaction.

Returns transaction timeline, payment method details, fees, and current status.

authorizer-scopes: ["payment:payments:Read"]
Authorizations:
authorizer-lambdaapi_key
path Parameters
transactionId
required
string
Example: txn_12345

The unique transaction identifier

Responses

Response Schema: application/json
status
string
timestamp
string <date-time>
operation
string
object

Response samples

Content type
application/json
{
  • "status": "success",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "operation": "GetTransactionStatus",
  • "data": {
    }
}

Payment Health Check

Health check for payment service

Check if Payment API is available

Verify that the Payment API Lambda and Demeter integration are operational

Responses

Response Schema: application/json
status
string
version
string
service
string

Response samples

Content type
application/json
{
  • "status": "ok",
  • "version": "1.0.0",
  • "service": "payments"
}