Add Card Payment Method

Please use this (https://blkem.com/mobile_api/add_card_payment_method) API for adding card as payment method


Post parameters

Field Value Remarks
session_id ​Access token ID E.g. de25cc16eb00960f076...
stripe_pm_id Payment Method ID received from Stripe E.g. pm_1L48hWDnLq2J5dWxh0huA8J7
name Card Holder name E.g. John Doe

Success response

{
    "code": 200,
    "id": 70,
    "message": "Payment method added successfully",
    "cards": [
        {
            "id": 70,
            "user_id": 6098,
            "json_data": {
                "paymentMethod": {
                    "id": "pm_1L48hWDnLq2J5dWxh0huA8J7",
                    "object": "payment_method",
                    "billing_details": {
                        "address": {
                            "city": null,
                            "country": null,
                            "line1": null,
                            "line2": null,
                            "postal_code": null,
                            "state": null
                        },
                        "email": null,
                        "name": "Abid",
                        "phone": null
                    },
                    "card": {
                        "brand": "visa",
                        "checks": {
                            "address_line1_check": null,
                            "address_postal_code_check": null,
                            "cvc_check": "pass"
                        },
                        "country": "US",
                        "exp_month": 4,
                        "exp_year": 2024,
                        "fingerprint": "8aJqtbexkn4aojZP",
                        "funding": "credit",
                        "generated_from": null,
                        "last4": "4242",
                        "networks": {
                            "available": [
                                "visa"
                            ],
                            "preferred": null
                        },
                        "three_d_secure_usage": {
                            "supported": true
                        },
                        "wallet": null
                    },
                    "created": 1653679198,
                    "customer": null,
                    "livemode": false,
                    "metadata": [],
                    "type": "card"
                }
            },
            "type": "stripe",
            "name": "test **** (4242)",
            "time": "just now",
            "is_default": 0
        },
        {
            "id": 67,
            "user_id": 6098,
            "json_data": {
                "paymentMethod": {
                    "id": "pm_1L48hWDnLq2J5dWxh0huA8J7",
                    "object": "payment_method",
                    "billing_details": {
                        "address": {
                            "city": "",
                            "country": "",
                            "line1": "",
                            "line2": "",
                            "postal_code": "",
                            "state": ""
                        },
                        "email": "",
                        "name": "Abid",
                        "phone": ""
                    },
                    "card": {
                        "brand": "visa",
                        "checks": {
                            "address_line1_check": "",
                            "address_postal_code_check": "",
                            "cvc_check": ""
                        },
                        "country": "US",
                        "exp_month": "4",
                        "exp_year": "2024",
                        "funding": "credit",
                        "generated_from": "",
                        "last4": "4242",
                        "networks": {
                            "available": [
                                "visa"
                            ],
                            "preferred": ""
                        },
                        "three_d_secure_usage": {
                            "supported": "true"
                        },
                        "wallet": ""
                    },
                    "created": "1653679198",
                    "customer": "",
                    "livemode": "false",
                    "type": "card"
                }
            },
            "type": "stripe",
            "name": "Abid **** (4242)",
            "time": "7 minutes ago",
            "is_default": 0
        }
    ]
}
    

Error responses

{
        "code": 401,
        "data": [],
        "message": "Unauthorized Access"
    }

    {
        "code": 500,
        "message": "Payment method already added, try removing that first",
        "data": []
    }

    {
        "code": 404,
        "message": "Invalid payment method id",
        "data": []
    }

    {
        "code": 500,
        "message": "Payment method cannot be added right now, please try again later",
        "data": []
    }