# 401 Unauthorized: \[no body\] - Create Payments (sandbox)

**URL:** https://community.rapyd.net/t/401-unauthorized-no-body-create-payments-sandbox/58560
**Category:** ⚙️ API
**Tags:** payments, java
**Created:** [April 13, 2023, 11:11am UTC](https://community.rapyd.net/t/401-unauthorized-no-body-create-payments-sandbox/58560 "2023-04-13T11:11:10Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![jcanare2](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/jcanare2/32/21592_2.png) [@jcanare2](https://community.rapyd.net/u/jcanare2)
#### Post date: [April 13, 2023, 11:11am UTC](https://community.rapyd.net/t/401-unauthorized-no-body-create-payments-sandbox/58560/1 "2023-04-13T11:11:10Z")

</div>

Greetings, I hope you are well

I am writing for the following, I have been trying to save a payment in a sandbox environment and the API throws me the following error:

**HttpClientErrorException$Unauthorized: 401 Unauthorized: [no body]**

Here I leave more information in case you can give me an idea of ​​what I may be doing wrong.

**String to be encrypted::**

post/v1/paymentsypdqlkktci1612453829rak\_726832C4E8581C1604C2rsk\_91f33b33fa5f45fb74c2902a180fe87423838872f1974c6d176bc706a392d79865e92f5a798c6b3a{“amount”:1.0,“capture”:true,“currency”:“USD”,“customer”:{“customer”:“cus\_0bdff3c7491e88d437422414b7f1b60d”},“payment\_method”:{“fields”:{“name”:“John Doe”},“metadata”:{“merchant\_defined”:true},“type”:“in\_amex\_card”}}

**Body String:**

{“amount”:1.0,“capture”:true,“currency”:“USD”,“customer”:{“customer”:“cus\_0bdff3c7491e88d437422414b7f1b60d”},“payment\_method”:{“fields”:{“name”:“John Doe”},“metadata”:{“merchant\_defined”:true},“type”:“in\_amex\_card”}}

**Java Code:**

Gson gson = new Gson();  
String bodyString = gson.toJson(payment);  
RestTemplate restTemplate = new RestTemplate();  
HttpHeaders headers = new HttpHeaders();  
headers.setContentType(MediaType.APPLICATION\_JSON);  
HttpEntity\<?\> entity = new HttpEntity(bodyString, headers);  
restTemplate = this.signerRapydService.sign(httpMethod, urlPath, bodyString);

```
    PaymentRapydResponse response = restTemplate.postForObject(urlPathLarge, entity, PaymentRapydResponse.class);

```

**URL:**  
[https://sandboxapi.rapyd.net/v1/payments](https://sandboxapi.rapyd.net/v1/payments)

Thanks a lot for help me!

---

<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 13, 2023, 3:39pm UTC](https://community.rapyd.net/t/401-unauthorized-no-body-create-payments-sandbox/58560/3 "2023-04-13T15:39:20Z")

</div>

Thanks @jcanare2, an unauthorized no body designates that there may be missing parameters you are inputting. But I do see them here.

By save payment method do you mean [add payment method to customer](https://docs.rapyd.net/build-with-rapyd/reference/customer-payment-method#add-payment-method-to-customer)?

However I did notice in your request body, the currency doesn’t match the country’s payment method. If you are using USD, your payment method should be something like us\_debit\_discover\_card, us\_debit\_visa\_card or us\_debit\_mastercard\_card.

If you want to use in\_amex\_card you need to use INR for your currency.

If you want to do FX payments, that’s a different story, I can link more resources on that.

FYI One you create a payment, the payment method also will automatically be saved to the generated customer ID. This will be returned in the webhook.

---

<div class="post-metadata">

### Author: ![jcanare2](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/jcanare2/32/21592_2.png) [@jcanare2](https://community.rapyd.net/u/jcanare2)
#### Post date: [April 18, 2023, 1:40pm UTC](https://community.rapyd.net/t/401-unauthorized-no-body-create-payments-sandbox/58560/4 "2023-04-18T13:40:21Z")

</div>

Hello! Thanks for your attention!

I keep having trouble registering a new payment.

**Here the JSON being sent:**

{  
“amount”: 1,  
“currency”: “USD”,  
“customer”: {  
“email”: “[johndoe@rapyd.net](mailto:johndoe@rapyd.net)”,  
“ewallet”: null,  
“invoice\_prefix”: “JP-”,  
“name”: “Juan Pacheco”,  
“phone\_number”: “+14155559993”  
},  
“payment\_method”: {  
“type”: “us\_debit\_mastercard\_card”,  
“fields”: {  
“name”: “John Doe”,  
“number”: “4111111111111111”,  
“expiration\_month”: “05”,  
“expiration\_year”: “25”,  
“cvv”: “111”  
}  
},  
“payment\_method\_options”: {},  
“save\_payment\_method”: false,  
“capture”: true  
}

**Error** :  
401 Unauthorized: [no body]

**String to be encrypted:**

post/v1/paymentstcdzbsusah1681824892rak\_726832C466581C1604C2rsk\_91f33b33fa5f45fb74c2902a180fe87423834672f1974c6d176bc706a392c79865e92f5a798c6b3a{“amount”:1.0,“capture”:true,“currency”:“USD”,“customer”:{“[email":"johndoe@rapyd.net](mailto:email%22:%22johndoe@rapyd.net)”,“invoice\_prefix”:“JP-”,“name”:“Juan Pacheco”,“phone\_number”:“+14155559993”},“payment\_method”:{“fields”:{“name”:“John Doe”,“number”:“4111111111111111”,“expiration\_month”:“05”,“expiration\_year”:“25”,“cvv”:“111”},“type”:“us\_debit\_mastercard\_card”},“payment\_method\_options”:{},“save\_payment\_method”:false}

**What could be missing?**

Documentation: [Payment](https://docs.rapyd.net/build-with-rapyd/reference/payment#create-payment)

Thanks for help me!

---

<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 19, 2023, 3:36am UTC](https://community.rapyd.net/t/401-unauthorized-no-body-create-payments-sandbox/58560/5 "2023-04-19T03:36:43Z")

</div>

Thanks @jcanare2,

One thing may be the way you are passing the body in the request. Not sure if those quotation marks are curly quotes for example:

# “ ” - Curly Quotes

vs

# " " - Straight Quotes

It seems like you have may curly quotes in your request, but it also may be the way you pasted it into the forum.

Here is an example below of your request I made in postman.

# Create Payment

## Request

```auto
{
	"amount": 1,
	"currency": "USD",
    "customer":{
        "email": "johndoe@rapyd.net",
        "ewallet": null,
        "invoice_prefix":"JP-",
        "name": "Juan Pacheco",
        "phone_number":"14155559993" 
    },
	"payment_method": {
		"type": "us_debit_mastercard_card",
		"fields": {
			"number": "4111111111111111",
			"expiration_month": "12",
			"expiration_year": "25",
			"name": "John Doe",
			"cvv": "111"
		},
		"metadata": {
		"merchant_defined": true
	}
	},
    "payment_method_options":{},
    "save_payment_method": false,
	"capture": true
}

```

## Response

```auto
{
    "status": {
        "error_code": "",
        "status": "SUCCESS",
        "message": "",
        "response_code": "",
        "operation_id": "d31a2239-c167-4e46-9e82-1aa40acc3313"
    },
    "data": {
        "id": "payment_f5a1052566be3c1be3917887b4522edf",
        "amount": 1,
        "original_amount": 1,
        "is_partial": false,
        "currency_code": "USD",
        "country_code": "US",
        "status": "CLO",
        "description": "",
        "merchant_reference_id": "",
        "customer_token": "cus_4fc1e73163f295ce96aa83f82e6615c4",
        "payment_method": "card_321c400639d04df76029d547e03a9114",
        "payment_method_data": {
            "id": "card_321c400639d04df76029d547e03a9114",
            "type": "us_debit_mastercard_card",
            "category": "card",
            "metadata": {
                "merchant_defined": true
            },
            "image": "",
            "webhook_url": "",
            "supporting_documentation": "",
            "next_action": "not_applicable",
            "name": "John Doe",
            "last4": "1111",
            "acs_check": "unchecked",
            "cvv_check": "unchecked",
            "bin_details": {
                "type": null,
                "brand": null,
                "level": null,
                "issuer": null,
                "country": null,
                "bin_number": "411111"
            },
            "expiration_year": "25",
            "expiration_month": "12",
            "fingerprint_token": "ocfp_2a694038316f52122bbbb3ae926cfda9"
        },
        "auth_code": null,
        "expiration": 1682479554,
        "captured": true,
        "refunded": false,
        "refunded_amount": 0,
        "receipt_email": "",
        "redirect_url": "",
        "complete_payment_url": "",
        "error_payment_url": "",
        "receipt_number": "",
        "flow_type": "",
        "address": null,
        "statement_descriptor": "Test Business",
        "transaction_id": "",
        "created_at": 1681874754,
        "metadata": {},
        "failure_code": "",
        "failure_message": "",
        "paid": true,
        "paid_at": 1681874755,
        "dispute": null,
        "refunds": null,
        "order": null,
        "outcome": null,
        "visual_codes": {},
        "textual_codes": {},
        "instructions": [],
        "ewallet_id": "ewallet_db4ad4a76278f94c4a83dd9b28b483ed",
        "ewallets": [
            {
                "ewallet_id": "ewallet_db4ad4a76278f94c4a83dd9b28b483ed",
                "amount": 1,
                "percent": 100,
                "refunded_amount": 0
            }
        ],
        "payment_method_options": {},
        "payment_method_type": "us_debit_mastercard_card",
        "payment_method_type_category": "card",
        "fx_rate": 1,
        "merchant_requested_currency": null,
        "merchant_requested_amount": null,
        "fixed_side": "",
        "payment_fees": null,
        "invoice": "",
        "escrow": null,
        "group_payment": "",
        "cancel_reason": null,
        "initiation_type": "customer_present",
        "mid": "",
        "next_action": "not_applicable",
        "error_code": "",
        "remitter_information": {},
        "save_payment_method": false
    }
}

```

---

<div class="post-metadata">

### Author: ![jcanare2](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/jcanare2/32/21592_2.png) [@jcanare2](https://community.rapyd.net/u/jcanare2)
#### Post date: [April 19, 2023, 1:38pm UTC](https://community.rapyd.net/t/401-unauthorized-no-body-create-payments-sandbox/58560/6 "2023-04-19T13:38:26Z")

</div>

Hello, thanks for your answer.

**The headers to send are only these or is there any other?**  
**Headers:**

RestTemplate restTemplate = new RestTemplate();  
// create a list the headers  
List interceptors = new ArrayList\<\>();  
interceptors.add(new HttpHeaderInterceptor(“Content-Type”, MediaType.APPLICATION\_JSON\_VALUE));  
interceptors.add(new HttpHeaderInterceptor(“access\_key”, accessKey));  
interceptors.add(new HttpHeaderInterceptor(“salt”, salt));  
interceptors.add(new HttpHeaderInterceptor(“timestamp”, Long.toString(timestamp)));  
interceptors.add(new HttpHeaderInterceptor(“signature”, signature.trim()));

```
	// set header interceptors here
	restTemplate.setInterceptors(interceptors);

```

**Because the type of error seems to me to be authentication:**

org.springframework.web.client.HttpClientErrorException$Unauthorized: 401 Unauthorized: [no body]  
401 Unauthorized: [no body]

**Thank you very much for your help and prompt response!**

---

<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 19, 2023, 4:25pm UTC](https://community.rapyd.net/t/401-unauthorized-no-body-create-payments-sandbox/58560/7 "2023-04-19T16:25:14Z")

</div>

Authentication errors with the headers would come out as:

## MISSING AUTHENTICATION HEADERS

```auto
{
    "status": {
        "error_code": "MISSING_AUTHENTICATION_HEADERS",
        "status": "ERROR",
        "message": "The request did not contain the required headers for authentication. The request was rejected. Corrective action: Add authentication headers.",
        "response_code": "MISSING_AUTHENTICATION_HEADERS",
        "operation_id": "a25f686a-a467-4436-a5b0-bee9761064c0"
    }
}

```

## UNAUTHENTICATED API CALL: ACCOUNT ACTIVATION

```auto
{
    "status": {
        "error_code": "UNAUTHENTICATED_API_CALL",
        "status": "ERROR",
        "message": "The request was rejected due to an authentication issue. Corrective action: Check the status of your account in the 'Account Details' page of the Client Portal.",
        "response_code": "UNAUTHENTICATED_API_CALL",
        "operation_id": "de3af1a7-ce61-4399-9a84-7345a3b5b74e"
    }
}

```

## UNAUTHENTICATED API CALL: SPACES AND DECIMALS

```auto
{
    "status": {
        "error_code": "UNAUTHENTICATED_API_CALL",
        "status": "ERROR",
        "message": "The API received a request, but the signature did not match. The request was rejected. Corrective action: (1) Remove all whitespace that is not inside a string. (2) Remove trailing zeroes and decimal points, or wrap numbers in a string.",
        "response_code": "UNAUTHENTICATED_API_CALL",
        "operation_id": "d28d951d-059f-4534-8f71-7e888240b567"
    }
}

```

Yours seems to be with authorization and a missing request body. This means something is wrong with the request itself.

## UNAUTHORIZED API CALL

```auto
{
    "status": {
        "error_code": "UNAUTHORIZED_API_CALL",
        "status": "ERROR",
        "message": "",
        "response_code": "UNAUTHORIZED_API_CALL",
        "operation_id": "4eaceee8-5181-4701-ad74-d32374f20abd"
    }
}

```

---

<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 20, 2023, 4:37am UTC](https://community.rapyd.net/t/401-unauthorized-no-body-create-payments-sandbox/58560/8 "2023-04-20T04:37:21Z")

</div>

Hi @jcanare2

Can you please paste here the full response that you are getting from Rapyd’s API?

It should look something like this the examples @Community_Team mentioned above:

```auto
{
    "status": {
        "error_code": "UNAUTHORIZED_API_CALL",
        "status": "ERROR",
        "message": "",
        "response_code": "UNAUTHORIZED_API_CALL",
        "operation_id": "4eaceee8-5181-4701-ad74-d32374f20abd"
    }
}

```

Thanks!

---

<div class="post-metadata">

### Author: ![jcanare2](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/jcanare2/32/21592_2.png) [@jcanare2](https://community.rapyd.net/u/jcanare2)
#### Post date: [April 20, 2023, 11:05am UTC](https://community.rapyd.net/t/401-unauthorized-no-body-create-payments-sandbox/58560/9 "2023-04-20T11:05:46Z")

</div>

Hello, sure!

**Here is the full response:**

{  
“timestamp”: 1681988624022,  
“status”: 500,  
“error”: “Internal Server Error”,  
“trace”: “org.springframework.web.client.HttpClientErrorException$Unauthorized: 401 Unauthorized: [no body]\n\tat org.springframework.web.client.HttpClientErrorException.create(HttpClientErrorException.java:105)\n\tat org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:186)\n\tat org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:125)\n\tat org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63)\n\tat org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:819)\n\tat org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:777)\n\tat org.springframework.web.client.RestTemplate.execute(RestTemplate.java:711)\n\tat org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:437)\n\tat com.navent.api.naventpg.service.impl.rapyd.PaymentServiceRapydImpl.createPayment(PaymentServiceRapydImpl.java:102)\n\tat com.navent.api.naventpg.controller.rapyd.PaymentRapydController.create(PaymentRapydController.java:59)\n\tat com.navent.api.naventpg.controller.rapyd.PaymentRapydController$$FastClassBySpringCGLIB$$7bc664d4.invoke()\n\tat org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)\n\tat org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:64)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)\n\tat org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:57)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)\n\tat org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:58)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)\n\tat org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)\n\tat org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692)\n\tat com.navent.api.naventpg.controller.rapyd.PaymentRapydController$$EnhancerBySpringCGLIB$$9da62c3.create()\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:567)\n\tat org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197)\n\tat org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141)\n\tat org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106)\n\tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)\n\tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)\n\tat org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)\n\tat org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1064)\n\tat org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)\n\tat org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)\n\tat org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:681)\n\tat org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:764)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:228)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)\n\tat org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:113)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:113)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327)\n\tat org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115)\n\tat org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)\n\tat org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:121)\n\tat org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)\n\tat org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126)\n\tat org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)\n\tat org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:105)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)\n\tat org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)\n\tat org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)\n\tat com.navent.api.naventpg.configuration.security.AuthTokenFilter.doFilterInternal(AuthTokenFilter.java:53)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)\n\tat com.navent.api.naventpg.configuration.security.LogEntryStartContextFilter.doFilterInternal(LogEntryStartContextFilter.java:24)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)\n\tat org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103)\n\tat org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)\n\tat org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)\n\tat org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)\n\tat org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110)\n\tat org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)\n\tat org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)\n\tat org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211)\n\tat org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183)\n\tat org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358)\n\tat org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)\n\tat org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)\n\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)\n\tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)\n\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)\n\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)\n\tat org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382)\n\tat org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)\n\tat org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)\n\tat org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1723)\n\tat org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)\n\tat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n\tat java.base/java.lang.Thread.run(Thread.java:831)\n”,  
“message”: “401 Unauthorized: [no body]”,  
“path”: “/rapyd/payment”  
}

**Note** : The endpoint is **[https://sandboxapi.rapyd.net/v1/payments](https://sandboxapi.rapyd.net/v1/payments)**

Thanks for your answer and your help to me!  
You’re a great team! #TeamRapyd #RapydDevelopers

---

<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 20, 2023, 6:01pm UTC](https://community.rapyd.net/t/401-unauthorized-no-body-create-payments-sandbox/58560/10 "2023-04-20T18:01:58Z")

</div>

Thanks @jcanare2

Reading your log, I can see that Rapyd is not getting your http request!

Your application cannot create nor send the request to [https://sandboxapi.rapyd.net/v1/payments](https://sandboxapi.rapyd.net/v1/payments)

You have to troubleshoot your Java application and find out why it cannot send http requests.

This seems to be your internal application’s endpoint (not a Rapyd endpoint) that seems to be restricted:

```auto
“path”: “/rapyd/payment”

```

The authorization error you are getting does not come from Rapyd. It comes from your own application.

Hope this is helpful!

---

<div class="post-metadata">

### Author: ![drew.harris](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/drew.harris/32/1259_2.png) [@drew.harris](https://community.rapyd.net/u/drew.harris)
#### Post date: [September 25, 2023, 8:23pm UTC](https://community.rapyd.net/t/401-unauthorized-no-body-create-payments-sandbox/58560/12 "2023-09-25T20:23:20Z")

</div>

We now have an [OpenAPI Spec](https://www.postman.com/rapyd-dev) - try it out and tell us what you think.

#💻 OpenAPI
