Ejemplo n.º 1
0
        /// <summary>
        /// Asychronously generate a scan from for the batch.
        /// </summary>
        public void GenerateScanForm() {
            Request request = new Request("batches/{id}/scan_form", Method.POST);
            request.AddUrlSegment("id", id);

            Merge(request.Execute<Batch>());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Retrieve a Batch from its id.
        /// </summary>
        /// <param name="id">String representing a Batch. Starts with "batch_".</param>
        /// <returns>EasyPost.Batch instance.</returns>
        public static Batch Retrieve(string id) {
            Request request = new Request("batches/{id}");
            request.AddUrlSegment("id", id);

            return request.Execute<Batch>();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Purchase all shipments within a batch. The Batch's state must be "created" before purchasing.
        /// </summary>
        public void Buy() {
            Request request = new Request("batches/{id}/buy", Method.POST);
            request.AddUrlSegment("id", id);

            Merge(request.Execute<Batch>());
        }