Skip to content
Aller au contenu
Charitips

API reference · Donations

Update a donation

PATCH/v1/donations/{donationId}

Update a not claimed and not billed donation's amount or set the externalId/uniqueExternalId of your choice.

Requires a Bearer access token.

Parameters

This field has no description in the spec.

  • donationId#stringin pathrequired

Body

UpdateDonationDto
  • amount#integer (int64)minimum 1

    Donation amount in minor currency unit i.e cents if the donation hasn't been billed or claimed yet.

  • externalId#string

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

  • uniqueExternalId#string

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

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
  • 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
  • Donation amount can't be updated as its card has already been posted.
    {
      "statusCode": 403,
      "message": "Donation amount can't be updated as its card has already been posted.",
      "error": "Forbidden"
    }
  • Donation amount can't be updated as it has already been claimed.
    {
      "statusCode": 403,
      "message": "Donation amount can't be updated as it has already been claimed.",
      "error": "Forbidden"
    }
  • Donation amount can't be updated as it has already been billed.
    {
      "statusCode": 403,
      "message": "Donation amount can't be updated as it has already been billed.",
      "error": "Forbidden"
    }
  • Donation amount can't be updated as it has been claimed, billed or its card posted.
    {
      "statusCode": 403,
      "message": "Donation amount can't be updated as it has been claimed, billed or its card posted.",
      "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
  • Unique constraint failed on uniqueExternalId

    {
      "statusCode": 409,
      "message": "Unique constraint failed on uniqueExternalId"
    }
PATCH /v1/donations/<donationId>
curl -X PATCH https://api.sandbox.charitips.com/v1/donations/<donationId> \  -H "Authorization: Bearer $CHARITIPS_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "amount": 2000,    "externalId": "<externalId>"  }'
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.