# INVALID\_COMPLETE\_PAYMENT\_URL when creating customer with payment method

**URL:** <https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388>\
**Category:** ⚙️ API\
**Created:** [June 7, 2021, 5:59pm UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388 "2021-06-07T17:59:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![abo](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/abo/32/906_2.png) [@abo](https://community.rapyd.net/u/abo)\
**Post date:** [June 7, 2021, 5:59pm UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/1 "2021-06-07T17:59:21Z")

</div>

When posting to “/v1/customers” to create customer with (fake) payment method, I get the error:

{  
“status”: {  
“error\_code”: “INVALID\_COMPLETE\_PAYMENT\_URL”,  
“status”: “ERROR”,  
“message”: “The request tried to create a payment, but the \u0027complete\_payment\_url\u0027 parameter was not valid. The request was rejected. Corrective action: Use the correct URL.”,  
“response\_code”: “INVALID\_COMPLETE\_PAYMENT\_URL”,  
“operation\_id”: “46aba627-2cf5-4ae8-9fe8-55db82b08789”  
}  
}

The body of the POST looks like this:

{“name”:“Customer [name",“email”:"someemail@gmail.com](mailto:name%22,%22email%22:%22someemail@gmail.com)”,“payment\_method”:{“type”:“is\_visa\_card”,“fields”:{“number”:“4111111111111111”,“expiration\_month”:“10”,“expiration\_year”:“23”,“cvv”:“123”,“name”:“Customer name”}}

I’ve tried placing “payment\_options” (and “payment\_method\_options”) in the body as well, in various places:

“payment\_method\_options”: {“complete\_payment\_url”:“[http://1.2.3.4:3000/rapyd",“error\_payment\_url”:"http://1.2.3.4:3000/rapyd](http://1.2.3.4:3000/rapyd%22,%22error_payment_url%22:%22http://1.2.3.4:3000/rapyd)”}

So I’m a bit lost where it should actually be specified and couldn’t find out based on the documentation.

Thanks!

---

<div class="post-metadata">

**Author:** ![Community\_Team](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@Community\_Team](https://community.rapyd.net/u/Community_Team)\
**Post date:** [June 7, 2021, 7:14pm UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/2 "2021-06-07T19:14:46Z")

</div>

Thanks @abo. I’ve posted a request and response below that works for me. Let me know if you have any questions.

Create Customer with Payment Method Request

```auto
{
    "name": "Test User",
    "business_vat_id": "123456666",
    "email": "testuser@rapyd.net",
    "ewallet": "ewallet_622b1deb47c3391d9075fd1f5c09a3e5",
    "invoice_prefix": "TU-",
    "metadata": {
        "merchant_defined": true
    },
    "payment_method": {
    "type": "is_visa_card",
    "fields": {
        "name": "Test User",
        "number": "4111111111111111",
        "expiration_month": "08",
        "expiration_year": "24",
        "cvv": "789"
    },
    "complete_payment_url": "https://samsung.com",
    "error_payment_url": "https://apple.com"
    },
    "phone_number": "+14155556666"
}

```

Create Customer with Payment Method Response

````auto
{
    "status": {
        "error_code": "",
        "status": "SUCCESS",
        "message": "",
        "response_code": "",
        "operation_id": "4e9ccd88-e628-40f6-b347-1f843dda16e1"
    },
    "data": {
        "id": "cus_438a1c1c7dc37f0a92cea6bfdf473996",
        "delinquent": false,
        "discount": null,
        "name": "Test User",
        "default_payment_method": "card_808d76b2d27617f0c5b49895606d9f45",
        "description": "",
        "email": "testuser@rapyd.net",
        "phone_number": "+14155556666",
        "invoice_prefix": "TU-",
        "addresses": [],
        "payment_methods": {
            "data": [
                {
                    "id": "card_808d76b2d27617f0c5b49895606d9f45",
                    "type": "is_visa_card",
                    "category": "card",
                    "metadata": null,
                    "image": "https://iconslib.rapyd.net/checkout/is_visa_card.png",
                    "authentication_url": "",
                    "webhook_url": "",
                    "supporting_documentation": "",
                    "name": "Test User",
                    "last4": "1111",
                    "acs_check": "unchecked",
                    "cvv_check": "unchecked",
                    "bin_details": {
                        "brand": null,
                        "bin_number": "411111"
                    },
                    "expiration_year": "24",
                    "expiration_month": "08",
                    "fingerprint_token": "ocfp_2a694038316f52122bbbb3ae926cfda9",
                    "redirect_url": "https://sandboxdashboard.rapyd.net/3ds-payment?token=payment_fa1cf4249fdf098356b42f6cda09d9c2"
                }
            ],
            "has_more": false,
            "total_count": 1,
            "url": "/v1/customers/cus_438a1c1c7dc37f0a92cea6bfdf473996/payment_methods"
        },
        "subscriptions": null,
        "created_at": 1623092363,
        "metadata": {
            "merchant_defined": true
        },
        "business_vat_id": "123456666",
        "ewallet": "ewallet_622b1deb47c3391d9075fd1f5c09a3e5",
        "complete_payment_url": "https://samsung.com",
        "error_payment_url": "https://apple.com"
    }
}```
````

---

<div class="post-metadata">

**Author:** ![abo](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/abo/32/906_2.png) [@abo](https://community.rapyd.net/u/abo)\
**Post date:** [June 7, 2021, 7:34pm UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/3 "2021-06-07T19:34:49Z")

</div>

That did the trick! Thank you for the speedy response, awesome!

---

<div class="post-metadata">

**Author:** ![GermaVinsmoke](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/germavinsmoke/32/1549_2.png) [@GermaVinsmoke](https://community.rapyd.net/u/GermaVinsmoke)\
**Post date:** [March 22, 2022, 10:33am UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/4 "2022-03-22T10:33:58Z")

</div>

This error is coming for “sg\_debit\_visa\_card” but not for “us\_visa\_card”. Why is that?  
Even in the card requirement fields, there’s no mention of this “complete\_url” field.

---

<div class="post-metadata">

**Author:** ![Community\_Team](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@Community\_Team](https://community.rapyd.net/u/Community_Team)\
**Post date:** [March 25, 2022, 10:46pm UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/5 "2022-03-25T22:46:39Z")

</div>

Thanks @GermaVinsmoke, is this in Sandbox?

What error are you getting? I was able to create with the following.

### Create Customer Payment Method

Request

```auto
{
    "name": "Test User",
    "business_vat_id": "1234566667",
    "email": "testuser@rapyd.net",
    "ewallet": "ewallet_6e50c83cedb7e380fad467ee63c13ce6",
    "invoice_prefix": "TU-",
    "metadata": {
        "merchant_defined": true
    },
    "payment_method": {
    "type": "sg_debit_visa_card",
    "fields": {
        "name": "Test User",
        "number": "4111111111111111",
        "expiration_month": "08",
        "expiration_year": "24",
        "cvv": "789"
    },
    "complete_payment_url": "https://samsung.com",
    "error_payment_url": "https://apple.com"
    },
    "phone_number": "+14155556666"
}

```

Response

```auto
{
    "status": {
        "error_code": "",
        "status": "SUCCESS",
        "message": "",
        "response_code": "",
        "operation_id": "b10c945e-2d84-4913-bb0d-a4ec7f8e649e"
    },
    "data": {
        "id": "cus_e595778cd4df684b9790c398e30a8f5a",
        "delinquent": false,
        "discount": null,
        "name": "Test User",
        "default_payment_method": "card_03ee569153845498755b035f9d0096e2",
        "description": "",
        "email": "testuser@rapyd.net",
        "phone_number": "+14155556666",
        "invoice_prefix": "TU-",
        "addresses": [],
        "payment_methods": {
            "data": [
                {
                    "id": "card_03ee569153845498755b035f9d0096e2",
                    "type": "sg_debit_visa_card",
                    "category": "card",
                    "metadata": null,
                    "image": "https://iconslib.rapyd.net/checkout/sg_debit_visa_card.png",
                    "webhook_url": "",
                    "supporting_documentation": "",
                    "next_action": "3d_verification",
                    "name": "Test User",
                    "last4": "1111",
                    "acs_check": "unchecked",
                    "cvv_check": "unchecked",
                    "bin_details": {
                        "type": null,
                        "brand": null,
                        "country": null,
                        "bin_number": "411111"
                    },
                    "expiration_year": "24",
                    "expiration_month": "08",
                    "fingerprint_token": "ocfp_2a694038316f52122bbbb3ae926cfda9",
                    "redirect_url": "https://sandboxcheckout.rapyd.net/3ds-payment?token=payment_b544a98f05d76c72469d5c7c00582769"
                }
            ],
            "has_more": false,
            "total_count": 1,
            "url": "/v1/customers/cus_e595778cd4df684b9790c398e30a8f5a/payment_methods"
        },
        "subscriptions": null,
        "created_at": 1648247548,
        "metadata": {
            "merchant_defined": true
        },
        "business_vat_id": "1234566667",
        "ewallet": "ewallet_6e50c83cedb7e380fad467ee63c13ce6",
        "complete_payment_url": "https://samsung.com",
        "error_payment_url": "https://apple.com"
    }
} 

```

The complete\_payment\_url field is in the [Payment Object](https://docs.rapyd.net/build-with-rapyd/reference/payment-object) and can be listed in the [Payment Method Type Object](https://docs.rapyd.net/build-with-rapyd/reference/payment-method-type-object) using [List Payment Methods by Country](https://docs.rapyd.net/build-with-rapyd/reference/payment-method-type-object#list-payment-methods-by-country).

For example

```auto
     {
            "type": "sg_debit_visa_card",
            "name": "Visa Debit",
            "category": "card",
            "image": "https://iconslib.rapyd.net/checkout/sg_debit_visa_card.png",
            "country": "sg",
            "payment_flow_type": "",
            "currencies": [
                "AED",
                "AUD",
                "BDT",
                "BND",
                "BRL",
                "CAD",
                "CHF",
                "CNY",
                "COP",
                "CZK",
                "DKK",
                "EGP",
                "EUR",
                "FJD",
                "GBP",
                "HKD",
                "HUF",
                "IDR",
                "ILS",
                "INR",
                "IQD",
                "IRR",
                "ISK",
                "JPY",
                "KRW",
                "KWD",
                "LAK",
                "LKR",
                "MMK",
                "MOP",
                "MXN",
                "MYR",
                "NGN",
                "NOK",
                "NPR",
                "NZD",
                "PHP",
                "PKR",
                "PLN",
                "QAR",
                "RUB",
                "SAR",
                "SCR",
                "SEK",
                "SGD",
                "THB",
                "TRY",
                "TWD",
                "USD",
                "VND",
                "ZAR"
            ],
            "status": 1,
            "is_cancelable": true,
            "payment_options": [
                {
                    "name": "capture",
                    "type": "boolean",
                    "regex": "",
                    "description": "Determines when the payment is processed for capture.",
                    "is_required": false,
                    "is_updatable": false
                },
                {
                    "name": "complete_payment_url",
                    "type": "string",
                    "regex": "",
                    "description": "the complete_payment_url field must be filled in.",
                    "is_required": true,
                    "is_updatable": false
                },
                {
                    "name": "error_payment_url",
                    "type": "string",
                    "regex": "",
                    "description": "the error_payment_url field must be filled in.",
                    "is_required": true,
                    "is_updatable": false
                }

```

---

<div class="post-metadata">

**Author:** ![Ahmad\_Aldali](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/ahmad_aldali/32/1477_2.png) [@Ahmad\_Aldali](https://community.rapyd.net/u/Ahmad_Aldali)\
**Post date:** [April 14, 2022, 12:48pm UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/6 "2022-04-14T12:48:07Z")

</div>

Hi @Community_Team ,  
Thanks for your reply.

I am trying to create a customer with a payment method for “ro\_visa\_card”;  
This is my body for the request.  
{  
“name”: “Jane Doe”,  
“email”: “[janedoe6666@rapyd.net](mailto:janedoe6666@rapyd.net)”,  
“payment\_method”: {  
“type”: “ro\_visa\_card”,  
“fields”: {  
“number”: “4111111111111111”,  
“expiration\_month”: “10”,  
“expiration\_year”: “23”,  
“cvv”: “123”,  
“name”: “Test User”  
},  
“complete\_payment\_url”: “xx”  
“error\_payment\_url”: “xx”  
}  
}  
I got this response  
{  
“status”: {  
“error\_code”: “ERROR\_CREATE\_PAYMENT\_METHOD”,  
“status”: “ERROR”,  
“message”: “The request attempted an operation that requires specific fields for payment method, but a required field was missing, or an extra, unallowed field was included. Corrective action: Run ‘Get Payment Method Required Fields’ and check all input fields.”,  
“response\_code”: “ERROR\_CREATE\_PAYMENT\_METHOD”,  
“operation\_id”: “ba27ea04-b734-4d25-a120-1cc2df51da0a”  
}  
}

I also tried this  
{  
“name”: “Jane Doe”,  
“email”: “[janedoe6666@rapyd.net](mailto:janedoe6666@rapyd.net)”,  
“payment\_method”: {  
“type”: “ro\_visa\_card”,  
“fields”: {  
“number”: “4111111111111111”,  
“expiration\_month”: “10”,  
“expiration\_year”: “23”,  
“cvv”: “123”,  
“name”: “Test User”  
},  
“payment\_options”: {  
“complete\_payment\_url”: “xx”,  
“error\_payment\_url”: “xx”  
}  
}  
}  
but I got this response  
{  
“status”: {  
“error\_code”: “INVALID\_COMPLETE\_PAYMENT\_URL”,  
“status”: “ERROR”,  
“message”: “The request tried to create a payment, but the ‘complete\_payment\_url’ parameter was not valid. The request was rejected. Corrective action: Use the correct URL.”,  
“response\_code”: “INVALID\_COMPLETE\_PAYMENT\_URL”,  
“operation\_id”: “5214c28e-a7c7-4bf7-b8fd-5adefe100914”  
}  
}

Do you have any idea about that?

FYI, I put xx instead of the link because I am a new user here.

---

<div class="post-metadata">

**Author:** ![Community\_Team](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@Community\_Team](https://community.rapyd.net/u/Community_Team)\
**Post date:** [April 15, 2022, 6:04pm UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/7 "2022-04-15T18:04:01Z")

</div>

Thanks @Ahmad_Aldali. For the second request with `INVALID_COMPLETE_PAYMENT_URL`, the payment method would require a complete URL and error URL field. This is due to having any 3DS or 3rd party authentication for the card payment.

You can find this information in the [Payment Method Type Object](https://docs.rapyd.net/build-with-rapyd/reference/payment-method-type-object) using **List Payment Methods by Country** or **Get Required Payment Method Fields**.

Here’s the required fields which include error payment and complete payment url below. `ro_visa_card`

```auto
{
    "status": {
        "error_code": "",
        "status": "SUCCESS",
        "message": "",
        "response_code": "",
        "operation_id": "29269039-bd4f-4636-ac25-d21cb3b10928"
    },
    "data": {
        "type": "ro_visa_card",
        "fields": [
            {
                "name": "name",
                "type": "string",
                "regex": "",
                "is_required": true,
                "instructions": "card holder name"
            },
            {
                "name": "number",
                "type": "string",
                "regex": "",
                "is_required": true,
                "instructions": "card number"
            },
            {
                "name": "expiration_month",
                "type": "string",
                "regex": "",
                "is_required": true,
                "instructions": "expiration month as string, 01-12"
            },
            {
                "name": "expiration_year",
                "type": "string",
                "regex": "",
                "is_required": true,
                "instructions": "expiration year in to digits as string, 18-99"
            },
            {
                "name": "cvv",
                "type": "string",
                "regex": "",
                "is_required": true,
                "instructions": "card cvv"
            }
        ],
        "payment_method_options": [
            {
                "name": "3d_required",
                "type": "boolean",
                "regex": "",
                "description": "Allows the client to determine whether the customer is required to complete 3DS authentication for the transaction",
                "is_required": false,
                "is_updatable": false
            },
            {
                "name": "3d_version",
                "type": "String",
                "regex": "(1.0.2|2.1.0|2.2.0)",
                "description": "3D Secure version of the transaction.",
                "is_required": false,
                "is_updatable": false
            },
            {
                "name": "cavv",
                "type": "String",
                "regex": "",
                "description": "Cardholder Authentication Verification Value represented as a 20-byte value that is base64 encoded.",
                "is_required": false,
                "is_updatable": false
            },
            {
                "name": "eci",
                "type": "String",
                "regex": "(01|02|05|06|07|08)",
                "description": "Electronic Commerce Indicator (ECI) from MPI Plugin(3-D Secure 1.0) or 3DS Server(3-D Secure 2.0).",
                "is_required": false,
                "is_updatable": false
            },
            {
                "name": "xid",
                "type": "String",
                "regex": "",
                "description": "3D Secure XID, Base64 encoded.Required for VISA 1.0",
                "is_required": false,
                "is_updatable": false
            },
            {
                "name": "ds_trans_id",
                "type": "String",
                "regex": "",
                "description": "The Directory Server (DS) Transaction ID. Required Mastercard 2.0.",
                "is_required": false,
                "is_updatable": false
            },
            {
                "name": "recurrence_type",
                "type": "string",
                "regex": "(recurring|installment|unscheduled)",
                "description": "This indicates the purpose of the token. should be aligned with the subsequent payments using the token.",
                "is_required": false,
                "is_updatable": false
            }
        ],
        "payment_options": [
            {
                "name": "description",
                "type": "string",
                "regex": "",
                "description": "the description field must be filled in.",
                "is_required": false,
                "is_updatable": false
            },
            {
                "name": "capture",
                "type": "boolean",
                "regex": "",
                "description": "Determines when the payment is processed for capture.",
                "is_required": false,
                "is_updatable": false
            },
            {
                "name": "complete_payment_url",
                "type": "string",
                "regex": "",
                "description": "the complete_payment_url field must be filled in.",
                "is_required": true,
                "is_updatable": false
            },
            {
                "name": "error_payment_url",
                "type": "string",
                "regex": "",
                "description": "the error_payment_url field must be filled in.",
                "is_required": true,
                "is_updatable": false
            }
        ],
        "minimum_expiration_seconds": 600,
        "maximum_expiration_seconds": 604800
    }
}

```

For the first request error, `ERROR_CREATE_PAYMENT_METHOD` I’ve put in a ticket and waiting to hear back.

---

<div class="post-metadata">

**Author:** ![Ahmad\_Aldali](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/ahmad_aldali/32/1477_2.png) [@Ahmad\_Aldali](https://community.rapyd.net/u/Ahmad_Aldali)\
**Post date:** [April 17, 2022, 8:41am UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/8 "2022-04-17T08:41:54Z")

</div>

Thanks @Community_Team  
Looking forward to hearing from you soon.

---

<div class="post-metadata">

**Author:** ![GermaVinsmoke](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/germavinsmoke/32/1549_2.png) [@GermaVinsmoke](https://community.rapyd.net/u/GermaVinsmoke)\
**Post date:** [April 20, 2022, 6:23am UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/9 "2022-04-20T06:23:11Z")

</div>

For completing and testing things quickly, you can create 2 simple HTML pages and deploy it on vercel. I also did the same 👌🏻

---

<div class="post-metadata">

**Author:** ![Ahmad\_Aldali](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/ahmad_aldali/32/1477_2.png) [@Ahmad\_Aldali](https://community.rapyd.net/u/Ahmad_Aldali)\
**Post date:** [April 20, 2022, 8:02am UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/10 "2022-04-20T08:02:10Z")

</div>

Hi @GermaVinsmoke  
I don’t think that will solve the problem. but I am going to try.

---

<div class="post-metadata">

**Author:** ![GermaVinsmoke](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/germavinsmoke/32/1549_2.png) [@GermaVinsmoke](https://community.rapyd.net/u/GermaVinsmoke)\
**Post date:** [April 20, 2022, 8:19am UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/11 "2022-04-20T08:19:35Z")

</div>

It’ll solve the problem of “INVALID\_COMPLETE\_PAYMENT\_URL”  
We need to provide 2 URLs for 3DS verification of the cards.  
**complete\_payment\_url** and **error\_payment\_url**

---

<div class="post-metadata">

**Author:** ![Ahmad\_Aldali](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/ahmad_aldali/32/1477_2.png) [@Ahmad\_Aldali](https://community.rapyd.net/u/Ahmad_Aldali)\
**Post date:** [April 20, 2022, 8:26am UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/12 "2022-04-20T08:26:48Z")

</div>

Yes, when I provided them as static values as is shown in Kyle’s replay, that error disappeared. But I got another error “ERROR\_CREATE\_PAYMENT\_METHOD” with this message  
“The request attempted an operation that requires specific fields for payment method, but a required field was missing, or an extra, unallowed field was included."

Could you send me a screenshot of your code example for that request?  
Regards.

---

<div class="post-metadata">

**Author:** ![GermaVinsmoke](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/germavinsmoke/32/1549_2.png) [@GermaVinsmoke](https://community.rapyd.net/u/GermaVinsmoke)\
**Post date:** [April 20, 2022, 8:49am UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/13 "2022-04-20T08:49:38Z")

</div>

I tried to create the customer with this “ro\_visa\_card” payment method.  
I’m also getting the same error. I’m not sure why it isn’t working even after providing the all the fields.

---

<div class="post-metadata">

**Author:** ![Ahmad\_Aldali](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/ahmad_aldali/32/1477_2.png) [@Ahmad\_Aldali](https://community.rapyd.net/u/Ahmad_Aldali)\
**Post date:** [April 20, 2022, 8:56am UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/14 "2022-04-20T08:56:19Z")

</div>

Thanks for letting me know.  
Regards.

---

<div class="post-metadata">

**Author:** ![GermaVinsmoke](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/germavinsmoke/32/1549_2.png) [@GermaVinsmoke](https://community.rapyd.net/u/GermaVinsmoke)\
**Post date:** [April 20, 2022, 8:57am UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/15 "2022-04-20T08:57:17Z")

</div>

Btw, is ro → Romania?

---

<div class="post-metadata">

**Author:** ![Ahmad\_Aldali](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/ahmad_aldali/32/1477_2.png) [@Ahmad\_Aldali](https://community.rapyd.net/u/Ahmad_Aldali)\
**Post date:** [April 20, 2022, 9:02am UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/16 "2022-04-20T09:02:52Z")

</div>

Should be that.

 ![Screenshot from 2022-04-20 12-01-35](https://us1.discourse-cdn.com/flex016/uploads/rapyd/original/2X/b/b52d90c6527759cd451cae23c4e1d08c2cc6b650.png)

---

<div class="post-metadata">

**Author:** ![Community\_Team](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@Community\_Team](https://community.rapyd.net/u/Community_Team)\
**Post date:** [April 21, 2022, 11:36pm UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/17 "2022-04-21T23:36:47Z")

</div>

**Edit** : Updated the second method listed below using API only

Thanks @Ahmad_Aldali. Also thanks @GermaVinsmoke for chiming in.

I reported this as this is not the intended behavior for Sandbox.

I also found a couple work arounds with the following:

1. [Create a Customer without a Payment Method](https://docs.rapyd.net/build-with-rapyd/reference/customer-object#create-customer)
2. [Save Card Details Hosted Page](https://docs.rapyd.net/build-with-rapyd/reference/hosted-page-card-token-object#create-card-token-hosted-page)

or

API Only

1. [Create a Customer without a Payment Method](https://docs.rapyd.net/build-with-rapyd/reference/customer-object#create-customer)  
~~[Create an address ID](https://docs.rapyd.net/build-with-rapyd/reference/address-object#create-address)  
Use `ro_visa_card` to [tokenize a card with address ID](https://docs.rapyd.net/build-with-rapyd/reference/tokens#create-token)~~
2. Use Card info to [add payment method to the customer](https://docs.rapyd.net/build-with-rapyd/reference/customer-payment-method-object#add-payment-method-to-customer) | [See below](#add-payment-method-to-customer-api-1)

* * *

### Add Payment Method to Customer API

#### Request

```auto
{
    "type": "us_debit_mastercard_card",
    "fields": {
        "number": "4111111111111111",
        "expiration_month": "12",
        "expiration_year": "25",
        "cvv": "555",
        "name": "John Doe"
    },
    "metadata": {
        "merchant_defined": true
    }
}

```

#### Response

```auto
{
    "status": {
        "error_code": "",
        "status": "SUCCESS",
        "message": "",
        "response_code": "",
        "operation_id": "5181e259-69ea-4abd-94c4-020c8f72d00a"
    },
    "data": {
        "id": "card_c0a7dafb6840de42b9b9e28015136abd",
        "type": "us_debit_mastercard_card",
        "category": "card",
        "metadata": {
            "merchant_defined": true
        },
        "image": "",
        "webhook_url": "",
        "supporting_documentation": "",
        "next_action": "3d_verification",
        "name": "John Doe",
        "last4": "1111",
        "acs_check": "unchecked",
        "cvv_check": "unchecked",
        "bin_details": {
            "type": null,
            "brand": null,
            "level": null,
            "country": null,
            "bin_number": "411111"
        },
        "expiration_year": "25",
        "expiration_month": "12",
        "fingerprint_token": "ocfp_2a694038316f52122bbbb3ae926cfda9",
        "redirect_url": "https://sandboxcheckout.rapyd.net/3ds-payment?token=payment_2d60b0b719ed4479a66a81218d54e863"
    }
}

```

---

<div class="post-metadata">

**Author:** ![Ahmad\_Aldali](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/ahmad_aldali/32/1477_2.png) [@Ahmad\_Aldali](https://community.rapyd.net/u/Ahmad_Aldali)\
**Post date:** [April 23, 2022, 4:26pm UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/18 "2022-04-23T16:26:21Z")

</div>

Thanks @Community_Team  
I will try that.

I appreciate your help.  
Regards.

---

<div class="post-metadata">

**Author:** ![Ahmad\_Aldali](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/ahmad_aldali/32/1477_2.png) [@Ahmad\_Aldali](https://community.rapyd.net/u/Ahmad_Aldali)\
**Post date:** [September 16, 2022, 7:11am UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/19 "2022-09-16T07:11:20Z")

</div>

Hi @Community_Team  
Now, when I am trying to tokenize the token, i get the following response:  
{  
‘error\_code’ =\> ‘ERROR\_GET\_PAYMENT\_METHOD\_TYPE’,  
‘status’ =\> ‘ERROR’,  
‘message’ =\> ‘The request attempted an operation that requires a payment method, but the payment method type specified is not available for this merchant or does not exist at all. Corrective action: Use a payment method type that this merchant is authorized to use.’,  
}  
url: “[https://sandboxapi.rapyd.net/v1/tokens](https://sandboxapi.rapyd.net/v1/tokens)”;  
It was working fine a month ago.

Regards.

---

<div class="post-metadata">

**Author:** ![Community\_Team](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@Community\_Team](https://community.rapyd.net/u/Community_Team)\
**Post date:** [September 16, 2022, 5:49pm UTC](https://community.rapyd.net/t/invalid-complete-payment-url-when-creating-customer-with-payment-method/388/20 "2022-09-16T17:49:45Z")

</div>

Thanks @Ahmad_Aldali, I updated the flow. You can create a customer and then add the card details in the second step.

Also check the payment method type if it is listed in [Rapyd Docs | Error](https://docs.rapyd.net/build-with-rapyd/reference/payment-method-types) for your country.
