Skip to content
Aller au contenu
Charitips

API reference · Donations

Claim a donation

POST/v1/donations/{donationId}/claim

Link a donation with a given Charity.

Requires a Bearer access token.

Parameters

This field has no description in the spec.

  • donationId#stringin pathrequired

Body

ClaimDonationDto

1 of 3 fields has no description in the spec.

  • charityId#stringrequiredUUID

    Id of the Charity to which the donation will be made.

  • amount#integer (int64)minimum 1

    Donation amount in minor currency unit i.e cents if not provided on creation.

  • lead#LeadInfo

    6 child fields
    • fullnamestring

    • companyNamestring

    • emailstringemail address

    • phonestring

    • customstring

    • hasAcceptedTermsbooleanrequired

Response

200 · Donation

No field is described in the spec.

  • donationId#stringalways returned

  • amount#integer (int64)

  • externalId#string

  • uniqueExternalId#string

  • status#DonationStatusalways returned

    PENDINGDONEPROCESSEDCANCELED

  • secret#stringalways returned

  • withFiscalReceipt#booleanalways returned

  • hasBeenCharged#booleanalways returned

  • claimedAt#string (date-time)

  • validatedAt#string (date-time)

  • processedAt#string (date-time)

  • billingStatus#BillingStatusalways returned

    PENDINGBILLEDPAID

  • hideAmount#booleanalways returned

  • billedOn#DonationBilledOnalways returned

    CREATIONCLAIM

  • autoAssigned#boolean

  • expiryDate#string (date-time)

  • sendingMode#CampaignSendingModealways returned

    MANUALEMAILPHYSICALSLACKPOSTAL

  • sendingDate#string (date-time)

  • sendingStatus#DonationSendingStatusalways returned

    PENDINGFAILEDDONE

  • externalSendingId#string

  • lastReminderId#string

  • message#string

  • reminderMessage#string

  • from#string

  • language#Languagealways returned

    fren

  • sharedOn#SocialNetwork

    LINKEDININSTAGRAMFACEBOOKTWITTERWHATSAPP

  • ptoType#PaidTimeOffTypealways returned

    NONEPAID_TIME_OFFWORKING_TIME_REDUCTION

  • accountId#stringalways returned

  • campaignId#stringalways returned

  • charityId#string

  • recurringDonationId#string

  • transactionId#string

  • donorId#string

  • orderPlatformUserId#string

  • usageId#string

  • parentDonationId#string

  • parentVoteId#string

  • parentRecurringDonationId#string

  • createdAt#string (date-time)always returned

  • updatedAt#string (date-time)always returned

Errors

  • 400 Bad Request
  • Lead is required
    {
      "statusCode": 400,
      "message": "Lead is required",
      "error": "Bad Request"
    }
  • Lead has to accept terms and conditions
    {
      "statusCode": 400,
      "message": "Lead has to accept terms and conditions",
      "error": "Bad Request"
    }
  • Invalid lead information
    {
      "statusCode": 400,
      "message": "Invalid lead information",
      "error": "Bad Request"
    }
  • Lead collection is not enabled for this campaign
    {
      "statusCode": 400,
      "message": "Lead collection is not enabled for this campaign",
      "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"
    }
  • 401 Unauthorized
  • Unauthorized

    Missing, expired or invalid access token.

    {
      "statusCode": 401,
      "message": "Unauthorized"
    }
  • 403 Forbidden
  • Campaign has ended.
    {
      "statusCode": 403,
      "message": "Campaign has ended.",
      "error": "Forbidden"
    }
  • Account not validated
    {
      "statusCode": 403,
      "message": "Account not validated",
      "error": "Forbidden"
    }
  • Account closed
    {
      "message": "Account closed",
      "code": "ACCOUNT_CLOSED"
    }
  • Forbidden

    Your credentials cannot perform this action on this resource. An id from another account answers 404 in the path, 400 in the body or the query.

    {
      "statusCode": 403,
      "message": "Forbidden"
    }
  • 404 Not Found
  • Not Found

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

    {
      "statusCode": 404,
      "message": "Not Found"
    }
  • 409 Conflict
  • Donation already claimed
    {
      "statusCode": 409,
      "message": "Donation already claimed",
      "error": "Conflict"
    }
POST /v1/donations/<donationId>/claim
curl -X POST https://api.sandbox.charitips.com/v1/donations/<donationId>/claim \  -H "Authorization: Bearer $CHARITIPS_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "charityId": "<charityId>"  }'
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.