Billing API 400 Bad Request

Howdy.

I cannot get billing api to work.

Every time I try to create charge, get 400 Bad Request in response, regerdless if I use test flag or no.

The POST body seems to be ok, I tried many combinations and none of them worked :frowning:

Can you please give me a hint ? Bellow sample requests that did not work.

URL: https://xxx.myshopify.com/admin/api/2020-04/application_charges.json,

X-Request-Id: [df7907e3-661e-49b0-a858-4a3de71c20e3]

{
    "application_charge": {
        "name": "Super Duper Expensive action",
        "price": 100,
        "return_url": "http://super-duper.shopifyapps.com"
    }
}

X-Request-Id: [f66b21a7-46ab-4f87-a973-4b80bf3255d6]

{
    "application_charge": {
        "name": "Super Duper Expensive action",
        "price": 100,
        "return_url": "http://super-duper.shopifyapps.com",
        "test": true
    }
}

X-Request-ID: [c7a54b8b-b06f-4c8c-8b5f-e18672aea67f]

{
    "application_charge": {
        "name": "Super Duper Expensive action",
        "price": 100,
        "return_url": "http://localhost:3000",
        "test": true
    }
}

Ok, I solved it, it’s second time I faced this issue :frowning:
Springs RestTemplate adds additional HTTP headers, that are not allowed by shopify: Accept, Content-Length, Content-Type

1 Like