AlmondTill/G3N API

Take a return and refund it

Create the return, take the goods back — sellable or damaged as received — approve it, pay the customer back on the original method where possible, and close it. At the till with a receipt, one step does the whole walk.

Selling · a play in 5 steps.

In the office

When a cashier cannot finish a return at the till, the return comes to you: open it, take the goods back as received — sellable or damaged — approve it under your own name, pay the customer back on the original method where possible, and close it. At the till with a receipt, one step does the whole walk.

Where it starts: the office’s Returns page.

Returns — /returns
Returns — /returns

Step 1. Create the return.

Step 2. Take the goods back — stock returns bucketed as you receive it.

Step 3. Approve it — the approval names you.

Step 4. Pay the customer back — money out, permanently — and close it.

Step 5. At the till, with a receipt: approve, receive and refund cash from the drawer in ONE step.

What you see

The example shop is Linden & Vale and takes CAD and USD; every return it records keeps who approved it and how the customer was paid back.

Try it

Walked with screenshots in the manager’s manual: chapter 3 — Take the return the register could not

For developers — the calls

The steps

  1. Create the return. — createReturn
  2. Take the goods back — stock returns bucketed as you receive it. — receiveReturn
  3. Approve it — the approval names you. — approveReturn
  4. Pay the customer back — money out, permanently — and close it. — refundReturn, closeReturn
  5. At the till, with a receipt: approve, receive and refund cash from the drawer in ONE step. — posReturn

The calls

Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.

createReturn

createReturn — mutation · Create a new customer return at your organization.

Example request

graphql
mutation ExampleCreateReturn($input: NewReturnInput!) {
  createReturn(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    orderId
    invoiceId
    organizationId
    currency
    refundTotalMinor
  }
}

Variables:

json
{
  "input": {
    "caption": "Blue jeans",
    "orderId": "01900000-0000-7000-8000-18e782370000",
    "logicalFacilityId": "01900000-0000-7000-8000-10c08c590000",
    "lines": [
      {
        "orderLineNo": 1,
        "quantity": "2",
        "reason": "Correcting a miscount."
      }
    ]
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "createReturn": {
      "id": "01900000-0000-7000-8000-cc01b1df0000",
      "sysId": "RT-EXMP-0000-000F",
      "type": "Return",
      "caption": "Blue jeans",
      "status": "requested",
      "parentId": "01900000-0000-7000-8000-10c08c590000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 0,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "orderId": "01900000-0000-7000-8000-18e782370000",
      "invoiceId": "01900000-0000-7000-8000-71ec87b00000",
      "organizationId": "01900000-0000-7000-8000-1971e30a0000",
      "currency": "USD",
      "refundTotalMinor": 1250
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

receiveReturn

receiveReturn — mutation · Take returned goods physically back in.

Example request

graphql
mutation ExampleReceiveReturn($input: ReceiveReturnInput!) {
  receiveReturn(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    orderId
    invoiceId
    organizationId
    currency
    refundTotalMinor
  }
}

Variables:

json
{
  "input": {
    "returnId": "01900000-0000-7000-8000-cc01b1df0000",
    "expectedRevision": "01900000-0000-7000-8000-e02b2e6c0000",
    "dispositions": [
      {
        "lineNo": 1,
        "disposition": "restock",
        "quantity": "2",
        "reason": "Correcting a miscount."
      }
    ]
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "receiveReturn": {
      "id": "01900000-0000-7000-8000-cc01b1df0000",
      "sysId": "RT-EXMP-0000-000F",
      "type": "Return",
      "caption": "Blue jeans",
      "status": "received",
      "parentId": "01900000-0000-7000-8000-10c08c590000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "orderId": "01900000-0000-7000-8000-18e782370000",
      "invoiceId": "01900000-0000-7000-8000-71ec87b00000",
      "organizationId": "01900000-0000-7000-8000-1971e30a0000",
      "currency": "USD",
      "refundTotalMinor": 1250
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

approveReturn

approveReturn — mutation · Approve a customer return — your sign-off moves it forward.

Example request

graphql
mutation ExampleApproveReturn($id: ID!, $revision: ID!, $reason: String) {
  approveReturn(id: $id, revision: $revision, reason: $reason) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    orderId
    invoiceId
    organizationId
    currency
    refundTotalMinor
  }
}

Variables:

json
{
  "id": "01900000-0000-7000-8000-cc01b1df0000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "reason": "Correcting a miscount."
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "approveReturn": {
      "id": "01900000-0000-7000-8000-cc01b1df0000",
      "sysId": "RT-EXMP-0000-000F",
      "type": "Return",
      "caption": "Blue jeans",
      "status": "approved",
      "parentId": "01900000-0000-7000-8000-10c08c590000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "orderId": "01900000-0000-7000-8000-18e782370000",
      "invoiceId": "01900000-0000-7000-8000-71ec87b00000",
      "organizationId": "01900000-0000-7000-8000-1971e30a0000",
      "currency": "USD",
      "refundTotalMinor": 1250
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

refundReturn

refundReturn — mutation · Pay the customer back for an approved, received return.

Example request

graphql
mutation ExampleRefundReturn($input: RefundReturnInput!) {
  refundReturn(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    orderId
    invoiceId
    organizationId
    currency
    refundTotalMinor
  }
}

Variables:

json
{
  "input": {
    "returnId": "01900000-0000-7000-8000-cc01b1df0000",
    "expectedRevision": "01900000-0000-7000-8000-e02b2e6c0000",
    "method": "original_tender",
    "reference": "<reference>"
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "refundReturn": {
      "id": "01900000-0000-7000-8000-cc01b1df0000",
      "sysId": "RT-EXMP-0000-000F",
      "type": "Return",
      "caption": "Blue jeans",
      "status": "refunded",
      "parentId": "01900000-0000-7000-8000-10c08c590000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "orderId": "01900000-0000-7000-8000-18e782370000",
      "invoiceId": "01900000-0000-7000-8000-71ec87b00000",
      "organizationId": "01900000-0000-7000-8000-1971e30a0000",
      "currency": "USD",
      "refundTotalMinor": 1250
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

closeReturn

closeReturn — mutation · Close a customer return — finish it.

Example request

graphql
mutation ExampleCloseReturn($id: ID!, $revision: ID!, $reason: String) {
  closeReturn(id: $id, revision: $revision, reason: $reason) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    orderId
    invoiceId
    organizationId
    currency
    refundTotalMinor
  }
}

Variables:

json
{
  "id": "01900000-0000-7000-8000-cc01b1df0000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "reason": "Correcting a miscount."
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "closeReturn": {
      "id": "01900000-0000-7000-8000-cc01b1df0000",
      "sysId": "RT-EXMP-0000-000F",
      "type": "Return",
      "caption": "Blue jeans",
      "status": "closed",
      "parentId": "01900000-0000-7000-8000-10c08c590000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "orderId": "01900000-0000-7000-8000-18e782370000",
      "invoiceId": "01900000-0000-7000-8000-71ec87b00000",
      "organizationId": "01900000-0000-7000-8000-1971e30a0000",
      "currency": "USD",
      "refundTotalMinor": 1250
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

posReturn

posReturn — mutation · A with-receipt return at the till, in ONE step — approve, take the goods back, and refund cash from the drawer.

Example request

graphql
mutation ExamplePosReturn($input: PosReturnInput!) {
  posReturn(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    orderId
    invoiceId
    organizationId
    currency
    refundTotalMinor
  }
}

Variables:

json
{
  "input": {
    "caption": "Blue jeans",
    "orderId": "01900000-0000-7000-8000-18e782370000",
    "logicalFacilityId": "01900000-0000-7000-8000-10c08c590000",
    "lines": [
      {
        "orderLineNo": 1,
        "quantity": "2",
        "reason": "Correcting a miscount."
      }
    ],
    "dispositions": [
      {
        "lineNo": 1,
        "disposition": "restock",
        "quantity": "2",
        "reason": "Correcting a miscount."
      }
    ],
    "refund": {
      "method": "original_tender",
      "reference": "<reference>"
    }
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "posReturn": {
      "id": "01900000-0000-7000-8000-cc01b1df0000",
      "sysId": "RT-EXMP-0000-000F",
      "type": "Return",
      "caption": "Blue jeans",
      "status": "requested",
      "parentId": "01900000-0000-7000-8000-10c08c590000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "orderId": "01900000-0000-7000-8000-18e782370000",
      "invoiceId": "01900000-0000-7000-8000-71ec87b00000",
      "organizationId": "01900000-0000-7000-8000-1971e30a0000",
      "currency": "USD",
      "refundTotalMinor": 1250
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}