ADMIN REST API Not getting payment url for created order

Topic summary

A developer successfully created an order via Shopify’s Admin REST API but did not receive a payment URL in the response. They are using Razorpay as their payment gateway.

Attempted Solutions:

  • Tried using the Checkout API but encountered an error requiring write_checkouts scope approval, which isn’t listed in their private app’s Admin API configuration
  • Attempted Draft Order API, but the invoice URL requires authentication and redirects users to a login page before checkout

Community Suggestions:

  1. Draft Orders: Use the Draft Order API which returns an invoice URL
  2. Sales Channel Access: Convert the app to a Sales Channel to unlock read_checkouts and write_checkouts scopes needed for the Checkout API
  3. Authentication Settings: Check if certain authentication settings are enabled that might be causing the login redirect issue
  4. Storefront API: Consider using the Storefront API to create carts and generate checkout access tokens via the storefrontAccessTokenCreate mutation

Status: The discussion remains open with the developer seeking a way to bypass authentication requirements for the invoice/checkout URL.

Summarized with AI on November 19. AI used: claude-sonnet-4-5-20250929.

Hi I am trying to create an order using Rest Admin API. Order creation was success but didn’t receive payment URL for the order in response.

Following API are used.

order API

POST : https://shop.myshopify.com/admin/api/2023-04/orders.json

BODY:
{
"order": {
"line_items": [
{
"variant_id": 44598046785811,
"quantity": 1
}
],
"customer": {
"email": "madhana.sohan@gmail.com"
},
"financial_status": "pending"
}
}

Status 201 created.

Checkout API

POST https://shop.myshopify.com/admin/api/2023-04/checkouts.json
BODY:
{
"checkout": {
"line_items": [
{
"variant_id": 44598046785811,
"quantity": 1
}
],
"email": "dummy@email.com",
"presentment_currency": "INR"
}
}

RESPONSE
{
"errors": "[API] This action requires merchant approval for write_checkouts scope."
}

So tried finding write_checkouts scope in Admin API configuration of my private app. But that scope is not listed in Admin API.

Payment Gateway used: Razor pay Secure.

Please suggest.

Hey @ShivamShukla1

I think you’ll want to use a Draft Order for this, which returns an invoice URL.

Thank you for your response Scott. I also tried using Draft Order API. But the invoice URL needs authentication. Invoice URL is redirected to login page and the user has to login for continuing to checkout page. Is there a way to bypass it.

Hi ShivamShukla1,

In order to create checkouts, your app needs to have the write_checkouts access scope, which is available for apps which are Sales Channels. You can follow this guide to create a Sales Channel which will open up the read and write checkouts scopes.

Hope this helps,

You might have this setting or this setting enabled.

I forgot to mention there’s also the Storefront API which allows you to create carts and send customers to checkout. You can generate a token with the admin API.