Skip to content

API โ€‹

Introduction โ€‹

To offer an easy-to-use experience, we offer libraries in Shell, Python, Perl or PHP and the list keeps getting longer

Code examples are displayed in each section. Tabs available in the menu allow you to switch them to various programming languages.

The API is available at https://api.stancer.com/ and supports TLS 1.2, HTTP/1.1 and HTTP/2.

INFO

This documentation uses httpie(https://httpie.io/) for shell examples, and our libraries for PHP, Python & Perl examples.

Key concepts โ€‹

The API is available at https://api.stancer.com and supports TLS 1.2, HTTP/1.1 and HTTP/2 requests.

The same API can be used to access live resources processing real payments and payment methods, but also test resources for your software development and debug purpose. Our API service use API keys to authenticate requests. You can register for an API key at our website. API keys are in the form of sprod_xxx for your live requests and stest_xxx for your test ones. Corresponding public keys are pprod_xxx and ptest_xxx.

The authentication to the API is performed via HTTP Basic Auth. You must use your API key as username and provide no password.

We advise you to use the basic auth mecanism of your HTTP toolkit, but if you need to handle it manually, as specified in HTTP Basic Auth RFC, you need to encode your API key in base64 before sending the corresponding authenticationc token in an Authorization HTTP header. For example, if your API key is sprod_xxx, you need to encode sprod_xxx: (remember, empty password) in base64 (given c3Byb2RfeHh4Og==) then send a Authorization: Basic c3Byb2RfeHh4Og== HTTP header.

This documentation focus on common use case workflows. For more comprehensive or technical documentation, please refer to our OpenAPI or Redoc documentation.

Create payments โ€‹

Through integrated payment page โ€‹

shell
$ http --auth stest_xxx: https://api.stancer.com/v2/customers/ \
    name="Foo Bar" email=foo.bar@example.org
{
    "id": "cust_xxx",
    โ€ฆ
}

$ http --auth stest_xxx: https://api.stancer.com/v2/payments/ \
currency=eur amount=100 customer=cust_xxx description="Test payment" auth=True
{
    "id": "paym_xxx",
    โ€ฆ
}

To create a payment, use the POST /v2/payments route. You need to at least provide a currency and an amount.

If you want to associate the payment with a customer, you can use the customer field and pass the corresponding cust_xxx ID.

Note you currently have to force 3DS validation with the auth=true parameter. Else your customer won't be able to proceed the payment as his bank will surely refuse a not authenticated payment.

You can now send your customer on the payment page located at https://payment.stancer.com/ptest_xxx/paym_xxx. Replace public key and payment ID accordingly.

Once payment is created, you can modify it until capture for example to reflect a purchase change, using PATCH /v2/payments/{id} method.

shell
$ http --auth stest_xxx: https://api.stancer.com/v2/payments/paym_xxx amount=200

Through API โ€‹

shell
$ http --auth stest_xxx: https://api.stancer.com/v2/cards/ \
    name="Foo Bar" number=4242424242424242 exp_month=10 exp_year=2024 cvc=424
{
    "id": "card_xxx",
    โ€ฆ
}

$ http --auth stest_xxx: https://api.stancer.com/v2/payments/ \
currency=eur amount=100 customer=cust_xxx description="Test payment" \
card=card_xxx auth[return_url]=http://example.org
{
    "id": "paym_xxx",
    "auth": {
        "redirect_url": "https://3ds.iliad78.net/v2/redirect/xxx",
        โ€ฆ
    }
    โ€ฆ
}

If you prefer to collect by yourself the card number, you can process a payment directly and tokenize the sensible information with POST /v2/cards before using it elsewhere in API calls.

You need to specify a return_url to handle 3DS authentication. At the end of the 3DS process, we will redirect your customer to this URL.

shell
$ http --auth stest_xxx: https://api.stancer.com/v2/payments/paym_xxx
{
    โ€ฆ
    "auth": {
        "status": "success"
    }
}

$ http --auth stest_xxx: PATCH https://api.stancer.com/v2/payments/paym_xxx \
status=capture

Then send your customer on the given auth[redirect_url] to proceed with 3DS. After the redirect to your return_url, you need to check for authentication validity, then capture the payment if all is good.

API status code โ€‹

Payment status โ€‹

The status field in the payment object indicates in which state is the payment.

StatusMeaning
๐Ÿ“‹ authorizedThe bank authorized the payment but the transaction will only be processed after asking for capture
๐Ÿ“‹ to_captureThe bank authorized the payment, money will be processed within the day
๐Ÿ“‹ capture_sentThe capture operation is being processed, the payment can not be cancelled anymore, refunds must wait the end of the capture process
๐Ÿ“‹ capturedThe amount of the payment have been credited to your account
๐Ÿ“‹ disputedThe customer declined the payment after it have been captured on your account
๐Ÿ“‹ expiredThe authorisation was not captured and expired after 7 days
๐Ÿ“‹ failedThe payment has failed, refer to the response field for more details
๐Ÿ“‹ refusedThe payment has been refused

Authenticated payment status codes โ€‹

The status field in the auth object returns the authorisation state for an authenticated payment.

StatusMeaning
๐Ÿ“‹ availableCustomer strong authentication is possible
๐Ÿ“‹ requestedA strong authentication is awaiting for more information
๐Ÿ“‹ attemptedCustomer was redirected to his bank for authentication
๐Ÿ“‹ successAuthentication succeeded, processing can continue
๐Ÿ“‹ declinedAuthentication declined
๐Ÿ“‹ expiredAuthentication sessions expired after 6 hours
๐Ÿ“‹ failedAuthentication failed
๐Ÿ“‹ unavailableThe strong authentication is not available for this payment method

Payout status codes โ€‹

The status field in the payout explains in which state is the credit transfer which wires funds from Stancer to your bank.

StatusMeaning
๐Ÿ“‹ pendingThe payout has been created and is awaiting for clearing
๐Ÿ“‹ to_payThe payout is ready to be transfered
๐Ÿ“‹ sentThe payout has been sent out for processing
๐Ÿ“‹ paidThe payout credit transfer has been processed: funds have been received by your bank
๐Ÿ“‹ failedThe credit transfer has failed, please refer to you dashboard for more informations

Card response codes โ€‹

โš ๏ธ = real code & reason must not be sent to the customer, replace them with a generic 05 do-not-honor.

CodeMeaning
๐Ÿ“‹ 00Successful approval/completion or that VIP PIN verification is valid
๐Ÿ“‹ 01Refer to card issuer
๐Ÿ“‹ 02Refer to card issuer, special condition
๐Ÿ“‹ 03Invalid merchant or service provider
๐Ÿ“‹ 04Pickup
๐Ÿ“‹ 05Do not honor
๐Ÿ“‹ 06General error
๐Ÿ“‹ 07Pickup card, special condition (other than lost/stolen card)
๐Ÿ“‹ 08Honor with identification
๐Ÿ“‹ 09Request in progress
๐Ÿ“‹ 10Partial approval
๐Ÿ“‹ 11VIP approval
๐Ÿ“‹ 12Invalid transaction
๐Ÿ“‹ 13Invalid amount (currency conversion field overflow) or amount exceeds maximum for card program
๐Ÿ“‹ 14Invalid account number (no such number)
๐Ÿ“‹ 15No such issuer
๐Ÿ“‹ 16Insufficient funds
๐Ÿ“‹ 17Customer cancellation
๐Ÿ“‹ 19Re-enter transaction
๐Ÿ“‹ 20Invalid response
๐Ÿ“‹ 21No action taken (unable to back out prior transaction)
๐Ÿ“‹ 22Suspected Malfunction
๐Ÿ“‹ 25Unable to locate record in file, or account number is missing from the inquiry
๐Ÿ“‹ 28File is temporarily unavailable
๐Ÿ“‹ 30Format error
๐Ÿ“‹ 41โš ๏ธMerchant should retain card (card reported lost)
๐Ÿ“‹ 43โš ๏ธMerchant should retain card (card reported stolen)
๐Ÿ“‹ 51Insufficient funds
๐Ÿ“‹ 52No checking account
๐Ÿ“‹ 53No savings account
๐Ÿ“‹ 54Expired card
๐Ÿ“‹ 55Incorrect PIN
๐Ÿ“‹ 56Card missing from file
๐Ÿ“‹ 57Transaction not permitted to cardholder
๐Ÿ“‹ 58Transaction not allowed at terminal
๐Ÿ“‹ 59โš ๏ธSuspected fraud
๐Ÿ“‹ 61Activity amount limit exceeded
๐Ÿ“‹ 62โš ๏ธRestricted card (for example, in country exclusion table)
๐Ÿ“‹ 63โš ๏ธSecurity violation
๐Ÿ“‹ 65โš ๏ธActivity count limit exceeded
๐Ÿ“‹ 68Response received too late
๐Ÿ“‹ 75Allowable number of PIN-entry tries exceeded
๐Ÿ“‹ 76Unable to locate previous message (no match on retrieval reference number)
๐Ÿ“‹ 77Previous message located for a repeat or reversal, but repeat or reversal data are inconsistent with original message
๐Ÿ“‹ 78โ€™Blocked, first usedโ€™โ€”The transaction is from a new cardholder, and the card has not been properly unblocked.
๐Ÿ“‹ 80Visa transactions: credit issuer unavailable. Private label and check acceptance: Invalid date
๐Ÿ“‹ 81PIN cryptographic error found (error found by VIC security module during PIN decryption)
๐Ÿ“‹ 82Negative CAM, dCVV, iCVV, or CVV results
๐Ÿ“‹ 83Unable to verify PIN
๐Ÿ“‹ 85No reason to decline a request for account number verification, address verification, CVV2 verification; or a credit voucher or merchandise return
๐Ÿ“‹ 91Issuer unavailable or switch inoperative (STIP not applicable or available for this transaction)
๐Ÿ“‹ 92Destination cannot be found for routing
๐Ÿ“‹ 93โš ๏ธTransaction cannot be completed, violation of law
๐Ÿ“‹ 94Duplicate transmission
๐Ÿ“‹ 95Reconcile error
๐Ÿ“‹ 96System malfunction, System malfunction or certain field error conditions
๐Ÿ“‹ 98Server inaccessible
๐Ÿ“‹ A0Authentication Required, you must do a card inserted payment with PIN code
๐Ÿ“‹ A1Authentication Required, you must do a 3-D Secure authentication
๐Ÿ“‹ B1Surcharge amount not permitted on Visa cards (U.S. acquirers only)
๐Ÿ“‹ N0Force STIP
๐Ÿ“‹ N3Cash service not available
๐Ÿ“‹ N4Cashback request exceeds issuer limit
๐Ÿ“‹ N7Decline for CVV2 failure
๐Ÿ“‹ P2Invalid biller information
๐Ÿ“‹ P5PIN change/unblock request declined
๐Ÿ“‹ P6Unsafe PIN
๐Ÿ“‹ Q1Card authentication failed
๐Ÿ“‹ R0Stop payment order
๐Ÿ“‹ R1Revocation of authorization order
๐Ÿ“‹ R3Revocation of all authorizations order
๐Ÿ“‹ XAForward to issuer
๐Ÿ“‹ XDForward to issuer
๐Ÿ“‹ Z1Offline-declined
๐Ÿ“‹ Z3Unable to go online
๐Ÿ“‹ 7810โš ๏ธRefusal count exceeded for this card / sepa
๐Ÿ“‹ 7811โš ๏ธExceeded payment volume for this card / sepa
๐Ÿ“‹ 7812โš ๏ธCard temporarily frozen by the customer's bank
๐Ÿ“‹ 7840โš ๏ธStolen or lost card
๐Ÿ“‹ 7898Bank server unavailable

Dispute response codes โ€‹

โš ๏ธ = real code & reason must not be sent to the customer, replace them with a generic 45 transaction-disputed.

ResponseNetworkMeaning
๐Ÿ“‹ 14NationalTransaction not authorized
๐Ÿ“‹ 42NationalDuplicate processing
๐Ÿ“‹ 45NationalTransaction disputed
๐Ÿ“‹ 1040โš ๏ธVisaFraud; card Absent Environment
๐Ÿ“‹ 1261VisaDuplicate processing
๐Ÿ“‹ 4808MastercardRequested/required authorization not obtained. Transaction not authorized
๐Ÿ“‹ 4834MastercardDuplicate processing
๐Ÿ“‹ 4837โš ๏ธMastercardFraudulent transaction; no cardholder authorization
๐Ÿ“‹ 4853MastercardCardholder Dispute Defective/Not as Described
๐Ÿ“‹ 4863โš ๏ธMastercardCardholder does not recognize. Potential fraud

Test data โ€‹

Test cards โ€‹

NumberBrandCountry3DSReturn
๐Ÿ“‹ 4000000400000008VisaAT ๐Ÿ‡ฆ๐Ÿ‡นOptional00 OK
๐Ÿ“‹ 4000000560000004VisaBE ๐Ÿ‡ง๐Ÿ‡ชOptional00 OK
๐Ÿ“‹ 4000002080000001VisaDK ๐Ÿ‡ฉ๐Ÿ‡ฐOptional00 OK
๐Ÿ“‹ 4000002460000001VisaFI ๐Ÿ‡ซ๐Ÿ‡ฎOptional00 OK
๐Ÿ“‹ 4000002500000003CBFR ๐Ÿ‡ซ๐Ÿ‡ทOptional00 OK
๐Ÿ“‹ 4000002760000016VisaDE ๐Ÿ‡ฉ๐Ÿ‡ชOptional00 OK
๐Ÿ“‹ 4000003720000005VisaIE ๐Ÿ‡ฎ๐Ÿ‡ชOptional00 OK
๐Ÿ“‹ 4000003800000008VisaIT ๐Ÿ‡ฎ๐Ÿ‡นOptional00 OK
๐Ÿ“‹ 4000004420000006VisaLU ๐Ÿ‡ฑ๐Ÿ‡บOptional00 OK
๐Ÿ“‹ 4000005280000002VisaNL ๐Ÿ‡ณ๐Ÿ‡ฑOptional00 OK
๐Ÿ“‹ 4000005780000007VisaNO ๐Ÿ‡ณ๐Ÿ‡ดOptional00 OK
๐Ÿ“‹ 4000006200000007VisaPT ๐Ÿ‡ต๐Ÿ‡นOptional00 OK
๐Ÿ“‹ 4000006430000009VisaRU ๐Ÿ‡ท๐Ÿ‡บOptional00 OK
๐Ÿ“‹ 4000007240000007VisaES ๐Ÿ‡ช๐Ÿ‡ธOptional00 OK
๐Ÿ“‹ 4000007520000008VisaSE ๐Ÿ‡ธ๐Ÿ‡ชOptional00 OK
๐Ÿ“‹ 4000007560000009VisaCH ๐Ÿ‡จ๐Ÿ‡ญOptional00 OK
๐Ÿ“‹ 4000008260000000VisaGB ๐Ÿ‡ฌ๐Ÿ‡งOptional00 OK
๐Ÿ“‹ 4242424242424242VisaUS ๐Ÿ‡บ๐Ÿ‡ธNot required00 OK
๐Ÿ“‹ 4444333322221111VisaUS ๐Ÿ‡บ๐Ÿ‡ธNot required00 OK
๐Ÿ“‹ 4111111111111111VisaUS ๐Ÿ‡บ๐Ÿ‡ธNot required00 OK
๐Ÿ“‹ 5555555555554444MastercardUS ๐Ÿ‡บ๐Ÿ‡ธOptional00 OK
๐Ÿ“‹ 5200828282828210MastercardUS ๐Ÿ‡บ๐Ÿ‡ธOptional00 OK
๐Ÿ“‹ 5105105105105100MastercardUS ๐Ÿ‡บ๐Ÿ‡ธOptional00 OK
๐Ÿ“‹ 4000000000003055VisaUS ๐Ÿ‡บ๐Ÿ‡ธNot enrolled00 OK
๐Ÿ“‹ 4000000760000002VisaBR ๐Ÿ‡ง๐Ÿ‡ทOptional00 OK
๐Ÿ“‹ 4000001240000000VisaCA ๐Ÿ‡จ๐Ÿ‡ฆOptional00 OK
๐Ÿ“‹ 4000004840000008VisaMX ๐Ÿ‡ฒ๐Ÿ‡ฝOptional00 OK
๐Ÿ“‹ 4000000000000077VisaFR ๐Ÿ‡ซ๐Ÿ‡ทOptional00 OK | status = 50 captured
๐Ÿ“‹ 4000000000003220VisaUS ๐Ÿ‡บ๐Ÿ‡ธRequiredA1 must perform 3DS | status = 0 refused
๐Ÿ“‹ 4000000000000002VisaFR ๐Ÿ‡ซ๐Ÿ‡ทOptional05 do not honor | status = 0 refused
๐Ÿ“‹ 4000000000009995VisaFR ๐Ÿ‡ซ๐Ÿ‡ทOptional51 insufficient fund | status = 0 refused
๐Ÿ“‹ 4000000000009987VisaFR ๐Ÿ‡ซ๐Ÿ‡ทOptional41 lost card | status = 0 refused
๐Ÿ“‹ 4000000000000259VisaFR ๐Ÿ‡ซ๐Ÿ‡ทOptional00 OK | status = 60 disputed
๐Ÿ“‹ 4000000000001976VisaFR ๐Ÿ‡ซ๐Ÿ‡ทOptional00 OK | status = 60 disputed
๐Ÿ“‹ 4000000000005423VisaFR ๐Ÿ‡ซ๐Ÿ‡ทOptional00 OK | status = 60 disputed

Test SEPA โ€‹

IBANCountryNameBirthdateReturn
๐Ÿ“‹ AT611904300234573201AT ๐Ÿ‡ฆ๐Ÿ‡นOtto Normalverbraucher1971-02-0200 OK
๐Ÿ“‹ BE62510007547061BE ๐Ÿ‡ง๐Ÿ‡ชJef Van Pijperzele1972-03-0300 OK
๐Ÿ“‹ CH2089144321842946678CH ๐Ÿ‡จ๐Ÿ‡ญLeonhard Euler1973-04-0400 OK
๐Ÿ“‹ DE89370400440532013000DE ๐Ÿ‡ฉ๐Ÿ‡ชMax Mustermann1974-05-0500 OK
๐Ÿ“‹ EE382200221020145685EE ๐Ÿ‡ช๐Ÿ‡ชFriedrich Robert Faehlmann1975-06-0600 OK
๐Ÿ“‹ ES0700120345030000067890ES ๐Ÿ‡ช๐Ÿ‡ธJuan Pรฉrez1976-07-0700 OK
๐Ÿ“‹ FI2112345600000785FI ๐Ÿ‡ซ๐Ÿ‡ฎMaija Meikรคlรคinen1977-08-0800 OK
๐Ÿ“‹ FR1420041010050500013M02606FR ๐Ÿ‡ซ๐Ÿ‡ทPierre Martin1978-09-0900 OK
๐Ÿ“‹ GB33BUKB20201555555555GB ๐Ÿ‡ฌ๐Ÿ‡งJohn Doe1970-01-0100 OK
๐Ÿ“‹ IE29AIBK93115212345678IE ๐Ÿ‡ฎ๐Ÿ‡ชJohn Kilkenny1979-10-1000 OK
๐Ÿ“‹ LT121000011101001000LT ๐Ÿ‡ฑ๐Ÿ‡นJonas Petraitis1980-11-1100 OK
๐Ÿ“‹ LU280019400644750000LU ๐Ÿ‡ฑ๐Ÿ‡บAdalbert Boros1981-12-1200 OK
๐Ÿ“‹ IT02A0301926102000000490887IT ๐Ÿ‡ฎ๐Ÿ‡นPiero Pers1982-01-1300 OK
๐Ÿ“‹ NL39RABO0300065264NL ๐Ÿ‡ณ๐Ÿ‡ฑJan Modaal1983-02-1400 OK
๐Ÿ“‹ NO9386011117947NO ๐Ÿ‡ณ๐Ÿ‡ดPeder Aas1984-03-1500 OK
๐Ÿ“‹ PT50000201231234567890154PT ๐Ÿ‡ต๐Ÿ‡นJan Kowalski1985-04-1600 OK
๐Ÿ“‹ SE3550000000054910000003SE ๐Ÿ‡ธ๐Ÿ‡ชLisa Svensson1986-05-1700 OK
๐Ÿ“‹ FR9430003000409249176322Z50FR ๐Ÿ‡ซ๐Ÿ‡ทGilles Dupont1987-06-1800 OK
๐Ÿ“‹ FR2990665286926539507769811FR ๐Ÿ‡ซ๐Ÿ‡ทJean Banbois1992-11-23AC01 Incorrect Account Number | status = 0 refused
๐Ÿ“‹ FR8191676442817818484578833FR ๐Ÿ‡ซ๐Ÿ‡ทMarie-Jeanne Sansbanque1993-12-24AC04 Closed Account Number | status = 0 refused
๐Ÿ“‹ FR3083648641551044006702169FR ๐Ÿ‡ซ๐Ÿ‡ทMarc Barrer1994-01-25AC06 Blocked Account | status = 0 refused
๐Ÿ“‹ FR4200838098473368525032012FR ๐Ÿ‡ซ๐Ÿ‡ทSophie Fontek1995-02-26AG01 Transaction Forbidden | status = 0 refused
๐Ÿ“‹ FR7099253427049384102178149FR ๐Ÿ‡ซ๐Ÿ‡ทHector Fauchรฉ1996-03-27AM04 Insufficient Funds | status = 0 refused
๐Ÿ“‹ FR7240745948453163519978561FR ๐Ÿ‡ซ๐Ÿ‡ทLillianne Sansmandat1997-04-28MD01 No Mandate | status = 0 refused
๐Ÿ“‹ FR5533686478441573584650545FR ๐Ÿ‡ซ๐Ÿ‡ทVincent Refusรฉ1998-05-29MD06 Refund Request By End Customer | status = 0 refused
๐Ÿ“‹ FR2488294045573706143240475FR ๐Ÿ‡ซ๐Ÿ‡ทEric Indรฉcis1999-06-30MS02 Not Specified Reason Customer Generated | status = 0 refused
๐Ÿ“‹ BE08510007547063BE ๐Ÿ‡ง๐Ÿ‡ชCamille Honnรชte1988-07-19AM04 Insufficient Funds | status = 60 disputed
๐Ÿ“‹ ES5000120345030000067892ES ๐Ÿ‡ช๐Ÿ‡ธPepito Pรฉrez1990-09-21AC04 Closed Account Number | status = 60 disputed