1

We're integrating our solution to AmazonPay.

I'm trying to "GetOrderReferenceDetails" using dotnet SDK but I'm getting this response: "The OrderReferenceId C01-9737628-XXXXXX is invalid".

I grabbed the AmazonOrderReferenceId like so:

//Front end
onOrderReferenceCreate: function (orderReference) {
            var id = orderReference.getAmazonOrderReferenceId();
}

which returns something like "C01-9737628-XXXXXX".

The environment is sandbox.

This is the code I'm using to get the detail on server side:

var getOrdDetailReq = new GetOrderReferenceDetailsRequest()
            .WithAccessToken(token)
            .WithAmazonOrderReferenceId(amznOrdRefId)
            .WithMerchantId(merchantId)
            .WithMWSAuthToken(mwsToken);


        var getOrdDetailRes = client.GetOrderReferenceDetails(getOrdDetailReq);

My intent is to accomplish an one time payment.

Am I missing something?

ramires.cabral
  • 910
  • 4
  • 13
  • 28
  • 1
    "C01-..." is a reference for a billing agreement for automatic/recurring payments and not an order reference. Did you intent to do this? Or were you trying to initiate a single payment? – marcus.kreusch Mar 05 '21 at 12:27
  • I want an one time payment. Make sense what you're saying. I started the flow for recurring payments. I'll revise that. Thanks. – ramires.cabral Mar 05 '21 at 12:30
  • In addition: This is based on the "old" API (http://amazonpaycheckoutintegrationguide.s3.amazonaws.com/amazon-pay-checkout/v1-introduction.html) If you are still at the start you might want to use the new one (http://amazonpaycheckoutintegrationguide.s3.amazonaws.com/amazon-pay-checkout/introduction.html) – marcus.kreusch Mar 05 '21 at 12:30

1 Answers1

1

References starting with "C01-..." are billing agreements for recurring payments. To get an order reference you want to start a one time payment.

To create an authorization based on a billing agreement, you have to use the AuthorizeOnBillingAgreement call (https://developer.amazon.com/docs/amazon-pay-api/authorizeonbillingagreement.html).

marcus.kreusch
  • 648
  • 5
  • 15