Aller au contenu principal

Cette page est disponible uniquement en anglais.Ouvrir en anglais

Invites

The API creates and changes the same invites of the panel, with the same rules. Only the mode of your app (Open, Private or Embedded) is changed only in the panel.

The invite​

{
"id": "inv_8QX4M2T7KA9PB",
"status": "pending",
"email": "[email protected]",
"phone": "+14155550167",
"name": "Liam",
"externalRef": "crm-1042",
"link": "https://cards.example.com/invite/9f3a…",
"createdAt": "2026-11-16T10:00:00Z",
"expiresAt": "2026-12-16T10:00:00Z",
"usedAt": null,
"userId": null,
"canResume": false
}
statusMeaning
pendingNobody used it. A pending invite has a link
usedThe account was born. userId is the user
pausedPaused
revokedRevoked, for good
expired30 days without use

When an invite is revoked or expires without use, email, phone and name turn null.

used means the account was born, when the mobile number was confirmed. The identity verification comes after it, on the same link: follow it in user.kyc.updated. canResume is true when the account of the invite can go on from the invite page: the verification stopped halfway, or the card issuer asked to verify again. While it is true, the used invite shows its link again and resend creates a new one. The account takes the mode your app has when the person opens the invite.

Routes​

RouteWhat it does
GET /v2/invitesThe last 100 invites, with the mode of your app and your invite credit. Filters status and externalRef
GET /v2/invites/{id}One invite
POST /v2/invitesCreates an invite
POST /v2/invites/{id}/pausePauses a pending or used invite
POST /v2/invites/{id}/resumeResumes it
POST /v2/invites/{id}/revokeRevokes it
POST /v2/invites/{id}/resendA new link for a pending invite, or for a used one with canResume: the old link stops working and the 30 days start again, with no credit used

Every POST needs an Idempotency-Key. An action that does not apply to the state of the invite answers 403 not_allowed, reason nothing_to_do.

Create an invite​

curl -X POST https://api.sandbox.creditcard/v2/invites \
-H "Authorization: Bearer w3c_test_YOUR_SECRET" \
-H "Idempotency-Key: invite-crm-1042" \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "phone": "+14155550167", "name": "Liam", "externalRef": "crm-1042"}'
FieldRule
emailRequired. The person never types it: the invite carries it
phoneRequired, with + and the country code
nameOptional, up to 80 characters. It only greets the person
externalRefOptional, up to 100 characters: the id of the person in your system. It comes back in the users and in the events

The answer is {"success": true, "invite": {...}}. Send the link to the person. The price of the invite comes out of your invite credit.

ErrorWhen
409 insufficient_creditNot enough invite credit. Add credit to send invites.
409 invite_existsThere is already a pending invite for this person.
409 person_already_registeredThis person already has an account in this program.
403 not_allowed, reason country_not_servedThis country cannot be served. The mobile number is from a country that no program serves
403 not_allowedNo paid plan, or the program contract was not created yet

Events​

invite.created, invite.paused, invite.resumed, invite.revoked and invite.expired, with inviteId, status and externalRef. When the account is born, user.created brings userId, inviteId, externalRef and mode. See Webhooks.

Paused and revoked accounts​

When the invite of a person who already has an account is paused or revoked, new cards and top-ups of that account are refused with 403 not_allowed, reason account_paused (The company paused new cards and loads for this account.) or account_revoked (The company revoked new cards and loads for this account.). The cards keep working with their balance.