Transaction Id


Where can I find the transcationId if I do the payments manually?


You can capture the transaction id with the following call:

curl -X POST \
     -H "Authorization: Bearer XXXX"

The transaction id should be returned in the body from the authorization call.

We have a great resource at that explains how to use the manual gateway.

Thank you



Hi @drew

I am using that docs you send, will the transactionId be automatically generated?
because unlike the orderId that I get in a response and then use in the parameter, I can’t find any responses were the transactionId is displayed?


will that be manually entered?

for example the payment is received outside of moltin and then I have to give the transaction a ID? received from payment gate?


Hey Handre,

Yes, you would get the transaction id from your payment gateway and capture it with the above curl request I posted.




Hi @drew

I am getting a 401 error.

here is my api call:

finishOrder(orderId, transactionId) {
      { headers: new HttpHeaders().set('Authorization', 'Bearer ' + localStorage.getItem('auth')) }


Hi, @handre do you have the message returned from the API?




The response is the following {status: 401, title: "Unable to validate access token"}

Are you sure that the transactionId must be inserted manually, through the header?


Hi @handre this issue looks like it isn’t related to the URL and rather its to do with the access token. Can you show me full call payload being made the API?




ts. file

onCompletes(transactionId) {
      switchMap((params: ParamMap) =>
        this.mhttp.finishOrder(params.get('id'), transactionId)
      .subscribe(response => {

html form:

<form [formGroup]="completeOrder" (ngSubmit)="onCompletes(completeOrder.value)">
              <div class="form-group">
                <input type="text" id="transactionId" class="form-control" formControlName="transactionId" placeholder="Unique ID for this order"
              <button type="submit" class="btn btn-lg btn-block" value="Submit Form">Clear Order</button>


Thanks @handre can you show me what is being sent to the API from the Dev console?


POST[object%20Object]/capture 401 (Unauthorized)


I got the correct header info to be send. I still get a 401 error:

POST 401 (Unauthorized)

It is because I do not have the 2nd argument in the post which is the body. However your api requests to be in the header not the body?


Hi @handre,

The current issue appears to be with your Bearer token, the call is being rejected because the access token is being rejected. Can you show me the access token inside your call payload, you can find this in the dev console in your browser.

The transaction ID is sent in along with the URL and the access token should be sent in the header:

curl -X POST \
     -H "Authorization: Bearer XXXX"


HI @drew

It is not my token, it is because when you do a post request, their must be a body argument, it is the second argument. here is my token however:
{expires: 1537614727, identifier: "client_credentials", expires_in: 3600, access_token: "50e7dccdf042300b76ba8ac64737acc2f3492d87", token_type: "Bearer"}

and I post it correctly as the url is correct:
POST 401 (Unauthorized)

but I had this error previously when I did post, because I did not insert my body in the POST. However in this case your requests are in the path and not in the body.


Hi @handre sorry for the confusion around this.

Once you have authorized your payment via orders/:order_id/payments

You can then do a GET on orders/c14610c9-900c-4172-95ff-0be932376968/transactions

Which will give a response like:

    "data": [
            "id": "f257d8e2-c959-4c71-b3f5-31b2374cf26d",
            "type": "transaction",
            "reference": "manual",
            "gateway": "manual",
            "amount": 20,
            "currency": "USD",
            "transaction-type": "authorize",
            "status": "complete",
            "relationships": {
                "order": {
                    "data": {
                        "type": "order",
                        "id": "c14610c9-900c-4172-95ff-0be932376968"

You can then take the transaction id and insert it into your URL in the capture call.

Here is an example of the call I am using

curl -X POST \ \
  -H 'authorization: Bearer XXXX' \
  -H 'content-type: application/json' 

This works in my case and returns a 200 OK http response

The issue with your call looks like there is a problem with your Authentication token, perhaps it is not being refreshed or an incorrect value is being inserted. If you note in my above call there are no body values and the required ids are submitted in the URL.

Hope this helps



Hi @drew

Thank you, I got confused because previously you mentioned that the transactionId must be self generated.

But everything is working now.
Thank you