cardRegistrations

Create a Card Registration

Changed on

Create a Card Registration

Read more about the Card Registration object →

post/v2.01/{ClientId}/cardregistrations

Request

  • Base URL
    https://api.sandbox.mangopay.com
  • URL
    https://api.sandbox.mangopay.com/v2.01/{ClientId}/cardregistrations
  • Auth
    HTTP bearer

Path parameters

ClientIdstring required

Platform's API account identifier, associated with the API key.

Request body

Tagstring

Max. length: 255 characters

Custom data that you can add to this object, such as unique identifiers in your system. To store multiple values, you can serialize them into a single string, for example a JSON object: "{\"id_1\":AB123,\"id_2\":DE456}".

This value will also be inherited by the Card object's Tag parameter and cannot be edited.

UserIdstring required

The unique identifier of the user the card belongs to.

CardTypestring

Allowed values: CB_VISA_MASTERCARD, AMEX, MAESTRO, BCMC

Default value: CB_VISA_MASTERCARD

The type of the card. If not supplied, the default value will be taken into account.

Currencystring required

Allowed values: The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

The currency of the card.

Response

Success

Idstring

The unique identifier of the Card Registration object.

Tagstring

Max. length: 255 characters

Custom data that you can add to this object, such as unique identifiers in your system. To store multiple values, you can serialize them into a single string, for example a JSON object: "{\"id_1\":AB123,\"id_2\":DE456}".

This value will also be inherited by the Card object's Tag parameter and cannot be edited.

CreationDateinteger

Unix timestamp (UTC) of the date and time the object was created.

UserIdstring

The unique identifier of the user the card belongs to.

AccessKeystring

The secure value to use when tokenizing the card via the dedicated endpoint.

PreregistrationDatastring

The secure value to identify the registration when tokenizing the card via the dedicated endpoint.

RegistrationDatastring

The string returned by the tokenization server, which must be sent in full as the RegistrationData on the <a href="/api-reference/card-registrations/update-card-registration">PUT Update a Card Registration</a> endpoint to create the Card object.

CardIdstring

The unique identifier of the Card object, which is returned after updating the Card Registration object with the RegistrationData.

CardTypestring

Returned values: CB_VISA_MASTERCARD, AMEX, MAESTRO, BCMC

Default value: CB_VISA_MASTERCARD

The type of the card. If not supplied, the default value will be taken into account.

CardRegistrationURLstring

The URL to make the card tokenization call.

Caution: This variable URL is specific to each card registration. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it.

ResultCodestring

The code indicating the result of the operation. This information is mostly used to <a href="/errors/codes">handle errors</a> or for filtering purposes.

ResultMessagestring

The explanation of the result code.

Currencystring

Returned values: The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

The currency of the card.

Statusstring

Returned values: CREATED, VALIDATED, ERROR

The status of the card registration:

  • CREATED – The card registration has been created, but no RegistrationData has been entered yet and the CardId value is null.
  • VALIDATED – The card registration has been successfully updated with the RegistrationData from the tokenization server.
  • ERROR – The card registration couldn't be updated with the RegistrationData and no CardId was generated. For more information, refer to the ResultCode (<a href="/errors/codes/105206">105206</a>, <a href="/errors/codes/105299">105299</a>) and ResultMessage.

Changes

    • warning

      deleted the header request parameter Authorization

    • info

      the endpoint scheme security oauth2 was added to the API

    • info

      api operation id create_card_registration removed and replaced with cardRegistrations_create_card_registration