Skip to content
Aller au contenu
Charitips

API reference · Recurring Donations

Create a recurring donation

POST/v1/recurring-donations

This recurring donation will then have to be claimed i.e linked to a Charity by the donor.

Requires a Bearer access token.

Body

CreateRecurringDonationDto
  • campaignId#stringrequiredUUID

    Id of the campaign

  • amount#integer (int64)requiredminimum 1

    Donation amount in minor currency unit i.e cents.

  • donorFirstName#stringrequired

    First name of the donor. Will be used for email communications.

  • donorLastName#stringrequired

    Last name of the donor. Will be used for email communications.

  • donorEmail#stringrequired

    Email of the donor. Will be used for email communications.

  • externalId#string

    An optional internal id of your system e.g orderId or customerId. Can be used to link a recurring donation to an entity in your system.

  • uniqueExternalId#string

    Similar to externalId but should be unique across all recurring donations. Can be used to prevent duplicate recurring donations.

  • language#string

    Locale to be used to communicate with the donor. Default to the campaign's language value.

    fren

Response

201 · RecurringDonation

No field is described in the spec.

  • recurringDonationId#stringalways returned

  • type#RecurringDonationTypealways returned

    FREQUENCYMANUAL

  • amountType#RecurringDonationAmountTypealways returned

    FIXED_AMOUNTRATE

  • status#RecurringDonationStatusalways returned

    PENDINGACTIVEPAUSEDCANCELED

  • hasBeenCharged#booleanalways returned

  • feeType#FeeTypealways returned

    EXCLUDEDINCLUDED

  • amount#integer (int64)always returned

  • rate#number

  • baseAmount#integer (int64)

  • withRounding#booleanalways returned

  • frequency#string

  • secret#stringalways returned

  • externalId#string

  • uniqueExternalId#string

  • sendingMode#CampaignSendingModealways returned

    MANUALEMAILPHYSICALSLACKPOSTAL

  • sendingDate#string (date-time)

  • sendingStatus#DonationSendingStatusalways returned

    PENDINGFAILEDDONE

  • lastReminderId#string

  • message#string

  • reminderMessage#string

  • from#string

  • language#Languagealways returned

    fren

  • accountId#stringalways returned

  • campaignId#stringalways returned

  • charityId#string

  • donorId#stringalways returned

  • createdAt#string (date-time)always returned

  • updatedAt#string (date-time)always returned

Errors

  • 400 Bad Request
  • Recurring donations can only be created for FREE_AMOUNT campaigns
    {
      "statusCode": 400,
      "message": "Recurring donations can only be created for FREE_AMOUNT campaigns",
      "error": "Bad Request"
    }
  • A field is missing, has the wrong type, or is not part of the request schema.

    Every request with a body or query is validated.

    {
      "statusCode": 400,
      "message": [
        "amount must not be less than 1",
        "property foo should not exist"
      ],
      "error": "Bad Request"
    }
  • Bad Request

    No resource with this id on your account: the API answers as if it did not exist.

    {
      "statusCode": 400,
      "message": "Bad Request"
    }
  • 401 Unauthorized
  • Unauthorized

    Missing, expired or invalid access token.

    {
      "statusCode": 401,
      "message": "Unauthorized"
    }
  • 402 Payment Required
  • Missing payment method
    {
      "message": "Missing payment method",
      "code": "MISSING_PAYMENT_METHOD"
    }
  • 403 Forbidden
  • Campaign has ended.
    {
      "statusCode": 403,
      "message": "Campaign has ended.",
      "error": "Forbidden"
    }
  • Recurring donations can only be created for recurring frequency campaigns.
    {
      "statusCode": 403,
      "message": "Recurring donations can only be created for recurring frequency campaigns.",
      "error": "Forbidden"
    }
  • Campaign has to be activated first.
    {
      "statusCode": 403,
      "message": "Campaign has to be activated first.",
      "error": "Forbidden"
    }
  • Account not validated
    {
      "statusCode": 403,
      "message": "Account not validated",
      "error": "Forbidden"
    }
  • Account closed
    {
      "message": "Account closed",
      "code": "ACCOUNT_CLOSED"
    }
  • 409 Conflict
  • Unique constraint failed on uniqueExternalId

    {
      "statusCode": 409,
      "message": "Unique constraint failed on uniqueExternalId"
    }
POST /v1/recurring-donations
curl -X POST https://api.sandbox.charitips.com/v1/recurring-donations \  -H "Authorization: Bearer $CHARITIPS_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "campaignId": "<campaignId>",    "amount": 2000,    "donorFirstName": "Jane",    "donorLastName": "Doe",    "donorEmail": "jane.doe@example.com",    "uniqueExternalId": "subscription_2291"  }'
Built from the spec and the API code

Request bodies are written for this docs and checked against the API's validation; ids in angle brackets are placeholders. Response values are placeholders built from the schema.