Cards

Create a Card for a User

Changed on

📘

You can place the bearer access_token for a specific user into the Authentication section of this documentation 👉.

Cards can be created directly through the API using this PCI-compliant endpoint.

Cards can also be created through the OAuth Module by selecting the Connect New Debit Card button.

Astra authorizes the card with the issuer before returning it. When the issuer refuses the card, the response is a 400 carrying embedded_error.code of card_authorization_declined, and the same card will be refused again. When no decision was reached about the card, the response is a 429 with card_authorization_throttled or a 503 with card_authorization_unavailable, and the same request can be retried.

Cards on Discover, Diners Club, UnionPay, Maestro and private-label networks, whose card numbers begin with 6, require an enhanced client configuration. A card on one of these networks is rejected with a 403 for clients without it. Please contact customer support if you are interested in accepting them.

For Unit customers, please reference their technical documentation below to learn more about enabling card to card payments. Enabling Card to Card Payments with Unit & Astra

❗️ This resource requires the use of the secure endpoint.

Retrying a card add. Send an optional Idempotency-Key header, unique to each card add (for example a UUID), and resend the same key, with the same request unchanged, when you retry that request. A retry with the same key within 24 hours returns the same card, as it is now, without authorizing it again. Reusing a key with a different request, such as a different card, cardholder or billing address, returns a 422. card_security_code is not compared, as a tokenized security code may differ between retries. If the first request is still being processed, a retry may return a 409 with a Retry-After header: wait that many seconds and retry. To add a card again, for example after it was removed, use a new key. Requests without the header behave as before.

post/v1/cards

Request

  • Base URL
    https://secure.api-sandbox.astra.finance
  • URL
    https://secure.api-sandbox.astra.finance/v1/cards
  • Auth
    HTTP bearer

Headers

Idempotency-Keystring

A key unique to this card add, resent unchanged on each retry of it. 1 to 255 characters; a UUID is recommended. Keys are kept for 24 hours per client.

Request body

card_numberstring required

The card number the User

card_security_codestring required

The card security code

expiration_datestring required

The card expiration date

first_namestring required

The card owner's first name

last_namestring required

The card owner's last name

street_line_1string required

The street line 1 of the card billing address

street_line_2string

The street line 2 of the card billing address

citystring required

The city of the card billing address

statestring required

The US State of the card billing address

zip_codestring required

The zip code of the card billing address

added_by_userboolean

Set to false for client-issued debit cards. Set to true for externally linked debit cards. Defaults to false if not provided

Response

Successful response

idstring

Unique card ID

activeboolean

Whether or not the card is active with the issuing bank

address_verifiedboolean

AVS response from debit networks

card_companystring

Name of card company

card_fingerprintstring

A unique identifier derived from the card number

card_type'debit' | 'prepaid' | 'credit' | 'unknown'

The type of card

citystring

The city of the card billing address

createdstring date-time

Date and time of card creation

expiration_datestring

Month/Year of card expiration

first_namestring

The first name of card user

first_six_digitsstring

The provided Bank Identification Number (BIN)

last_four_digitsstring

Last 4 digits of the card number

last_namestring

The last name of card user

name_verification_result'Match' | 'No Match' | 'Partial Match' | 'Unknown'

The ANI results from the issuing bank of the card

product_type'Consumer' | 'Business' | 'Commercial' | 'Unknown'

The product type of the card

pull_enabledboolean

Whether or not the card is enabled for pull transactions

push_enabledboolean

Whether or not the card is enabled for push transactions

aft_enabledboolean

If true, this card is allowed to be used as a source in routines.

oct_enabledboolean

If true, this card is allowed to be used as a desetination in routines.

removedboolean

Whether or not the user has removed the card

reviewed_atstring date-time

The date and time the Card was reviewed

review_status'approved' | 'flagged' | 'rejected'

(Deprecated) Review status of the card

statestring

Card address state

status'approved' | 'flagged' | 'rejected' | 'removed'

The status of the card (Card Statuses)

street_line_1string

The street line 1 of the card billing address

street_line_2string

The street line 2 of the card billing address

zip_codestring

The zip code of the card billing address

Changes

    • breaking

      added to the response body oneOf list for the response status

    • breaking

      the response's body type changed from object to no type for status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      added the new optional header request parameter Idempotency-Key

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status