API

1 Create Order

1.1 Create Credit Card Order (Direct)

POST https://api.stripay.io/v1/direct/pay

Field Type Required Description
key String Stripay merchant key
merchantOrderId String Your order id, maximum length is 64 characters
amount Double Amount, up to 2 decimal
currency String Currency, 3-letter ISO code, default USD
successUrl String Payment successful redirect url, maximum length is 1024 characters
failUrl String Payment failed redirect url, maximum length is 1024 characters
cardNumber String Credit card number, eg: 4242424242424242
cardExpYear String Credit card expire year, eg: 2028
cardExpMonth String Credit card expire month, eg: 08
cardCvc String Credit card cvc, eg: 888
ip String Customer IP
email String Customer email
phone String Customer phone number, eg: +1xxxxxxxxxxx
billingFirstName String Billing firstname
billingLastName String Billing lastname
billingCountry String Billing country, 2-letter ISO code, eg: US
billingState String Billing state, 2-letter ISO code, eg: CA
billingCity String Billing city, eg: Fullerton
billingLine1 String Billing street line 1
billingLine2 String Billing street line 2
billingPostCode String Billing postcode
force3ds Boolean Whether to force 3ds to be enabled, default false

Note: The Direct method only supports the Stripe, and make sure your Stripe account supports Direct payment.

1.2 Create Credit Card Order (Inline)

POST https://api.stripay.io/v1/inline/pay

Field Type Required Description
key String Stripay merchant key
merchantOrderId String Your order id, maximum length is 64 characters
amount Double Amount, up to 2 decimal
currency String Currency, 3-letter ISO code, default USD
successUrl String Payment successful redirect url, maximum length is 1024 characters
failUrl String Payment failed redirect url, maximum length is 1024 characters
ip String Customer IP
email String Customer email
phone String Customer phone number, eg: +1xxxxxxxxxxx
billingFirstName String Billing firstname
billingLastName String Billing lastname
billingCountry String Billing country, 2-letter ISO code, eg: US
billingState String Billing state, 2-letter ISO code, eg: CA
billingCity String Billing city, eg: Fullerton
billingLine1 String Billing street line 1
billingLine2 String Billing street line 2
billingPostCode String Billing postcode
force3ds Boolean Whether to force 3ds to be enabled, default false

1.3 Create Credit Card Order (Checkout)

POST https://api.stripay.io/v1/checkout/pay

Field Type Required Description
key String Stripay merchant key
merchantOrderId String Your order id, maximum length is 64 characters
amount Double Amount, up to 2 decimal
currency String Currency, 3-letter ISO code, default USD
successUrl String Payment successful redirect url, maximum length is 1024 characters
failUrl String Payment failed redirect url, maximum length is 1024 characters
ip String Customer IP
email String Customer email
phone String Customer phone number, eg: +1xxxxxxxxxxx
billingFirstName String Billing firstname
billingLastName String Billing lastname
billingCountry String Billing country, 2-letter ISO code, eg: US
billingState String Billing state, 2-letter ISO code, eg: CA
billingCity String Billing city, eg: Fullerton
billingLine1 String Billing street line 1
billingLine2 String Billing street line 2
billingPostCode String Billing postcode
force3ds Boolean Whether to force 3ds to be enabled, default false

1.4 Create PayPal Order

POST https://api.stripay.io/v1/paypal/pay

Field Type Required Description
key String Stripay merchant key
merchantOrderId String Your order id, maximum length is 64 characters
amount Double Amount, up to 2 decimal
currency String Currency, 3-letter ISO code, default USD
successUrl String Payment successful redirect url, maximum length is 1024 characters
failUrl String Payment failed redirect url, maximum length is 1024 characters
ip String Customer IP
email String Customer email
phone String Customer phone number, eg: +1xxxxxxxxxxx
billingFirstName String Billing firstname
billingLastName String Billing lastname
billingCountry String Billing country, 2-letter ISO code, eg: US
billingState String Billing state, 2-letter ISO code, eg: CA
billingCity String Billing city, eg: Fullerton
billingLine1 String Billing street line 1
billingLine2 String Billing street line 2
billingPostCode String Billing postcode

1.5 Create Order Response

Field Type Required Description
status String success/fail/3ds
statusNote String Payment failed message
redirectUrl String Payment redirect url

1.6 Example

POST https://api.stripay.io/v1/checkout/pay

Request body:

{
  "key": "098f6bcd4621d373cade4e832627b4f6",
  "merchantOrderId": "1",
  "amount": 0.99,
  "successUrl": "https://stripay.io/v1/success.html",
  "failUrl": "https://stripay.io/v1/fail.html",
  "ip": "38.94.109.229",
  "email": "[email protected]"
}

Successful response body:

{
  "status": "success",
  "statusNote": null,
  "redirectUrl": "https://stripay.io/v1/success.html"
}

Failed response body:

{
  "status": "fail",
  "statusNote": "No account avaliable",
  "redirectUrl": "https://stripay.io/v1/fail.html"
}

Need to redirect to the URL of the payment/3DS page:

{
  "status": "3ds",
  "statusNote": null,
  "redirectUrl": "https://checkout.stripe.com/c/pay/cs_test_xxx"
}

2 Get Order

2.1 Get Multiple Orders

POST https://api.stripay.io/v1/orders

Request body:

{
  "key": "098f6bcd4621d373cade4e832627b4f6",
  "page": 1,
  "limit": 20 // range of [20, 100]
}

Response body:

{
    "total": 90,
    "orders": [
        {
            "id": 1,
            "merchantId": 1,
            "merchantOrderId": "your order id",
            "amount": 1.99,
            "currency": "USD",
            "successUrl": "https://stripay.io/v1/success.html",
            "failUrl": "https://stripay.io/v1/fail.html",
            "email": "[email protected]",
            "ip": "102.171.177.216",
            "riskScore": 65,
            "status": "completed",
            "statusNote": null,
            "is3ds": false,
            "createdAt": "2023-02-14T12:39:13.000Z",
            "updatedAt": "2023-02-14T12:39:21.000Z"
        }
    ]
}

2.2 Get One Order

POST https://api.stripay.io/v1/order

Request body:

{
    "key": "098f6bcd4621d373cade4e832627b4f6",
    "merchantOrderId": "your order id", // merchantOrderId and stripeOrderId, choose one
    "stripayOrderId": "stripay order id" // Recommend. merchantOrderId and stripeOrderId, choose one
}

Response body:

{
    "order": {
        "id": 1,
        "merchantId": 1,
        "merchantOrderId": "your order id",
        "amount": 1.99,
        "currency": "USD",
        "successUrl": "https://stripay.io/v1/success.html",
        "failUrl": "https://stripay.io/v1/fail.html",
        "email": "[email protected]",
        "ip": "102.171.177.216",
        "riskScore": 0,
        "status": "rejected",
        "statusNote": "No valid payment method types for this Checkout Session.",
        "is3ds": false,
        "createdAt": "2023-01-10T03:39:53.000Z",
        "updatedAt": "2023-01-10T03:43:37.000Z"
    }
}

2.3 Order Status

The order status has the following values:

  • pending: Order created, not paid
  • rejected: Order rejected, such as refusing payment after risk control is triggered
  • 3ds: 3ds is triggered, but the user does not complete the 3ds verification process and gives up payment
  • 3dsSuccess: 3ds is triggered and 3ds verification is successful, but payment fails due to insufficient credit card balance/credit card expiration/card issuing bank rejection, etc.
  • 3dsFail: 3ds is triggered, but 3ds verification fails
  • completed: Order paid
  • canceled: Order canceled
  • expired: Order expired
  • refunded: Order refunded
  • disputed: Order disputed

3 Testing

Test account and test credit card reference: