Skip to content

Getting started

With the Shift API you receive the donors recruited for you, and you report back what happens to them afterwards. Over time the API replaces delivery as a file over SFTP.

Beta. The API is in development. Endpoints and fields may still change. What is not settled yet is marked to follow.

  • A pledge reaches you from day 1, the sign-up date, with the status pending.
  • While the pledge is pending, everything can still be changed: the amount, the frequency, the account number and the donor’s details. If the donor tells you about a change or regret, you report it to Shift (flow 2). You receive a change made at Shift immediately.
  • If the donor regrets it in those days, or the pledge is rejected, the status becomes no_show.
  • On day 9 the pledge becomes final: the status becomes confirmed. For 7 days after that you can still fetch the full record; after that the API returns no personal data, only the status.
  • You hear immediately when something happens (push), and you can always fetch what is new or changed yourself (pull).
  • From confirmed on, until 13 months after the sign-up date, you only report the progress: the number of successful collections, and whether the donor has stopped or the collection was reversed, with the reason and a description (flow 3). The status then becomes cancelled. If a donor stops with Shift, you receive it the same way.
  • In every flow the record ID is the key, for example PL00012345.
  • Everyone receives the same record in the same format. You do the translation to your own system yourself.
Flow Direction Endpoint
1. New and changed donors Shift to you GET /v1/pledges, GET /v1/pledges/{record_id}, plus a push to your system
2. Regret and changes You to Shift POST /v1/pledges/{record_id}/changes
3. Collections and cancellations You to Shift PUT /v1/pledges/{record_id}/collection-status

See The life cycle of a pledge and The flows.

The API is only reachable for organisations that are connected. When you connect, you receive:

  • the base URL of the API and of a test environment; every path in this documentation starts with /v1;
  • a client ID and client secret, through a separate and secured channel;
  • the rights (scopes) you have: fetching, reporting regret and changes, reporting collections.

You give us:

  • the fixed IP addresses your system calls the API from. Requests from other addresses are refused;
  • if you want to receive push: the URL at which your system receives notifications.

You exchange your client ID and client secret for an access token (OAuth 2.0, client credentials). A token is valid for about fifteen minutes; after that you fetch a new one.

POST /oauth/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id=...&client_secret=...&scope=pledges.read

Every following request sends the token along:

GET /v1/pledges
Authorization: Bearer <token>

A token only gives access to the pledges of your own organisation.

Your records contain the personal data and bank account numbers of donors. That is why the API does not rely on a single key: a secret, a short-lived token, your fixed IP addresses and rights separated per flow must all match. Keep the client secret as you keep a password of your direct debit system. If you suspect it has leaked, report it immediately; we revoke it and give you a new one.

pace-api staging · a79cbe01e4c5