Marqeta is a card issuer-processor which will issue cards for our customers. It's biggest advantage is Just-in-Time (JIT) funding feature giving us real-time control over the approval of customers transactions.
This RESTful API is the main API of the Marqeta platform. It consist of objects of which the most important are User, Card and Transaction.
- Integration documentation
- Developer Guides
- Core API Reference
- Core API Explorer (requires sign up)
- Card Proxy
- 3DS Authentication
- Flow charts
User object represents an end customer and can be associated with multiple payment cards. Every user has a general purpose account (GPA) used to fund their payments. When the JIT funding is used GPA doesn't hold any funds, only the ledger balance which stores funds that are currently on hold, but not yet cleared, is used.
POST /users HTTP/1.1
Host: localhost:4002
Content-Type: application/json
{
"token": "user_token_1",
"email": "[email protected]",
"first_name": "Blue",
"last_name": "Bird"
}
Cards are objects representing physic or virtual payment cards. To create a card an user and a Card Product objects are needed. Card Product is object defined in cooperation Marqeta and defines attributes of associated cards like card type (physical, virtual), allowed usage methods (ATM, ecommerce...) etc.
POST /cards HTTP/1.1
Host: localhost:4002
Content-Type: application/json
{
"user_token": "user_token_1",
"card_product_token": "twisto_card_product"
}
Transaction are immutable (excepting the state attribute) objects. They usually originate when a transaction message from the card network is received by Marqeta. For every message received it creates a new transaction. Marqeta also creates transactions based on internal actions like funding user's GPA in response to approved JIT funding gateway message.
A typical payment can consist of these transactions:
-
authorisation
Confirming whether a card is valid, business rules are met, and funds are sufficient, and then placing a temporary hold on those funds. When JIT funding is used Marqeta will move funds from the cad program funding source (PFS) into the user's GPA ledger balance.
-
authorisation.advice or authorization.reversal
Increasing or decreasing the funds on hold after the authorization. In case of JIT funding funds moves between the cards PFS and the user's GPA.
-
authorization.clearing
Finalizing the hold on funds and posting the transaction on the card holder's account. Moves funds out of the user's GPA ledger balance and letter settle the transaction between Marqeta and a merchants acquiring bank. Cleared amount can be higher or lower then the original amount on hold. In case of a partial clearing the rest of the authorized funds will stay on hold and addition advices or clearings can be invoked.
PIN debit payments consist of only one transaction:
-
pindebit
Card holder attempts to make a payment using their PIN. Such a transaction typically contains all information required for authorization and clearing in a single electronic message. In case of JIT funding funds are moved from the card's PFS into the user's GPA and immediately spent.
Other transaction types exist like chargeback, token.activation-request etc. For more see Transaction events in the docs.