Skip to main content

Fulfillment Service

Contains functions for verifying fulfillment service requests.

See the fulfillment service documentation for more information.

Verifies requests coming from Shopify to fulfillment service apps

Anchor to request
request
Request
required

Promise<<Resources>>
Examples

/app/routes/**.ts

import {type ActionFunctionArgs} from '@remix-run/node';

import {authenticate} from '../shopify.server';

export const action = async ({request}: ActionFunctionArgs) => {
const {admin, payload} = await authenticate.flow(request);

const kind = payload.kind;

if(kind === 'FULFILLMENT_REQUEST') {
const response = await admin?.graphql(
`#graphql
query {
shop {
assignedFulfillmentOrders(first: 10, assignmentStatus: FULFILLMENT_REQUESTED) {
edges {
node {
id
destination {
firstName
lastName
}
lineItems(first: 10) {
edges {
node {
id
productTitle
sku
remainingQuantity
}
}
}
merchantRequests(first: 10, kind: FULFILLMENT_REQUEST) {
edges {
node {
message
}
}
}
}
}
}
}
}`);

const fulfillments = await response.json();
console.log(fulfillments);
}


return new Response();
};
Was this page helpful?